astronaut-cms 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/THIRD_PARTY_LICENSES.md +88 -40
- package/dist/admin/assets/assistant-DTlSNidc.js +235 -0
- package/dist/admin/assets/badge-BfN73-be.js +1 -0
- package/dist/admin/assets/changes-h1lmD7AA.js +1 -0
- package/dist/admin/assets/client-B4PWCmC4.js +5 -0
- package/dist/admin/assets/{collapsible-item-UaoJaaPw.js → collapsible-item-zlnNAUdM.js} +1 -1
- package/dist/admin/assets/{collapsible-B6P_J0Bg.js → collapsible-mcJ6G3X4.js} +1 -1
- package/dist/admin/assets/{collections._collection-BE1enDCq.js → collections._collection-D-rC9E9v.js} +1 -1
- package/dist/admin/assets/{collections._collection._entry-D3UksnCo.js → collections._collection._entry-UD8hLmC1.js} +33 -33
- package/dist/admin/assets/collections._collection.index-Cgc93hCD.js +1 -0
- package/dist/admin/assets/component-lookup-8lVQh8pl.js +4 -0
- package/dist/admin/assets/{copy-DezZzPMV.js → copy-DxuErr3x.js} +1 -1
- package/dist/admin/assets/{dist-UbA1s2kM.js → dist-DVv3ALC7.js} +1 -1
- package/dist/admin/assets/{dist-DzkcSBZl.js → dist-Dpyc1riS.js} +1 -1
- package/dist/admin/assets/editor-BauN0yXd.js +2 -0
- package/dist/admin/assets/{empty-DSBYiI_7.js → empty-DAOUBpWb.js} +1 -1
- package/dist/admin/assets/{entry-link-CQLN2Zpf.js → entry-link-DhcL6M5c.js} +19 -19
- package/dist/admin/assets/{error-banner-yskeRXe8.js → error-banner-CNWZU5u_.js} +93 -91
- package/dist/admin/assets/{field-BDK5tt3J.js → field-CbbZZGxO.js} +2 -2
- package/dist/admin/assets/{file-text-BzBif8ui.js → file-text-Ciz5Mr4S.js} +1 -1
- package/dist/admin/assets/{highlighted-body-JLMTFACH-CIQujGv2.js → highlighted-body-JLMTFACH-D1bycIV3.js} +1 -1
- package/dist/admin/assets/{lib-CMURo-7A.js → lib-CC_S4yjQ.js} +9 -9
- package/dist/admin/assets/{library-Cr3f75Es.js → library-Da82FNwp.js} +1 -1
- package/dist/admin/assets/{list-skeleton-BdTNfVXs.js → list-skeleton-BXLP4Fak.js} +1 -1
- package/dist/admin/assets/matchContext-BjW1F-Cq.js +2 -0
- package/dist/admin/assets/media-browser-DeKpWCUD.js +1 -0
- package/dist/admin/assets/media._library-DGnXJc0I.js +1 -0
- package/dist/admin/assets/mermaid-WFAXDIZX-CqFnahFh.js +1 -0
- package/dist/admin/assets/page-header-C2Uwa_yv.js +1 -0
- package/dist/admin/assets/pdf-BSEX-sd8.js +106 -0
- package/dist/admin/assets/{react-kbcsfQYH.js → react-CXnqG51l.js} +1 -1
- package/dist/admin/assets/{routes-CBt04sNR.js → routes-Bx9rPcHA.js} +1 -1
- package/dist/admin/assets/save-actions-DrVgh3KH.js +32 -0
- package/dist/admin/assets/{select-Bv2EoLhN.js → select-CMV39q80.js} +1 -1
- package/dist/admin/assets/separator-C9bNKNSU.js +3 -0
- package/dist/admin/assets/{skeleton-CKiqTaRh.js → skeleton-DTwTUSqm.js} +1 -1
- package/dist/admin/assets/syntax-DDPd1mQn.js +8 -0
- package/dist/admin/assets/{toggle-Y2UpJZyU.js → toggle-B6ASf-kL.js} +1 -1
- package/dist/admin/assets/{ui.module.css-WaO_77ml.js → ui.module.css-BdAmwQeM.js} +29 -29
- package/dist/admin/assets/{use-entries-B2lsaiK9.js → use-entries-CrNqaMfa.js} +1 -1
- package/dist/admin/assets/useSelector-Cs39W18m.js +1 -0
- package/dist/admin/bootstrap.js +1 -1
- package/dist/admin/editor.d.ts +1009 -1
- package/dist/admin/editor.js +1 -1
- package/dist/server/THIRD_PARTY_LICENSES.md +49 -0
- package/dist/server/assets.d.ts +28 -0
- package/dist/server/chunks/config-BsOYly9a.d.ts +1210 -0
- package/dist/server/chunks/{digest-BYzWNJea.js → digest-tkKu_Wj5.js} +3 -3
- package/dist/server/chunks/{entry-checks-CKMag1G4.js → entry-checks-3SxhoHwH.js} +1 -1
- package/dist/server/chunks/{types-DOR5XaJO.js → types-DkkewFTT.js} +32 -11
- package/dist/server/chunks/{types-DwA-C6Br.d.ts → types-Jew_-Qpp.d.ts} +8 -1
- package/dist/server/chunks/{user-config-DoypbpQf.js → user-config-CqNK-Ebs.js} +13 -4
- package/dist/server/config.d.ts +3 -3
- package/dist/server/config.js +5 -1
- package/dist/server/content.d.ts +10 -0
- package/dist/server/content.js +2 -8
- package/dist/server/endpoint.d.ts +5 -0
- package/dist/server/endpoint.js +28 -14
- package/dist/server/integration.d.ts +2 -2
- package/dist/server/integration.js +29 -16
- package/dist/server/internal.d.ts +39 -4
- package/dist/server/internal.js +2 -2
- package/dist/server/server-local.d.ts +1 -1
- package/dist/server/server-local.js +2 -2
- package/dist/styles/THIRD_PARTY_LICENSES.md +2 -2
- package/dist/styles/styles.css +2 -2
- package/package.json +4 -4
- package/dist/admin/assets/assistant-DkS355co.js +0 -201
- package/dist/admin/assets/badge-BXsOvOPX.js +0 -1
- package/dist/admin/assets/changes-Ba0G_GN1.js +0 -1
- package/dist/admin/assets/client-VKp75fDU.js +0 -5
- package/dist/admin/assets/collections._collection.index-BN5d8UIY.js +0 -1
- package/dist/admin/assets/component-lookup-CUCiK8Xh.js +0 -4
- package/dist/admin/assets/editor-FGqMznBK.js +0 -2
- package/dist/admin/assets/matchContext-Bq5Es9aD.js +0 -2
- package/dist/admin/assets/media-browser-9-CPTCks.js +0 -1
- package/dist/admin/assets/media._library-BfFaEZLR.js +0 -1
- package/dist/admin/assets/mermaid-WFAXDIZX-CJ3hhA0i.js +0 -1
- package/dist/admin/assets/page-header-B4nvAsVA.js +0 -1
- package/dist/admin/assets/pdf-DgessaF0.js +0 -106
- package/dist/admin/assets/save-actions-Cz0TkpcP.js +0 -32
- package/dist/admin/assets/separator-DlYj_PoQ.js +0 -3
- package/dist/admin/assets/syntax-BAXqRKRO.js +0 -8
- package/dist/admin/assets/useSelector-CWr3iU9K.js +0 -1
- package/dist/server/chunks/config-WQqG4mNH.d.ts +0 -193
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-BWaJ3C7D.js";import{A as t,B as n,C as r,D as i,F as a,I as o,L as s,O as c,S as l,T as u,_ as d,a as f,b as p,c as m,f as h,g,h as _,j as v,k as y,m as b,o as x,p as S,s as C,t as ee,w as te,y as ne,z as re}from"./lib-CMURo-7A.js";import{a as ie,i as ae,r as oe,t as se}from"./zwitch-Wwuax-dJ.js";import*as ce from"react";import le,{Component as ue,Suspense as de,createContext as fe,forwardRef as pe,useCallback as me,useContext as he,useEffect as ge,useLayoutEffect as _e,useMemo as ve,useState as ye,useSyncExternalStore as be}from"react";import{Fragment as xe,jsx as Se,jsxs as Ce}from"react/jsx-runtime";import{createPortal as we}from"react-dom";var Te=Object.defineProperty,Ee=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,De=(e,t,n)=>Ee(e,typeof t==`symbol`?t:t+``,n),Oe=class e{constructor(e=/* @__PURE__ */ new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},ke=class{constructor(){De(this,`map`,/* @__PURE__ */ new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=/* @__PURE__ */ new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function Ae(e,t){return t(e),e}function je(){}var Me=`cell`;function Ne(e,t){return e===t}var Pe=/* @__PURE__ */ new Map,Fe,Ie=class{constructor(e={}){De(this,`subscriptions`,new ke),De(this,`singletonSubscriptions`,/* @__PURE__ */ new Map),De(this,`graph`,new ke),De(this,`state`,/* @__PURE__ */ new Map),De(this,`distinctNodes`,/* @__PURE__ */ new Map),De(this,`executionMaps`,/* @__PURE__ */ new Map),De(this,`definitionRegistry`,/* @__PURE__ */ new Set),De(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?Ne:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?Ne:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);t!=null&&t(o.get(i),e)?c=!1:(c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e))};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>Ae(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return Ae(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=Pe.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),Ae(t.type===Me?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Fe;Fe=this;let n=e();return Fe=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=/* @__PURE__ */ new Set,r=new ke,i=new Oe,a=new ke,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function w(e,t=je,n=!0){return Ae(Symbol(),r=>{Pe.set(r,{type:Me,distinct:n,initial:e,init:t})})}function Le(e=je,t=!1){return Ae(Symbol(),n=>{Pe.set(n,{type:`signal`,distinct:t,init:e})})}function Re(e=je){return Ae(Symbol(),t=>{Pe.set(t,{type:`signal`,distinct:!1,init:e})})}var ze=ce.createContext(null);function Be(){let e=ce.useContext(ze);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function Ve(e){let t=Be();t.register(e);let n=ce.useCallback(n=>t.sub(e,n),[t,e]);return ce.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function He(...e){let t=Be();return Ve(ce.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function Ue(e){let t=Be();return t.register(e),ce.useCallback(n=>{t.pub(e,n)},[t,e])}function We(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function T(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function Ge(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>()=>{t(e)},sink:r,sources:[t]}),r}}function Ke(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function qe(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}var Je=/* @__PURE__ */ new WeakMap;function Ye(e,t){let n=Je.get(e);return n||(n=/* @__PURE__ */ new Set,Je.set(e,n)),n.add(t),()=>{n.delete(t)}}function Xe(e){let t=Je.get(e);if(Je.delete(e),!t)return;let n=!1,r;for(let e of[...t].reverse())try{e()}catch(e){n||(n=!0,r=e)}if(n)throw r instanceof Error?r:/* @__PURE__ */ Error(`Realm cleanup failed with a non-Error value`)}function Ze(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Qe({children:e,plugins:t}){let[n,r]=le.useState(null);return le.useEffect(()=>{var e,n;let i=new Ie;try{for(let n of t)(e=n.init)==null||e.call(n,i);for(let e of t)(n=e.postInit)==null||n.call(e,i)}catch(e){try{Xe(i)}catch(t){throw AggregateError([e,t],`Realm plugin initialization and cleanup both failed`)}throw e}return r(i),()=>{Xe(i)}},[]),le.useEffect(()=>{var e;if(n)for(let r of t)(e=r.update)==null||e.call(r,n)}),n?/* @__PURE__ */ le.createElement(ze.Provider,{value:n},e):null}var $e=Symbol.for(`preact-signals`);function et(){if(at>1)at--;else{var e,t=!1;for((function(){var e=lt;for(lt=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();it!==void 0;){var n=it;for(it=void 0,ot++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&mt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ot=0,at--,t)throw e}}function tt(e){if(at>0)return e();ct=++st,at++;try{return e()}finally{et()}}var nt,E=void 0;function rt(e){var t=E,n=nt;E=void 0,nt=void 0;try{return e()}finally{E=t,nt=n}}var it=void 0,at=0,ot=0,st=0,ct=0,lt=void 0,ut=0;function dt(e){if(E!==void 0){var t=e.n;if(t===void 0||t.t!==E)return t={i:0,S:e,p:E.s,n:void 0,t:E,e:void 0,x:void 0,r:t},E.s!==void 0&&(E.s.n=t),E.s=t,e.n=t,32&E.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=E.s,t.n=void 0,E.s.n=t,E.s=t),t}}function ft(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ft.prototype.brand=$e,ft.prototype.h=function(){return!0},ft.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?rt(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},ft.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&rt(function(){var e;(e=t.Z)==null||e.call(t)}))}},ft.prototype.subscribe=function(e){var t=this;return St(function(){var n=t.value;rt(function(){return e(n)})},{name:`sub`})},ft.prototype.valueOf=function(){return this.value},ft.prototype.toString=function(){return this.value+``},ft.prototype.toJSON=function(){return this.value},ft.prototype.peek=function(){var e=this;return rt(function(){return e.value})},Object.defineProperty(ft.prototype,"value",{get:function(){var e=dt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ot>100)throw Error(`Cycle detected`);(function(e){at!==0&&ot===0&&e.l!==ct&&(e.l=ct,lt={S:e,v:e.v,i:e.i,o:lt})})(this),this.v=e,this.i++,ut++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{et()}}}});function pt(e,t){return new ft(e,t)}function mt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ht(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function gt(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function _t(e,t){ft.call(this,void 0,t),this.x=e,this.s=void 0,this.g=ut-1,this.f=4}_t.prototype=new ft,_t.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ut))return!0;if(this.g=ut,this.f|=1,this.i>0&&!mt(this))return this.f&=-2,!0;var e=E;try{ht(this),E=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return E=e,gt(this),this.f&=-2,!0},_t.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ft.prototype.S.call(this,e)},_t.prototype.U=function(e){if(this.t!==void 0&&(ft.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},_t.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(_t.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=dt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function vt(e){var t=e.j;if(e.j=void 0,typeof t==`function`){at++;var n=E;E=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,yt(e),t}finally{E=n,et()}}}function yt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,vt(e)}function bt(e){if(E!==this)throw Error(`Out-of-order effect`);gt(this),E=e,this.f&=-2;try{8&this.f&&yt(this)}finally{et()}}function xt(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,nt&&nt.push(this)}xt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},xt.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,vt(this),ht(this),at++;var e=E;return E=this,bt.bind(this,e)},xt.prototype.N=function(){2&this.f||(this.f|=2,this.u=it,it=this)},xt.prototype.d=function(){this.f|=8,1&this.f||yt(this)},xt.prototype.dispose=function(){this.d()};function St(e,t){var n=new xt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Ct(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function D(e,...t){throw Ct(e,...t)}function wt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Tt(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var Et=/* @__PURE__ */ Tt();function Dt(){return Et&&`documentMode`in document?document.documentMode:null}var Ot=/* @__PURE__ */ Dt();function kt(e){return Et&&e.test(navigator.platform)}function At(e){return Et&&e.test(navigator.userAgent)}var jt=/* @__PURE__ */ kt(/Mac|iPod|iPhone|iPad/),Mt=/* @__PURE__ */ At(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Nt(){return!(!Et||!(`InputEvent`in window)||Ot)&&`getTargetRanges`in new window.InputEvent(`input`)}var Pt=/* @__PURE__ */ Nt();function Ft(){return Et&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var It=/* @__PURE__ */ Ft(),Lt=/* @__PURE__ */ At(/Android/),Rt=/* @__PURE__ */ At(/Version\/[\d.]+.*Safari/)&&!Lt,zt=/* @__PURE__ */ At(/^(?=.*Chrome).*/i),Bt=Et&&Lt&&zt,Vt=/* @__PURE__ */ At(/AppleWebKit\/[\d.]+/)&&jt&&!zt;function Ht(){return 2047}var Ut=/* @__PURE__ */ Ht(),Wt=Rt||It||Vt?`\xA0`:``,Gt=`
|
|
1
|
+
import{t as e}from"./rolldown-runtime-BWaJ3C7D.js";import{A as t,B as n,C as r,E as i,I as a,L as o,M as s,O as c,R as l,T as u,V as d,_ as f,a as p,b as m,c as h,g,h as _,j as v,k as y,m as b,o as x,p as S,s as C,t as ee,v as te,w as ne,x as re}from"./lib-CC_S4yjQ.js";import{a as ie,i as ae,r as oe,t as se}from"./zwitch-Wwuax-dJ.js";import*as ce from"react";import le,{Component as ue,Suspense as de,createContext as fe,forwardRef as pe,useCallback as me,useContext as he,useEffect as ge,useLayoutEffect as _e,useMemo as ve,useState as ye,useSyncExternalStore as be}from"react";import{Fragment as xe,jsx as Se,jsxs as Ce}from"react/jsx-runtime";import{createPortal as we}from"react-dom";var Te=Object.defineProperty,Ee=(e,t,n)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,De=(e,t,n)=>Ee(e,typeof t==`symbol`?t:t+``,n),Oe=class e{constructor(e=/* @__PURE__ */ new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},ke=class{constructor(){De(this,`map`,/* @__PURE__ */ new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=/* @__PURE__ */ new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function Ae(e,t){return t(e),e}function je(){}var Me=`cell`;function Ne(e,t){return e===t}var Pe=/* @__PURE__ */ new Map,Fe,Ie=class{constructor(e={}){De(this,`subscriptions`,new ke),De(this,`singletonSubscriptions`,/* @__PURE__ */ new Map),De(this,`graph`,new ke),De(this,`state`,/* @__PURE__ */ new Map),De(this,`distinctNodes`,/* @__PURE__ */ new Map),De(this,`executionMaps`,/* @__PURE__ */ new Map),De(this,`definitionRegistry`,/* @__PURE__ */ new Set),De(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?Ne:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?Ne:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);t!=null&&t(o.get(i),e)?c=!1:(c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e))};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>Ae(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return Ae(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=Pe.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),Ae(t.type===Me?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Fe;Fe=this;let n=e();return Fe=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=/* @__PURE__ */ new Set,r=new ke,i=new Oe,a=new ke,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function w(e,t=je,n=!0){return Ae(Symbol(),r=>{Pe.set(r,{type:Me,distinct:n,initial:e,init:t})})}function Le(e=je,t=!1){return Ae(Symbol(),n=>{Pe.set(n,{type:`signal`,distinct:t,init:e})})}function Re(e=je){return Ae(Symbol(),t=>{Pe.set(t,{type:`signal`,distinct:!1,init:e})})}var ze=ce.createContext(null);function Be(){let e=ce.useContext(ze);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function Ve(e){let t=Be();t.register(e);let n=ce.useCallback(n=>t.sub(e,n),[t,e]);return ce.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function He(...e){let t=Be();return Ve(ce.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function Ue(e){let t=Be();return t.register(e),ce.useCallback(n=>{t.pub(e,n)},[t,e])}function We(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function T(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function Ge(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>()=>{t(e)},sink:r,sources:[t]}),r}}function Ke(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function qe(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}var Je=/* @__PURE__ */ new WeakMap;function Ye(e,t){let n=Je.get(e);return n||(n=/* @__PURE__ */ new Set,Je.set(e,n)),n.add(t),()=>{n.delete(t)}}function Xe(e){let t=Je.get(e);if(Je.delete(e),!t)return;let n=!1,r;for(let e of[...t].reverse())try{e()}catch(e){n||(n=!0,r=e)}if(n)throw r instanceof Error?r:/* @__PURE__ */ Error(`Realm cleanup failed with a non-Error value`)}function Ze(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Qe({children:e,plugins:t}){let[n,r]=le.useState(null);return le.useEffect(()=>{var e,n;let i=new Ie;try{for(let n of t)(e=n.init)==null||e.call(n,i);for(let e of t)(n=e.postInit)==null||n.call(e,i)}catch(e){try{Xe(i)}catch(t){throw AggregateError([e,t],`Realm plugin initialization and cleanup both failed`)}throw e}return r(i),()=>{Xe(i)}},[]),le.useEffect(()=>{var e;if(n)for(let r of t)(e=r.update)==null||e.call(r,n)}),n?/* @__PURE__ */ le.createElement(ze.Provider,{value:n},e):null}var $e=Symbol.for(`preact-signals`);function et(){if(ot>1)ot--;else{var e,t=!1;for((function(){var e=ut;for(ut=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();at!==void 0;){var n=at;for(at=void 0,st++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ht(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(st=0,ot--,t)throw e}}function tt(e){if(ot>0)return e();lt=++ct,ot++;try{return e()}finally{et()}}var nt,rt=void 0;function it(e){var t=rt,n=nt;rt=void 0,nt=void 0;try{return e()}finally{rt=t,nt=n}}var at=void 0,ot=0,st=0,ct=0,lt=0,ut=void 0,dt=0;function ft(e){if(rt!==void 0){var t=e.n;if(t===void 0||t.t!==rt)return t={i:0,S:e,p:rt.s,n:void 0,t:rt,e:void 0,x:void 0,r:t},rt.s!==void 0&&(rt.s.n=t),rt.s=t,e.n=t,32&rt.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=rt.s,t.n=void 0,rt.s.n=t,rt.s=t),t}}function pt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}pt.prototype.brand=$e,pt.prototype.h=function(){return!0},pt.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?it(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},pt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&it(function(){var e;(e=t.Z)==null||e.call(t)}))}},pt.prototype.subscribe=function(e){var t=this;return Ct(function(){var n=t.value;it(function(){return e(n)})},{name:`sub`})},pt.prototype.valueOf=function(){return this.value},pt.prototype.toString=function(){return this.value+``},pt.prototype.toJSON=function(){return this.value},pt.prototype.peek=function(){var e=this;return it(function(){return e.value})},Object.defineProperty(pt.prototype,"value",{get:function(){var e=ft(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(st>100)throw Error(`Cycle detected`);(function(e){ot!==0&&st===0&&e.l!==lt&&(e.l=lt,ut={S:e,v:e.v,i:e.i,o:ut})})(this),this.v=e,this.i++,dt++,ot++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{et()}}}});function mt(e,t){return new pt(e,t)}function ht(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function gt(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function _t(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function vt(e,t){pt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=dt-1,this.f=4}vt.prototype=new pt,vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===dt))return!0;if(this.g=dt,this.f|=1,this.i>0&&!ht(this))return this.f&=-2,!0;var e=rt;try{gt(this),rt=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return rt=e,_t(this),this.f&=-2,!0},vt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}pt.prototype.S.call(this,e)},vt.prototype.U=function(e){if(this.t!==void 0&&(pt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},vt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(vt.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=ft(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function yt(e){var t=e.j;if(e.j=void 0,typeof t==`function`){ot++;var n=rt;rt=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,bt(e),t}finally{rt=n,et()}}}function bt(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,yt(e)}function xt(e){if(rt!==this)throw Error(`Out-of-order effect`);_t(this),rt=e,this.f&=-2;try{8&this.f&&bt(this)}finally{et()}}function St(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,nt&&nt.push(this)}St.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},St.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,yt(this),gt(this),ot++;var e=rt;return rt=this,xt.bind(this,e)},St.prototype.N=function(){2&this.f||(this.f|=2,this.u=at,at=this)},St.prototype.d=function(){this.f|=8,1&this.f||bt(this)},St.prototype.dispose=function(){this.d()};function Ct(e,t){var n=new St(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function wt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function E(e,...t){throw wt(e,...t)}function Tt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Et(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var Dt=/* @__PURE__ */ Et();function Ot(){return Dt&&`documentMode`in document?document.documentMode:null}var kt=/* @__PURE__ */ Ot();function At(e){return Dt&&e.test(navigator.platform)}function jt(e){return Dt&&e.test(navigator.userAgent)}var Mt=/* @__PURE__ */ At(/Mac|iPod|iPhone|iPad/),Nt=/* @__PURE__ */ jt(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Pt(){return!(!Dt||!(`InputEvent`in window)||kt)&&`getTargetRanges`in new window.InputEvent(`input`)}var Ft=/* @__PURE__ */ Pt();function It(){return Dt&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Lt=/* @__PURE__ */ It(),Rt=/* @__PURE__ */ jt(/Android/),zt=/* @__PURE__ */ jt(/Version\/[\d.]+.*Safari/)&&!Rt,Bt=/* @__PURE__ */ jt(/^(?=.*Chrome).*/i),Vt=Dt&&Rt&&Bt,Ht=/* @__PURE__ */ jt(/AppleWebKit\/[\d.]+/)&&Mt&&!Bt;function Ut(){return 2047}var Wt=/* @__PURE__ */ Ut(),Gt=zt||Lt||Ht?`\xA0`:``,Kt=`
|
|
2
2
|
|
|
3
|
-
`,Kt=Mt?`\xA0`:Wt,qt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Jt={directionless:1,unmergeable:2},Yt={center:2,end:6,justify:4,left:1,right:3,start:5};function Xt(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Zt=/* @__PURE__ */ Xt(Yt),Qt={normal:0,segmented:2,token:1},$t=/* @__PURE__ */ Xt(Qt),en=Symbol.for(`@lexical/ctrlOrOtherKey`),tn=`$config`;function nn(e){return()=>{}}function O(e){return{type:e}}var rn=/* @__PURE__ */ O(`SELECTION_CHANGE_COMMAND`),an=/* @__PURE__ */ O(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),on=/* @__PURE__ */ O(`CLICK_COMMAND`),sn=/* @__PURE__ */ O(`BEFORE_INPUT_COMMAND`),cn=/* @__PURE__ */ O(`INPUT_COMMAND`),ln=/* @__PURE__ */ O(`COMPOSITION_START_COMMAND`),un=/* @__PURE__ */ O(`COMPOSITION_END_COMMAND`),dn=/* @__PURE__ */ O(`DELETE_CHARACTER_COMMAND`),fn=/* @__PURE__ */ O(`INSERT_LINE_BREAK_COMMAND`),pn=/* @__PURE__ */ O(`INSERT_PARAGRAPH_COMMAND`),mn=/* @__PURE__ */ O(`CONTROLLED_TEXT_INSERTION_COMMAND`),hn=/* @__PURE__ */ O(`PASTE_COMMAND`),gn=/* @__PURE__ */ O(`REMOVE_TEXT_COMMAND`),_n=/* @__PURE__ */ O(`DELETE_WORD_COMMAND`),vn=/* @__PURE__ */ O(`DELETE_LINE_COMMAND`),yn=/* @__PURE__ */ O(`FORMAT_TEXT_COMMAND`),bn=/* @__PURE__ */ O(`SET_TEXT_FORMAT_COMMAND`),xn=/* @__PURE__ */ O(`UNDO_COMMAND`),Sn=/* @__PURE__ */ O(`REDO_COMMAND`),Cn=/* @__PURE__ */ O(`KEYDOWN_COMMAND`),wn=/* @__PURE__ */ O(`KEY_ARROW_RIGHT_COMMAND`),Tn=/* @__PURE__ */ O(`MOVE_TO_END`),En=/* @__PURE__ */ O(`KEY_ARROW_LEFT_COMMAND`),Dn=/* @__PURE__ */ O(`MOVE_TO_START`),On=/* @__PURE__ */ O(`KEY_ARROW_UP_COMMAND`),kn=/* @__PURE__ */ O(`KEY_ARROW_DOWN_COMMAND`),An=/* @__PURE__ */ O(`KEY_ENTER_COMMAND`),jn=/* @__PURE__ */ O(`KEY_SPACE_COMMAND`),Mn=/* @__PURE__ */ O(`KEY_BACKSPACE_COMMAND`),Nn=/* @__PURE__ */ O(`KEY_ESCAPE_COMMAND`),Pn=/* @__PURE__ */ O(`KEY_DELETE_COMMAND`),Fn=/* @__PURE__ */ O(`KEY_TAB_COMMAND`),In=/* @__PURE__ */ O(`INSERT_TAB_COMMAND`),Ln=/* @__PURE__ */ O(`INDENT_CONTENT_COMMAND`),Rn=/* @__PURE__ */ O(`OUTDENT_CONTENT_COMMAND`),zn=/* @__PURE__ */ O(`DROP_COMMAND`),Bn=/* @__PURE__ */ O(`FORMAT_ELEMENT_COMMAND`),Vn=/* @__PURE__ */ O(`DRAGSTART_COMMAND`),Hn=/* @__PURE__ */ O(`DRAGOVER_COMMAND`),Un=/* @__PURE__ */ O(`DRAGEND_COMMAND`),Wn=/* @__PURE__ */ O(`COPY_COMMAND`),Gn=/* @__PURE__ */ O(`CUT_COMMAND`),Kn=/* @__PURE__ */ O(`SELECT_ALL_COMMAND`),qn=/* @__PURE__ */ O(`CLEAR_EDITOR_COMMAND`),Jn=/* @__PURE__ */ O(`CLEAR_HISTORY_COMMAND`),Yn=/* @__PURE__ */ O(`CAN_REDO_COMMAND`),Xn=/* @__PURE__ */ O(`CAN_UNDO_COMMAND`),Zn=/* @__PURE__ */ O(`FOCUS_COMMAND`),Qn=/* @__PURE__ */ O(`BLUR_COMMAND`),$n=/* @__PURE__ */ O(`KEY_MODIFIER_COMMAND`);function er(e,t){return{...t,[en]:e}}var tr=/* @__PURE__ */ er(`metaKey`,{ctrlKey:!jt,metaKey:jt}),nr=/* @__PURE__ */ er(`altKey`,{altKey:jt,ctrlKey:!jt}),rr=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function ir(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var ar=class{byKey=/* @__PURE__ */ new Map;byCode=/* @__PURE__ */ new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||D(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of rr){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))ir(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?ir(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&ir(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of rr)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function or(e){let t=new ar;for(let n of e)t.add(n);return t}function sr(e){let t=/* @__PURE__ */ new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:/* @__PURE__ */ new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function cr(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var lr=/* @__PURE__ */ cr(),ur=class{_front=/* @__PURE__ */ new Set;_back=/* @__PURE__ */ new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},dr=null;function fr(e,t=1e3){return e instanceof pr?e.clone():e.size<t?new Map(e):new pr().init(new Map(e),void 0,e.size)}var pr=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===dr?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===dr?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==dr&&n!==void 0||(this._size++,n===dr&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,dr),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==dr&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===dr||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},mr=!1;function hr(e,t,...n){let r=mr,i;try{mr=e,i=t()}finally{mr=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||D(421),i}function gr(){return mr}function _r(e){let t=e.exportJSON(mr),n=e.constructor;return t.type!==n.getType()&&D(130,n.name),j(e)&&!Array.isArray(t.children)&&D(59,n.name),t}function vr(){return H()._blockCursorElement}function yr(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var br=Vt||It||Rt;function xr(){let e=Nc().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function Sr(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var Cr=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&D(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&D(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&D(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=wr(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=wr(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function wr(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Tr=class e extends Cr{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;yr(t);)e=t,t=t.nextSibling;Sr(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===vr()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;yr(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===vr()&&(t=t.previousSibling);return Sr(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(xr(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(xr(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&yr(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&br;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=Nc().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=Nc().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=vr(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Er(t,n);i.push(r);let a=Er(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Er(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&D(225),n.reverse()}var Dr=!1,Or=0;function kr(){Or=performance.now()}function Ar(e){return V(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function jr(e,t,n){let r=Ec(gc(n)),i=r&&Ic(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Xs(t,s,a,o,!1)}function Mr(e,t,n){if(G(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Cs(t)&&n.isAttached()}function Nr(e,t,n){for(let r=e;r&&!ul(r);r=cc(r)){let e=Is(r,t);if(e!==void 0){let t=I(e,n);if(t)return M(t)||!V(r)?void 0:[r,t]}}}function Pr(e,t,n,r){Dr=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-Or>100;try{$u(e,()=>{let a=q()||function(e){return e.read(`latest`,()=>{let e=q();return e===null?null:e.clone()})}(e),o=/* @__PURE__ */ new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Nr(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?P(m)&&m.isAttached()&&m.markDirty():i&&P(m)&&Cs(d)&&Mr(a,d,m)&&jr(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=Is(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&V(t)&&t.hasAttribute(`data-lexical-slot`)||ul(t)))){if(Mt){let e=(V(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||Sr(e)||Ar(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||Is(n,e)||Ar(n)||n.remove();n.takeRecords(),a!==null&&(l&&R(a),Mt&&oc(e)&&a.insertRawText(u))})}finally{Dr=!1}}function Fr(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&Pr(e,i,r,t)}}function Ir(e){(function(e){gc(e).addEventListener(`textInput`,kr,!0)})(e),e._observer=new MutationObserver((t,n)=>{Pr(e,t,n)})}function Lr(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Rr(e,t){return Lr(e,t,e.defaultValue)}function zr(e){return typeof e==`object`&&!!e}function Br(e,t){let n=Gr(e,t).getter;return zr(n)&&n.getterTable!==void 0||D(405,t),Wr(n.getterTable)}function Vr(e,t){let n=Gr(e,t).setter;return zr(n)&&n.setterTable!==void 0||D(406,t),Wr(n.setterTable)}function Hr(e,t,n){let{meta:r}=Gr(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Wr(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:D(407,t,String(n))}function Ur(e,t){let n=Gr(e,t),{setter:r}=n;zr(r)&&r.setterTable!==void 0||D(408,t);let i=String(n.defaultValue);return ei(r.setterTable,i)||D(409,t,i),r.setterTable[i]}function Wr(e){return Object.assign(Object.create(null),e)}function Gr(e,t){let n=e.get(t);return n===void 0&&D(410,t),n}function Kr(e,t,n,r,i){i!==void 0&&qr.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Xr(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var qr=/* @__PURE__ */ new WeakSet,Jr=/* @__PURE__ */ new WeakSet;function Yr(e){return typeof e==`object`&&e&&Jr.add(e),e}function Xr(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Jr.has(e)){Object.freeze(e);for(let t of Object.values(e))Xr(t)}}function Zr(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Qr(e,t){return n=>t(n)||$r(e,n)}function $r(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return $r(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Rr(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function ei(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ti(e=``){return Kr(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var ni=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ri(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&ni.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Kr(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function ii(e=!1){return Kr(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function ai(e,...t){let n=Yr(t.length===0?e[0]:t[0]),r=new Set(e);return Kr(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function oi(e,t={}){let{defaultAsNull:n}=t;return Kr(t=>{if(t==null)return null;let r=e(t);return n&&Rr(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Zr(e),Qr(e,e=>e==null))}function si(e,t={}){let{omitDefault:n}=t;return Kr(t=>{if(t===void 0)return;let r=e(t);return n&&Rr(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Zr(e),Qr(e,e=>e===void 0))}function ci(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function li(e,t){let n=e=>typeof e==`string`&&ei(t,e);return Kr(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||$r(e,t))}function ui(e,t){return fi(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function di(e,t){return fi(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function fi(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var pi=`latest`,mi=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Ti).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Lr(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function hi(e,t){return new mi(e,t)}function gi(e,t,n=pi){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function _i(e,t,n){let r;if(Mu(),typeof n==`function`){let i=e.getLatest(),a=gi(i,t);if(r=vi(t,n(a)),t.isEqual(a,r))return i}else r=vi(t,n);let i=e.getWritable();return Si(i).updateFromKnown(t,r),i}function vi(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function yi(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set;for(let{ownNodeConfig:r}of Hl(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var bi=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]),xi=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=/* @__PURE__ */ new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return wi(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(bi.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=wi(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(bi.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Si(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new xi(t,function(e){return e.__state?e.__state.sharedNodeState:fs(H(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function Ci(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&Si(e).updateFromJSON(r),n}function wi(e){if(e)for(let t in e)return e}function Ti(e){return e}function Ei(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function Di(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function Oi(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ki(e){return!N(e)&&e.getTextContent!==ao.prototype.getTextContent}var Ai=Symbol.for(`@lexical/CachedTextSize`);function ji(e,t){return Ki.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Gi.get(r);if(i===void 0&&D(345,r),j(i)){let a=qi.get(r);if(a!==void 0&&j(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=Ji.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&D(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(ua(i).size>0)n+=i.getTextContentSize();else{let e=i[Ai];e===void 0&&D(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:k})}function Mi(e){j(e)||ua(e).size>0||e[Ai]===void 0&&(e[Ai]=P(e)?e.__text.length:e.getTextContentSize())}var Ni=4,Pi,k,Fi,A=``,Ii=null,Li=null,Ri=null;function zi(){return{firstTextKey:Ri,format:Ii,style:Li}}function Bi(e){e.firstTextKey!==null&&(Ii=e.format,Li=e.style,Ri=e.firstTextKey)}function Vi(e){if(Ri!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&D(348),t===null)return;let n=qi.get(t);P(n)&&(Ii=n.getFormat(),Li=n.getStyle(),Ri=t)}var Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi=!1,$i=!1;function ea(e,t){let n=Gi.get(e),r=qi.has(e);if(t!==null){let n=Ta(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(k._keyToDOMMap.delete(e),j(n)){let e=Wl(n,Gi);ta(e,0,e.length-1,null)}if(n!==void 0){for(let e of ua(n).values()){let t=fa(e);ea(e,null),t!==null&&t.remove()}rc(Xi,Fi,Hi,n,`destroyed`)}}}function ta(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&ea(t,r)}}function na(e,t){e.setProperty(`text-align`,t)}var ra=`40px`;function ia(e,t){let n=Pi.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${ra}))`),tc(e,`class`),tc(e,`style`)}function aa(e,t){let n=e.style;t===0?na(n,``):t===1?na(n,`left`):t===2?na(n,`center`):t===3?na(n,`right`):t===4?na(n,`justify`):t===5?na(n,`start`):t===6&&na(n,`end`),tc(e,`style`)}function oa(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(N(e))return null;let n=e.getParent();return n===null||B(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function sa(e){let t=Nc().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function ca(e,t,n){t||e.contentEditable===`false`?dl(n,k):n.removeAttribute(`contenteditable`)}function la(e,t,n){let r=A,i=zi();A=``;let a=``,o=M(e);for(let[r,i]of n){let n=sa(r);ca(t,o,n),t.appendChild(n),A=``;let s=zi();ma(i,Qc(e,n,k)),Bi(s),da(e,r,t,n),a+=A}return Bi(i),A=r,a}function ua(e){return up(e)&&e.__slots!==null?e.__slots:lp}function da(e,t,n,r){let i=Zi.$getSlotTargetElement(e,t,n,k);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function fa(e){let t=Ji.get(e);return t===void 0?null:t.parentElement}function pa(e,t,n){let r=ua(e),i=ua(t);for(let[e,t]of r)if(!i.has(e)){let e=fa(t);ea(t,null),e!==null&&e.remove()}let a=A,o=zi(),s=``,c=null,l=M(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:fa(i);A=``;let u=zi();if(o===null){o=sa(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),ma(a,Qc(t,o,k))}else i===a?ba(a,o):(i!==void 0&&ea(i,o),ma(a,Qc(t,o,k)));if(Bi(u),ca(n,l,o),da(t,e,n,o),s+=A,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Bi(o),A=a,s}function ma(e,t){let n=qi.get(e);if(n===void 0&&D(60),t!==null){let r=Gi.get(e);if(r!==void 0){let i=Ji.get(e);if(i!==void 0){let a=dp(r)?r.__slotHost:null,o=dp(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),ba(e,t.element)}}}let r=Zi.$createDOM(n,k);if(function(e,t,n){let r=n._keyToDOMMap;Fs(t,n,e),r.set(e,t)}(e,r,k),P(n)?r.setAttribute(`data-lexical-text`,`true`):M(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),ll(r,{captureSelection:!0})),j(n)){let e=A,t=n.__indent,i=n.__size;oa(r,n),t!==0&&ia(r,t);let a=ua(n),o=a.size>0?la(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,A+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(ha(Wl(n,qi),n,0,t,Qc(n,r,k)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,A=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(ki(n)){let t=n.getTextContent();r.__lexicalTextContent=t,A=e+t}let s=n.__format;s!==0&&aa(r,s),n.isInline()||(va(0,n,r),_a(n,r))}else{let t=n.getTextContent();if(M(n)){let t=n.decorate(k,Pi);t!==null&&xa(e,t),r.contentEditable=`false`;let i=ua(n);i.size>0&&la(n,r,i)}A+=t}return t!==null&&t.insertChild(r),Zi.$decorateDOM(n,null,r,k),Mi(n),rc(Xi,Fi,Hi,n,`created`),r}function ha(e,t,n,r,i){let a=A,o=zi();A=``,Ii=null,Li=null,Ri=null;let s=n;for(;s<=r;++s){let t=zi();ma(e[s],i);let n=qi.get(e[s]);n!==null&&P(n)?Ii===null&&(Ii=n.getFormat(),Li=n.getStyle(),Ri=n.__key):j(n)&&s<r&&!n.isInline()&&(A+=Gt),Bi(t)}let c=k._keyToDOMMap.get(t.__key);c===void 0&&D(349,t.__key),c.__lexicalTextContent=A,c.__lexicalFirstTextKey=Ri,A=a+A,Bi(o)}function ga(e){return M(e)&&!e.isInline()}function _a(e,t,n=Qc(e,t,k)){n.setDecoratorBoundaryAnchor(`leading`,ga(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,ga(e.getLastChild()))}function va(e,t,n){let r=Qc(t,n,k),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return cu(e)?`line-break`:M(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,qi);r.setManagedLineBreak(i)}function ya(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=qi.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=qi.get(r);if(P(e))return Ii=e.getFormat(),void(Li=e.getStyle())}}t.__lexicalFirstTextKey=Ri}function ba(e,t){let n=Gi.get(e),r=qi.get(e);n!==void 0&&r!==void 0||D(61);let i=Qi||Wi.has(e)||Ui.has(e),a=sc(k,e);if(n===r&&!i){let e;if(j(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&D(355,n.getType()),e=t,Vi(a)}else e=n.getTextContent();return A+=e,a}if(n!==r&&i&&rc(Xi,Fi,Hi,r,`updated`),Zi.$updateDOM(r,n,a,k)){let n=ma(e,null);return t===null&&D(62),t.replaceChild(n,a),ea(e,null),n}if(j(n)){j(r)||D(334,e);let t=r.__indent;(Qi||t!==n.__indent)&&ia(a,t);let o=r.__format;(Qi||o!==n.__format)&&aa(a,o);let s=i&&(ua(r).size>0||ua(n).size>0)?pa(n,r,a):``;if(i){let e=A;if(function(e,t,n){var r;Ii=null,Li=null,Ri=null,function(e,t,n){let r=A,i=e.__size,a=t.__size;A=``;let o=n.element,s=k._keyToDOMMap.get(t.__key);s===void 0&&D(351,t.__key);let c=a-i;if(!Qi&&Math.abs(c)<=1&&i>=Ni&&e.__first===t.__first&&(c!==0||!k._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Yi.get(e.__key);if(!Qi&&!ki(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=qi.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=ji(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=qi.get(n);if(e===void 0)break;let t=zi();ba(n,o),P(e)&&Ii===null&&(Ii=e.getFormat(),Li=e.getStyle(),Ri=e.__key),Bi(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=qi.get(n);if(e===void 0)break;let t;if(j(e)){let r=k._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&D(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&j(e)&&!e.isInline()&&(d+=Gt),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,A=r+m,ya(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Gi.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=qi.get(a),d=Gi.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=qi.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Gi.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=ji(l,c);for(let e of _){let t=zi();if(e.kind===`reconcile`)ba(e.key,n.element);else if(e.kind===`destroy`)ea(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=k._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}ma(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=qi.get(e.key);t&&P(t)&&Ii===null&&(Ii=t.getFormat(),Li=t.getStyle(),Ri=t.__key)}Bi(t)}let x=``;for(let e=0;e<o;e++){let t=qi.get(f[e]);if(t===void 0)return!1;let n;if(j(t)){let r=k._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&D(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&j(t)&&!t.isInline()&&(x+=Gt)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&D(353),A=r+e,ya(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=qi.get(t);if(e===void 0)break;let r=Qi||Wi.has(t)||Ui.has(t),i=zi();if(r)ba(t,o);else{let n,r;if(j(e)){r=Ji.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&D(354,e.getType()),n=i}else n=e.getTextContent();A+=n,r!==void 0&&Vi(r)}P(e)?Ii===null&&(Ii=e.getFormat(),Li=e.getStyle(),Ri=e.__key):j(e)&&n<a-1&&!e.isInline()&&(A+=Gt),Bi(i),t=e.__next,n++}s.__lexicalTextContent=A,s.__lexicalFirstTextKey=Ri,A=r+A;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)ba(r,o);else{let e=Ta(r),t=ma(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}ea(r,null)}let a=qi.get(i);P(a)&&Ii===null&&(Ii=a.getFormat(),Li=a.getStyle(),Ri=a.__key)}else{let r=Wl(e,Gi),s=Wl(t,qi);if(r.length!==i&&D(227),s.length!==a&&D(228),i===0)a!==0&&ha(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&ua(t).size===0&&n.element.__lexicalLineBreak==null;ta(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=zi();if(e===r)u=Sa(ba(r,a.element)),d++,f++;else{if(l===void 0&&(l=Ca(n,f)),c===void 0)c=Ca(t,d);else if(!c.has(e)){d++,Bi(i);continue}if(!l.has(e)){let t=Ta(e);t.parentNode===a.element&&(u=Sa(t)),ea(e,a.element),d++,c.delete(e),Bi(i);continue}if(c.has(r)){let e=sc(k,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=Sa(ba(r,a.element)),d++,f++}else ma(r,a.withBefore(u??a.before)),f++}let o=qi.get(r);o!==null&&P(o)?Ii===null&&(Ii=o.getFormat(),Li=o.getStyle(),Ri=o.__key):j(o)&&f<=s&&!o.isInline()&&(A+=Gt),Bi(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:k.getElementByKey(t);ha(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&ta(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=A,s.__lexicalFirstTextKey=Ri,A=r+A}(e,t,Qc(t,n,k)),B(t)||(r=t,Ii==null||Ii===r.__textFormat||$i||r.setTextFormat(Ii),function(e){Li==null||Li===e.__textStyle||$i||e.setTextStyle(Li)}(t))}(n,r,a),r.isInline()||(N(r)||va(0,r,a),_a(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,A=e+s+t,a.__lexicalSlotTextLength=s.length}else(ua(r).size>0||ua(n).size>0)&&(a.__lexicalSlotTextLength=0);if(ki(r)){let t=r.getTextContent();a.__lexicalTextContent=t,A=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&D(356,n.getType()),A+=e,Vi(a)}if((Qi||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(oa(a,r),N(r)&&!Qi))for(let e of r.getChildren())j(e)&&oa(sc(k,e.getKey()),e)}else{let t=r.getTextContent();if(M(r)){let t=r.decorate(k,Pi);t!==null&&xa(e,t),i&&(ua(r).size>0||ua(n).size>0)&&pa(n,r,a)}A+=t}if(!$i&&N(r)){let e=r.getLatest();if(e.__cachedText!==A){let t=e.getWritable();t.__cachedText=A,r=t}}return Zi.$decorateDOM(r,n,a,k),Mi(r),a}function xa(e,t){let n=k._pendingDecorators,r=k._decorators;if(n===null){if(r[e]===t)return;n=Rs(k)}n[e]=t}function Sa(e){let t=e.nextSibling;return t!==null&&t===k._blockCursorElement&&(t=t.nextSibling),t}function Ca(e,t){let n=/* @__PURE__ */ new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function wa(e,t,n,r,i,a){A=``,Ii=null,Li=null,Ri=null,Qi=r===2,k=n,Pi=n._config,Zi=n._config.dom||hu,Fi=n._nodes,Hi=k._listeners.mutation,Ui=i,Wi=a,Gi=e._nodeMap,Ki=e,qi=t._nodeMap,$i=t._readOnly,Ji=fr(n._keyToDOMMap),Yi=function(){let e=/* @__PURE__ */ new Map,t=t=>{for(let n of t){let t=qi.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=/* @__PURE__ */ new Set,e.set(r,i)),i.add(n)}};return t(Ui.keys()),t(Wi),e}();let o=/* @__PURE__ */ new Map;return Xi=o,ba(`root`,null),k=void 0,Fi=void 0,Ui=void 0,Wi=void 0,Gi=void 0,Ki=void 0,qi=void 0,Pi=void 0,Ji=void 0,Yi=void 0,Xi=void 0,Zi=hu,o}function Ta(e){let t=Ji.get(e);return t===void 0&&D(75,e),t}function Ea(e,t,n){Mu();let r=e.__key,i=e.getParent();if(i===null)return void(fp(e)!==null&&D(367,r,String(fp(e))));let a=function(e){let t=q();if(!G(t)||!j(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return mc(i,e)&&n.set(e.__key,0,`element`),mc(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(G(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Vf(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Vf(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else K(a)&&t&&e.isSelected()&&e.selectPrevious();ap(e.getWritable(),t&&!o&&G(a)?a:null),n||B(i)||i.canBeEmpty()||!i.isEmpty()||Ea(i,t),t&&a&&N(i)&&i.isEmpty()&&i.selectEnd()}function Da(e){return e}var Oa=Symbol.for(`ephemeral`);function ka(e){return e[Oa]||!1}var Aa={configurable:!0,enumerable:!1,value:void 0,writable:!0},ja=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Pl(this);return e===void 0&&D(64,this.name),e}static clone(e){D(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Gl(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Aa),Object.defineProperty(this,Ai,Aa),Os(this,e)}getType(){return this.__type}isInline(){D(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=I(e);if(t===null)break;e=t.__parent===null?fp(t):t.__parent}return!1}isSelected(e){let t=e||q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(P(this))return n;if(G(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(M(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:I(e)}getParentOrThrow(){let e=this.getParent();return e===null&&D(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(B(t)||fp(e)!==null)return j(e)||e===this&&M(e)||D(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&D(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:I(e)}getPreviousSiblings(){return cp(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:I(e)}getNextSiblings(){return cp(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=um(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?sm(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&D(279),!1)))}isParentOf(e){return mc(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&j(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=W()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ka(this))return this;let e=I(this.__key);return e===null&&D(442,this.__key,this.__type),e}getWritable(){if(ka(this))return this;Mu();let e=Pu(),t=W(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return As(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&D(442,n,this.__type);let c=il(s);return r.set(n,c),o.set(n,c),As(c),c}getTextContent(){return Ep(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){D(70)}updateDOM(e,t,n){D(71)}getDOMSlot(e){return new Cr(e)}exportDOM(e){return{element:Zc(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=gl(hl(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return j(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=kl(e)[a.field];o=a.getterTable===void 0?t:ei(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!Al(a,o)&&a.when.call(e)||(o=void 0)),r&&Al(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){D(18,this.name)}updateFromJSON(e){return Nl(Ci(this,e),e)}static transform(){return null}remove(e){Ea(this,!0,e)}replace(e,t){Mu();let n=q();n!==null&&(n=n.clone()),Sc(this,e);let r=this.getLatest(),i=this.__key,a=pp(r);a!==null&&D(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();ap(s,G(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();Ea(r,!1,!0),rp(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(j(this)&&j(s)||D(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),G(n)){R(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):tf(e,s))}return Ms()===i&&js(o),s}insertAfter(e,t=!0){return op(this,`next`,e,t)}insertBefore(e,t=!0){return op(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return F()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return sp(J(this,`previous`),e,t)}selectNext(e,t){return sp(J(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function Ma(e){return e instanceof ja}function Na(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=/* @__PURE__ */ new Set;return!(e&&Ei(n,e,t)||t&&Ei(n,t,e)||e&&Di(n,e,t)||t&&Di(n,t,e))}(c,l))}function Pa(e,t){let n=e.mergeWithSibling(t),r=W()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Fa(e){let t,n,r=e;if(!Ns(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!Ns(t);){if(t.__text!==``){if(Na(t,r)){r=Pa(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&P(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!Ns(n);){if(n.__text!==``){if(Na(r,n)){r=Pa(r,n);break}break}n.remove()}}else r.remove()}}function Ia(e){return La(e.anchor),La(e.focus),e}function La(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),P(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!j(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Ra=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function za(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Ra.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Ba(e,t,n,r,i){let a=za(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var Va=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ba(t.indent,0,0,1/0),e.__textFormat=za(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Ha(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Ua=e=>{let t=Br(e,`mode`),n=Hr(e,`detail`,0),r=Hr(e,`format`,0),i=Vr(e,`mode`),a=Ur(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:za(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:za(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Ha}},Wa=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ba(t.indent,0,0,1/0),e.__textFormat=za(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ga=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Ka=e=>{let t=Br(e,`mode`),n=Hr(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:za(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},qa=/* @__PURE__ */ new WeakMap;function Ja(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!Ll(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function Ya(e){for(let{ownNodeConfig:t}of Hl(e))if(t&&t.children!==void 0)return t.children}function Xa(e){let t=qa.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of Hl(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=/* @__PURE__ */ new Set,n=Tl(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of Hl(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof mi?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&Ja(e,r.inline)!==void 0&&Ja(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=Tl(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=Ya(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),qa.set(e,t)}return t}function Za(e){let{derivedNames:t,...n}=Xa(e);return Object.freeze({...n,derived:new Set(t)})}function Qa(e){return!1}function $a(){return{...Zt,0:``}}function eo(){return{...Yt,"":0}}var to=/* @__PURE__ */ $a(),no=/* @__PURE__ */ eo(),ro=/* @__PURE__ */ ci()({direction:/* @__PURE__ */ ui(/* @__PURE__ */ ai([null,`ltr`,`rtl`]),{field:`__dir`}),format:/* @__PURE__ */ ui(/* @__PURE__ */ ai([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:to,setter:`setFormat`,setterTable:no}),indent:/* @__PURE__ */ ui(/* @__PURE__ */ ri(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:/* @__PURE__ */ di(/* @__PURE__ */ ri(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:/* @__PURE__ */ di(/* @__PURE__ */ ti(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function io(e){if(B(e)&&!Qa(W())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var ao=class extends ja{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:io,extends:ja,generated:Va,json:ro})}constructor(e){super(e),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=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&D(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return Zt[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return cp(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&vp(this).length===0}isDirty(){let e=W()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of vp(this)){let n=yp(this,t);if(j(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(P(t)&&e.push(t),j(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;j(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;j(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return j(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:I(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&D(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:I(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&D(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Ep(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),j(i)&&r!==n-1&&!i.isInline()&&(e+=Gt)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of _p(e).values()){let e=I(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),j(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Yt[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=qt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Es(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Mu();let n=q(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(P(e)||j(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(P(e)||j(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return G(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):jf(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&Yt[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){ka(this)&&D(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||D(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&D(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return tp(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(np(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,ip(t);let n=e.__key;rp(i,t,d,c&&c.getWritable()),e.__key===a&&D(76),o.push(n),d=t}if(i.__size=u,s.length){let e=q();if(G(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])oo(r,t,n)&&Vf(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||B(this)||this.remove()}}return i}getDOMSlot(e){return new Tr(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(B(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(P(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=Qc(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=Is(s,t))&&ul(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}_a(this,e,n)})}};function j(e){return e instanceof ao}function oo(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var so=class extends ja{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&D(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function M(e){return e instanceof so}function co(e){let t=e.getLatest().__cachedText;return t===null||!ju()&&W()._dirtyType!==0?null:t}var lo=class extends ao{__cachedText;$config(){return this.config(`root`,{extends:ao})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){D(51)}getTextContent(){let e=co(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=co(this);return e===null?super.getTextContentSize():e.length}remove(){D(52)}replace(e){D(53)}insertBefore(e){D(54)}insertAfter(e){D(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)j(e)||M(e)||D(282);return super.splice(e,t,n)}static importJSON(e){return L().updateFromJSON(e)}collapseAtStart(){return!0}};function N(e){return e instanceof lo}function uo(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function fo(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function po(e,t,n=``){if(t===n)return;let r=uo(n),i=uo(t);for(let t in i)delete r[t],fo(e,t,i[t]);for(let t in r)e.removeProperty(t)}var mo=/* @__PURE__ */ ci()({detail:/* @__PURE__ */ ui(/* @__PURE__ */ li(/* @__PURE__ */ ri(),Jt),{field:`__detail`}),format:/* @__PURE__ */ ui(/* @__PURE__ */ li(/* @__PURE__ */ ri(),qt),{field:`__format`}),mode:/* @__PURE__ */ ui(/* @__PURE__ */ ai([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:$t,setterTable:Qt}),style:/* @__PURE__ */ ui(/* @__PURE__ */ ti(),{field:`__style`}),text:/* @__PURE__ */ ui(/* @__PURE__ */ ti(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function ho(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function go(e,t){return 1&t?`strong`:2&t?`em`:`span`}function _o(e,t,n,r,i){let a=r.classList,o=nc(i,`base`);o!==void 0&&a.add(...o),o=nc(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in qt){let r=qt[e];if(o=nc(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}tc(r,`class`)}function vo(e,t,n){let r=n.isComposing(),i=e+(r?Wt:``),a=H(),o=Zc(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Nc().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Mt||zt){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function yo(e,t,n,r,i,a){vo(i,e,t);let o=a.theme.text;o!==void 0&&_o(0,0,r,e,o)}function bo(e,t){let n=Nc().createElement(t);return n.appendChild(e),n}function xo(e){return e!=null&&!0===e.__isInlineFormattable}var So=class extends ja{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:ja,generated:Ua,importDOM:{"#text":()=>({conversion:Do,priority:0}),b:()=>({conversion:wo,priority:0}),code:()=>({conversion:Ao,priority:0}),em:()=>({conversion:Ao,priority:0}),i:()=>({conversion:Ao,priority:0}),mark:()=>({conversion:Ao,priority:0}),s:()=>({conversion:Ao,priority:0}),span:()=>({conversion:Co,priority:0}),strong:()=>({conversion:Ao,priority:0}),sub:()=>({conversion:Ao,priority:0}),sup:()=>({conversion:Ao,priority:0}),u:()=>({conversion:Ao,priority:0})},json:mo})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return $t[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ms()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=qt[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Es(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=ho(0,n),i=go(0,n),a=r===null?i:r,o=Nc().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Nc().createElement(i),o.appendChild(s)),yo(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&po(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=ho(0,i),s=ho(0,a),c=go(0,i),l=go(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??D(48);let i=Nc().createElement(l);return yo(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??D(49)),vo(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&_o(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(po(t.style,p,f),tc(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return V(t)||D(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=bo(t,`b`)),this.hasFormat(`italic`)&&(t=bo(t,`i`)),this.hasFormat(`strikethrough`)&&(t=bo(t,`s`)),this.hasFormat(`underline`)&&(t=bo(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?qt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Jt[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Es(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Qt[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Mu();let n=e,r=t,i=q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!G(i))return jf(o,n,o,r,`text`,`text`);{let e=Ms();e!==i.anchor.key&&e!==i.focus.key||js(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=q();if(r&&G(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Mu();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Ms(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=q();if(G(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=jo(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=Oi(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=jo(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=Oi(t,n);let a=n.__key;i===r&&js(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&As(t),n!==null&&As(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),G(v)&&Bf(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||D(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Ms()===r&&js(n);let o=q();if(G(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Hf(i,t,n,e,a),s!==null&&s.key===r&&Hf(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Co(e){return{forChild:Mo(e.style),node:null}}function wo(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Mo(t.style,n?void 0:`bold`),node:null}}var To=/* @__PURE__ */ new WeakMap;function Eo(e){if(!V(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Do(e){let t=e;e.parentElement===null&&D(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=To.get(n))===void 0&&!Eo(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)To.set(r[e],i);return i}(t)!==null)return{node:Jf(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Oo(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Oo(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:jo(n)}}function Oo(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,V(n)){let e=n.style.display;if(e===``&&!qc(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Cs(n))return n;if(n.nodeName===`BR`)return null}}var ko={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Ao(e){let t=ko[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Mo(e.style,t),node:null}}function jo(e=``){return xc(new So(e))}function P(e){return e instanceof So}function Mo(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((P(e)||xo(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function No(e,t){let{type:n,key:r,offset:i}=e,a=Cc(e.key);return n===`text`?(P(a)||D(266,a.getType(),r),Wp(a,t,i)):(j(a)||D(267,a.getType(),r),Ko(a,e.offset,t))}function Po(e,t){let{origin:n,direction:r}=t,i=r===`next`;Rp(t)?e.set(n.getKey(),t.offset,`text`):zp(t)?P(n)?e.set(n.getKey(),Gp(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(Bp(t)&&j(n)||D(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Fo(e){let t=q(),n=G(t)?t:Mf();return Io(n,e),R(n),n}function Io(e,t){Po(e.anchor,t.anchor),Po(e.focus,t.focus)}function Lo(e){let{anchor:t,focus:n}=e,r=No(t,`next`),i=No(n,`next`),a=im(r,i)<=0?`next`:`previous`;return nm($p(r,a),$p(i,a))}function Ro(e){let{direction:t,origin:n}=e,r=J(n,Pp(t)).getNodeAtCaret();return r?J(r,t):qp(n.getParentOrThrow(),t)}function zo(e,t=`root`){let n=[e];for(let r=Bp(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Ro(r));return n}function Bo(e){return!!e&&e.origin.isAttached()}function Vo(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Go(e,r),o=a.anchor.origin;for(;o!==null&&!B(o);)o=o.getParent();let s=j(o)?o.getFirstChild():null,c=zo(a.anchor,n),l=zo(a.focus.getFlipped(),n),u=/* @__PURE__ */ new Set,d=[];for(let e of a.iterNodeCarets(n))if(Bp(e))u.add(e.origin.getKey());else if(zp(e)){let{origin:t}=e;j(t)&&!u.has(t.getKey())||d.push(t)}let f=/* @__PURE__ */ new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),ks(e)}for(let e of f)!e.canBeEmpty()&&!B(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Ro(J(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=jo(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Wp(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=Ho(c),m=Ho(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&um(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(B(i))return;t&&!n.has(i.__key)||!Xc(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&vp(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;qp(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(Bp(e)){let t=e.origin;if(Xc(t))return t}else{let t=e.getParentAtCaret();if(t&&Xc(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(yc);if(e&&t&&!N(t)&&e.isEmpty()&&u.has(e.getKey())&&vp(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!N(n)&&n.isEmpty();){let e=n.getParent();if(e&&N(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}Vs(o,s)!==null||o===null||o.isAttached()||Vs(L(),null);let g=Ho([p,m,...c,...l]);if(g)return tm($p(g,e.direction));D(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Ho(e){let t=e.find(Bo);return t&&Uo(t)}function Uo(e){let t=function(e){let t=e;for(;Bp(t);){let e=Yp(t);if(!Bp(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(P(t.origin))return Rp(t)?t:Wp(t.origin,n,n);let r=t.getAdjacentCaret();return zp(r)&&P(r.origin)?Wp(r.origin,n,Pp(n)):t}function Wo(e){return Rp(e)&&e.offset!==Gp(e.origin,e.direction)}function Go(e,t){return e.direction===t?e:nm($p(e.focus,t),$p(e.anchor,t))}function Ko(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?qp(e,n):J(a,n)}function qo(e,t=`root`){let n=0,r=e,i=Yp(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=Yp(r)}return i&&[i,n]}function Jo(e){let{origin:t,offset:n,direction:r}=e;if(n===Gp(t,r))return e.getSiblingCaret();if(n===Gp(t,Pp(r)))return Ro(e.getSiblingCaret());let[i]=t.splitText(n);return P(i)||D(281),$p(J(i,`next`),r)}function Yo(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Xo(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&zf(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==q()&&Bf(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Zo(e,t){return!0}function Qo(e,{$copyElementNode:t=bc,$splitTextPointCaretNext:n=Jo,rootMode:r=`shadowRoot`,$shouldSplit:i=Zo,removeEmptyDestination:a=!1}={}){if(Rp(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(Bp(e)){let e=Ro(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=cp((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function $o(e,t,n){let r=$p(t,`next`);Rp(r)&&(r.offset===0?r=J(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=J(r.origin,`next`))),r.origin.is(e)&&(zp(r)||D(342,e.getKey(),e.getType()),r=Ro(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Qo(e,n))r=e;return Rp(r)&&D(283),r.insert(e.isInline()?F().append(e):e),$p(J(e.getLatest(),`next`),t.direction)}function es(e,t){let n=Go(G(t)?Lo(t):t,`next`),r=hp(n.anchor.origin),i=hp(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Uo(qp(e,`next`)),o=$p(Uo(qp(e,`previous`)),`next`);return im(n.anchor,a)<=0&&im(n.focus,o)>=0}var ts=class extends ao{$config(){return this.config(`paragraph`,{children:`inline`,extends:ao,generated:Wa,importDOM:{p:()=>({conversion:ns,priority:0})}})}createDOM(e){let t=Nc().createElement(`p`),n=nc(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(P),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!G(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(es(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=F();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>P(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function ns(e){let t=F();if(cl(t,e),ol(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Yt&&t.setFormat(n)}return sl(t,e),{node:t}}function F(){return xc(new ts)}function rs(e){return e instanceof ts}var is=/* @__PURE__ */ ci()({detail:/* @__PURE__ */ di(/* @__PURE__ */ ri(2),{getter:{field:`__detail`},setter:null}),mode:/* @__PURE__ */ di(/* @__PURE__ */ ai([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:/* @__PURE__ */ di(/* @__PURE__ */ ti(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),as=class extends So{$config(){return this.config(`tab`,{extends:So,generated:Ka,json:is})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=nc(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||D(286),this}setDetail(e){return e!==2&&D(127),this}setMode(e){return e!==`normal`&&D(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function os(){return xc(new as)}function ss(e){return e instanceof as}var cs=null;function ls(e){cs=e}var us=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),ds=1;function fs(e,t){let n=ps(e,t);return n===void 0&&D(30,t),n}function ps(e,t){return e._nodes.get(t)}var ms=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function hs(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return ws(t)||Oc(t)?Vc(t):null})():t;if(!V(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Ls(n),i=n.nodeName;return Ma(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&bs(n)==null)}function gs(e){let t=e===null?null:Hc(e);return Wc(t)&&hs(t)}function _s(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return ys(t)===e&&e.read(`latest`,()=>!hs(t))}function vs(e){return e instanceof yu}function ys(e){let t=e;for(;t!=null;){let e=bs(t);if(vs(e))return e;t=cc(t)}return null}function bs(e){return e?e.__lexicalEditor:null}function xs(e){return ss(e)||e.isToken()}function Ss(e){return xs(e)||e.isSegmented()}function Cs(e){return Wc(e)&&e.nodeType===3}function ws(e){return Wc(e)&&e.nodeType===9}function Ts(e){let t=e;for(;t!=null;){if(Cs(t))return t;t=t.firstChild}return null}function Es(e,t,n){let r=qt[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~qt.superscript:t===`superscript`?i&=~qt.subscript:t===`lowercase`?(i&=~qt.uppercase,i&=~qt.capitalize):t===`uppercase`?(i&=~qt.lowercase,i&=~qt.capitalize):t===`capitalize`&&(i&=~qt.lowercase,i&=~qt.uppercase),i}function Ds(e){return P(e)||cu(e)||M(e)}function Os(e,t){let n=function(){let e=cs;return cs=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Mu(),Nu();let r=W(),i=Pu(),a=``+ds++;i._nodeMap.set(a,e),j(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function ks(e){ip(e.getParent()===null?e:e.getWritable())}function As(e){Nu(),ka(e)&&D(323,e.__key,e.__type);let t=e.__parent===null?dp(e)?e.__slotHost:null:e.__parent,n=Pu(),r=W(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?dp(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),j(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function js(e){Mu();let t=W(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=I(n);e!==null&&e.getWritable()}if(e!==null){let t=I(e);t!==null&&t.getWritable()}}}function Ms(){return ju()?null:W()._compositionKey}function Ns(e){return!It&&(Rt||Vt)&&e.__text===``&&e.__key===W()._compositionKey}function I(e,t){let n=(t||Pu())._nodeMap.get(e);return n===void 0?null:n}function Ps(e,t){let n=Is(e,W());return n===void 0?null:I(n,t)}function Fs(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Is(e,t){return e[`__lexicalKey_${t._key}`]}function Ls(e,t){let n=e;for(;n!=null;){let e=Ps(n,t);if(e!==null)return e;n=cc(n)}return null}function Rs(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function zs(e){return e.read(()=>L().getTextContent())}function Bs(e,t){let n=rl(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=I(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function L(){return Pu()._nodeMap.get(`root`)}function Vs(e,t){if(!(B(e)&&e.isAttached()&&(N(e)?e.getChildrenSize()===0:e.isEmpty())&&(N(e)||t!==null&&Xc(t))))return null;let n=F();return e.append(n),n}function R(e){Mu();let t=Pu();e!==null&&(e.dirty=!0,e.setCachedNodes(null),G(e)&&W()._slotsUsed&&Df(e)),t._selection=e}function Hs(e){Mu(),Fr(W(),e)}function Us(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Is(n,t);if(e!==void 0)return e;n=cc(n)}return null}(e,W());return t===null?null:I(t)}function Ws(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Gs(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Ks=0;function qs(){return Et?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Ks).toString(36)}`}function Js(e){return Cs(e)?e.nodeValue:null}function Ys(e,t,n){let r=Ec(gc(t));if(r===null)return;let i=Ic(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=Js(a),r=Ls(a);if(t!==null&&P(r)){if((t===Wt||t===Kt)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Xs(r,t,o,s,e)}}}function Xs(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!It&&(Rt||Vt);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Wt)||s&&t===a.getTextContent()||(c=t.slice(0,-Wt.length)),i&&!s)){let e=Kt,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=q();if(c===``){if(o&&!i&&s)return void Zs(a,``,t);if(js(null),Rt||It||Vt)a.remove();else{let e=W();Zs(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=Rf(),d=a.getTextContentSize(),f=Ms(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||G(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!G(t)||n===null||r===null)return void Zs(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=jo(a.getTextContent());a.replace(e),a=e}Zs(a,c,t)}}}function Zs(e,t,n){if(e.setTextContent(t),G(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Gp(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Qs(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(N(e))return t;t=e}return null}function $s(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(Ia(e),!N(t))return e;let u=Qs(n.getNode());return j(u)&&u.isShadowRoot()&&u.is(Qs(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function ec(e){let t=L();if(G(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(N(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),$s(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(j(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),$s(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),$s(e,a),e)}{let e=t.select(0,t.getChildrenSize());return R($s(e,t)),e}}function tc(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function nc(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=mm(i);return n[t]=e,e}return i}function rc(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&D(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=/* @__PURE__ */ new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function ic(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function ac(e,t){let n=e.offset;if(e.type===`element`)return ic(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?ic(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function oc(e){let t=gc(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function z(e,t,...n){return Ju(e,t,n[0],e)}function sc(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&D(75,t),n}function cc(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Oc(n)?n.host:null}function lc(e){return ws(e)?e:V(e)?e.ownerDocument:null}function uc(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function dc(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+uc(o.scrollPaddingLeft,i)*l,p=d+(i-uc(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function fc(e){Mu(),W()._updateTags.add(e)}function pc(e){Mu(),W()._deferred.push(e)}function mc(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function hc(e){let t=lc(e);return t?t.defaultView:null}function gc(e){let t=e._window;return t===null&&D(78),t}function _c(e){return j(e)&&e.isInline()||M(e)&&e.isInline()}function vc(e){let t=e.getLatest();for(;t!==null;){if(fp(t)!==null&&j(t))return t;let e=t.getParentOrThrow();if(B(e))return e;t=e}return t}function yc(e){return j(e)&&e.isShadowRoot()}function B(e){return N(e)||yc(e)}function bc(e,t=!1){let n=e.constructor.clone(e,us);return Os(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function xc(e){let t=W(),n=e.getType(),r=ps(t,n);r===void 0&&D(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||D(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||D(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&D(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Sc(e,t){!N(e.getParent())||j(t)||M(t)||D(99)}function Cc(e){let t=I(e);return t===null&&D(63,e),t}function wc(e){if(!e||e.isInline())return!1;if(M(e))return!0;if(j(e)){if(e.isShadowRoot()){let t=e.getParent();return!(j(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Tc(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Ec(e){return Et?(e||window).getSelection():null}function Dc(e){let t=hc(e);return t?t.getSelection():null}function Oc(e){return Gc(e)&&`host`in e}var kc=[];function Ac(e){let t=e.getRootNode();if(t===e||!Oc(t))return kc;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Oc(e))break;n.push(e),r=e.host}return n}function*jc(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(ws(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Mc(e){return e===null?document:e.ownerDocument}function Nc(){let e=Ru();return Mc(e===null?null:e._rootElement)}function Pc(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=Ac(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Fc(e,t){let n=Pc(e,t);if(n!==null){let e=Lc(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Ic(e,t){let n=Pc(e,t);return n===null?e:Rc(n,zc(e))}function Lc(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Rc(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function zc(e){return e.direction}function Bc(e){let t=e.getRootNode();return ws(t)||Oc(t)?t.activeElement:null}function Vc(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Hc(e){let t=e.target;if(t!==null&&V(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function Uc(e){return V(e)&&e.tagName===`A`}function V(e){return Wc(e)&&e.nodeType===1}function Wc(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Gc(e){return Wc(e)&&e.nodeType===11}var Kc=/^(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;function qc(e){return!(!V(e)||!e.style.display.startsWith(`inline`))||Kc.test(e.nodeName)}var Jc=/^(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;function Yc(e){return(!V(e)||!e.style.display.startsWith(`inline`))&&Jc.test(e.nodeName)}function Xc(e){if(M(e)&&!e.isInline())return!0;if(!j(e)||B(e))return!1;let t=e.getFirstChild(),n=t===null||cu(t)||P(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function H(){return W()}function Zc(e=H()){return e._config.dom||hu}function Qc(e,t,n=H()){let r=Zc(n).$getDOMSlot(e,t,n);return j(e)&&($c(r)||D(344,e.getKey(),e.getType())),r}function $c(e){return e instanceof Tr}function el(e,t,n=H()){return Ts(Qc(e,t,n).element)}var tl=/* @__PURE__ */ new WeakMap,nl=/* @__PURE__ */ new Map;function rl(e){if(!e._readOnly&&e.isEmpty())return nl;e._readOnly||D(192);let t=tl.get(e);return t||(t=function(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=/* @__PURE__ */ new Map,t.set(e,i)),i.set(n,r)}return t}(e),tl.set(e,t)),t}function il(e){let t=e.constructor.clone(e,us);return t.afterCloneFrom(e),t}function al(e){return(t=il(e))[Oa]=!0,t;var t}function ol(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function sl(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function cl(e,t){let n=t.style.textAlign;return n&&n in Yt?e.setFormat(n):e}function ll(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function ul(e){return!0===e.__lexicalUnmanaged}function dl(e,t=H()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function fl(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(V(n)&&n.hasAttribute(`data-lexical-slot`)||Is(n,t)!==void 0)return!1;n=cc(n)}return!1}function pl(e,t){return ei(e,t)&&e[t]!==ja[t]}var ml=/* @__PURE__ */ new WeakMap;function hl(e){let t=ml.get(e);return t===void 0?function(e){let t=e.prototype!=null&&tn in e.prototype?e.prototype[tn]():void 0,n=function(e){if(!(e===ja||e.prototype instanceof ja)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{yu.version&&(n=JSON.parse(yu.version))}catch{}D(290,e.name,t,n)}return e===so||e===ao||e===ja}(e),r=!n&&pl(e,`getType`)?e.getType:void 0,i=r&&!(_l in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:ei(e.prototype,tn),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};ml.set(e,s);try{let t=function(e){let t=e.prototype,n=/* @__PURE__ */ new Map,{fieldsBaseFirst:r}=wl(e);for(let[i,a]of r){let r=Ol(e,i,a);if(r===null)continue;if(zr(r)){let t=r.field;if(t===`__proto__`&&D(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])ei(t,String(r))||D(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&D(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?vl:[...n.values()]}(e),r=function(e){let t=e.prototype,n=/* @__PURE__ */ new Map;for(let[r,i]of wl(e).fieldsDerivedFirst){let a=Dl(e,r,i);if(a===null)continue;if(zr(a)){let o=a.field;o===`__proto__`&&D(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&D(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&D(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?El:[...n.values()]}(e),i=wl(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Hl(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,gl(hl(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:jl(r),setters:t},function(e,t,n,r){if(!t&&n){if(!pl(e,`getType`)){let t=e,r=function(){return this===t?n:ja.getType.call(this)};r[_l]=!0,e.getType=r}if(pl(e,`clone`)||(e.clone=(t,n)=>{ls(t);let r=new e;return n!==us&&r.afterCloneFrom(t),r}),pl(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Ul(e);return n.updateFromJSON===ja.prototype.updateFromJSON?function(e,t){return Nl(e.__state||t.$!==void 0?Ci(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!pl(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;ei(t,`getTextContent`)&&!ei(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=ja.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Hl(e)){let e=t.prototype;if(ei(e,`afterCloneFrom`))continue;let r=Vl(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?gl(hl(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[zl]=!0}}(e),function(e,t){t&&t.inline!==void 0&&ei(e.prototype,tn)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?Fl:Il,writable:!0})}(e,a)}catch(t){throw ml.delete(e),t}return s}(e):t}function gl(e){let{compiled:t}=e;return t===void 0&&D(422,e.config.klass.name),t}var _l=Symbol(`lexical.synthesizedGetType`),vl=[];function yl(e,t,n,r){let i=n.method===void 0?r:n.method,a=wl(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return bl(o,s,i)&&bl(o,s,r)?n:i}function bl(e,t,n){return e[n]===t[n]}function xl(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Sl(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var Cl={declaredBy:/* @__PURE__ */ new Map,fields:/* @__PURE__ */ new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function wl(e){let t=hl(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Hl(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=/* @__PURE__ */ new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Cl:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function Tl(e){let{fieldsDerivedFirst:t,flatStates:n}=wl(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var El=[];function Dl(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?Sl(t):r;return zr(i)?yl(e,t,i,Sl(t)):i}function Ol(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?xl(t):r;return zr(i)?yl(e,t,i,xl(t)):i}function kl(e){return e}function Al(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function jl(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&Al(i,r)}}function Ml(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function Nl(e,t){let{flatStates:n,generated:r,setters:i}=gl(hl(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=_i(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?kl(e)[i.field]=i.setterTable===void 0?a:ei(i.setterTable,a)?i.setterTable[a]:Ml(i):i.setter.call(e,a)}return e}(a,t,i)}function Pl(e){return hl(e).config}function Fl(){return!0}function Il(){return!1}function Ll(e){return e===Fl||e===Il}function Rl(e){let t=[];for(let n of[e.getter,e.setter])zr(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var zl=`__lexicalSynthesizedAfterCloneFrom`;function Bl(e){let{declaredBy:t,fieldsBaseFirst:n}=wl(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of Rl(a))r.includes(e)||r.push(e);return r}function Vl(e){let t=Bl(e);if(t.length===0)return t;let n=/* @__PURE__ */ new Set;for(let{klass:t}of Hl(e))if(t!==e)for(let e of Bl(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Hl(e){for(let t=e;t&&(t===ja||Ma(t.prototype));){let e=Pl(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Gl(t)}}function Ul(e){let t=H();Mu();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:xc(r)}var U=(e,t)=>{let n=e;for(;n!=null&&!N(n);){if(t(n))return n;n=n.getParent()}return null};function Wl(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?I(r):t.get(r);e??D(174),n.push(r),r=e.__next}return n}function Gl(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function Kl(e){return new Xl(fr(e._nodeMap),null,e._slotsUsed)}function ql(){return new Xl(/* @__PURE__ */ new Map([[`root`,new lo]]),null,!1)}function Jl(e){let t=e.constructor,n=_r(e);if(j(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(Jl(r[e]))}let r=vp(e);if(r.length>0){let i={};for(let n of r){let r=yp(e,n);r===null&&D(366,t.name,n),i[n]=Jl(r)}n.$slots=i}return n}function Yl(e){return e instanceof Xl}var Xl=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Wu(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return hr(typeof e==`boolean`&&e,()=>Wu(null,this,()=>({root:Jl(L())})))}},Zl=`historic`,Ql=`history-push`,$l=`history-merge`,eu=`collaboration`,tu=`skip-dom-selection`,nu=`skip-selection-focus`,ru=`composition-end`,iu=class extends ao{$config(){return this.config(`artificial`,{extends:ao})}createDOM(e){return Nc().createElement(`div`)}},au=class extends ja{$config(){return this.config(`linebreak`,{extends:ja,generated:Ga,importDOM:{br:e=>lu(e)||uu(e)?null:{conversion:ou,priority:0}}})}getTextContent(){return`
|
|
4
|
-
`}createDOM(){return Nc().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function ou(e){return{node:su()}}function su(){return xc(new au)}function cu(e){return e instanceof au}function lu(e){let t=e.parentElement;if(t!==null&&Yc(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&du(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&du(n))return!0}}return!1}function uu(e){let t=e.parentElement;if(t!==null&&Yc(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&du(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&du(r))return!0}return!1}function du(e){return Cs(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function fu(e){console.warn(e)}function pu(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ql(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements.clear(),e._normalizedNodes=/* @__PURE__ */ new Set,i&&i.preserveUpdateQueue||(e._updateTags=/* @__PURE__ */ new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&vd(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Fs(n,e,`root`))}function mu(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;for(let{klass:r,ownNodeConfig:i}of Hl(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var hu={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=ps(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>j(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>j(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function gu(e){let t=e||{},n=Ru(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=ql(),s=t.namespace||(i===null?qs():i._config.namespace),c=t.editorState,l=[lo,So,au,as,ts,iu,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=/* @__PURE__ */ new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===ja||n.prototype instanceof ja)){let r=`<unknown>`;try{r=JSON.parse(lr)}catch{}D(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Pl(n);let a=n.getType(),o=mu(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:yi(l[e]),transforms:o})}}let h=new yu(o,i,m,{disableEvents:a,dom:{...hu,...e&&e.dom},namespace:s,theme:r},u||console.error,d||fu,function(e,t){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(sn,Od,0),e.registerCommand(cn,Ad,0),e.registerCommand(ln,Md,0),e.registerCommand(un,Nd,0),e.registerCommand(Cn,Wd,0)}(h),h}function _u(e,t){let n=e.get(t);e.delete(t),n&&n()}function vu(e,t,n){return e.set(t,n),_u.bind(null,e,t)}var yu=class{static version=lr;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new pr,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:/* @__PURE__ */ new Map,editable:/* @__PURE__ */ new Map,mutation:/* @__PURE__ */ new Map,root:/* @__PURE__ */ new Map,textcontent:/* @__PURE__ */ new Map,update:/* @__PURE__ */ new Map},this._commands=/* @__PURE__ */ new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=/* @__PURE__ */ new Map,this._dirtyLeaves=/* @__PURE__ */ new Set,this._dirtyElements=/* @__PURE__ */ new Map,this._normalizedNodes=/* @__PURE__ */ new Set,this._updateTags=/* @__PURE__ */ new Set,this._observer=null,this._key=qs(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return vu(this._listeners.update,e)}registerEditableListener(e){return vu(this._listeners.editable,e)}registerDecoratorListener(e){return vu(this._listeners.decorator,e)}registerTextContentListener(e){return vu(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return ed(vu(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&D(35);let r=this._commands;r.has(e)||r.set(e,[new ur,new ur,new ur,new ur,new ur]);let i=r.get(e);i===void 0&&D(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=/* @__PURE__ */ new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&D(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=rl(n).get(t.getType());if(!r)return;let i=/* @__PURE__ */ new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:/* @__PURE__ */ new Set,prevEditorState:n,updateTags:/* @__PURE__ */ new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return Bs(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return z(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=nc(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,pu(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=id.get(e);if(t===void 0)return void Zd();let n=ad.get(t);if(n===void 0)return void Zd();id.delete(e);let r=bs(e);vs(r)?(function(e){if(e._parentEditor!==null){let t=Gs(e),n=t[t.length-1]._key;qd.get(n)===e&&qd.delete(n)}else qd.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&D(198);let i=Gd(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=hc(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Ir(this),this._updateTags.add($l),Gu(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;id.set(e,n);let r=ad.get(n);r===void 0&&(r={editors:/* @__PURE__ */ new Set,hasShadowEditor:void 0},ad.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Gd(e);i.push(od.register(n));let a={blur:Qn,click:pd,compositionend:Id,compositionstart:jd,copy:Wn,cut:Gn,dragend:Un,dragover:Hn,dragstart:Vn,drop:zn,focus:Zn,input:kd,keydown:Ld,paste:hn,pointerdown:yd,...Pt&&{beforeinput:Dd},...It&&{keyup:Rd,mousedown:gd}};for(let[n,r]of Object.entries(a))i.push(td(e,n,i=>{Xd(i)||(Yd(i),n===`blur`&&(vd(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):z(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,$u(t,()=>{let o=Ec(gc(t));if(a.type!==`mousedown`){let r=c&&o&&G(q())&&If(Rf(),o,t,new Event(`selectionchange`));return r&&R(r),xd(t,n,c&&o?Ic(o,e).focusNode:null)}let l=Pf(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Kd(t,o,new Event(`selectionchange`),r),xd(t,a,Ic(o,e).focusNode);let n=q();G(n)&&n.isCollapsed()&&!n.is(Rf())&&fd(t,n)}})};i.push(nd(n,{pointercancel:c,pointermove:c,pointerup:c},!0),td(gc(t),`blur`,s),t.registerEditableListener(s),nd(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||fl(Hc(e),t)?null:e}}),td(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),It&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return ed(td(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),td(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=md&&Math.abs(r.clientY-n.y)<=md&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(_d(e,t,n)||(Vc(n.ownerDocument)===n&&n.blur(),vd(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add($l),Gu(this);Ku(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=Kl(e),r._selection=e._selection?e._selection.clone():null),Fr(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Gu(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,$u(this,()=>{if(a&&this._updateTags.add(a),n&&(wt(38),L().append(F())),e._parsed)for(let[e,t]of r._nodeMap.entries())j(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=ql(),i=xu,a=Cu,o=Su,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=/* @__PURE__ */ new Map,t._dirtyLeaves=/* @__PURE__ */ new Set,t._cloneNotNeeded=/* @__PURE__ */ new Map,t._dirtyType=0,xu=r,Cu=!1,Su=t,ls(null);try{let i=t._nodes;Uu(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,xu=i,Cu=a,Su=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(Ou.has(this)||Gu(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Qu(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),$u(this,()=>{let r=q(),i=L();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||R(r.clone()),fc(`focus`),pc(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Ec(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ku(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Iu()))}toJSON(){return{editorState:this._editorState.toJSON(gr())}}};function bu(e,t,n,r,i,a){if(j(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=j(e);e.__parent!==t||s&&a.has(o)||((s||up(e)&&e.__slots!==null)&&bu(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of up(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&dp(e)&&e.__slotHost===t&&((j(e)||up(e)&&e.__slots!==null)&&bu(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var xu=null,Su=null,Cu=!1,wu=!1,Tu=!1,Eu=/* @__PURE__ */ new Set,Du=/* @__PURE__ */ new Set,Ou=/* @__PURE__ */ new Set,ku=0,Au={characterData:!0,childList:!0,subtree:!0};function ju(){return Cu||xu!==null&&xu._readOnly}function Mu(){Cu&&D(13)}function Nu(){ku>99&&D(14)}function Pu(){return xu===null&&D(195,Lu()),xu}function Fu(e){Pu()!==null&&Su===null&&(Su=e),Su!==e&&wt(378)}function W(){return Su===null&&D(337,Lu()),Su}function Iu(){W()._dirtyType=2}function Lu(){let e=0,t=/* @__PURE__ */ new Set,n=yu.version;if(typeof window<`u`)for(let r of jc(document)){let i=bs(r);if(vs(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Ru(){return Su}function zu(e,t,n){let r=t.__type,i=fs(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Bu(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Vu(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Hu(e){return Uu(e,W()._nodes)}function Uu(e,t){let n=e.type,r=t.get(n);r===void 0&&D(17,n);let i=r.klass;e.type!==i.getType()&&D(18,i.name);let a=i.importJSON(e),o=e.children;if(j(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Uu(o[e],t);a.append(n)}let s=e.$slots;if(s){up(a)||D(379,i.name);for(let e in s)Op(a,e,Uu(s[e],t))}return a}function Wu(e,t,n){let r=xu,i=Cu,a=Su;xu=t,Cu=!0,Su=e;try{return n()}finally{xu=r,Cu=i,Su=a}}function Gu(e,t){e._pendingEditorState!==null&&Su!==e&&Fr(e,!1,!0);let n=Tu;Tu=!0;try{let n=function(e){if(Du.has(e))return!1;Du.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!qu(e,n))return!1;let i=(n===null||G(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;Qu(e,()=>e.dispatchCommand(rn),void 0,!0)}return!1}finally{Du.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Yu(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=xu,u=Cu,d=Su,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Su=e,xu=n,Cu=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=wa(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),wu)throw t;pu(e,null,r,n),Ir(e),e._dirtyType=2,wu=!0,Gu(e,a),wu=!1;return}finally{p.observe(r,Au),e._updating=f,xu=l,Cu=u,Su=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements=/* @__PURE__ */ new Map,e._normalizedNodes=/* @__PURE__ */ new Set),e._updateTags=/* @__PURE__ */ new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Rs(e)),delete r[a])}(e,n);let b=i?null:Ec(gc(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Su=e,xu=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Tc(t,e,r),Gf(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(G(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Bc(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())wc(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&wc(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=Qc(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Nc().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=mm(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Tc(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Au),Su=d,xu=l}}let x=Ou.has(e);Ou.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,Ku(`decorator`,e,!0,r)),function(e,t,n){let r=zs(t),i=zs(n);r!==i&&Ku(`textcontent`,e,!0,i)}(e,t||a,n),Ku(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||Ou.delete(e)}f||Yu(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){Eu.has(e)||(Eu.add(e),setTimeout(()=>{Eu.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Ct(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Qu(e,t,r)}}(e)})(e,t),n&&e._onWarn(Ct(436))}finally{Tu=n}}function Ku(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function qu(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Ju(e,t,n,r){let i=Gs(e),a;if(!Tu)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===rn){if(Su!==e||Cu){let i=!1;return $u(e,()=>{i=Ju(e,t,n,r)}),i}let i=Pu()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if($u(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Ju(a,t,n,r)}),!1}function Yu(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Xu(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&D(191),a._flushSync=!0),o&&e._deferred.push(o),Vu(e,i.tag)),a==null?Qu(e,n,i):n()}}return r}function Zu(){let e=Pu();Mu(),e._flushSync=!0}function Qu(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,Vu(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=Kl(l||c),u=!0),l._flushSync=s;let d=xu,f=Cu,p=Su,m=e._updating,h=e._lastNotifiedSelection;xu=l,Cu=!1,e._updating=!0,Su=e;let g=e._headless||e.getRootElement()===null;ls(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=Ec(gc(e));return G(n)||n==null?If(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Xu(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(G(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);P(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Fa(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Ms(),o=/* @__PURE__ */ new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=/* @__PURE__ */ new Set;for(let e of s){let r=i.get(e);P(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Fa(r),r!==void 0&&Bu(r,a)&&zu(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){ku++;continue}}t._dirtyLeaves=/* @__PURE__ */ new Set,t._dirtyElements=/* @__PURE__ */ new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Bu(c,a)&&zu(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,ku++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Xu(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(j(t)&&bu(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(up(t)&&t.__slots!==null&&bu(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=W(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(G(i)){e._slotsUsed&&Df(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||D(19)}else K(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements.clear(),Gu(e);return}finally{xu=d,Cu=f,Su=p,e._updating=m,ku=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Gu(e)):u&&ms(()=>{Gu(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function $u(e,t,n){Su===e&&n===void 0?ju()?Qu(e,t,n):t():Qu(e,t,n)}function ed(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function td(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function nd(e,t,n){return ed(...Object.entries(t).map(([t,r])=>td(e,t,r,n)))}var rd=30,id=/* @__PURE__ */ new WeakMap,ad=/* @__PURE__ */ new WeakMap,od=/* @__PURE__ */ sr(e=>(e.addEventListener(`selectionchange`,Jd),()=>e.removeEventListener(`selectionchange`,Jd)));function sd(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=W(),u;if(a!==void 0)u=a;else{let e=Ec(gc(l));u=e===null?null:Ic(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!P(c)||(!i&&(!Pt||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||Ws(n))&&o.offset!==s.offset&&!c.isComposing()||Ss(c)||c.isDirty()&&m>1||(i||!Pt)&&p!==null&&!c.isComposing()&&d!==el(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=xs(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(P(t)||j(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function cd(e,t){return Cs(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function ld(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Ic(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,cd(r,i)&&cd(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}$u(t,()=>{if(!n)return void R(null);if(!_s(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||xd(t,c,a);let l=bd.has(c),u=q();if(s.postDeleteSelectionToRestore&&G(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),R(u))}if(s.postDeleteSelectionToRestore=null,G(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),fd(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=Ut,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(P(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||qu(e,t))&&e.dispatchCommand(rn)})(t,u,u!==null&&(u.dirty&&!l||!G(u)))})}function ud(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function dd(e,t){ud(e,t.getFormat(),t.getStyle())}function fd(e,t){let n=t.anchor,r=n.getNode(),i=gc(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?ud(t,o,s):n.type===`text`?(P(r)||D(141),dd(t,r)):(e.isComposing()||L().getTextContent()!==``)&&(j(r)||D(259),r.isEmpty()?Lf(t,``):ud(t,t.format,``))}function pd(e,t){$u(t,()=>{let n=q(),r=Ec(gc(t)),i=Rf();if(r){if(G(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!N(t)&&L().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||It&&t._inputState.lastPointerType!==`mouse`){let n=Ic(r,t._rootElement).anchorNode;(V(n)||Cs(n))&&R(If(i,r,t,e))}}if(Mt&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(V(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=If(i,r,t,e);s===null?r.removeAllRanges():R(s)}}z(t,on,e)})}var md=10,hd=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function gd(e,t){let n=t.getRootElement();n!==null&&(_d(e,t,n)?(e.preventDefault(),Vc(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):vd(t,n))}function _d(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=Hc(e);if(!Wc(r))return!1;let i=!1;for(let e=r;e!==null;e=cc(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(hd))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function vd(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function yd(e,t){let n=Hc(e),r=e.pointerType;Wc(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&$u(t,()=>{fl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var bd=/* @__PURE__ */ new WeakSet;function xd(e,t,n=null){let r=q(),i=r&&r.clone();(function(e,t,n){let r=Rf(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&Ls(n);M(o)&&(i?a&&o.isInline()&&o.selectPrevious():G(r)&&R(r.clone()));let s=q(),c=s||(a?Mf():G(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!G(c)||a&&!c.isCollapsed()||!ws(u)&&!Oc(u))return;let{anchor:d,focus:f}=c;if(!i&&G(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&Ls(h),_=(e,t)=>j(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=j(g)&&!g.isInline()&&(N(g)?U(f.getNode(),Af):g);for(let e of y?qp(y,`next`):[])v.push(J(e.origin,`previous`),e);let b=gc(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!M(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle(cc(r)||r).direction===`rtl`,C=2*p>u+h!==y,ee=C?`next`:`previous`,te=t&&t.getNodeAtCaret(),ne=te&&e.getElementByKey(te.getKey()),re=ne?ne.getClientRects():[],ie=re[C?0:re.length-1];if(!t||t.direction===ee&&b.getComputedStyle(r).cssFloat===`none`&&(!te||cu(te)||ie&&(C===y?2*ie.right>u+h:2*ie.left<u+h))){if(!n.is(_(ac(f,C),ee))){let e=J(n,ee);Po(f,e),a&&Po(d,e)}s||R(c);return}}if(M(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:Oc(u)?[u]:[]}),r=n&&Sf(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=q(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&bd.add(o),t.type===`mousedown`&&G(a)&&Lf(a,G(i)?i.anchor.key:``)}function Sd(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Cd(e){let{lastKeyCode:t}=W()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
|
3
|
+
`,qt=Nt?`\xA0`:Gt,Jt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Yt={directionless:1,unmergeable:2},Xt={center:2,end:6,justify:4,left:1,right:3,start:5};function Zt(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Qt=/* @__PURE__ */ Zt(Xt),$t={normal:0,segmented:2,token:1},en=/* @__PURE__ */ Zt($t),tn=Symbol.for(`@lexical/ctrlOrOtherKey`),nn=`$config`;function rn(e){return()=>{}}function D(e){return{type:e}}var an=/* @__PURE__ */ D(`SELECTION_CHANGE_COMMAND`),on=/* @__PURE__ */ D(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),sn=/* @__PURE__ */ D(`CLICK_COMMAND`),cn=/* @__PURE__ */ D(`BEFORE_INPUT_COMMAND`),ln=/* @__PURE__ */ D(`INPUT_COMMAND`),un=/* @__PURE__ */ D(`COMPOSITION_START_COMMAND`),dn=/* @__PURE__ */ D(`COMPOSITION_END_COMMAND`),fn=/* @__PURE__ */ D(`DELETE_CHARACTER_COMMAND`),pn=/* @__PURE__ */ D(`INSERT_LINE_BREAK_COMMAND`),mn=/* @__PURE__ */ D(`INSERT_PARAGRAPH_COMMAND`),hn=/* @__PURE__ */ D(`CONTROLLED_TEXT_INSERTION_COMMAND`),gn=/* @__PURE__ */ D(`PASTE_COMMAND`),_n=/* @__PURE__ */ D(`REMOVE_TEXT_COMMAND`),vn=/* @__PURE__ */ D(`DELETE_WORD_COMMAND`),yn=/* @__PURE__ */ D(`DELETE_LINE_COMMAND`),bn=/* @__PURE__ */ D(`FORMAT_TEXT_COMMAND`),xn=/* @__PURE__ */ D(`SET_TEXT_FORMAT_COMMAND`),Sn=/* @__PURE__ */ D(`UNDO_COMMAND`),Cn=/* @__PURE__ */ D(`REDO_COMMAND`),wn=/* @__PURE__ */ D(`KEYDOWN_COMMAND`),Tn=/* @__PURE__ */ D(`KEY_ARROW_RIGHT_COMMAND`),En=/* @__PURE__ */ D(`MOVE_TO_END`),Dn=/* @__PURE__ */ D(`KEY_ARROW_LEFT_COMMAND`),On=/* @__PURE__ */ D(`MOVE_TO_START`),kn=/* @__PURE__ */ D(`KEY_ARROW_UP_COMMAND`),An=/* @__PURE__ */ D(`KEY_ARROW_DOWN_COMMAND`),jn=/* @__PURE__ */ D(`KEY_ENTER_COMMAND`),Mn=/* @__PURE__ */ D(`KEY_SPACE_COMMAND`),Nn=/* @__PURE__ */ D(`KEY_BACKSPACE_COMMAND`),Pn=/* @__PURE__ */ D(`KEY_ESCAPE_COMMAND`),Fn=/* @__PURE__ */ D(`KEY_DELETE_COMMAND`),In=/* @__PURE__ */ D(`KEY_TAB_COMMAND`),Ln=/* @__PURE__ */ D(`INSERT_TAB_COMMAND`),Rn=/* @__PURE__ */ D(`INDENT_CONTENT_COMMAND`),zn=/* @__PURE__ */ D(`OUTDENT_CONTENT_COMMAND`),Bn=/* @__PURE__ */ D(`DROP_COMMAND`),Vn=/* @__PURE__ */ D(`FORMAT_ELEMENT_COMMAND`),Hn=/* @__PURE__ */ D(`DRAGSTART_COMMAND`),Un=/* @__PURE__ */ D(`DRAGOVER_COMMAND`),Wn=/* @__PURE__ */ D(`DRAGEND_COMMAND`),Gn=/* @__PURE__ */ D(`COPY_COMMAND`),Kn=/* @__PURE__ */ D(`CUT_COMMAND`),qn=/* @__PURE__ */ D(`SELECT_ALL_COMMAND`),Jn=/* @__PURE__ */ D(`CLEAR_EDITOR_COMMAND`),Yn=/* @__PURE__ */ D(`CLEAR_HISTORY_COMMAND`),Xn=/* @__PURE__ */ D(`CAN_REDO_COMMAND`),Zn=/* @__PURE__ */ D(`CAN_UNDO_COMMAND`),Qn=/* @__PURE__ */ D(`FOCUS_COMMAND`),$n=/* @__PURE__ */ D(`BLUR_COMMAND`),er=/* @__PURE__ */ D(`KEY_MODIFIER_COMMAND`);function tr(e,t){return{...t,[tn]:e}}var nr=/* @__PURE__ */ tr(`metaKey`,{ctrlKey:!Mt,metaKey:Mt}),rr=/* @__PURE__ */ tr(`altKey`,{altKey:Mt,ctrlKey:!Mt}),ir=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function ar(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var or=class{byKey=/* @__PURE__ */ new Map;byCode=/* @__PURE__ */ new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||E(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of ir){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))ar(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?ar(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&ar(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of ir)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function sr(e){let t=new or;for(let n of e)t.add(n);return t}function cr(e){let t=/* @__PURE__ */ new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:/* @__PURE__ */ new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function lr(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var ur=/* @__PURE__ */ lr(),dr=class{_front=/* @__PURE__ */ new Set;_back=/* @__PURE__ */ new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},fr=null;function pr(e,t=1e3){return e instanceof mr?e.clone():e.size<t?new Map(e):new mr().init(new Map(e),void 0,e.size)}var mr=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===fr?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===fr?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==fr&&n!==void 0||(this._size++,n===fr&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,fr),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==fr&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===fr||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},hr=!1;function gr(e,t,...n){let r=hr,i;try{hr=e,i=t()}finally{hr=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||E(421),i}function _r(){return hr}function vr(e){let t=e.exportJSON(hr),n=e.constructor;return t.type!==n.getType()&&E(130,n.name),j(e)&&!Array.isArray(t.children)&&E(59,n.name),t}function yr(){return H()._blockCursorElement}function br(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var xr=Ht||Lt||zt;function Sr(){let e=Nc().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function Cr(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var wr=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&E(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&E(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&E(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Tr(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Tr(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Tr(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Er=class e extends wr{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;br(t);)e=t,t=t.nextSibling;Cr(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===yr()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;br(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===yr()&&(t=t.previousSibling);return Cr(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(Sr(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(Sr(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&br(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&xr;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=Nc().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=Nc().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=yr(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Dr(t,n);i.push(r);let a=Dr(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Dr(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&E(225),n.reverse()}var Or=!1,kr=0;function Ar(){kr=performance.now()}function jr(e){return V(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function Mr(e,t,n){let r=Ec(gc(n)),i=r&&Ic(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Xs(t,s,a,o,!1)}function Nr(e,t,n){if(G(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Cs(t)&&n.isAttached()}function Pr(e,t,n){for(let r=e;r&&!ul(r);r=cc(r)){let e=Is(r,t);if(e!==void 0){let t=I(e,n);if(t)return M(t)||!V(r)?void 0:[r,t]}}}function Fr(e,t,n,r){Or=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-kr>100;try{$u(e,()=>{let a=q()||function(e){return e.read(`latest`,()=>{let e=q();return e===null?null:e.clone()})}(e),o=/* @__PURE__ */ new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Pr(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?P(m)&&m.isAttached()&&m.markDirty():i&&P(m)&&Cs(d)&&Nr(a,d,m)&&Mr(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=Is(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&V(t)&&t.hasAttribute(`data-lexical-slot`)||ul(t)))){if(Nt){let e=(V(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||Cr(e)||jr(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||Is(n,e)||jr(n)||n.remove();n.takeRecords(),a!==null&&(l&&R(a),Nt&&oc(e)&&a.insertRawText(u))})}finally{Or=!1}}function Ir(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&Fr(e,i,r,t)}}function Lr(e){(function(e){gc(e).addEventListener(`textInput`,Ar,!0)})(e),e._observer=new MutationObserver((t,n)=>{Fr(e,t,n)})}function Rr(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function zr(e,t){return Rr(e,t,e.defaultValue)}function Br(e){return typeof e==`object`&&!!e}function Vr(e,t){let n=Kr(e,t).getter;return Br(n)&&n.getterTable!==void 0||E(405,t),Gr(n.getterTable)}function Hr(e,t){let n=Kr(e,t).setter;return Br(n)&&n.setterTable!==void 0||E(406,t),Gr(n.setterTable)}function Ur(e,t,n){let{meta:r}=Kr(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Gr(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:E(407,t,String(n))}function Wr(e,t){let n=Kr(e,t),{setter:r}=n;Br(r)&&r.setterTable!==void 0||E(408,t);let i=String(n.defaultValue);return ti(r.setterTable,i)||E(409,t,i),r.setterTable[i]}function Gr(e){return Object.assign(Object.create(null),e)}function Kr(e,t){let n=e.get(t);return n===void 0&&E(410,t),n}function qr(e,t,n,r,i){i!==void 0&&Jr.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Zr(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Jr=/* @__PURE__ */ new WeakSet,Yr=/* @__PURE__ */ new WeakSet;function Xr(e){return typeof e==`object`&&e&&Yr.add(e),e}function Zr(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Yr.has(e)){Object.freeze(e);for(let t of Object.values(e))Zr(t)}}function Qr(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function $r(e,t){return n=>t(n)||ei(e,n)}function ei(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return ei(e,t)?{parsed:e(t)}:void 0;let r=e(t);return zr(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function ti(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ni(e=``){return qr(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var ri=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ii(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&ri.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return qr(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function ai(e=!1){return qr(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function oi(e,...t){let n=Xr(t.length===0?e[0]:t[0]),r=new Set(e);return qr(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function si(e,t={}){let{defaultAsNull:n}=t;return qr(t=>{if(t==null)return null;let r=e(t);return n&&zr(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Qr(e),$r(e,e=>e==null))}function ci(e,t={}){let{omitDefault:n}=t;return qr(t=>{if(t===void 0)return;let r=e(t);return n&&zr(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Qr(e),$r(e,e=>e===void 0))}function li(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function ui(e,t){let n=e=>typeof e==`string`&&ti(t,e);return qr(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||ei(e,t))}function di(e,t){return pi(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function fi(e,t){return pi(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function pi(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var mi=`latest`,hi=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Ei).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Rr(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function gi(e,t){return new hi(e,t)}function _i(e,t,n=mi){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function vi(e,t,n){let r;if(Mu(),typeof n==`function`){let i=e.getLatest(),a=_i(i,t);if(r=yi(t,n(a)),t.isEqual(a,r))return i}else r=yi(t,n);let i=e.getWritable();return Ci(i).updateFromKnown(t,r),i}function yi(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function bi(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set;for(let{ownNodeConfig:r}of Hl(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var xi=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]),Si=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=/* @__PURE__ */ new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Ti(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(xi.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=Ti(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(xi.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Ci(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Si(t,function(e){return e.__state?e.__state.sharedNodeState:fs(H(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function wi(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&Ci(e).updateFromJSON(r),n}function Ti(e){if(e)for(let t in e)return e}function Ei(e){return e}function Di(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function Oi(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ki(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Ai(e){return!N(e)&&e.getTextContent!==ao.prototype.getTextContent}var ji=Symbol.for(`@lexical/CachedTextSize`);function Mi(e,t){return qi.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Ki.get(r);if(i===void 0&&E(345,r),j(i)){let a=A.get(r);if(a!==void 0&&j(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=Ji.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&E(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(ua(i).size>0)n+=i.getTextContentSize();else{let e=i[ji];e===void 0&&E(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:O})}function Ni(e){j(e)||ua(e).size>0||e[ji]===void 0&&(e[ji]=P(e)?e.__text.length:e.getTextContentSize())}var Pi=4,Fi,O,Ii,k=``,Li=null,Ri=null,zi=null;function Bi(){return{firstTextKey:zi,format:Li,style:Ri}}function Vi(e){e.firstTextKey!==null&&(Li=e.format,Ri=e.style,zi=e.firstTextKey)}function Hi(e){if(zi!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&E(348),t===null)return;let n=A.get(t);P(n)&&(Li=n.getFormat(),Ri=n.getStyle(),zi=t)}var Ui,Wi,Gi,Ki,qi,A,Ji,Yi,Xi,Zi,Qi=!1,$i=!1;function ea(e,t){let n=Ki.get(e),r=A.has(e);if(t!==null){let n=Ta(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(O._keyToDOMMap.delete(e),j(n)){let e=Wl(n,Ki);ta(e,0,e.length-1,null)}if(n!==void 0){for(let e of ua(n).values()){let t=fa(e);ea(e,null),t!==null&&t.remove()}rc(Xi,Ii,Ui,n,`destroyed`)}}}function ta(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&ea(t,r)}}function na(e,t){e.setProperty(`text-align`,t)}var ra=`40px`;function ia(e,t){let n=Fi.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${ra}))`),tc(e,`class`),tc(e,`style`)}function aa(e,t){let n=e.style;t===0?na(n,``):t===1?na(n,`left`):t===2?na(n,`center`):t===3?na(n,`right`):t===4?na(n,`justify`):t===5?na(n,`start`):t===6&&na(n,`end`),tc(e,`style`)}function oa(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(N(e))return null;let n=e.getParent();return n===null||B(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function sa(e){let t=Nc().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function ca(e,t,n){t||e.contentEditable===`false`?dl(n,O):n.removeAttribute(`contenteditable`)}function la(e,t,n){let r=k,i=Bi();k=``;let a=``,o=M(e);for(let[r,i]of n){let n=sa(r);ca(t,o,n),t.appendChild(n),k=``;let s=Bi();ma(i,Qc(e,n,O)),Vi(s),da(e,r,t,n),a+=k}return Vi(i),k=r,a}function ua(e){return up(e)&&e.__slots!==null?e.__slots:lp}function da(e,t,n,r){let i=Zi.$getSlotTargetElement(e,t,n,O);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function fa(e){let t=Ji.get(e);return t===void 0?null:t.parentElement}function pa(e,t,n){let r=ua(e),i=ua(t);for(let[e,t]of r)if(!i.has(e)){let e=fa(t);ea(t,null),e!==null&&e.remove()}let a=k,o=Bi(),s=``,c=null,l=M(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:fa(i);k=``;let u=Bi();if(o===null){o=sa(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),ma(a,Qc(t,o,O))}else i===a?ba(a,o):(i!==void 0&&ea(i,o),ma(a,Qc(t,o,O)));if(Vi(u),ca(n,l,o),da(t,e,n,o),s+=k,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Vi(o),k=a,s}function ma(e,t){let n=A.get(e);if(n===void 0&&E(60),t!==null){let r=Ki.get(e);if(r!==void 0){let i=Ji.get(e);if(i!==void 0){let a=dp(r)?r.__slotHost:null,o=dp(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),ba(e,t.element)}}}let r=Zi.$createDOM(n,O);if(function(e,t,n){let r=n._keyToDOMMap;Fs(t,n,e),r.set(e,t)}(e,r,O),P(n)?r.setAttribute(`data-lexical-text`,`true`):M(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),ll(r,{captureSelection:!0})),j(n)){let e=k,t=n.__indent,i=n.__size;oa(r,n),t!==0&&ia(r,t);let a=ua(n),o=a.size>0?la(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,k+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(ha(Wl(n,A),n,0,t,Qc(n,r,O)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,k=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(Ai(n)){let t=n.getTextContent();r.__lexicalTextContent=t,k=e+t}let s=n.__format;s!==0&&aa(r,s),n.isInline()||(va(0,n,r),_a(n,r))}else{let t=n.getTextContent();if(M(n)){let t=n.decorate(O,Fi);t!==null&&xa(e,t),r.contentEditable=`false`;let i=ua(n);i.size>0&&la(n,r,i)}k+=t}return t!==null&&t.insertChild(r),Zi.$decorateDOM(n,null,r,O),Ni(n),rc(Xi,Ii,Ui,n,`created`),r}function ha(e,t,n,r,i){let a=k,o=Bi();k=``,Li=null,Ri=null,zi=null;let s=n;for(;s<=r;++s){let t=Bi();ma(e[s],i);let n=A.get(e[s]);n!==null&&P(n)?Li===null&&(Li=n.getFormat(),Ri=n.getStyle(),zi=n.__key):j(n)&&s<r&&!n.isInline()&&(k+=Kt),Vi(t)}let c=O._keyToDOMMap.get(t.__key);c===void 0&&E(349,t.__key),c.__lexicalTextContent=k,c.__lexicalFirstTextKey=zi,k=a+k,Vi(o)}function ga(e){return M(e)&&!e.isInline()}function _a(e,t,n=Qc(e,t,O)){n.setDecoratorBoundaryAnchor(`leading`,ga(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,ga(e.getLastChild()))}function va(e,t,n){let r=Qc(t,n,O),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return cu(e)?`line-break`:M(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,A);r.setManagedLineBreak(i)}function ya(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=A.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=A.get(r);if(P(e))return Li=e.getFormat(),void(Ri=e.getStyle())}}t.__lexicalFirstTextKey=zi}function ba(e,t){let n=Ki.get(e),r=A.get(e);n!==void 0&&r!==void 0||E(61);let i=Qi||Gi.has(e)||Wi.has(e),a=sc(O,e);if(n===r&&!i){let e;if(j(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&E(355,n.getType()),e=t,Hi(a)}else e=n.getTextContent();return k+=e,a}if(n!==r&&i&&rc(Xi,Ii,Ui,r,`updated`),Zi.$updateDOM(r,n,a,O)){let n=ma(e,null);return t===null&&E(62),t.replaceChild(n,a),ea(e,null),n}if(j(n)){j(r)||E(334,e);let t=r.__indent;(Qi||t!==n.__indent)&&ia(a,t);let o=r.__format;(Qi||o!==n.__format)&&aa(a,o);let s=i&&(ua(r).size>0||ua(n).size>0)?pa(n,r,a):``;if(i){let e=k;if(function(e,t,n){var r;Li=null,Ri=null,zi=null,function(e,t,n){let r=k,i=e.__size,a=t.__size;k=``;let o=n.element,s=O._keyToDOMMap.get(t.__key);s===void 0&&E(351,t.__key);let c=a-i;if(!Qi&&Math.abs(c)<=1&&i>=Pi&&e.__first===t.__first&&(c!==0||!O._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Yi.get(e.__key);if(!Qi&&!Ai(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=A.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=Mi(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=A.get(n);if(e===void 0)break;let t=Bi();ba(n,o),P(e)&&Li===null&&(Li=e.getFormat(),Ri=e.getStyle(),zi=e.__key),Vi(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=A.get(n);if(e===void 0)break;let t;if(j(e)){let r=O._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&E(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&j(e)&&!e.isInline()&&(d+=Kt),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,k=r+m,ya(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Ki.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=A.get(a),d=Ki.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=A.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Ki.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=Mi(l,c);for(let e of _){let t=Bi();if(e.kind===`reconcile`)ba(e.key,n.element);else if(e.kind===`destroy`)ea(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=O._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}ma(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=A.get(e.key);t&&P(t)&&Li===null&&(Li=t.getFormat(),Ri=t.getStyle(),zi=t.__key)}Vi(t)}let x=``;for(let e=0;e<o;e++){let t=A.get(f[e]);if(t===void 0)return!1;let n;if(j(t)){let r=O._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&E(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&j(t)&&!t.isInline()&&(x+=Kt)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&E(353),k=r+e,ya(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=A.get(t);if(e===void 0)break;let r=Qi||Gi.has(t)||Wi.has(t),i=Bi();if(r)ba(t,o);else{let n,r;if(j(e)){r=Ji.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&E(354,e.getType()),n=i}else n=e.getTextContent();k+=n,r!==void 0&&Hi(r)}P(e)?Li===null&&(Li=e.getFormat(),Ri=e.getStyle(),zi=e.__key):j(e)&&n<a-1&&!e.isInline()&&(k+=Kt),Vi(i),t=e.__next,n++}s.__lexicalTextContent=k,s.__lexicalFirstTextKey=zi,k=r+k;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)ba(r,o);else{let e=Ta(r),t=ma(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}ea(r,null)}let a=A.get(i);P(a)&&Li===null&&(Li=a.getFormat(),Ri=a.getStyle(),zi=a.__key)}else{let r=Wl(e,Ki),s=Wl(t,A);if(r.length!==i&&E(227),s.length!==a&&E(228),i===0)a!==0&&ha(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&ua(t).size===0&&n.element.__lexicalLineBreak==null;ta(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=Bi();if(e===r)u=Sa(ba(r,a.element)),d++,f++;else{if(l===void 0&&(l=Ca(n,f)),c===void 0)c=Ca(t,d);else if(!c.has(e)){d++,Vi(i);continue}if(!l.has(e)){let t=Ta(e);t.parentNode===a.element&&(u=Sa(t)),ea(e,a.element),d++,c.delete(e),Vi(i);continue}if(c.has(r)){let e=sc(O,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=Sa(ba(r,a.element)),d++,f++}else ma(r,a.withBefore(u??a.before)),f++}let o=A.get(r);o!==null&&P(o)?Li===null&&(Li=o.getFormat(),Ri=o.getStyle(),zi=o.__key):j(o)&&f<=s&&!o.isInline()&&(k+=Kt),Vi(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:O.getElementByKey(t);ha(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&ta(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=k,s.__lexicalFirstTextKey=zi,k=r+k}(e,t,Qc(t,n,O)),B(t)||(r=t,Li==null||Li===r.__textFormat||$i||r.setTextFormat(Li),function(e){Ri==null||Ri===e.__textStyle||$i||e.setTextStyle(Ri)}(t))}(n,r,a),r.isInline()||(N(r)||va(0,r,a),_a(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,k=e+s+t,a.__lexicalSlotTextLength=s.length}else(ua(r).size>0||ua(n).size>0)&&(a.__lexicalSlotTextLength=0);if(Ai(r)){let t=r.getTextContent();a.__lexicalTextContent=t,k=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&E(356,n.getType()),k+=e,Hi(a)}if((Qi||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(oa(a,r),N(r)&&!Qi))for(let e of r.getChildren())j(e)&&oa(sc(O,e.getKey()),e)}else{let t=r.getTextContent();if(M(r)){let t=r.decorate(O,Fi);t!==null&&xa(e,t),i&&(ua(r).size>0||ua(n).size>0)&&pa(n,r,a)}k+=t}if(!$i&&N(r)){let e=r.getLatest();if(e.__cachedText!==k){let t=e.getWritable();t.__cachedText=k,r=t}}return Zi.$decorateDOM(r,n,a,O),Ni(r),a}function xa(e,t){let n=O._pendingDecorators,r=O._decorators;if(n===null){if(r[e]===t)return;n=Rs(O)}n[e]=t}function Sa(e){let t=e.nextSibling;return t!==null&&t===O._blockCursorElement&&(t=t.nextSibling),t}function Ca(e,t){let n=/* @__PURE__ */ new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function wa(e,t,n,r,i,a){k=``,Li=null,Ri=null,zi=null,Qi=r===2,O=n,Fi=n._config,Zi=n._config.dom||hu,Ii=n._nodes,Ui=O._listeners.mutation,Wi=i,Gi=a,Ki=e._nodeMap,qi=e,A=t._nodeMap,$i=t._readOnly,Ji=pr(n._keyToDOMMap),Yi=function(){let e=/* @__PURE__ */ new Map,t=t=>{for(let n of t){let t=A.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=/* @__PURE__ */ new Set,e.set(r,i)),i.add(n)}};return t(Wi.keys()),t(Gi),e}();let o=/* @__PURE__ */ new Map;return Xi=o,ba(`root`,null),O=void 0,Ii=void 0,Wi=void 0,Gi=void 0,Ki=void 0,qi=void 0,A=void 0,Fi=void 0,Ji=void 0,Yi=void 0,Xi=void 0,Zi=hu,o}function Ta(e){let t=Ji.get(e);return t===void 0&&E(75,e),t}function Ea(e,t,n){Mu();let r=e.__key,i=e.getParent();if(i===null)return void(fp(e)!==null&&E(367,r,String(fp(e))));let a=function(e){let t=q();if(!G(t)||!j(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return mc(i,e)&&n.set(e.__key,0,`element`),mc(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(G(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Vf(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Vf(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else K(a)&&t&&e.isSelected()&&e.selectPrevious();ap(e.getWritable(),t&&!o&&G(a)?a:null),n||B(i)||i.canBeEmpty()||!i.isEmpty()||Ea(i,t),t&&a&&N(i)&&i.isEmpty()&&i.selectEnd()}function Da(e){return e}var Oa=Symbol.for(`ephemeral`);function ka(e){return e[Oa]||!1}var Aa={configurable:!0,enumerable:!1,value:void 0,writable:!0},ja=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Pl(this);return e===void 0&&E(64,this.name),e}static clone(e){E(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Gl(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Aa),Object.defineProperty(this,ji,Aa),Os(this,e)}getType(){return this.__type}isInline(){E(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=I(e);if(t===null)break;e=t.__parent===null?fp(t):t.__parent}return!1}isSelected(e){let t=e||q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(P(this))return n;if(G(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(M(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:I(e)}getParentOrThrow(){let e=this.getParent();return e===null&&E(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(B(t)||fp(e)!==null)return j(e)||e===this&&M(e)||E(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&E(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:I(e)}getPreviousSiblings(){return cp(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:I(e)}getNextSiblings(){return cp(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=um(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?sm(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&E(279),!1)))}isParentOf(e){return mc(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&j(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=W()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ka(this))return this;let e=I(this.__key);return e===null&&E(442,this.__key,this.__type),e}getWritable(){if(ka(this))return this;Mu();let e=Pu(),t=W(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return As(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&E(442,n,this.__type);let c=il(s);return r.set(n,c),o.set(n,c),As(c),c}getTextContent(){return Ep(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){E(70)}updateDOM(e,t,n){E(71)}getDOMSlot(e){return new wr(e)}exportDOM(e){return{element:Zc(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=gl(hl(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return j(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=kl(e)[a.field];o=a.getterTable===void 0?t:ti(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!Al(a,o)&&a.when.call(e)||(o=void 0)),r&&Al(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){E(18,this.name)}updateFromJSON(e){return Nl(wi(this,e),e)}static transform(){return null}remove(e){Ea(this,!0,e)}replace(e,t){Mu();let n=q();n!==null&&(n=n.clone()),Sc(this,e);let r=this.getLatest(),i=this.__key,a=pp(r);a!==null&&E(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();ap(s,G(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();Ea(r,!1,!0),rp(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(j(this)&&j(s)||E(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),G(n)){R(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):tf(e,s))}return Ms()===i&&js(o),s}insertAfter(e,t=!0){return op(this,`next`,e,t)}insertBefore(e,t=!0){return op(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return F()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return sp(J(this,`previous`),e,t)}selectNext(e,t){return sp(J(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function Ma(e){return e instanceof ja}function Na(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=/* @__PURE__ */ new Set;return!(e&&Di(n,e,t)||t&&Di(n,t,e)||e&&Oi(n,e,t)||t&&Oi(n,t,e))}(c,l))}function Pa(e,t){let n=e.mergeWithSibling(t),r=W()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Fa(e){let t,n,r=e;if(!Ns(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&P(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!Ns(t);){if(t.__text!==``){if(Na(t,r)){r=Pa(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&P(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!Ns(n);){if(n.__text!==``){if(Na(r,n)){r=Pa(r,n);break}break}n.remove()}}else r.remove()}}function Ia(e){return La(e.anchor),La(e.focus),e}function La(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),P(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!j(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Ra=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function za(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Ra.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Ba(e,t,n,r,i){let a=za(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var Va=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ba(t.indent,0,0,1/0),e.__textFormat=za(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Ha(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Ua=e=>{let t=Vr(e,`mode`),n=Ur(e,`detail`,0),r=Ur(e,`format`,0),i=Hr(e,`mode`),a=Wr(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:za(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:za(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Ha}},Wa=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ba(t.indent,0,0,1/0),e.__textFormat=za(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ga=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Ka=e=>{let t=Vr(e,`mode`),n=Ur(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:za(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},qa=/* @__PURE__ */ new WeakMap;function Ja(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!Ll(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function Ya(e){for(let{ownNodeConfig:t}of Hl(e))if(t&&t.children!==void 0)return t.children}function Xa(e){let t=qa.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of Hl(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=/* @__PURE__ */ new Set,n=Tl(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of Hl(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof hi?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&Ja(e,r.inline)!==void 0&&Ja(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=Tl(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=Ya(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),qa.set(e,t)}return t}function Za(e){let{derivedNames:t,...n}=Xa(e);return Object.freeze({...n,derived:new Set(t)})}function Qa(e){return!1}function $a(){return{...Qt,0:``}}function eo(){return{...Xt,"":0}}var to=/* @__PURE__ */ $a(),no=/* @__PURE__ */ eo(),ro=/* @__PURE__ */ li()({direction:/* @__PURE__ */ di(/* @__PURE__ */ oi([null,`ltr`,`rtl`]),{field:`__dir`}),format:/* @__PURE__ */ di(/* @__PURE__ */ oi([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:to,setter:`setFormat`,setterTable:no}),indent:/* @__PURE__ */ di(/* @__PURE__ */ ii(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:/* @__PURE__ */ fi(/* @__PURE__ */ ii(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:/* @__PURE__ */ fi(/* @__PURE__ */ ni(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function io(e){if(B(e)&&!Qa(W())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var ao=class extends ja{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:io,extends:ja,generated:Va,json:ro})}constructor(e){super(e),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=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&E(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return Qt[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return cp(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&vp(this).length===0}isDirty(){let e=W()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of vp(this)){let n=yp(this,t);if(j(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(P(t)&&e.push(t),j(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;j(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;j(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return j(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:I(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&E(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:I(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&E(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Ep(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),j(i)&&r!==n-1&&!i.isInline()&&(e+=Kt)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of _p(e).values()){let e=I(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),j(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Xt[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Jt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Es(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Mu();let n=q(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(P(e)||j(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(P(e)||j(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return G(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):jf(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&Xt[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){ka(this)&&E(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||E(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&E(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return tp(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(np(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,ip(t);let n=e.__key;rp(i,t,d,c&&c.getWritable()),e.__key===a&&E(76),o.push(n),d=t}if(i.__size=u,s.length){let e=q();if(G(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])oo(r,t,n)&&Vf(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||B(this)||this.remove()}}return i}getDOMSlot(e){return new Er(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(B(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(P(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=Qc(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=Is(s,t))&&ul(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}_a(this,e,n)})}};function j(e){return e instanceof ao}function oo(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var so=class extends ja{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&E(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function M(e){return e instanceof so}function co(e){let t=e.getLatest().__cachedText;return t===null||!ju()&&W()._dirtyType!==0?null:t}var lo=class extends ao{__cachedText;$config(){return this.config(`root`,{extends:ao})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){E(51)}getTextContent(){let e=co(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=co(this);return e===null?super.getTextContentSize():e.length}remove(){E(52)}replace(e){E(53)}insertBefore(e){E(54)}insertAfter(e){E(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)j(e)||M(e)||E(282);return super.splice(e,t,n)}static importJSON(e){return L().updateFromJSON(e)}collapseAtStart(){return!0}};function N(e){return e instanceof lo}function uo(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function fo(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function po(e,t,n=``){if(t===n)return;let r=uo(n),i=uo(t);for(let t in i)delete r[t],fo(e,t,i[t]);for(let t in r)e.removeProperty(t)}var mo=/* @__PURE__ */ li()({detail:/* @__PURE__ */ di(/* @__PURE__ */ ui(/* @__PURE__ */ ii(),Yt),{field:`__detail`}),format:/* @__PURE__ */ di(/* @__PURE__ */ ui(/* @__PURE__ */ ii(),Jt),{field:`__format`}),mode:/* @__PURE__ */ di(/* @__PURE__ */ oi([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:en,setterTable:$t}),style:/* @__PURE__ */ di(/* @__PURE__ */ ni(),{field:`__style`}),text:/* @__PURE__ */ di(/* @__PURE__ */ ni(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function ho(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function go(e,t){return 1&t?`strong`:2&t?`em`:`span`}function _o(e,t,n,r,i){let a=r.classList,o=nc(i,`base`);o!==void 0&&a.add(...o),o=nc(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Jt){let r=Jt[e];if(o=nc(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}tc(r,`class`)}function vo(e,t,n){let r=n.isComposing(),i=e+(r?Gt:``),a=H(),o=Zc(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Nc().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Nt||Bt){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function yo(e,t,n,r,i,a){vo(i,e,t);let o=a.theme.text;o!==void 0&&_o(0,0,r,e,o)}function bo(e,t){let n=Nc().createElement(t);return n.appendChild(e),n}function xo(e){return e!=null&&!0===e.__isInlineFormattable}var So=class extends ja{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:ja,generated:Ua,importDOM:{"#text":()=>({conversion:Do,priority:0}),b:()=>({conversion:wo,priority:0}),code:()=>({conversion:Ao,priority:0}),em:()=>({conversion:Ao,priority:0}),i:()=>({conversion:Ao,priority:0}),mark:()=>({conversion:Ao,priority:0}),s:()=>({conversion:Ao,priority:0}),span:()=>({conversion:Co,priority:0}),strong:()=>({conversion:Ao,priority:0}),sub:()=>({conversion:Ao,priority:0}),sup:()=>({conversion:Ao,priority:0}),u:()=>({conversion:Ao,priority:0})},json:mo})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return en[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ms()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Jt[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Es(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=ho(0,n),i=go(0,n),a=r===null?i:r,o=Nc().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Nc().createElement(i),o.appendChild(s)),yo(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&po(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=ho(0,i),s=ho(0,a),c=go(0,i),l=go(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??E(48);let i=Nc().createElement(l);return yo(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??E(49)),vo(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&_o(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(po(t.style,p,f),tc(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return V(t)||E(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=bo(t,`b`)),this.hasFormat(`italic`)&&(t=bo(t,`i`)),this.hasFormat(`strikethrough`)&&(t=bo(t,`s`)),this.hasFormat(`underline`)&&(t=bo(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Jt[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Yt[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Es(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=$t[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Mu();let n=e,r=t,i=q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!G(i))return jf(o,n,o,r,`text`,`text`);{let e=Ms();e!==i.anchor.key&&e!==i.focus.key||js(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=q();if(r&&G(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Mu();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Ms(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=q();if(G(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=jo(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ki(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=jo(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ki(t,n);let a=n.__key;i===r&&js(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&As(t),n!==null&&As(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),G(v)&&Bf(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||E(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Ms()===r&&js(n);let o=q();if(G(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Hf(i,t,n,e,a),s!==null&&s.key===r&&Hf(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Co(e){return{forChild:Mo(e.style),node:null}}function wo(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Mo(t.style,n?void 0:`bold`),node:null}}var To=/* @__PURE__ */ new WeakMap;function Eo(e){if(!V(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Do(e){let t=e;e.parentElement===null&&E(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=To.get(n))===void 0&&!Eo(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)To.set(r[e],i);return i}(t)!==null)return{node:Jf(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Oo(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Oo(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:jo(n)}}function Oo(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,V(n)){let e=n.style.display;if(e===``&&!qc(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Cs(n))return n;if(n.nodeName===`BR`)return null}}var ko={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Ao(e){let t=ko[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Mo(e.style,t),node:null}}function jo(e=``){return xc(new So(e))}function P(e){return e instanceof So}function Mo(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((P(e)||xo(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function No(e,t){let{type:n,key:r,offset:i}=e,a=Cc(e.key);return n===`text`?(P(a)||E(266,a.getType(),r),Wp(a,t,i)):(j(a)||E(267,a.getType(),r),Ko(a,e.offset,t))}function Po(e,t){let{origin:n,direction:r}=t,i=r===`next`;Rp(t)?e.set(n.getKey(),t.offset,`text`):zp(t)?P(n)?e.set(n.getKey(),Gp(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(Bp(t)&&j(n)||E(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Fo(e){let t=q(),n=G(t)?t:Mf();return Io(n,e),R(n),n}function Io(e,t){Po(e.anchor,t.anchor),Po(e.focus,t.focus)}function Lo(e){let{anchor:t,focus:n}=e,r=No(t,`next`),i=No(n,`next`),a=im(r,i)<=0?`next`:`previous`;return nm($p(r,a),$p(i,a))}function Ro(e){let{direction:t,origin:n}=e,r=J(n,Pp(t)).getNodeAtCaret();return r?J(r,t):qp(n.getParentOrThrow(),t)}function zo(e,t=`root`){let n=[e];for(let r=Bp(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Ro(r));return n}function Bo(e){return!!e&&e.origin.isAttached()}function Vo(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Go(e,r),o=a.anchor.origin;for(;o!==null&&!B(o);)o=o.getParent();let s=j(o)?o.getFirstChild():null,c=zo(a.anchor,n),l=zo(a.focus.getFlipped(),n),u=/* @__PURE__ */ new Set,d=[];for(let e of a.iterNodeCarets(n))if(Bp(e))u.add(e.origin.getKey());else if(zp(e)){let{origin:t}=e;j(t)&&!u.has(t.getKey())||d.push(t)}let f=/* @__PURE__ */ new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),ks(e)}for(let e of f)!e.canBeEmpty()&&!B(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Ro(J(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=jo(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Wp(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=Ho(c),m=Ho(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&um(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(B(i))return;t&&!n.has(i.__key)||!Xc(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&vp(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;qp(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(Bp(e)){let t=e.origin;if(Xc(t))return t}else{let t=e.getParentAtCaret();if(t&&Xc(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(yc);if(e&&t&&!N(t)&&e.isEmpty()&&u.has(e.getKey())&&vp(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!N(n)&&n.isEmpty();){let e=n.getParent();if(e&&N(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}Vs(o,s)!==null||o===null||o.isAttached()||Vs(L(),null);let g=Ho([p,m,...c,...l]);if(g)return tm($p(g,e.direction));E(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Ho(e){let t=e.find(Bo);return t&&Uo(t)}function Uo(e){let t=function(e){let t=e;for(;Bp(t);){let e=Yp(t);if(!Bp(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(P(t.origin))return Rp(t)?t:Wp(t.origin,n,n);let r=t.getAdjacentCaret();return zp(r)&&P(r.origin)?Wp(r.origin,n,Pp(n)):t}function Wo(e){return Rp(e)&&e.offset!==Gp(e.origin,e.direction)}function Go(e,t){return e.direction===t?e:nm($p(e.focus,t),$p(e.anchor,t))}function Ko(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?qp(e,n):J(a,n)}function qo(e,t=`root`){let n=0,r=e,i=Yp(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=Yp(r)}return i&&[i,n]}function Jo(e){let{origin:t,offset:n,direction:r}=e;if(n===Gp(t,r))return e.getSiblingCaret();if(n===Gp(t,Pp(r)))return Ro(e.getSiblingCaret());let[i]=t.splitText(n);return P(i)||E(281),$p(J(i,`next`),r)}function Yo(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Xo(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&zf(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==q()&&Bf(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Zo(e,t){return!0}function Qo(e,{$copyElementNode:t=bc,$splitTextPointCaretNext:n=Jo,rootMode:r=`shadowRoot`,$shouldSplit:i=Zo,removeEmptyDestination:a=!1}={}){if(Rp(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(Bp(e)){let e=Ro(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=cp((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function $o(e,t,n){let r=$p(t,`next`);Rp(r)&&(r.offset===0?r=J(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=J(r.origin,`next`))),r.origin.is(e)&&(zp(r)||E(342,e.getKey(),e.getType()),r=Ro(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Qo(e,n))r=e;return Rp(r)&&E(283),r.insert(e.isInline()?F().append(e):e),$p(J(e.getLatest(),`next`),t.direction)}function es(e,t){let n=Go(G(t)?Lo(t):t,`next`),r=hp(n.anchor.origin),i=hp(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Uo(qp(e,`next`)),o=$p(Uo(qp(e,`previous`)),`next`);return im(n.anchor,a)<=0&&im(n.focus,o)>=0}var ts=class extends ao{$config(){return this.config(`paragraph`,{children:`inline`,extends:ao,generated:Wa,importDOM:{p:()=>({conversion:ns,priority:0})}})}createDOM(e){let t=Nc().createElement(`p`),n=nc(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(P),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!G(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(es(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=F();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>P(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function ns(e){let t=F();if(cl(t,e),ol(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Xt&&t.setFormat(n)}return sl(t,e),{node:t}}function F(){return xc(new ts)}function rs(e){return e instanceof ts}var is=/* @__PURE__ */ li()({detail:/* @__PURE__ */ fi(/* @__PURE__ */ ii(2),{getter:{field:`__detail`},setter:null}),mode:/* @__PURE__ */ fi(/* @__PURE__ */ oi([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:/* @__PURE__ */ fi(/* @__PURE__ */ ni(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),as=class extends So{$config(){return this.config(`tab`,{extends:So,generated:Ka,json:is})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=nc(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||E(286),this}setDetail(e){return e!==2&&E(127),this}setMode(e){return e!==`normal`&&E(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function os(){return xc(new as)}function ss(e){return e instanceof as}var cs=null;function ls(e){cs=e}var us=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),ds=1;function fs(e,t){let n=ps(e,t);return n===void 0&&E(30,t),n}function ps(e,t){return e._nodes.get(t)}var ms=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function hs(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return ws(t)||Oc(t)?Vc(t):null})():t;if(!V(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Ls(n),i=n.nodeName;return Ma(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&bs(n)==null)}function gs(e){let t=e===null?null:Hc(e);return Wc(t)&&hs(t)}function _s(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return ys(t)===e&&e.read(`latest`,()=>!hs(t))}function vs(e){return e instanceof yu}function ys(e){let t=e;for(;t!=null;){let e=bs(t);if(vs(e))return e;t=cc(t)}return null}function bs(e){return e?e.__lexicalEditor:null}function xs(e){return ss(e)||e.isToken()}function Ss(e){return xs(e)||e.isSegmented()}function Cs(e){return Wc(e)&&e.nodeType===3}function ws(e){return Wc(e)&&e.nodeType===9}function Ts(e){let t=e;for(;t!=null;){if(Cs(t))return t;t=t.firstChild}return null}function Es(e,t,n){let r=Jt[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Jt.superscript:t===`superscript`?i&=~Jt.subscript:t===`lowercase`?(i&=~Jt.uppercase,i&=~Jt.capitalize):t===`uppercase`?(i&=~Jt.lowercase,i&=~Jt.capitalize):t===`capitalize`&&(i&=~Jt.lowercase,i&=~Jt.uppercase),i}function Ds(e){return P(e)||cu(e)||M(e)}function Os(e,t){let n=function(){let e=cs;return cs=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Mu(),Nu();let r=W(),i=Pu(),a=``+ds++;i._nodeMap.set(a,e),j(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function ks(e){ip(e.getParent()===null?e:e.getWritable())}function As(e){Nu(),ka(e)&&E(323,e.__key,e.__type);let t=e.__parent===null?dp(e)?e.__slotHost:null:e.__parent,n=Pu(),r=W(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?dp(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),j(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function js(e){Mu();let t=W(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=I(n);e!==null&&e.getWritable()}if(e!==null){let t=I(e);t!==null&&t.getWritable()}}}function Ms(){return ju()?null:W()._compositionKey}function Ns(e){return!Lt&&(zt||Ht)&&e.__text===``&&e.__key===W()._compositionKey}function I(e,t){let n=(t||Pu())._nodeMap.get(e);return n===void 0?null:n}function Ps(e,t){let n=Is(e,W());return n===void 0?null:I(n,t)}function Fs(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Is(e,t){return e[`__lexicalKey_${t._key}`]}function Ls(e,t){let n=e;for(;n!=null;){let e=Ps(n,t);if(e!==null)return e;n=cc(n)}return null}function Rs(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function zs(e){return e.read(()=>L().getTextContent())}function Bs(e,t){let n=rl(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=I(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function L(){return Pu()._nodeMap.get(`root`)}function Vs(e,t){if(!(B(e)&&e.isAttached()&&(N(e)?e.getChildrenSize()===0:e.isEmpty())&&(N(e)||t!==null&&Xc(t))))return null;let n=F();return e.append(n),n}function R(e){Mu();let t=Pu();e!==null&&(e.dirty=!0,e.setCachedNodes(null),G(e)&&W()._slotsUsed&&Df(e)),t._selection=e}function Hs(e){Mu(),Ir(W(),e)}function Us(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Is(n,t);if(e!==void 0)return e;n=cc(n)}return null}(e,W());return t===null?null:I(t)}function Ws(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Gs(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Ks=0;function qs(){return Dt?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Ks).toString(36)}`}function Js(e){return Cs(e)?e.nodeValue:null}function Ys(e,t,n){let r=Ec(gc(t));if(r===null)return;let i=Ic(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=Js(a),r=Ls(a);if(t!==null&&P(r)){if((t===Gt||t===qt)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Xs(r,t,o,s,e)}}}function Xs(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Lt&&(zt||Ht);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Gt)||s&&t===a.getTextContent()||(c=t.slice(0,-Gt.length)),i&&!s)){let e=qt,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=q();if(c===``){if(o&&!i&&s)return void Zs(a,``,t);if(js(null),zt||Lt||Ht)a.remove();else{let e=W();Zs(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=Rf(),d=a.getTextContentSize(),f=Ms(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||G(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!G(t)||n===null||r===null)return void Zs(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=jo(a.getTextContent());a.replace(e),a=e}Zs(a,c,t)}}}function Zs(e,t,n){if(e.setTextContent(t),G(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Gp(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Qs(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(N(e))return t;t=e}return null}function $s(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(Ia(e),!N(t))return e;let u=Qs(n.getNode());return j(u)&&u.isShadowRoot()&&u.is(Qs(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function ec(e){let t=L();if(G(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(N(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),$s(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(j(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),$s(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),$s(e,a),e)}{let e=t.select(0,t.getChildrenSize());return R($s(e,t)),e}}function tc(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function nc(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=mm(i);return n[t]=e,e}return i}function rc(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&E(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=/* @__PURE__ */ new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function ic(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function ac(e,t){let n=e.offset;if(e.type===`element`)return ic(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?ic(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function oc(e){let t=gc(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function z(e,t,...n){return Ju(e,t,n[0],e)}function sc(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&E(75,t),n}function cc(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Oc(n)?n.host:null}function lc(e){return ws(e)?e:V(e)?e.ownerDocument:null}function uc(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function dc(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+uc(o.scrollPaddingLeft,i)*l,p=d+(i-uc(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function fc(e){Mu(),W()._updateTags.add(e)}function pc(e){Mu(),W()._deferred.push(e)}function mc(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function hc(e){let t=lc(e);return t?t.defaultView:null}function gc(e){let t=e._window;return t===null&&E(78),t}function _c(e){return j(e)&&e.isInline()||M(e)&&e.isInline()}function vc(e){let t=e.getLatest();for(;t!==null;){if(fp(t)!==null&&j(t))return t;let e=t.getParentOrThrow();if(B(e))return e;t=e}return t}function yc(e){return j(e)&&e.isShadowRoot()}function B(e){return N(e)||yc(e)}function bc(e,t=!1){let n=e.constructor.clone(e,us);return Os(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function xc(e){let t=W(),n=e.getType(),r=ps(t,n);r===void 0&&E(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||E(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||E(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&E(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Sc(e,t){!N(e.getParent())||j(t)||M(t)||E(99)}function Cc(e){let t=I(e);return t===null&&E(63,e),t}function wc(e){if(!e||e.isInline())return!1;if(M(e))return!0;if(j(e)){if(e.isShadowRoot()){let t=e.getParent();return!(j(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Tc(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Ec(e){return Dt?(e||window).getSelection():null}function Dc(e){let t=hc(e);return t?t.getSelection():null}function Oc(e){return Gc(e)&&`host`in e}var kc=[];function Ac(e){let t=e.getRootNode();if(t===e||!Oc(t))return kc;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Oc(e))break;n.push(e),r=e.host}return n}function*jc(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(ws(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Mc(e){return e===null?document:e.ownerDocument}function Nc(){let e=Ru();return Mc(e===null?null:e._rootElement)}function Pc(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=Ac(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Fc(e,t){let n=Pc(e,t);if(n!==null){let e=Lc(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Ic(e,t){let n=Pc(e,t);return n===null?e:Rc(n,zc(e))}function Lc(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Rc(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function zc(e){return e.direction}function Bc(e){let t=e.getRootNode();return ws(t)||Oc(t)?t.activeElement:null}function Vc(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Hc(e){let t=e.target;if(t!==null&&V(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function Uc(e){return V(e)&&e.tagName===`A`}function V(e){return Wc(e)&&e.nodeType===1}function Wc(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Gc(e){return Wc(e)&&e.nodeType===11}var Kc=/^(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;function qc(e){return!(!V(e)||!e.style.display.startsWith(`inline`))||Kc.test(e.nodeName)}var Jc=/^(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;function Yc(e){return(!V(e)||!e.style.display.startsWith(`inline`))&&Jc.test(e.nodeName)}function Xc(e){if(M(e)&&!e.isInline())return!0;if(!j(e)||B(e))return!1;let t=e.getFirstChild(),n=t===null||cu(t)||P(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function H(){return W()}function Zc(e=H()){return e._config.dom||hu}function Qc(e,t,n=H()){let r=Zc(n).$getDOMSlot(e,t,n);return j(e)&&($c(r)||E(344,e.getKey(),e.getType())),r}function $c(e){return e instanceof Er}function el(e,t,n=H()){return Ts(Qc(e,t,n).element)}var tl=/* @__PURE__ */ new WeakMap,nl=/* @__PURE__ */ new Map;function rl(e){if(!e._readOnly&&e.isEmpty())return nl;e._readOnly||E(192);let t=tl.get(e);return t||(t=function(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=/* @__PURE__ */ new Map,t.set(e,i)),i.set(n,r)}return t}(e),tl.set(e,t)),t}function il(e){let t=e.constructor.clone(e,us);return t.afterCloneFrom(e),t}function al(e){return(t=il(e))[Oa]=!0,t;var t}function ol(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function sl(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function cl(e,t){let n=t.style.textAlign;return n&&n in Xt?e.setFormat(n):e}function ll(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function ul(e){return!0===e.__lexicalUnmanaged}function dl(e,t=H()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function fl(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(V(n)&&n.hasAttribute(`data-lexical-slot`)||Is(n,t)!==void 0)return!1;n=cc(n)}return!1}function pl(e,t){return ti(e,t)&&e[t]!==ja[t]}var ml=/* @__PURE__ */ new WeakMap;function hl(e){let t=ml.get(e);return t===void 0?function(e){let t=e.prototype!=null&&nn in e.prototype?e.prototype[nn]():void 0,n=function(e){if(!(e===ja||e.prototype instanceof ja)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{yu.version&&(n=JSON.parse(yu.version))}catch{}E(290,e.name,t,n)}return e===so||e===ao||e===ja}(e),r=!n&&pl(e,`getType`)?e.getType:void 0,i=r&&!(_l in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:ti(e.prototype,nn),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};ml.set(e,s);try{let t=function(e){let t=e.prototype,n=/* @__PURE__ */ new Map,{fieldsBaseFirst:r}=wl(e);for(let[i,a]of r){let r=Ol(e,i,a);if(r===null)continue;if(Br(r)){let t=r.field;if(t===`__proto__`&&E(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])ti(t,String(r))||E(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&E(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?vl:[...n.values()]}(e),r=function(e){let t=e.prototype,n=/* @__PURE__ */ new Map;for(let[r,i]of wl(e).fieldsDerivedFirst){let a=Dl(e,r,i);if(a===null)continue;if(Br(a)){let o=a.field;o===`__proto__`&&E(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&E(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&E(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?El:[...n.values()]}(e),i=wl(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Hl(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,gl(hl(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:jl(r),setters:t},function(e,t,n,r){if(!t&&n){if(!pl(e,`getType`)){let t=e,r=function(){return this===t?n:ja.getType.call(this)};r[_l]=!0,e.getType=r}if(pl(e,`clone`)||(e.clone=(t,n)=>{ls(t);let r=new e;return n!==us&&r.afterCloneFrom(t),r}),pl(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Ul(e);return n.updateFromJSON===ja.prototype.updateFromJSON?function(e,t){return Nl(e.__state||t.$!==void 0?wi(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!pl(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;ti(t,`getTextContent`)&&!ti(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=ja.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Hl(e)){let e=t.prototype;if(ti(e,`afterCloneFrom`))continue;let r=Vl(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?gl(hl(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[zl]=!0}}(e),function(e,t){t&&t.inline!==void 0&&ti(e.prototype,nn)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?Fl:Il,writable:!0})}(e,a)}catch(t){throw ml.delete(e),t}return s}(e):t}function gl(e){let{compiled:t}=e;return t===void 0&&E(422,e.config.klass.name),t}var _l=Symbol(`lexical.synthesizedGetType`),vl=[];function yl(e,t,n,r){let i=n.method===void 0?r:n.method,a=wl(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return bl(o,s,i)&&bl(o,s,r)?n:i}function bl(e,t,n){return e[n]===t[n]}function xl(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Sl(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var Cl={declaredBy:/* @__PURE__ */ new Map,fields:/* @__PURE__ */ new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function wl(e){let t=hl(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Hl(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=/* @__PURE__ */ new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Cl:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function Tl(e){let{fieldsDerivedFirst:t,flatStates:n}=wl(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var El=[];function Dl(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?Sl(t):r;return Br(i)?yl(e,t,i,Sl(t)):i}function Ol(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?xl(t):r;return Br(i)?yl(e,t,i,xl(t)):i}function kl(e){return e}function Al(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function jl(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&Al(i,r)}}function Ml(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function Nl(e,t){let{flatStates:n,generated:r,setters:i}=gl(hl(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=vi(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?kl(e)[i.field]=i.setterTable===void 0?a:ti(i.setterTable,a)?i.setterTable[a]:Ml(i):i.setter.call(e,a)}return e}(a,t,i)}function Pl(e){return hl(e).config}function Fl(){return!0}function Il(){return!1}function Ll(e){return e===Fl||e===Il}function Rl(e){let t=[];for(let n of[e.getter,e.setter])Br(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var zl=`__lexicalSynthesizedAfterCloneFrom`;function Bl(e){let{declaredBy:t,fieldsBaseFirst:n}=wl(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of Rl(a))r.includes(e)||r.push(e);return r}function Vl(e){let t=Bl(e);if(t.length===0)return t;let n=/* @__PURE__ */ new Set;for(let{klass:t}of Hl(e))if(t!==e)for(let e of Bl(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Hl(e){for(let t=e;t&&(t===ja||Ma(t.prototype));){let e=Pl(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Gl(t)}}function Ul(e){let t=H();Mu();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:xc(r)}var U=(e,t)=>{let n=e;for(;n!=null&&!N(n);){if(t(n))return n;n=n.getParent()}return null};function Wl(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?I(r):t.get(r);e??E(174),n.push(r),r=e.__next}return n}function Gl(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function Kl(e){return new Xl(pr(e._nodeMap),null,e._slotsUsed)}function ql(){return new Xl(/* @__PURE__ */ new Map([[`root`,new lo]]),null,!1)}function Jl(e){let t=e.constructor,n=vr(e);if(j(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(Jl(r[e]))}let r=vp(e);if(r.length>0){let i={};for(let n of r){let r=yp(e,n);r===null&&E(366,t.name,n),i[n]=Jl(r)}n.$slots=i}return n}function Yl(e){return e instanceof Xl}var Xl=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Wu(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return gr(typeof e==`boolean`&&e,()=>Wu(null,this,()=>({root:Jl(L())})))}},Zl=`historic`,Ql=`history-push`,$l=`history-merge`,eu=`collaboration`,tu=`skip-dom-selection`,nu=`skip-selection-focus`,ru=`composition-end`,iu=class extends ao{$config(){return this.config(`artificial`,{extends:ao})}createDOM(e){return Nc().createElement(`div`)}},au=class extends ja{$config(){return this.config(`linebreak`,{extends:ja,generated:Ga,importDOM:{br:e=>lu(e)||uu(e)?null:{conversion:ou,priority:0}}})}getTextContent(){return`
|
|
4
|
+
`}createDOM(){return Nc().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function ou(e){return{node:su()}}function su(){return xc(new au)}function cu(e){return e instanceof au}function lu(e){let t=e.parentElement;if(t!==null&&Yc(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&du(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&du(n))return!0}}return!1}function uu(e){let t=e.parentElement;if(t!==null&&Yc(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&du(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&du(r))return!0}return!1}function du(e){return Cs(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function fu(e){console.warn(e)}function pu(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ql(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements.clear(),e._normalizedNodes=/* @__PURE__ */ new Set,i&&i.preserveUpdateQueue||(e._updateTags=/* @__PURE__ */ new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&vd(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Fs(n,e,`root`))}function mu(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;for(let{klass:r,ownNodeConfig:i}of Hl(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var hu={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=ps(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>j(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>j(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function gu(e){let t=e||{},n=Ru(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=ql(),s=t.namespace||(i===null?qs():i._config.namespace),c=t.editorState,l=[lo,So,au,as,ts,iu,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=/* @__PURE__ */ new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===ja||n.prototype instanceof ja)){let r=`<unknown>`;try{r=JSON.parse(ur)}catch{}E(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Pl(n);let a=n.getType(),o=mu(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:bi(l[e]),transforms:o})}}let h=new yu(o,i,m,{disableEvents:a,dom:{...hu,...e&&e.dom},namespace:s,theme:r},u||console.error,d||fu,function(e,t){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(cn,Od,0),e.registerCommand(ln,Ad,0),e.registerCommand(un,Md,0),e.registerCommand(dn,Nd,0),e.registerCommand(wn,Wd,0)}(h),h}function _u(e,t){let n=e.get(t);e.delete(t),n&&n()}function vu(e,t,n){return e.set(t,n),_u.bind(null,e,t)}var yu=class{static version=ur;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new mr,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:/* @__PURE__ */ new Map,editable:/* @__PURE__ */ new Map,mutation:/* @__PURE__ */ new Map,root:/* @__PURE__ */ new Map,textcontent:/* @__PURE__ */ new Map,update:/* @__PURE__ */ new Map},this._commands=/* @__PURE__ */ new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=/* @__PURE__ */ new Map,this._dirtyLeaves=/* @__PURE__ */ new Set,this._dirtyElements=/* @__PURE__ */ new Map,this._normalizedNodes=/* @__PURE__ */ new Set,this._updateTags=/* @__PURE__ */ new Set,this._observer=null,this._key=qs(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return vu(this._listeners.update,e)}registerEditableListener(e){return vu(this._listeners.editable,e)}registerDecoratorListener(e){return vu(this._listeners.decorator,e)}registerTextContentListener(e){return vu(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return ed(vu(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&E(35);let r=this._commands;r.has(e)||r.set(e,[new dr,new dr,new dr,new dr,new dr]);let i=r.get(e);i===void 0&&E(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=/* @__PURE__ */ new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&E(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=rl(n).get(t.getType());if(!r)return;let i=/* @__PURE__ */ new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:/* @__PURE__ */ new Set,prevEditorState:n,updateTags:/* @__PURE__ */ new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return Bs(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return z(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=nc(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,pu(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=id.get(e);if(t===void 0)return void Zd();let n=ad.get(t);if(n===void 0)return void Zd();id.delete(e);let r=bs(e);vs(r)?(function(e){if(e._parentEditor!==null){let t=Gs(e),n=t[t.length-1]._key;qd.get(n)===e&&qd.delete(n)}else qd.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&E(198);let i=Gd(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=hc(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Lr(this),this._updateTags.add($l),Gu(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;id.set(e,n);let r=ad.get(n);r===void 0&&(r={editors:/* @__PURE__ */ new Set,hasShadowEditor:void 0},ad.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Gd(e);i.push(od.register(n));let a={blur:$n,click:pd,compositionend:Id,compositionstart:jd,copy:Gn,cut:Kn,dragend:Wn,dragover:Un,dragstart:Hn,drop:Bn,focus:Qn,input:kd,keydown:Ld,paste:gn,pointerdown:yd,...Ft&&{beforeinput:Dd},...Lt&&{keyup:Rd,mousedown:gd}};for(let[n,r]of Object.entries(a))i.push(td(e,n,i=>{Xd(i)||(Yd(i),n===`blur`&&(vd(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):z(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,$u(t,()=>{let o=Ec(gc(t));if(a.type!==`mousedown`){let r=c&&o&&G(q())&&If(Rf(),o,t,new Event(`selectionchange`));return r&&R(r),xd(t,n,c&&o?Ic(o,e).focusNode:null)}let l=Pf(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Kd(t,o,new Event(`selectionchange`),r),xd(t,a,Ic(o,e).focusNode);let n=q();G(n)&&n.isCollapsed()&&!n.is(Rf())&&fd(t,n)}})};i.push(nd(n,{pointercancel:c,pointermove:c,pointerup:c},!0),td(gc(t),`blur`,s),t.registerEditableListener(s),nd(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||fl(Hc(e),t)?null:e}}),td(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Lt&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return ed(td(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),td(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=md&&Math.abs(r.clientY-n.y)<=md&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(_d(e,t,n)||(Vc(n.ownerDocument)===n&&n.blur(),vd(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add($l),Gu(this);Ku(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=Kl(e),r._selection=e._selection?e._selection.clone():null),Ir(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Gu(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,$u(this,()=>{if(a&&this._updateTags.add(a),n&&(Tt(38),L().append(F())),e._parsed)for(let[e,t]of r._nodeMap.entries())j(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=ql(),i=xu,a=Cu,o=Su,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=/* @__PURE__ */ new Map,t._dirtyLeaves=/* @__PURE__ */ new Set,t._cloneNotNeeded=/* @__PURE__ */ new Map,t._dirtyType=0,xu=r,Cu=!1,Su=t,ls(null);try{let i=t._nodes;Uu(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,xu=i,Cu=a,Su=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(Ou.has(this)||Gu(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Qu(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),$u(this,()=>{let r=q(),i=L();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||R(r.clone()),fc(`focus`),pc(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Ec(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ku(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Iu()))}toJSON(){return{editorState:this._editorState.toJSON(_r())}}};function bu(e,t,n,r,i,a){if(j(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=j(e);e.__parent!==t||s&&a.has(o)||((s||up(e)&&e.__slots!==null)&&bu(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of up(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&dp(e)&&e.__slotHost===t&&((j(e)||up(e)&&e.__slots!==null)&&bu(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var xu=null,Su=null,Cu=!1,wu=!1,Tu=!1,Eu=/* @__PURE__ */ new Set,Du=/* @__PURE__ */ new Set,Ou=/* @__PURE__ */ new Set,ku=0,Au={characterData:!0,childList:!0,subtree:!0};function ju(){return Cu||xu!==null&&xu._readOnly}function Mu(){Cu&&E(13)}function Nu(){ku>99&&E(14)}function Pu(){return xu===null&&E(195,Lu()),xu}function Fu(e){Pu()!==null&&Su===null&&(Su=e),Su!==e&&Tt(378)}function W(){return Su===null&&E(337,Lu()),Su}function Iu(){W()._dirtyType=2}function Lu(){let e=0,t=/* @__PURE__ */ new Set,n=yu.version;if(typeof window<`u`)for(let r of jc(document)){let i=bs(r);if(vs(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Ru(){return Su}function zu(e,t,n){let r=t.__type,i=fs(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Bu(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Vu(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Hu(e){return Uu(e,W()._nodes)}function Uu(e,t){let n=e.type,r=t.get(n);r===void 0&&E(17,n);let i=r.klass;e.type!==i.getType()&&E(18,i.name);let a=i.importJSON(e),o=e.children;if(j(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Uu(o[e],t);a.append(n)}let s=e.$slots;if(s){up(a)||E(379,i.name);for(let e in s)Op(a,e,Uu(s[e],t))}return a}function Wu(e,t,n){let r=xu,i=Cu,a=Su;xu=t,Cu=!0,Su=e;try{return n()}finally{xu=r,Cu=i,Su=a}}function Gu(e,t){e._pendingEditorState!==null&&Su!==e&&Ir(e,!1,!0);let n=Tu;Tu=!0;try{let n=function(e){if(Du.has(e))return!1;Du.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!qu(e,n))return!1;let i=(n===null||G(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;Qu(e,()=>e.dispatchCommand(an),void 0,!0)}return!1}finally{Du.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Yu(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=xu,u=Cu,d=Su,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Su=e,xu=n,Cu=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=wa(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),wu)throw t;pu(e,null,r,n),Lr(e),e._dirtyType=2,wu=!0,Gu(e,a),wu=!1;return}finally{p.observe(r,Au),e._updating=f,xu=l,Cu=u,Su=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements=/* @__PURE__ */ new Map,e._normalizedNodes=/* @__PURE__ */ new Set),e._updateTags=/* @__PURE__ */ new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Rs(e)),delete r[a])}(e,n);let b=i?null:Ec(gc(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Su=e,xu=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Tc(t,e,r),Gf(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(G(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Bc(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())wc(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&wc(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=Qc(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Nc().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=mm(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Tc(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Au),Su=d,xu=l}}let x=Ou.has(e);Ou.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,Ku(`decorator`,e,!0,r)),function(e,t,n){let r=zs(t),i=zs(n);r!==i&&Ku(`textcontent`,e,!0,i)}(e,t||a,n),Ku(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||Ou.delete(e)}f||Yu(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){Eu.has(e)||(Eu.add(e),setTimeout(()=>{Eu.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(wt(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Qu(e,t,r)}}(e)})(e,t),n&&e._onWarn(wt(436))}finally{Tu=n}}function Ku(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function qu(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Ju(e,t,n,r){let i=Gs(e),a;if(!Tu)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===an){if(Su!==e||Cu){let i=!1;return $u(e,()=>{i=Ju(e,t,n,r)}),i}let i=Pu()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if($u(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Ju(a,t,n,r)}),!1}function Yu(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Xu(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&E(191),a._flushSync=!0),o&&e._deferred.push(o),Vu(e,i.tag)),a==null?Qu(e,n,i):n()}}return r}function Zu(){let e=Pu();Mu(),e._flushSync=!0}function Qu(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,Vu(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=Kl(l||c),u=!0),l._flushSync=s;let d=xu,f=Cu,p=Su,m=e._updating,h=e._lastNotifiedSelection;xu=l,Cu=!1,e._updating=!0,Su=e;let g=e._headless||e.getRootElement()===null;ls(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=Ec(gc(e));return G(n)||n==null?If(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Xu(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(G(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);P(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Fa(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Ms(),o=/* @__PURE__ */ new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=/* @__PURE__ */ new Set;for(let e of s){let r=i.get(e);P(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Fa(r),r!==void 0&&Bu(r,a)&&zu(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){ku++;continue}}t._dirtyLeaves=/* @__PURE__ */ new Set,t._dirtyElements=/* @__PURE__ */ new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Bu(c,a)&&zu(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,ku++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Xu(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(j(t)&&bu(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(up(t)&&t.__slots!==null&&bu(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=W(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(G(i)){e._slotsUsed&&Df(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||E(19)}else K(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=/* @__PURE__ */ new Set,e._dirtyElements.clear(),Gu(e);return}finally{xu=d,Cu=f,Su=p,e._updating=m,ku=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Gu(e)):u&&ms(()=>{Gu(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function $u(e,t,n){Su===e&&n===void 0?ju()?Qu(e,t,n):t():Qu(e,t,n)}function ed(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function td(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function nd(e,t,n){return ed(...Object.entries(t).map(([t,r])=>td(e,t,r,n)))}var rd=30,id=/* @__PURE__ */ new WeakMap,ad=/* @__PURE__ */ new WeakMap,od=/* @__PURE__ */ cr(e=>(e.addEventListener(`selectionchange`,Jd),()=>e.removeEventListener(`selectionchange`,Jd)));function sd(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=W(),u;if(a!==void 0)u=a;else{let e=Ec(gc(l));u=e===null?null:Ic(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!P(c)||(!i&&(!Ft||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||Ws(n))&&o.offset!==s.offset&&!c.isComposing()||Ss(c)||c.isDirty()&&m>1||(i||!Ft)&&p!==null&&!c.isComposing()&&d!==el(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=xs(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(P(t)||j(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function cd(e,t){return Cs(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function ld(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Ic(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,cd(r,i)&&cd(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}$u(t,()=>{if(!n)return void R(null);if(!_s(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||xd(t,c,a);let l=bd.has(c),u=q();if(s.postDeleteSelectionToRestore&&G(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),R(u))}if(s.postDeleteSelectionToRestore=null,G(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),fd(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=Wt,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(P(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||qu(e,t))&&e.dispatchCommand(an)})(t,u,u!==null&&(u.dirty&&!l||!G(u)))})}function ud(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function dd(e,t){ud(e,t.getFormat(),t.getStyle())}function fd(e,t){let n=t.anchor,r=n.getNode(),i=gc(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?ud(t,o,s):n.type===`text`?(P(r)||E(141),dd(t,r)):(e.isComposing()||L().getTextContent()!==``)&&(j(r)||E(259),r.isEmpty()?Lf(t,``):ud(t,t.format,``))}function pd(e,t){$u(t,()=>{let n=q(),r=Ec(gc(t)),i=Rf();if(r){if(G(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!N(t)&&L().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Lt&&t._inputState.lastPointerType!==`mouse`){let n=Ic(r,t._rootElement).anchorNode;(V(n)||Cs(n))&&R(If(i,r,t,e))}}if(Nt&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(V(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=If(i,r,t,e);s===null?r.removeAllRanges():R(s)}}z(t,sn,e)})}var md=10,hd=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function gd(e,t){let n=t.getRootElement();n!==null&&(_d(e,t,n)?(e.preventDefault(),Vc(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):vd(t,n))}function _d(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=Hc(e);if(!Wc(r))return!1;let i=!1;for(let e=r;e!==null;e=cc(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(hd))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function vd(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function yd(e,t){let n=Hc(e),r=e.pointerType;Wc(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&$u(t,()=>{fl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var bd=/* @__PURE__ */ new WeakSet;function xd(e,t,n=null){let r=q(),i=r&&r.clone();(function(e,t,n){let r=Rf(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&Ls(n);M(o)&&(i?a&&o.isInline()&&o.selectPrevious():G(r)&&R(r.clone()));let s=q(),c=s||(a?Mf():G(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!G(c)||a&&!c.isCollapsed()||!ws(u)&&!Oc(u))return;let{anchor:d,focus:f}=c;if(!i&&G(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&Ls(h),_=(e,t)=>j(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=j(g)&&!g.isInline()&&(N(g)?U(f.getNode(),Af):g);for(let e of y?qp(y,`next`):[])v.push(J(e.origin,`previous`),e);let b=gc(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!M(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle(cc(r)||r).direction===`rtl`,C=2*p>u+h!==y,ee=C?`next`:`previous`,te=t&&t.getNodeAtCaret(),ne=te&&e.getElementByKey(te.getKey()),re=ne?ne.getClientRects():[],ie=re[C?0:re.length-1];if(!t||t.direction===ee&&b.getComputedStyle(r).cssFloat===`none`&&(!te||cu(te)||ie&&(C===y?2*ie.right>u+h:2*ie.left<u+h))){if(!n.is(_(ac(f,C),ee))){let e=J(n,ee);Po(f,e),a&&Po(d,e)}s||R(c);return}}if(M(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:Oc(u)?[u]:[]}),r=n&&Sf(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=q(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&bd.add(o),t.type===`mousedown`&&G(a)&&Lf(a,G(i)?i.anchor.key:``)}function Sd(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Cd(e){let{lastKeyCode:t}=W()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
|
5
5
|
`:t===`Tab`?` `:null;if(!n)return;let r=q();if(!G(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!P(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
|
|
6
|
-
`){if(
|
|
7
|
-
`)e.preventDefault(),z(r,
|
|
8
|
-
`){let t=q();if(G(t)||K(t)){if(G(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return z(e,An,null),Pd(n),!1}}let r=I(n);if(r!==null&&P(r)&&Ss(r)){r.markDirty();let e=q(),i=r.getTextContentSize(),a=G(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return Ys(!0,e,t),Pd(n),!1}function Id(e,t){let n=t._inputState;Mt?n.compositionPhase=`ending-firefox`:(e.data===``||It||!Rt&&!Vt)&&z(t,un,e)}function Ld(e,t){let n=t._inputState;It&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&wd(n),t.isComposing()||!It&&(Rt||Vt)&&e.keyCode===229||z(t,Cn,e)}function Rd(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var zd={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},Bd={ctrlKey:!0},Vd={metaKey:!0},Hd={shiftKey:`any`},Ud={altKey:`any`,shiftKey:`any`};function Wd(e){let t=W();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=or(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{z(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),z(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!It||r.isShiftKeyDown),z(n,An,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:tr,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||G(r)||gs(e)||(e.preventDefault(),z(n,t,e))}});return[e(`ArrowRight`,Hd,wn),e(`ArrowLeft`,Hd,En),e(`ArrowUp`,Ud,On),e(`ArrowDown`,Ud,kn),n({...zd,shiftKey:!0},!0),n({...zd,shiftKey:!1},!1),e(` `,zd,jn),{key:`Backspace`,modifiers:Hd,onMatch:(e,t)=>{z(t,Mn,e)&&Td(t._inputState)}},e(`Escape`,zd,Nn),e(`Delete`,{},Pn),t(`Backspace`,nr,_n,!0),t(`Delete`,nr,_n,!1),t(`b`,tr,yn,`bold`),t(`u`,tr,yn,`underline`),t(`i`,tr,yn,`italic`),e(`Tab`,Hd,Fn),t(`z`,tr,xn,void 0),t(`z`,{...tr,shiftKey:!0},Sn,void 0),...jt?[{key:`o`,modifiers:Bd,onMatch:(e,t)=>{e.preventDefault(),z(t,fn,!0)}},e(`ArrowLeft`,{metaKey:!0,...Hd},Dn),e(`ArrowRight`,{metaKey:!0,...Hd},Tn),t(`h`,Bd,dn,!0),t(`d`,Bd,dn,!1),t(`Backspace`,Vd,vn,!0),t(`Delete`,Vd,vn,!1),t(`k`,Bd,vn,!1)]:[e(`Home`,Hd,Dn),e(`End`,Hd,Tn),t(`y`,Bd,Sn,void 0)],{key:`a`,modifiers:tr,onMatch:(e,t)=>{e.preventDefault(),z(t,Kn,e)&&Td(t._inputState)}},r(`c`,Wn),r(`x`,Gn)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand($n,e),!0}function Gd(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function Kd(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=Ic(t,e._rootElement).anchorNode;(V(i)||Cs(i))&&R(If(Rf(),t,e,n))}var qd=/* @__PURE__ */ new Map;function Jd(e){let t=e.target;if(V(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=Dc(t);if(n===null)return;let r=lc(t),i=null,a=r===null?void 0:ad.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&Oc(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=Ic(n,e).anchorNode;if(a!==null&&ys(a)===r){if(Oc(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||V(e)&&e.shadowRoot!==null||(i=ys(e))}}if(i===null){let e=Vc(r);i=e===null?null:ys(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&$u(i,()=>Kd(i,n,e,a));let o=Gs(i),s=o[o.length-1],c=s._key,l=qd.get(c),u=l||s;u!==i&&ld(n,u,!1),ld(n,i,!0),i===s?l&&qd.delete(c):qd.set(c,i)}function Yd(e){e._lexicalHandled=!0}function Xd(e){return!0===e._lexicalHandled}var Zd=/* @__PURE__ */ nn(),Qd=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:im(Uo(No(this,`next`)),Uo(No(e,`next`)))<0}getNode(){let e=I(this.key);return e===null&&D(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,ju()||(Ms()===a&&js(e),i!==null&&(i.setCachedNodes(null),G(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function $d(e,t,n){return new Qd(e,t,n)}function ef(e,t){let n=t.__key,r=e.offset,i=`element`;if(P(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!j(t)){let e=t.getNextSibling();if(P(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function tf(e,t){if(j(t)){let n=t.getLastDescendant();j(n)||P(n)?ef(e,n):ef(e,t)}else ef(e,t)}function nf(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=jo();if(o.setFormat(n),o.setStyle(r),rs(a))a.splice(0,0,[o]);else if(a!==null){let e=B(i)?F().append(o):o;a.insertBefore(e)}else if(B(i)){let e=i.getLastChild();j(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(F().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function rf(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(P(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(Ms()===null)return e.anchor.type===`element`&&nf(e.anchor,e.focus,r,i),void af(e,t,r,i)}e.anchor.type===`element`&&nf(e.anchor,e.focus,r,i);let a=e.anchor.getNode();P(a)||D(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(Ss(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(Ms()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),W()._inputState.composedSegmentedKey=a.getKey();else{let t=jo(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=q()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&q()!==e&&R(e)}(t!==``||n)&&rf(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=J(a,l).getNodeAtCaret(),d;P(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!Ss(u)?d=u:(d=jo().setFormat(r).setStyle(i),J((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),rf(e,t,n);return}let l=jo(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void af(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function af(e,t,n,r){let i=e.anchor.getNode();P(i)||D(398);let a=e.anchor.offset,o=jo(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))J(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var of=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!K(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>fp(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(P(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=I(e);t!==null&&n.push(t)}return ju()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>fp(e)===null);if((q()||Rf())===this&&e[0]){let t=J(e[0],`next`);Fo(nm(t,t))}for(let t of e)t.remove();sf()}};function sf(){let e=L();if(e.getChildrenSize()===0&&gp(q())===null){let t=F();e.append(t),t.select()}}function G(e){return e instanceof cf}var cf=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!G(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=/* @__PURE__ */ new Set,a=0;for(let n of e)if(Bp(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;j(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),zp(e.focus)&&j(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=qp(e.focus.origin,`previous`);Bp(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Yp(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!j(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Uo(e.anchor),r=Uo(e.anchor.getFlipped()),i=e=>Rp(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Go(Lo(this),`next`));return ju()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=Lo(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(j(a)&&!a.isInline()){r||(n+=`
|
|
9
|
-
`);let e=``;for(let t of vp(a)){let n=yp(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,P(a)){let e=Yo(t,a);n+=e?e.getTextContent():a.getTextContent()}else(M(a)||cu(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=W(),n=t.getEditorState()._selection,r=kf(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),Ia(this)}clone(){let t=this.anchor,n=this.focus;return new e($d(t.key,t.offset,t.type),$d(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Es(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=qt[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(Jf(e))}insertText(e){rf(this,e,!1)}removeText(){let e=q()===this,t=this.anchor.key;Io(this,Vo(Lo(this))),this.isCollapsed()&&Lf(this,t),e&&q()!==this&&R(this)}formatText(e,t=null){ff(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&j(t)&&t.isShadowRoot()&&fp(t)!==null){let n=t.getFirstChild()??t.append(F()).getFirstChild();if(n!==null&&!j(n)){let e=F();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=q();return G(t)||D(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&B(t)){let n=$f(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=U(r,Xc),a=e[e.length-1];if(j(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=Xf(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(j(e)||M(e))&&!e.isInline())){j(i)||D(211,r.constructor.name,r.getType());let[t,n]=Xf(this,!0);(j(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=$f(e),n=t.getLastDescendant(),r=No(this.anchor,`next`);for(let e of t.getChildren())r=$o(e,r);n!==null&&n.selectEnd();return}if(j(i)&&(fp(i)!==null||!i.isParentRequired()&&!B(i.getParentOrThrow()))){let[,t]=Xf(this),n=Yf(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=$f(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&j(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Xc(e)&&!B(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return cu(t)&&cu(t.getPreviousSibling())}(n),u=j(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=U(r,Xc));let d=c[c.length-1],f=c[0];var p=f;l||!j(p)||!Xc(p)||p.isEmpty()||!j(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(j(i)||D(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&D(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||D(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=U(s,Xc),h=s.selectEnd();u&&(j(m)&&(u.canMergeWhenEmpty()||Xc(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),j(i)&&i.isEmpty()&&i.remove();let g=j(i)?i.getLastChild():null;cu(g)&&m!==i&&g.remove();let _=Uo(No(h.anchor,`next`));Po(h.anchor,_),Po(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&B(e)){let t=F();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Xf(this),n=U(this.anchor.getNode(),Xc);if(n!==null&&fp(n)!==null)return null;j(n)||D(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=su();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=Lo(this).getTextSlices(),r=[];for(let t of e){let e=Yo(n,t),i=e?Xo(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&P(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(ep(this,e,t,n))return;let r=e===`move`,i=W(),a=Ec(gc(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!j(c)||c.isInline()||c.canBeEmpty()||Tc(o,i,s);let l=sc(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=P(c)?el(c,l,i):null),this.dirty){let e=sc(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=P(n)?el(n,e,i):null}t&&u&&Uf(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&P(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=J(c,t?`previous`:`next`).getNodeAtCaret();if(P(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?el(e,n,i):null;if(r){let e=t?r.length:0;Uf(a,r,e,r,e)}}}}if(hf(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=Pc(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=N(o)?o:vc(o);this.applyDOMRange(n),this.dirty=!0,r||(gf(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||mf(this))}n===`lineboundary`&&ep(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&j(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(j(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=j(n)?n.getNextSibling():null;if(!(j(n)&&n.isEmpty()&&j(e)&&e.isShadowRoot()))return}let r=No(t,e?`previous`:`next`),i=em(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(j(e)&&wc(e)){let t=e.getParent();e.remove();let n=Vs(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(Bp(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Uo(t);Io(this,nm(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(zp(t)){if(j(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(M(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=Nf();e.add(t.origin.getKey()),R(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=Vs(n,e);r!==null&&r.selectStart()}}return}if(cu(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return vp(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Io(this,nm(!t.origin.isEmpty()&&n.isEmpty()?Ro(J(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(fp(e)!==null)return;if(j(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(_f(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(j(n)){if(n.collapseAtStart(e))return!0;if(B(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void xf(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void xf(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!Ws(a=i.getTextContent().slice(c,l))&&!bf(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||pf(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&sf()}deleteLine(e){lf(this,e,`lineboundary`)}deleteWord(e){lf(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return ju()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function K(e){return e instanceof of}function lf(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=_f(e,t,n),n===`lineboundary`&&function(e){for(let t of Lo(e).iterNodeCarets(`shadowRoot`))if(zp(t)&&cu(t.origin))return void Po(e.focus,Ro(t))}(e)}n!==`lineboundary`||e.isCollapsed()||U(i.getNode(),Xc)===U(a.getNode(),Xc)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||pf(e),e.removeText())}function uf(e,t){if(K(e)){for(let n of e.getNodes())xo(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?Lo(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(P(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=Yo(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!Ss(l)?Xo(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else j(l)?l.setTextFormat(t(l.getTextFormat())):xo(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),js(null))}function df(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&uf(e,e=>{for(let[t,r]of n)e=Es(e,t,r?qt[t]:0);return e})}function ff(e,t,n=null){let r=n===null&&G(e)?Es(e.format,t,null):n;uf(e,e=>Es(e,t,r))}function pf(e){let t=L();!t.isEmpty()&&es(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function mf(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function hf(e,t,n,r,i){let a=r===`character`?Ic(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=Ic(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function gf(e,t,n){let r=e.getNodes(),i=r.filter(e=>mc(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=j(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function _f(e,t,n){if(ep(e,`extend`,t,n))return!1;let r=W(),i=Ec(gc(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!j(c)||c.isInline()||c.canBeEmpty()||Tc(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&P(t)?el(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(Uf(i,h,g,h,g),hf(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=Pc(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&Cs(v)&&ys(v)===r){let e=Us(v);if(M(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&P(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=J(u,t?`previous`:`next`).getNodeAtCaret();if(P(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&Ls(v),x=b?hp(u):null,S=b?hp(b):null;if(b&&!Ef(S,x)&&vf(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,ee,te,ne]=t?[v,y,d,f]:[d,f,v,y],re=N(u)?u:vc(u);return e.applyDOMRange({collapsed:!1,endContainer:te,endOffset:ne,startContainer:C,startOffset:ee}),e.dirty=!0,!gf(e,t,re)&&t&&mf(e),!1}function vf(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=pp(e);n!==null;){let e=hp(n);if(Ef(e,t))return e!==null||n.isAttached()?n:null;n=e&&pp(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!j(t))return t!==null&&function(e,t,n){j(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(P(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!j(i)||B(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function yf(){try{let e=/* @__PURE__ */ RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var bf=/* @__PURE__ */ yf();function xf(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Sf(e,t,n,r){let i,a=t,o=!1;if(V(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Is(e,r)!==void 0||fl(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Us(d),P(i))a=Gp(i,s?`next`:`previous`);else{let c=Us(e);if(c===null)return null;if(j(c)){let o=r.getElementByKey(c.getKey());o===null&&D(214);let l=Qc(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),j(c)||D(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(j(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=j(u)?u:u.getParentOrThrow()),a=0}P(u)?(i=u,c=null,a=Gp(u,s?`next`:`previous`)):u!==c&&s&&!f&&(j(c)||D(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=pp(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Us(e)===c){let n=Qc(c,s,r);n.element===s?t===0&&M(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(j(c))return[$d(c.__key,a,`element`),o]}}else i=Us(e);return P(i)?[$d(i.__key,Gp(i,a,`clamp`),`text`),o]:null}function Cf(e,t,n){let r=e.getNode();if(Ns(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=J(r,a).getNodeAtCaret();if(i===t||!j(o)||!o.isInline()||i&&n){if(i&&!t)P(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(j(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=J(t,a).getNodeAtCaret();P(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function wf(e){let t=I(e.key);return t===null?null:hp(t)}function Tf(e,t,n){let r=wf(e),i=wf(t);return!Ef(r,i)&&vf(t,I(e.key),r,i,`selection`,n)}function Ef(e,t){return e===null?t===null:e.is(t)}function Df(e){let t=Tf(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=/* @__PURE__ */ new Map;for(let t=null,r=e;r!==null;t=r,r=am(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=am(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return om(e,t);case`ancestor`:return e.type===`child`&&fp(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&fp(n.a)===null?1:-1;case`branch`:{let e=fp(n.a)&&n.a.getKey(),t=fp(n.b)&&n.b.getKey();if(e&&t){for(let r of _p(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(No(e.anchor,`next`),No(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function Of(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function kf(e,t,n,r,i,a){if(e===null||n===null||!_s(i,e,n))return null;let o=Sf(e,t,G(a)?a.anchor:null,i);if(o===null)return null;let s=Sf(n,r,G(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Us(e),r=Us(n);if(M(t)&&M(r))return null}let f=i._slotsUsed&&Tf(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?Of(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>Of(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Cf(e,n,r),Cf(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function Af(e){return j(e)&&!e.isInline()}function jf(e,t,n,r,i,a){let o=Pu(),s=new cf($d(e,t,i),$d(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Mf(){return new cf($d(`root`,0,`element`),$d(`root`,0,`element`),0,``)}function Nf(){return new of(/* @__PURE__ */ new Set)}function Pf(e,t){return If(null,e,t,null)}var Ff=/* @__PURE__ */ new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function If(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&Hc(c),u=c&&(c.ctrlKey||c.metaKey||Ff.has(c.key))&&Wc(l)&&ys(l)===n,d=!Dr&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(G(e)&&!d)return e.clone();{if(t===null)return null;let r=Ic(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&G(e)&&!_s(n,f,p))return e.clone()}let g=kf(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=G(e)?e:null,x=new cf(_,v,b?b.format:0,b?b.style:``);return b&&Lf(x,b.anchor.key),x.dirty=y,x}function Lf(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;P(r)?(i=r.getFormat(),a=r.getStyle()):j(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function q(){return Pu()._selection}function Rf(){return W()._editorState._selection}function zf(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function Bf(e,t,n,r=1){if(zf(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(j(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);P(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function Vf(e,t,n,r,i){let a=r||i;if(P(a)||j(a)){let t=P(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function Hf(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function Uf(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Wf(e,t,n){let r=sc(e,t.getKey());if(j(t)){let i=Qc(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Gf(e,t,n,r,i,a){let o=a.getRootNode(),s=ws(o)||Oc(o)?Vc(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&hs(s,s))return;let c=Ic(r,a),l;if(!G(t))return void(e!==null&&_s(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Wf(n,f,u.offset),[g,_]=Wf(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=P(f)?el(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):G(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=P(p)?el(p,g,n):null),x===null||S===null)return;let ee=b&&P(p)&&Ns(p)&&Cs(S)&&S.nodeValue===Wt?Wt.length:_;if(b&&(e===null||C||G(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===ee&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:ys(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(Uf(r,x,h,S,ee),Mt&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Bc(a);if(e===null||!a.contains(e)){let e=Vc(a.ownerDocument),t=e===null?null:ys(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Bc(a)){let e=G(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!V(r))return r||null;let i=Is(r,e),a=i===void 0?null:I(i);return a===null||j(a)?r:Qc(a,r,e).element}(n,x,h):(l===void 0&&(l=Fc(r,a)),l);if(e!==null){let t;if(Cs(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=V(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!Cs(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=lc(n),a=hc(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=V(r)?r:cc(r);for(;o!==null&&n.contains(o);){let t=dc(a,o,e,i);e-=t,i-=t,o=o===n?null:cc(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=gc(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=cc(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,ee)}function Kf(e){let t=q()||Rf();t===null&&(t=L().selectEnd()),t.insertNodes(e)}function qf(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
6
|
+
`){if(Lt)return;if(cu(e))e.selectEnd();else if(!e){let e=U(i,Af),t=e&&e.getNextSibling();j(t)&&t.selectStart()}}else n===` `?ss(e)&&e.selectEnd():P(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function wd(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Td(e){Mt&&!Lt&&Bt&&(wd(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>wd(e),0))}function Ed(e,t){let n=Hc(e);if(V(n)&&fl(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Vc(r.ownerDocument);return i!==null&&r.contains(i)&&(fl(i,t)||hs(r,i))}function Dd(e,t){let n=e.inputType;n===`deleteCompositionText`||Nt&&oc(t)||n!==`insertCompositionText`&&$u(t,()=>{Ed(e,t)||z(t,cn,e)},{event:e})}function Od(e){let t=e.inputType,n=Sd(e),r=W(),i=r._inputState,a=q();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(wd(i),e.preventDefault(),G(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Rf();if(!G(e))return!0;R(e.clone())}if(G(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+rd}(i,e.timeStamp)&&r.isComposing()&&t){if(js(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{$u(r,()=>{js(null)})},rd),G(a)){let e=a.anchor.getNode();e.markDirty(),P(e)||E(142),dd(a,e)}}else{if(js(null),Lt&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Vt&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!M(ac(a.anchor,!0))),!u){z(r,fn,!0);let e=q();Vt&&G(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!G(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),z(r,t===`historyUndo`?Sn:Cn)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&Ys(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!N(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&wf(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=$d(e,i,o),{anchor:r,focus:u}=a,d=!Ef(wf(r),c)||!Ef(wf(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
7
|
+
`)e.preventDefault(),z(r,pn,!1);else if(o===Kt)e.preventDefault(),z(r,mn);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&sd(a,n,o,e.timeStamp,!0)?(e.preventDefault(),z(r,hn,o),Cd(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:z(r,hn,e),Cd((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;js(null),t||z(r,hn,e),Pd(n);break}case`insertLineBreak`:js(null),i.isInsertLineBreak=!1,z(r,pn,!1);break;case`insertParagraph`:js(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,z(r,pn,!1)):z(r,mn);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:z(r,gn,e);break;case`deleteByComposition`:(function(e,t){return e!==t||j(e)||j(t)||!xs(e)||!xs(t)})(u,d)&&z(r,_n,e);break;case`deleteByDrag`:fc(nu),z(r,_n,e);break;case`deleteByCut`:z(r,_n,e);break;case`deleteContent`:z(r,fn,!1);break;case`deleteWordBackward`:z(r,vn,!0);break;case`deleteWordForward`:z(r,vn,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:z(r,yn,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:z(r,s?fn:yn,!1);break;case`formatStrikeThrough`:z(r,bn,`strikethrough`);break;case`formatBold`:z(r,bn,`bold`);break;case`formatItalic`:z(r,bn,`italic`);break;case`formatUnderline`:z(r,bn,`underline`);break;case`historyUndo`:z(r,Sn);break;case`historyRedo`:z(r,Cn)}return!0}function kd(e,t){e.stopPropagation();let n=t._inputState;wd(n),$u(t,()=>{Ed(e,t)||t.dispatchCommand(ln,e)},{event:e}),n.unprocessedBeforeInputData=null}function Ad(e){let t=W(),n=t._inputState,r=q(),i=e.data,a=Sd(e),o=!1,s=!1;if(i!=null&&G(r)){let c=Ec(gc(t)),l=c===null?null:Ic(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&P(d)&&Ss(d);if(!u&&!f&&sd(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Fd(t,i);if(n.compositionPhase=`idle`,e)return fc(ru),Hs(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;Ft&&!r.isCollapsed()&&P(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===Js(l.anchorNode)||(z(t,hn,i),s=e.inputType===`insertText`);let p=i.length;Nt&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),Vt&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,js(null))}}return o||(Ys(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Fd(t,i||void 0),fc(`composition-end`),n.compositionPhase=`idle`)),Hs(s),!0}function jd(e,t){z(t,un,e)}function Md(e){let t=W(),n=t._inputState,r=q();if(G(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(js(i.key),fc(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+rd||i.type===`element`||!r.isCollapsed()||!Vt&&(a.getFormat()!==r.format||P(a)&&a.getStyle()!==r.style)||P(a)&&(Ss(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Lt||!zt&&!Ht?z(t,hn,qt):function(e){rf(e,``,!0)}(r);let e=q();G(e)&&js(e.anchor.key)}}return!0}function Nd(e){let t=W();return t._inputState.compositionPhase=`idle`,Fd(t,e.data),fc(ru),!0}function Pd(e){let t=W()._inputState,n=t.composedSegmentedKey;if(t.composedSegmentedKey=null,e===null||e!==n)return;let r=I(e);if(!P(r)||r.getType()===`text`||Ss(r)||!r.isAttached())return;let i=q(),a=G(i)&&i.anchor.key===e?i.anchor.offset:null,o=jo(r.getTextContent());if(o.setFormat(r.getFormat()),o.setStyle(r.getStyle()),r.replace(o),a!==null){let e=Math.min(a,o.getTextContentSize());o.select(e,e)}}function Fd(e,t){let n=e._compositionKey;if(js(null),n!==null&&t!=null){if(t===``){let t=I(n),r=e.getElementByKey(n),i=r!==null&&P(t)?el(t,r,e):null;if(i!==null&&i.nodeValue!==null&&P(t)){let n=Ec(gc(e)),r=n&&Ic(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),Xs(t,i.nodeValue,a,o,!0)}return Pd(n),!1}if(t[t.length-1]===`
|
|
8
|
+
`){let t=q();if(G(t)||K(t)){if(G(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return z(e,jn,null),Pd(n),!1}}let r=I(n);if(r!==null&&P(r)&&Ss(r)){r.markDirty();let e=q(),i=r.getTextContentSize(),a=G(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return Ys(!0,e,t),Pd(n),!1}function Id(e,t){let n=t._inputState;Nt?n.compositionPhase=`ending-firefox`:(e.data===``||Lt||!zt&&!Ht)&&z(t,dn,e)}function Ld(e,t){let n=t._inputState;Lt&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&wd(n),t.isComposing()||!Lt&&(zt||Ht)&&e.keyCode===229||z(t,wn,e)}function Rd(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var zd={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},Bd={ctrlKey:!0},Vd={metaKey:!0},Hd={shiftKey:`any`},Ud={altKey:`any`,shiftKey:`any`};function Wd(e){let t=W();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=sr(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{z(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),z(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!Lt||r.isShiftKeyDown),z(n,jn,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:nr,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||G(r)||gs(e)||(e.preventDefault(),z(n,t,e))}});return[e(`ArrowRight`,Hd,Tn),e(`ArrowLeft`,Hd,Dn),e(`ArrowUp`,Ud,kn),e(`ArrowDown`,Ud,An),n({...zd,shiftKey:!0},!0),n({...zd,shiftKey:!1},!1),e(` `,zd,Mn),{key:`Backspace`,modifiers:Hd,onMatch:(e,t)=>{z(t,Nn,e)&&Td(t._inputState)}},e(`Escape`,zd,Pn),e(`Delete`,{},Fn),t(`Backspace`,rr,vn,!0),t(`Delete`,rr,vn,!1),t(`b`,nr,bn,`bold`),t(`u`,nr,bn,`underline`),t(`i`,nr,bn,`italic`),e(`Tab`,Hd,In),t(`z`,nr,Sn,void 0),t(`z`,{...nr,shiftKey:!0},Cn,void 0),...Mt?[{key:`o`,modifiers:Bd,onMatch:(e,t)=>{e.preventDefault(),z(t,pn,!0)}},e(`ArrowLeft`,{metaKey:!0,...Hd},On),e(`ArrowRight`,{metaKey:!0,...Hd},En),t(`h`,Bd,fn,!0),t(`d`,Bd,fn,!1),t(`Backspace`,Vd,yn,!0),t(`Delete`,Vd,yn,!1),t(`k`,Bd,yn,!1)]:[e(`Home`,Hd,On),e(`End`,Hd,En),t(`y`,Bd,Cn,void 0)],{key:`a`,modifiers:nr,onMatch:(e,t)=>{e.preventDefault(),z(t,qn,e)&&Td(t._inputState)}},r(`c`,Gn),r(`x`,Kn)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(er,e),!0}function Gd(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function Kd(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=Ic(t,e._rootElement).anchorNode;(V(i)||Cs(i))&&R(If(Rf(),t,e,n))}var qd=/* @__PURE__ */ new Map;function Jd(e){let t=e.target;if(V(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=Dc(t);if(n===null)return;let r=lc(t),i=null,a=r===null?void 0:ad.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&Oc(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=Ic(n,e).anchorNode;if(a!==null&&ys(a)===r){if(Oc(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||V(e)&&e.shadowRoot!==null||(i=ys(e))}}if(i===null){let e=Vc(r);i=e===null?null:ys(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&$u(i,()=>Kd(i,n,e,a));let o=Gs(i),s=o[o.length-1],c=s._key,l=qd.get(c),u=l||s;u!==i&&ld(n,u,!1),ld(n,i,!0),i===s?l&&qd.delete(c):qd.set(c,i)}function Yd(e){e._lexicalHandled=!0}function Xd(e){return!0===e._lexicalHandled}var Zd=/* @__PURE__ */ rn(),Qd=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:im(Uo(No(this,`next`)),Uo(No(e,`next`)))<0}getNode(){let e=I(this.key);return e===null&&E(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,ju()||(Ms()===a&&js(e),i!==null&&(i.setCachedNodes(null),G(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function $d(e,t,n){return new Qd(e,t,n)}function ef(e,t){let n=t.__key,r=e.offset,i=`element`;if(P(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!j(t)){let e=t.getNextSibling();if(P(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function tf(e,t){if(j(t)){let n=t.getLastDescendant();j(n)||P(n)?ef(e,n):ef(e,t)}else ef(e,t)}function nf(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=jo();if(o.setFormat(n),o.setStyle(r),rs(a))a.splice(0,0,[o]);else if(a!==null){let e=B(i)?F().append(o):o;a.insertBefore(e)}else if(B(i)){let e=i.getLastChild();j(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(F().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function rf(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(P(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(Ms()===null)return e.anchor.type===`element`&&nf(e.anchor,e.focus,r,i),void af(e,t,r,i)}e.anchor.type===`element`&&nf(e.anchor,e.focus,r,i);let a=e.anchor.getNode();P(a)||E(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(Ss(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(Ms()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),W()._inputState.composedSegmentedKey=a.getKey();else{let t=jo(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=q()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&q()!==e&&R(e)}(t!==``||n)&&rf(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=J(a,l).getNodeAtCaret(),d;P(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!Ss(u)?d=u:(d=jo().setFormat(r).setStyle(i),J((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),rf(e,t,n);return}let l=jo(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void af(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function af(e,t,n,r){let i=e.anchor.getNode();P(i)||E(398);let a=e.anchor.offset,o=jo(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))J(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var of=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!K(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>fp(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(P(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=I(e);t!==null&&n.push(t)}return ju()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>fp(e)===null);if((q()||Rf())===this&&e[0]){let t=J(e[0],`next`);Fo(nm(t,t))}for(let t of e)t.remove();sf()}};function sf(){let e=L();if(e.getChildrenSize()===0&&gp(q())===null){let t=F();e.append(t),t.select()}}function G(e){return e instanceof cf}var cf=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!G(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=/* @__PURE__ */ new Set,a=0;for(let n of e)if(Bp(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;j(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),zp(e.focus)&&j(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=qp(e.focus.origin,`previous`);Bp(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Yp(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!j(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Uo(e.anchor),r=Uo(e.anchor.getFlipped()),i=e=>Rp(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Go(Lo(this),`next`));return ju()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=Lo(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(j(a)&&!a.isInline()){r||(n+=`
|
|
9
|
+
`);let e=``;for(let t of vp(a)){let n=yp(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,P(a)){let e=Yo(t,a);n+=e?e.getTextContent():a.getTextContent()}else(M(a)||cu(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=W(),n=t.getEditorState()._selection,r=kf(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),Ia(this)}clone(){let t=this.anchor,n=this.focus;return new e($d(t.key,t.offset,t.type),$d(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Es(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Jt[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(Jf(e))}insertText(e){rf(this,e,!1)}removeText(){let e=q()===this,t=this.anchor.key;Io(this,Vo(Lo(this))),this.isCollapsed()&&Lf(this,t),e&&q()!==this&&R(this)}formatText(e,t=null){ff(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&j(t)&&t.isShadowRoot()&&fp(t)!==null){let n=t.getFirstChild()??t.append(F()).getFirstChild();if(n!==null&&!j(n)){let e=F();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=q();return G(t)||E(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&B(t)){let n=$f(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=U(r,Xc),a=e[e.length-1];if(j(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=Xf(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(j(e)||M(e))&&!e.isInline())){j(i)||E(211,r.constructor.name,r.getType());let[t,n]=Xf(this,!0);(j(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=$f(e),n=t.getLastDescendant(),r=No(this.anchor,`next`);for(let e of t.getChildren())r=$o(e,r);n!==null&&n.selectEnd();return}if(j(i)&&(fp(i)!==null||!i.isParentRequired()&&!B(i.getParentOrThrow()))){let[,t]=Xf(this),n=Yf(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=$f(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&j(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Xc(e)&&!B(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return cu(t)&&cu(t.getPreviousSibling())}(n),u=j(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=U(r,Xc));let d=c[c.length-1],f=c[0];var p=f;l||!j(p)||!Xc(p)||p.isEmpty()||!j(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(j(i)||E(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&E(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||E(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=U(s,Xc),h=s.selectEnd();u&&(j(m)&&(u.canMergeWhenEmpty()||Xc(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),j(i)&&i.isEmpty()&&i.remove();let g=j(i)?i.getLastChild():null;cu(g)&&m!==i&&g.remove();let _=Uo(No(h.anchor,`next`));Po(h.anchor,_),Po(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&B(e)){let t=F();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Xf(this),n=U(this.anchor.getNode(),Xc);if(n!==null&&fp(n)!==null)return null;j(n)||E(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=su();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=Lo(this).getTextSlices(),r=[];for(let t of e){let e=Yo(n,t),i=e?Xo(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&P(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(ep(this,e,t,n))return;let r=e===`move`,i=W(),a=Ec(gc(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!j(c)||c.isInline()||c.canBeEmpty()||Tc(o,i,s);let l=sc(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=P(c)?el(c,l,i):null),this.dirty){let e=sc(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=P(n)?el(n,e,i):null}t&&u&&Uf(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&P(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=J(c,t?`previous`:`next`).getNodeAtCaret();if(P(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?el(e,n,i):null;if(r){let e=t?r.length:0;Uf(a,r,e,r,e)}}}}if(hf(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=Pc(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=N(o)?o:vc(o);this.applyDOMRange(n),this.dirty=!0,r||(gf(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||mf(this))}n===`lineboundary`&&ep(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&j(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(j(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=j(n)?n.getNextSibling():null;if(!(j(n)&&n.isEmpty()&&j(e)&&e.isShadowRoot()))return}let r=No(t,e?`previous`:`next`),i=em(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(j(e)&&wc(e)){let t=e.getParent();e.remove();let n=Vs(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(Bp(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(j(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Uo(t);Io(this,nm(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(zp(t)){if(j(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(M(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&j(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=Nf();e.add(t.origin.getKey()),R(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=Vs(n,e);r!==null&&r.selectStart()}}return}if(cu(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return vp(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Io(this,nm(!t.origin.isEmpty()&&n.isEmpty()?Ro(J(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(fp(e)!==null)return;if(j(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(_f(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(j(n)){if(n.collapseAtStart(e))return!0;if(B(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void xf(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void xf(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!Ws(a=i.getTextContent().slice(c,l))&&!bf(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||pf(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&sf()}deleteLine(e){lf(this,e,`lineboundary`)}deleteWord(e){lf(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return ju()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function K(e){return e instanceof of}function lf(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=_f(e,t,n),n===`lineboundary`&&function(e){for(let t of Lo(e).iterNodeCarets(`shadowRoot`))if(zp(t)&&cu(t.origin))return void Po(e.focus,Ro(t))}(e)}n!==`lineboundary`||e.isCollapsed()||U(i.getNode(),Xc)===U(a.getNode(),Xc)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||pf(e),e.removeText())}function uf(e,t){if(K(e)){for(let n of e.getNodes())xo(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?Lo(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(P(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=Yo(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!Ss(l)?Xo(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else j(l)?l.setTextFormat(t(l.getTextFormat())):xo(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),js(null))}function df(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&uf(e,e=>{for(let[t,r]of n)e=Es(e,t,r?Jt[t]:0);return e})}function ff(e,t,n=null){let r=n===null&&G(e)?Es(e.format,t,null):n;uf(e,e=>Es(e,t,r))}function pf(e){let t=L();!t.isEmpty()&&es(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function mf(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function hf(e,t,n,r,i){let a=r===`character`?Ic(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=Ic(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function gf(e,t,n){let r=e.getNodes(),i=r.filter(e=>mc(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=j(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function _f(e,t,n){if(ep(e,`extend`,t,n))return!1;let r=W(),i=Ec(gc(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!j(c)||c.isInline()||c.canBeEmpty()||Tc(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&P(t)?el(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(Uf(i,h,g,h,g),hf(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=Pc(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&Cs(v)&&ys(v)===r){let e=Us(v);if(M(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&P(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=J(u,t?`previous`:`next`).getNodeAtCaret();if(P(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&Ls(v),x=b?hp(u):null,S=b?hp(b):null;if(b&&!Ef(S,x)&&vf(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,ee,te,ne]=t?[v,y,d,f]:[d,f,v,y],re=N(u)?u:vc(u);return e.applyDOMRange({collapsed:!1,endContainer:te,endOffset:ne,startContainer:C,startOffset:ee}),e.dirty=!0,!gf(e,t,re)&&t&&mf(e),!1}function vf(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=pp(e);n!==null;){let e=hp(n);if(Ef(e,t))return e!==null||n.isAttached()?n:null;n=e&&pp(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!j(t))return t!==null&&function(e,t,n){j(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(P(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!j(i)||B(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function yf(){try{let e=/* @__PURE__ */ RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var bf=/* @__PURE__ */ yf();function xf(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Sf(e,t,n,r){let i,a=t,o=!1;if(V(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Is(e,r)!==void 0||fl(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Us(d),P(i))a=Gp(i,s?`next`:`previous`);else{let c=Us(e);if(c===null)return null;if(j(c)){let o=r.getElementByKey(c.getKey());o===null&&E(214);let l=Qc(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),j(c)||E(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(j(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=j(u)?u:u.getParentOrThrow()),a=0}P(u)?(i=u,c=null,a=Gp(u,s?`next`:`previous`)):u!==c&&s&&!f&&(j(c)||E(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=pp(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Us(e)===c){let n=Qc(c,s,r);n.element===s?t===0&&M(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(j(c))return[$d(c.__key,a,`element`),o]}}else i=Us(e);return P(i)?[$d(i.__key,Gp(i,a,`clamp`),`text`),o]:null}function Cf(e,t,n){let r=e.getNode();if(Ns(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=J(r,a).getNodeAtCaret();if(i===t||!j(o)||!o.isInline()||i&&n){if(i&&!t)P(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(j(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=J(t,a).getNodeAtCaret();P(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function wf(e){let t=I(e.key);return t===null?null:hp(t)}function Tf(e,t,n){let r=wf(e),i=wf(t);return!Ef(r,i)&&vf(t,I(e.key),r,i,`selection`,n)}function Ef(e,t){return e===null?t===null:e.is(t)}function Df(e){let t=Tf(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=/* @__PURE__ */ new Map;for(let t=null,r=e;r!==null;t=r,r=am(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=am(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return om(e,t);case`ancestor`:return e.type===`child`&&fp(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&fp(n.a)===null?1:-1;case`branch`:{let e=fp(n.a)&&n.a.getKey(),t=fp(n.b)&&n.b.getKey();if(e&&t){for(let r of _p(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(No(e.anchor,`next`),No(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function Of(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function kf(e,t,n,r,i,a){if(e===null||n===null||!_s(i,e,n))return null;let o=Sf(e,t,G(a)?a.anchor:null,i);if(o===null)return null;let s=Sf(n,r,G(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Us(e),r=Us(n);if(M(t)&&M(r))return null}let f=i._slotsUsed&&Tf(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?Of(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>Of(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Cf(e,n,r),Cf(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function Af(e){return j(e)&&!e.isInline()}function jf(e,t,n,r,i,a){let o=Pu(),s=new cf($d(e,t,i),$d(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Mf(){return new cf($d(`root`,0,`element`),$d(`root`,0,`element`),0,``)}function Nf(){return new of(/* @__PURE__ */ new Set)}function Pf(e,t){return If(null,e,t,null)}var Ff=/* @__PURE__ */ new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function If(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&Hc(c),u=c&&(c.ctrlKey||c.metaKey||Ff.has(c.key))&&Wc(l)&&ys(l)===n,d=!Or&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(G(e)&&!d)return e.clone();{if(t===null)return null;let r=Ic(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&G(e)&&!_s(n,f,p))return e.clone()}let g=kf(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=G(e)?e:null,x=new cf(_,v,b?b.format:0,b?b.style:``);return b&&Lf(x,b.anchor.key),x.dirty=y,x}function Lf(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;P(r)?(i=r.getFormat(),a=r.getStyle()):j(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function q(){return Pu()._selection}function Rf(){return W()._editorState._selection}function zf(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function Bf(e,t,n,r=1){if(zf(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(j(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);P(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function Vf(e,t,n,r,i){let a=r||i;if(P(a)||j(a)){let t=P(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function Hf(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function Uf(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Wf(e,t,n){let r=sc(e,t.getKey());if(j(t)){let i=Qc(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Gf(e,t,n,r,i,a){let o=a.getRootNode(),s=ws(o)||Oc(o)?Vc(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&hs(s,s))return;let c=Ic(r,a),l;if(!G(t))return void(e!==null&&_s(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Wf(n,f,u.offset),[g,_]=Wf(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=P(f)?el(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):G(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=P(p)?el(p,g,n):null),x===null||S===null)return;let ee=b&&P(p)&&Ns(p)&&Cs(S)&&S.nodeValue===Gt?Gt.length:_;if(b&&(e===null||C||G(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===ee&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:ys(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(Uf(r,x,h,S,ee),Nt&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Bc(a);if(e===null||!a.contains(e)){let e=Vc(a.ownerDocument),t=e===null?null:ys(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Bc(a)){let e=G(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!V(r))return r||null;let i=Is(r,e),a=i===void 0?null:I(i);return a===null||j(a)?r:Qc(a,r,e).element}(n,x,h):(l===void 0&&(l=Fc(r,a)),l);if(e!==null){let t;if(Cs(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=V(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!Cs(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=lc(n),a=hc(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=V(r)?r:cc(r);for(;o!==null&&n.contains(o);){let t=dc(a,o,e,i);e-=t,i-=t,o=o===n?null:cc(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=gc(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=cc(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,ee)}function Kf(e){let t=q()||Rf();t===null&&(t=L().selectEnd()),t.insertNodes(e)}function qf(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
10
10
|
`||n===`\r
|
|
11
|
-
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Jf(e){let t=[];return qf(e,{linebreak:()=>t.push(su()),tab:()=>t.push(os()),text:e=>t.push(jo(e))}),t}function Yf(e){let t=[];for(let n of e)cu(n)||(!j(n)&&!M(n)||n.isInline()?t.push(n):j(n)&&t.push(...Yf(n.getChildren())));return t}function Xf(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=q();G(r)&&(n=r),G(n)||D(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Xc(a)&&fp(a)===null;){let e=a;if([a,o]=Zf(a,o,t),e.is(a))break}return[a,o]}function Zf(e,t,n=!1){let r=e.getParent();if(!r){let e=F();return L().append(e),e.select(),[L(),0]}if(P(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!j(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new cf($d(e.__key,t,`element`),$d(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function Qf(e){return cu(e)||_c(e)||P(e)||e.isParentRequired()}function $f(e){let t=F(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(Qf(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(cu(i)&&(a===void 0||!Qf(a)))continue}n.append(i)}else t.append(i),n=null}return t}function ep(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=No(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!Wo(c)){for(let e of c){l=!1;let{origin:t}=e;if(M(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of em(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Bp(e))e.origin.isInline()||(c=e);else{if(j(e.origin))continue;M(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&M(c.origin)&&c.origin.isKeyboardSelectable()){let e=Nf();return e.add(c.origin.getKey()),R(e),!0}return c=Uo(c),s&&Po(e.anchor,c),Po(e.focus,c),l||!o}function tp(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function np(e){let t=W();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=Pu(),r=t._movedNodes||=/* @__PURE__ */ new WeakMap,i=r.get(n);i===void 0&&(i=/* @__PURE__ */ new Set,r.set(n,i)),i.add(e.__key)}}function rp(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function ip(e){fp(e)!==null&&D(380,e.__key,String(fp(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();np(e);let r=e.getPreviousSibling(),i=e.getNextSibling();tp(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function ap(e,t){let n=t&&e.getParent(),r=t&&n&&zf(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),ip(e),t&&n&&r!==-1&&Bf(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function op(e,t,n,r){Mu();let i=t===`next`;Sc(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=q(),c=r&&G(s)?s:null,l=ap(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||zf(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(rp(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(Bf(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function sp(e,t,n){Mu();let{origin:r,direction:i}=e,a=i===`next`,o=pp(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(j(s))return a?s.select(0,0):s.select();if(P(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function cp(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var lp=/* @__PURE__ */ new Map;function up(e){return j(e)||M(e)}function dp(e){return j(e)||M(e)}function fp(e){let t=e.getLatest();return dp(t)?t.__slotHost:null}function pp(e){let t=fp(e);if(t===null)return null;let n=I(t);return j(n)||M(n)||D(370),n}function mp(e){let t=pp(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of _p(t))if(r===n)return e;return null}function hp(e){let t=e.getLatest();for(;t!==null;){if(fp(t)!==null)return t;t=t.getParent()}return null}function gp(e){if(e===null)return null;let t=G(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:hp(t)}function _p(e){let t=e.getLatest();return up(t)&&t.__slots!==null?t.__slots:lp}function vp(e){return Array.from(_p(e).keys())}function yp(e,t){let n=_p(e).get(t);return n===void 0?null:I(n)}var bp=[`__proto__`,`constructor`,`prototype`],xp=Symbol(`slotMapOwner`);function Sp(e){let t=e.__slots;return t!==null&&t[xp]===e||(t=new Map(t),t[xp]=e,e.__slots=t),t}var Cp=/* @__PURE__ */ new WeakMap,wp=[];function Tp(e){for(let{ownNodeConfig:t}of Hl(e)){let e=t&&t.slots;if(e)return e}return wp}function Ep(e){let t=``;for(let n of _p(e).values()){let e=I(n);e!==null&&(t+=e.getTextContent())}return t}function Dp(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Op(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||D(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!j(n)&&!M(n)||n.isInline())&&D(374,n.__key);let i=e.getWritable(),a=Sp(i),o=a.get(t);o!==void 0&&kp(o);let s=n.getWritable(),c=pp(s);if(c!==null){let e=mp(s);e!==null&&Sp(c.getWritable()).delete(e),s.__slotHost=null}return ip(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Cp.get(e);if(t===void 0){let n=Tp(e),r=/* @__PURE__ */ new Map;for(let t of n)bp.includes(t)&&D(371,e.name,t),r.has(t)&&D(372,e.name,t),r.set(t,r.size);t=r,Cp.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Dp(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Dp(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),W()._slotsUsed=!0,Pu()._slotsUsed=!0,i}function kp(e){let t=I(e);if(t===null)return;let n=t.getWritable();dp(n)||D(377,e),n.__slotHost=null,n.remove()}var Ap={next:`previous`,previous:`next`},jp=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return rm({hasNext:zp,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return J(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return J(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=/* @__PURE__ */ new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&D(263,Array.from(o).join(` `))}else i.insert(e);i=J(e,this.direction)}for(let e of o.values())e.remove();return this}},Mp=class e extends jp{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:qp(e,this.direction)}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pp(this.direction);return J(this.getNodeAtCaret(),e)||qp(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Np={root:N,shadowRoot:B};function Pp(e){return Ap[e]}function Fp(e,t=`root`){return e===null||Np[t](e)?null:fp(e)===null?e:null}var Ip=class e extends jp{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:J(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return j(this.origin)?qp(this.origin,this.direction):null}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pp(this.direction);return J(this.getNodeAtCaret(),e)||qp(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Lp)&&this.direction===t.direction&&this.origin.is(t.origin)}},Lp=class e extends jp{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Wp(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Wp(this.origin,Pp(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Ip||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return J(this.origin,this.direction)}};function Rp(e){return e instanceof Lp}function zp(e){return e instanceof Ip}function Bp(e){return e instanceof Mp}var Vp={next:class extends Lp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Lp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Hp={next:class extends Ip{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Ip{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Up={next:class extends Mp{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Mp{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function J(e,t){return e?new Hp[t](e):null}function Wp(e,t,n){return e?new Vp[t](e,Gp(e,n)):null}function Gp(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&wt(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Kp(e,t){return new Zp(e,t)}function qp(e,t){return j(e)?new Up[t](e):null}function Jp(e){return e&&e.getChildCaret()||e}function Yp(e){return e&&Jp(e.getAdjacentCaret())}var Xp=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return Rp(e)&&Rp(t)&&e.isSameNodeCaret(t)?[Kp(e,t.offset-e.offset),null]:[Rp(e)?Qp(e,`anchor`):null,Rp(t)?Qp(t,`focus`):null]}iterNodeCarets(e=`root`){let t=Rp(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Rp(n),i=t=>t.isSameNodeCaret(n)?null:Yp(t)||t.getParentCaret(e);return rm({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Zp=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Wp(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Qp(e,t){let{direction:n,origin:r}=e;return Kp(e,Gp(r,t===`focus`?Pp(n):n)-e.offset)}function $p(e,t){return e.direction===t?e:e.getFlipped()}function em(e){return nm(e,$p(qp(L(),Pp(e.direction)),e.direction))}function tm(e){return nm(e,e)}function nm(e,t){return e.direction!==t.direction&&D(265),new Xp(e,t,e.direction)}function rm(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function im(e,t){let n=um(e.origin,t.origin);switch(n===null&&D(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return om(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return sm(n)}}function am(e){return e.getParent()||pp(e)}function om(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function sm(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function cm(e,t){return t.is(e)}function lm(e){return j(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function um(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=/* @__PURE__ */ new Map;for(let[t,r]=lm(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=lm(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(cm(e,r)||D(276),{commonAncestor:r,type:`ancestor`}):i===null?(cm(t,r)||D(277),{commonAncestor:r,type:`descendant`}):((j(a)||cm(e,a))&&(j(i)||cm(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||D(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function dm(e){return e}function fm(...e){return e}function pm(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function mm(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function hm(e,...t){let n=mm(...t);n.length>0&&e.classList.add(...n)}function gm(e,...t){let n=mm(...t);n.length>0&&e.classList.remove(...n)}function _m(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var vm={tag:$l};function ym(){let e=L();e.isEmpty()&&e.append(F())}var bm={config:{setOptions:vm,updateOptions:vm},init:({$initialEditorState:e=ym})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Yl(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[lo,So,au,as,ts]};function Y(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function xm(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Sm=/* @__PURE__ */ xm(),Cm=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function wm(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!Cm.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=wm(n[e],r[e]));return e}return t}function Tm(e){return e.id===0}function Em(e){return e.id===2}var Dm=/* @__PURE__ */ new Set,Om=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=/* @__PURE__ */ new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):pm;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;Em(t)||Y(306,String(t.id));let 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(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&Y(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&Y(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&Y(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&Y(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&Y(311),this._signal}getInitResult(){this.extension.init===void 0&&Y(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||Y(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||Y(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Y(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Y(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||Y(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Dm}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||Y(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},km=Symbol.for(`@lexical/extension/LexicalBuilder`);function Am(...e){return Fm.fromExtensions(e).buildEditor()}function jm(){}function Mm(e){throw e}function Nm(e){return Array.isArray(e)?e:[e]}var Pm=Sm,Fm=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=/* @__PURE__ */ new Map,this.incomingEdges=/* @__PURE__ */ new Map,this.extensionNameMap=/* @__PURE__ */ new Map,this.conflicts=/* @__PURE__ */ new Map,this.PACKAGE_VERSION=Pm,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Nm(bm)];for(let e of t)n.push(Nm(e));return new e(n)}static maybeFromEditor(t){let n=t[km];return n&&(n.PACKAGE_VERSION!==Pm&&Y(292,n.PACKAGE_VERSION,Pm),n instanceof e||Y(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Y(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(gu({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[km]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=jm;function t(){try{e()}finally{e=jm}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=ed(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Y(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,/* @__PURE__ */ new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,/* @__PURE__ */ new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Y(296);let[t]=Nm(e);typeof t.name!=`string`&&Y(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Y(298,t.name),!n){n=new Om(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Y(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Y(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Nm(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(Em(i))return;let a=n.extension.name;var o;Tm(i)||Y(300,a,r||`[unknown]`),Tm(o=i)||Y(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||Y(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Tm(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Y(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return ed(...r)}buildCreateEditorArgs(){let e={},t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of _m(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Y(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&wm(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=Mm,e}};function Im(e,t){let n=Fm.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function Lm(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=pt(i===void 0?e[r]:i)}return n}function Rm(e){return JSON.stringify([e.exportJSON(),j(e)?e.getChildrenKeys():null])}function zm(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=/* @__PURE__ */ new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(ru);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(G(a)&&G(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||N(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&P(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!P(l)||!P(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(Ql),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>Rm(e))===n.read(()=>Rm(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(G(a)&&G(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!P(r)||!P(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function Bm(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function Vm(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function Hm(e,t,n,r=Date.now,i,a=null){let o=zm(e,n,r),s=()=>{i&&i(t)};return s(),ed(e.registerCommand(xn,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=Bm(o,a);t!==null&&(r.push(t),e.dispatchCommand(Yn,!0))}i.length===0&&e.dispatchCommand(Xn,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Sn,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=Bm(o,a);t!==null&&(i.push(t),e.dispatchCommand(Xn,!0))}r.length===0&&e.dispatchCommand(Yn,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(qn,()=>(Vm(t,i),!1),0),e.registerCommand(Jn,()=>(Vm(t,i),e.dispatchCommand(Yn,!1),e.dispatchCommand(Xn,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Yn,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Xn,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function Um(){return{current:null,redoStack:[],undoStack:[]}}var Wm={build:(e,{delay:t,createInitialHistoryState:n,disabled:r,maxDepth:i,now:a},o)=>({...Lm({delay:t,disabled:r,historyState:n(e),maxDepth:i,now:a}),...o.getInitResult()}),config:{createInitialHistoryState:Um,delay:300,disabled:typeof window>`u`,maxDepth:null,now:()=>Date.now()},init:()=>({canRedo:pt(!1),canUndo:pt(!1)}),name:`@lexical/history/History`,register:(e,t,n)=>{let{canUndo:r,canRedo:i}=n.getInitResult(),a=n.getOutput(),o=e=>tt(()=>{r.value=e!=null&&e.undoStack.length>0,i.value=e!=null&&e.redoStack.length>0});return St(()=>{if(!a.disabled.value)return Hm(e,a.historyState.value,a.delay,()=>a.now.peek()(),o,a.maxDepth);o(null)})}};function Gm(e){let t=e?Im(e,`@lexical/extension/HMR`):void 0;return t?t.output.restoreCount.value:0}var Km={build:(e,{disabled:t,parentEditor:n})=>Lm({disabled:t,parentEditor:n||e._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[[Wm,{disabled:!0}]],name:`@lexical/history/SharedHistory`,register:(e,t,n)=>St(()=>{let{disabled:t,parentEditor:r}=n.getOutput();if(!t.value){let{output:t}=n.getDependency(Wm);Gm(e),Gm(r.value);let i=function(e){return e?Im(e,Wm.name):null}(r.value);if(!i)return;let a=i.output;tt(()=>{t.delay.value=a.delay.value,t.historyState.value=a.historyState.value,t.now.value=a.now.value,t.maxDepth.value=a.maxDepth.value,t.disabled.value=a.disabled.value})}})};function qm(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Jm(e){let t=H().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Ym(e){let t=N(e)?e:e.getParent();return t&&Jm(t)}function Xm(e){let t=Ym(e);return t!==null&&t.direction===`rtl`}function Zm(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!Ss(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!G(e)||i.type!==`element`&&a.type!==`element`?void 0:Yo(Lo(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=al(t)),t.__text=l)}return t}function Qm(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return j(t)||qm(177),e.offset===t.getChildrenSize()}function $m(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function eh(e,t,n){let r=No(e,n);if(Wo(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function th(e,t,n=$m){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=/* @__PURE__ */ new Map;if(r){let[t,n]=r,s=U(t.getNode(),Xc);a=U(n.getNode(),Xc);let c=e.isBackward()?`previous`:`next`;i=j(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!j(r)||!r.isEmpty())&&eh(e,t,n)}(n,a,Pp(c)),j(s)&&o.set(s.getKey(),s),j(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(j(t)&&Xc(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=U(t,Xc);j(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(pp(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function nh(e){let t=rh(e);return t!==null&&t.writingMode===`vertical-rl`}function rh(e){let t=e.anchor.getNode();return j(t)?Jm(t):Ym(t)}function ih(e,t){let n=nh(e)?!t:t;oh(e)&&(n=!n);let r=No(e.focus,n?`previous`:`next`);if(Wo(r))return!1;if(Rp(r)&&!ss(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(P(e)&&!ss(e))return!0}for(let e of em(r)){if(Bp(e))return!e.origin.isInline();if(!j(e.origin)){if(M(e.origin))return!0;break}}return!1}function ah(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function oh(e){let t=rh(e);return t!==null&&t.direction===`rtl`}function sh(e,t,n){let r=oh(e),i;i=nh(e)||r?!n:n,ah(e,t,i,`character`)}function ch(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function lh(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function uh(e){let t=U(e,e=>j(e)&&!e.isInline());return j(t)||ch(4,e.__key),t}function dh(e){let t=q()||Rf(),n;if(G(t))n=No(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=J(r,`next`))}n||=qp(L(),`previous`).getFlipped().insert(F())}let r=$o(e,n,Wo(i=n)||qo(Rp(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=Yp(r);return Fo(tm(Bp(a)?Uo(a):r)),e.getLatest()}function fh(e,t){let n=t();return e.replace(n),n.append(e),n}function ph(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function mh(e){let t=null;if(ph(e,DragEvent)?t=e.dataTransfer:ph(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function hh(e){let t=q();if(!G(t))return!1;let n=/* @__PURE__ */ new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=U(i,e=>j(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}var gh=!(Mt||!Et)&&void 0;function _h(e,t=!1){let n=1;if(function(){if(gh===void 0){let e=document.createElement(`div`);e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`100px`,e.style.left=`-1000px`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),gh=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return gh}()||t){let t=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(t.getComputedStyle(e).getPropertyValue(`zoom`)),e=cc(e)}return n}function vh(e,t){return eh(e,t,`previous`)}function yh(e,t){return eh(e,t,`next`)}function bh(e){return Im(H(),e)}function xh(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Sh(e){if(!ws(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=/* @__PURE__ */ new Map;function r(e){let t=n.get(e);if(t===void 0){t=/* @__PURE__ */ new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!ph(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!V(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var Ch;function wh(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Th(e){return Ch&&Ch.editor===e?Ch:void 0}function Eh(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(wh(e,n))]}return t}function Dh(e,t){let n=t;for(let r of e){let[e,i]=Eh(n,r),a=e.key;if(n===t&&wh(n,e)===i)continue;let o=n===t||n===void 0?Oh(t):n;o[a]=i,n=o}return n}function Oh(e){return Object.create(e||null)}function kh(e,t){return[e,t]}function Ah(e,t,n,r=H()){let i=Ch,a=Th(r);try{return Ch={...a,editor:r,[e]:t},n()}finally{Ch=i}}function jh(e,t=()=>{}){return(n,r=H())=>i=>{let a=Th(r),o=a&&a[e],s=Dh(n,o||t(r));return s&&s!==o?Ah(e,s,i,r):i()}}function Mh(e,t,n,r){return Object.assign(hi(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var Nh=`@lexical/html/DOM`,Ph=Symbol.for(`@lexical/html/DOMExportContext`);function Fh(e,t,n){return Mh(Ph,e,t,n)}var Ih=/* @__PURE__ */ Fh(`isExport`,Boolean);function Lh(e){let t=Im(e,Nh);return t?t.output.defaults:void 0}function Rh(e){let t=Im(e,Nh);return t?t.output.runtime:void 0}function zh(e=H()){let t=Rh(e);return t?t.getSessionConfig():Zc(e)}var Bh=/* @__PURE__ */ jh(Ph,Lh),Vh=/* @__PURE__ */ new Set([`STYLE`,`SCRIPT`]);function Hh(e,t){Sh(t);let n=ws(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Vh.has(t.nodeName)){let n=Kh(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof iu&&t.insertAfter(su());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Uh(e,t=null,n=H()){return Bh([kh(Ih,!0)],n)(()=>{let r=L(),i=zh(n),a=gp(t),o=e.append.bind(e);for(let e of(j(a)?a:r).getChildren())Gh(n,e,o,t,i);return e})}function Wh(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&xh(338),Fu(e),Uh(Nc().createElement(`div`),t,e).innerHTML}function Gh(e,t,n,r=null,i=Zc(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&P(t)&&(s=Zm(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Nc().createDocumentFragment(),p=d?d():j(s)?s.getChildren():[],m=a&&K(r)&&j(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=Gh(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((V(c)||Gc(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(cu(t)&&V(e)&&Yc(e)&&n!==null&&n.nodeName===`BR`){let t=Nc().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Gc(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function Kh(e,t,n,r,i=/* @__PURE__ */ new Map,a){let o=[];if(Vh.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!B(s))&&(s!=null&&Af(s)||r);for(let e=0;e<d.length;e++)f.push(...Kh(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),Yc(e)&&(f=function(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(Af(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&Af(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,f,p?()=>{let e=new iu;return n.push(e),e}:F)),s==null){if(f.length>0)for(let e of f)o.push(e);else Yc(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&qc(e.nextSibling)&&qc(e.previousSibling)}(e)&&o.push(su())}else j(s)&&s.append(...f);return o}function qh(e,t,n=null){let r=Mc(n),i=n?Ac(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=cc(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Oc(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function Jh(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Yh={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function Xh(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var Zh=(e,t)=>{if(!G(t))return t.insertRawText(e),!0;t!==q()&&R(t);let n=e=>{let t=q();G(t)&&e(t)};return qf(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([os()])),text:e=>n(t=>t.insertText(e))}),!0},Qh={"application/x-lexical-editor":[(e,t,n)=>{try{let n=H(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return dg(n,mg(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=H();return dg(n,Hh(n,new DOMParser().parseFromString(Xh(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[Zh],"text/uri-list":[Zh]};function $h(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function eg(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&$h(e.$importMimeType[i],a,n,t))return!0}return!1}var tg={$importMimeType:Qh,$insertDataTransfer:(e,t)=>eg({$importMimeType:Qh,priority:Yh},e,t),priority:Yh},ng={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>eg(t,e,n),priority:t.priority}),config:{$importMimeType:Qh,priority:Yh},mergeConfig(e,t){let n=pm(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function rg(e,t=q()){return t??Jh(166),G(t)&&t.isCollapsed()||t.getNodes().length===0?``:Wh(e,t)}function ig(e,t=q()){return t??Jh(166),G(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(pg(e,t))}function ag(e,t,n){(function(){let e=bh(ng.name);return e?e.output:tg})().$insertDataTransfer(e,t)}var og=`application/x-lexical-drag`;function sg(e,t){let n={editorKey:t.getKey()};e.setData(og,JSON.stringify(n))}function cg(e){let t=e;if(Rp(t)){if(t.offset===0)t=Ro(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(Bp(t))t=Ro(J(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=J(e,`next`)}}}function lg(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(og);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=qh(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Ls(n.node);if(r===null)return null;if(P(r))return Wp(r,`next`,n.offset);let i=r.getParent();if(j(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=Qc(r,e,t);return n.node===a.element||i?Ko(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&Ko(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=q();if(o){if(!G(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Go(Lo(t),`next`),i=cg(e);return im(cg(n),i)<=0&&im(i,cg(r))<=0}(a,s))return e.preventDefault(),!0}let c=Uo(a),l=Rp(c)?Qo(c):c;if(l===null)return!1;let u=l.getFlipped();o&&G(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||Jh(438),n(r,Fo(tm(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of jc(t)){let t=bs(n);if(vs(t)&&t.getKey()===e&&V(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function ug(e,t){return lg(e,t,ag)}function dg(e,t,n){e.dispatchCommand(an,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(G(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=No(t,`previous`);if(r){if(Rp(r))n=r.origin;else{let e=nm(r,qp(L(),`next`).getFlipped());for(let t of e){if(P(t.origin)){n=t.origin;break}if(j(t.origin)&&!t.origin.isInline())break}}}if(n&&P(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function fg(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=j(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&P(o)&&(o=Zm(t,o,`clone`));let s=_r(o),c=j(o)?o.getChildren():[],l=s.children||[];P(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&K(t)&&j(n)?null:t;for(let r=0;r<c.length;r++){let a=c[r],o=fg(e,u,a,l);!i&&j(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=vp(o);if(t.length>0){let n={};for(let r of t){let t=yp(o,r);t===null&&Jh(366,o.constructor.name,r);let i=[];fg(e,null,t,i),(i.length!==1||j(t)&&t.excludeFromCopy(`clone`))&&Jh(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e<l.length;e++)r.push(l[e]);return i}function pg(e,t){let n=[],r=L(),i=gp(t),a=(j(i)?i:r).getChildren();for(let r=0;r<a.length;r++)fg(e,t,a[r],n);return{namespace:e._config.namespace,nodes:n}}function mg(e){let t=[];for(let n of e)t.push(Hu(n));return t}var hg=null;async function gg(e,t,n){if(hg!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(_g(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Ec(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Wn,r=>(ph(r,ClipboardEvent)&&(o(),hg!==null&&(i.clearTimeout(hg),hg=null),t(_g(e,r,n))),!0),4);hg=i.setTimeout(()=>{o(),hg=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function _g(e,t,n){if(n===void 0){let t=Ec(e._window),r=q();if(!r||r.isCollapsed()||!t)return!1;let i=Ic(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!_s(e,a,o))return!1;n=yg(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(bg(r,n),!0)}var vg=[[`text/html`,rg],[`application/x-lexical-editor`,ig]];function yg(e=q()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Cg(i,t);e!==null&&(n[r]=e)}return n}(xg(),e)}function bg(e,t){for(let[n]of vg)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function xg(e=H()){let t=Im(e,wg.name);return t?t.output:Sg}var Sg={"application/x-lexical-editor":[(e,t)=>e?ig(H(),e):t()],"text/html":[(e,t)=>e?rg(H(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Cg(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var wg={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:Sg},mergeConfig(e,t){let n=pm(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},Tg=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Eg(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Tg.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Dg(e,t,n,r,i){let a=Eg(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Og(e,t){e.__tag=t.__tag}var kg=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Dg(t.indent,0,0,1/0),e.__textFormat=Eg(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Og}},Ag=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Dg(t.indent,0,0,1/0),e.__textFormat=Eg(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},jg=/* @__PURE__ */ O(`DRAG_DROP_PASTE_FILE`),Mg=/* @__PURE__ */ hi(`shadowRoot`,{parse:/* @__PURE__ */ ii()}),Ng=class extends ao{$config(){return this.config(`quote`,{children:`inline`,extends:ao,generated:Ag,importDOM:{blockquote:()=>({conversion:Bg,priority:0})},stateConfigs:[{flat:!0,stateConfig:Mg}]})}isShadowRoot(){return gi(this,Mg)}setIsShadowRoot(e){return _i(this,Mg,e)}createDOM(e){let t=Nc().createElement(`blockquote`);return hm(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Pg().updateFromJSON(e)}insertNewAfter(e,t){let n=F();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=F();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Pg(e){let t=xc(new Ng);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function Fg(e){return e instanceof Ng}var Ig=/* @__PURE__ */ ci()({tag:/* @__PURE__ */ ui(/* @__PURE__ */ ai([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),Lg=class extends ao{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:ao,generated:kg,importDOM:{h1:()=>({conversion:zg,priority:0}),h2:()=>({conversion:zg,priority:0}),h3:()=>({conversion:zg,priority:0}),h4:()=>({conversion:zg,priority:0}),h5:()=>({conversion:zg,priority:0}),h6:()=>({conversion:zg,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Rg(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Rg(e)?{conversion:()=>({node:Vg(`h1`)}),priority:3}:null},json:Ig})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Nc().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];hm(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&yh(e.anchor,this),r=e&&vh(e.anchor,this),i=n||!e?F():Vg(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=F();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=F();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function Rg(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function zg(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=Vg(t),ol(e,n),cl(n,e),sl(n,e)),{node:n}}function Bg(e){let t=Pg();return cl(t,e),ol(e,t),sl(t,e),{node:t}}function Vg(e=`h1`){return xc(new Lg(e))}function Hg(e){return e instanceof Lg}function Ug(e){return M(Ls(e))&&!(V(e)&&e.hasAttribute(`data-lexical-slot`))}function Wg(e){let t=e.focus;return t.key===`root`&&t.offset===L().getChildrenSize()}function Gg(e){let t=e.focus;return t.key===`root`&&t.offset===0}function Kg(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?Wg(e):Gg(e)))return!1;let r=e.focus.offset;return wc(L().getChildAtIndex(n?r-1:r))}function qg(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(P(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&P(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Jg={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function Yg(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=No(e.focus,t),r=U(n.origin,yc);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!mc(i,r))return!1;let a=nm(n,J(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=nm(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!zp(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of em(J(r,t))){if(!e.origin.is(c.getParent())){if(wc(e.origin)){let e=J(c,t);return Fo(nm(e,e)),!0}break}if(!yc(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=No(e.anchor,t).getNodeAtCaret();return!(!yc(n)||n.isInline()||(Fo(tm(Uo(qp(n,t)))),0))}(e,t)}function Xg(e){return M(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function Zg(e){let t=Nf();t.add(e),R(t)}function Qg(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=No(n,i);if(n.type===`element`&&j(r)&&B(r)){let e=a.getNodeAtCaret();return!(e===null||!Xg(e)||(Zg(e.__key),0))}let o=U(j(r)?r:r.getParentOrThrow(),e=>j(e)&&!e.isInline()&&B(e.getParent()));if(o===null)return!1;let s=J(o,i).getNodeAtCaret();if(s===null||!Xg(s))return!1;if(o.getTextContentSize()===0)return Zg(s.__key),!0;let c=H().getRootElement();if(c===null)return!1;let l=Ec(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return $g(l,u,d,f,p),!1;let g=Ls(m);return $g(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!mc(g,o))&&(Zg(s.__key),!0)}function $g(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function e_(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=U(j(n)?n:n.getParentOrThrow(),e=>j(e)&&!e.isInline());if(r===null)return!1;let i=H(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(j(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=J(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!j(c)){if(t){let e=r.getFirstDescendant();P(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(P(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=Ec(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=qh(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(P(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function t_(e,t){let n=J(e,t),r=n.getAdjacentCaret();r!==null&&j(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Fo(tm(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function n_(e,t){let n=e.getNodes().map(e=>J(e,`next`)).sort(im),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e<n.length-1;e++)if(!n[e+1].origin.is(n[e].getNodeAtCaret()))return!1;return Fo(Go(nm(Ro(r),i),t)),Zu(),!0}function r_(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>J(e,`next`)).sort(im),a=(t?i[0]:i[i.length-1]).origin,o=U(a,e=>e!==a&&j(e)&&!e.isInline())??L(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function i_(e,t){return e.length>0&&!t}function a_(e,t=pt(Jg),n=pt(i_)){return ed(e.registerCommand(on,n=>{let r=q();if(K(r)){let t=n.target;if(V(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return G(r)&&qg(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(dn,e=>{let t=q();return G(t)?(t.deleteCharacter(e),!0):!!K(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(_n,e=>{let t=q();return!!G(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(vn,e=>{let t=q();return!!G(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(mn,t=>{let n=q();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)ag(r,n,e);else if(G(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(gn,()=>{let e=q();return!!G(e)&&(e.removeText(),!0)},0),e.registerCommand(yn,e=>{let t=q();return!(!G(t)&&!K(t)||(ff(t,e),0))},0),e.registerCommand(bn,e=>{let t=q();return!(!G(t)&&!K(t)||(df(t,e),0))},0),e.registerCommand(Bn,e=>{let t=q();if(!G(t)&&!K(t))return!1;let n=t.getNodes();for(let t of n){let n=U(t,e=>j(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(fn,e=>{let t=q();return!!G(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(pn,()=>{let e=q();return!!G(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(In,()=>{let e=os(),t=q();return G(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Kf([e]),!0},0),e.registerCommand(Ln,()=>hh(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Rn,()=>hh(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(On,e=>{let t=q();if(K(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!n_(t,`previous`))return e.preventDefault(),t_(n[0],`previous`),!0;t=q()}}return G(t)&&(Gg(t)||!e.shiftKey&&Yg(t,`previous`)||!e.shiftKey&&Qg(t,!0)||!e.shiftKey&&e_(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(kn,e=>{let t=q();if(K(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!n_(t,`next`))return e.preventDefault(),t_(n[0],`next`),!0;t=q()}}return G(t)&&(Wg(t)||!e.shiftKey&&Yg(t,`next`)||!e.shiftKey&&Qg(t,!1)||!e.shiftKey&&e_(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(En,e=>{let n=q();if(K(n)){let t=n.getNodes();if(t.length>0){let r=Xm(t[0])?`next`:`previous`;if(!e.shiftKey||!n_(n,r))return e.preventDefault(),t_(t[0],r),!0;n=q()}}if(!G(n))return!1;let r=Xm(n.anchor.getNode())?`next`:`previous`;if(Kg(n,r)||!e.shiftKey&&Yg(n,r))return e.preventDefault(),!0;if(e.shiftKey||qg(n,`arrow`,`start`,t.peek()),ih(n,!0)){let t=e.shiftKey;return e.preventDefault(),sh(n,t,!0),!0}return!1},0),e.registerCommand(wn,e=>{let n=q();if(K(n)){let t=n.getNodes();if(t.length>0){let r=Xm(t[0])?`previous`:`next`;if(!e.shiftKey||!n_(n,r))return e.preventDefault(),t_(t[0],r),!0;n=q()}}if(!G(n))return!1;let r=Xm(n.anchor.getNode())?`previous`:`next`;if(Kg(n,r)||!e.shiftKey&&Yg(n,r))return e.preventDefault(),!0;if(e.shiftKey||qg(n,`arrow`,`end`,t.peek()),ih(n,!1)){let t=e.shiftKey;return e.preventDefault(),sh(n,t,!1),!0}return!1},0),e.registerCommand(Mn,t=>{let n=q();if(!K(n)&&Ug(t.target))return!1;if(G(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(N(n))return!1;let r=uh(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Rn);if(It&&Pt)return!1}else if(!K(n))return!1;return t.preventDefault(),e.dispatchCommand(dn,!0)},0),e.registerCommand(Pn,t=>{let n=q();return!(!K(n)&&Ug(t.target))&&!(!G(n)&&!K(n))&&(t.preventDefault(),e.dispatchCommand(dn,!1))},0),e.registerCommand(An,n=>{let r=q();if(K(r)){let e=r.getNodes();e.length===1&&M(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!G(r))return!1;if(qg(r,`enter`,`both`,t.peek()),n!==null){if((It||Rt||Vt)&&Pt)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(fn,!1)}return e.dispatchCommand(pn)},0),e.registerCommand(Nn,()=>!!G(q())&&(e.blur(),!0),0),e.registerCommand(zn,t=>{let[,n]=mh(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=qh(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=Ls(t);if(n!==null){let t=Mf();if(P(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}R(Ia(t))}}return!(!e.dispatchCommand(jg,n)&&It&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return ug(t,e)},0),e.registerCommand(Vn,t=>{let[n]=mh(t),r=q();return!(n&&!G(r)||(G(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(bg(t.dataTransfer,yg(r)),sg(t.dataTransfer,e)),0))},0),e.registerCommand(Hn,t=>{let[n]=mh(t),r=q();if(n&&!G(r))return!1;let i=t.clientX,a=t.clientY,o=qh(i,a,e.getRootElement());return o!==null&&M(Ls(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Kn,()=>{let e=q();return ec(G(e)&&hp(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Wn,t=>!gs(t)&&(gg(e,ph(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Gn,t=>!gs(t)&&(async function(e,t){t.update(()=>{let e=q();G(e)&&!e.isCollapsed()&&pf(e)},{discrete:!0,tag:`cut`}),await gg(t,ph(e,ClipboardEvent)?e:null),t.update(()=>{let e=q();G(e)?e.removeText():K(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(hn,t=>{let[,r,i]=mh(t);return!(!n.peek()(r,i)||!e.dispatchCommand(jg,r))||!gs(t)&&q()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=q(),r=ph(e,InputEvent)||ph(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&ag(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(jn,()=>{let e=q();return G(e)&&qg(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Fn,()=>{let e=q();return G(e)&&qg(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(Tn,e=>{let t=q();if(K(t))return r_(t,!1,e);if(!G(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!j(r))return!1;let i=r.getFirstChild();if(!M(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Dn,e=>{let t=q();if(K(t))return r_(t,!0,e);if(!G(t))return!1;let{anchor:n,focus:r}=t,i=U(r.getNode(),e=>j(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!M(a)||!a.isInline()||U(n.getNode(),e=>j(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function o_(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function s_(e){let t=1,n=e.getParent();for(;n!=null;){if(Z(n)){let e=n.getParent();if(X(e)){t++,n=e.getParent();continue}o_(40)}return t}return t}function c_(e){let t=e.getParent();X(t)||o_(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),X(r)&&(n=r);return n}function l_(e){let t=[],n=e.getChildren().filter(Z);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();X(i)?t=t.concat(l_(i)):t.push(r)}return t}function u_(e){return Z(e)&&X(e.getFirstChild())}function d_(e,t){return t.getValue()}function f_(e,t){return Z(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function p_(e,t){return X(e)?bc(e).setListType(t):I_(t)}function m_(e){let t=q();if(t!==null){let n=t.getNodes();if(G(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(B(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=F();i.append(e),n=e.select().getNodes()}}else if(f_(i,n)){if(B(a)){let t=I_(e);i.replace(t);let n=H_();j(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(Z(i)){let t=i.getParentOrThrow();if(pp(t)===null){let n=p_(t,e);h_(n,t.getChildren()),t.replace(n)}}return}}let r=/* @__PURE__ */ new Set;for(let t=0;t<n.length;t++){let i=n[t];if(j(i)&&i.isEmpty()&&!Z(i)&&pp(i)===null&&!r.has(i.getKey())){g_(i,e);continue}let a=Ds(i)?i.getParent():Z(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(X(a)){if(!r.has(t)&&pp(a)===null){let n=p_(a,e);h_(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(B(n)&&!r.has(t)){r.add(t),g_(a,e);break}a=n}}}}}function h_(e,t){e.splice(e.getChildrenSize(),0,t)}function g_(e,t){if(X(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=H_(),a;if(h_(i,e.getChildren()),X(n)&&t===n.getListType())n.append(i),X(r)&&t===r.getListType()&&(h_(n,r.getChildren()),r.remove()),a=n;else if(X(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=I_(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=q();return G(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function __(e,t){v_(e,t,!1)}function v_(e,t,n){y_(e.getLastChild(),t.getFirstChild(),n);let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function y_(e,t,n=!1){if(e&&t&&u_(e)&&u_(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(v_(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();ao.prototype.remove.call(t)}}function b_(){let e=q();if(G(e)){let t=/* @__PURE__ */ new Set,n=e.getNodes(),r=e.anchor.getNode();if(f_(r,n))t.add(c_(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Ds(r)){let e=lh(r,R_);e!=null&&t.add(c_(e))}}for(let n of t){if(pp(n)!==null)continue;let t=n,r=l_(n);for(let n of r){let r=F().setTextStyle(e.style).setTextFormat(e.format);r.setFormat(n.getFormatType()).setIndent(n.getIndent()).setDirection(n.getDirection()).setStyle(n.getStyle()),h_(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Po(e.anchor,Uo(Ko(r,e.anchor.offset,`next`))),n.__key===e.focus.key&&Po(e.focus,Uo(Ko(r,e.focus.offset,`next`))),n.remove()}n.remove()}}}function x_(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Z(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),X(r.getFirstChild())||n++)}function S_(e){let t=/* @__PURE__ */ new Set;if(u_(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(u_(r)&&u_(i)){let n=i.getFirstChild();if(X(n)){n.append(e);let i=r.getFirstChild();X(i)&&n.getListType()===i.getListType()&&(h_(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(u_(r)){let t=r.getFirstChild();if(X(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(u_(i)){let t=i.getFirstChild();X(t)&&t.append(e)}else if(X(n)){let t=bc(e),a=bc(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function C_(e){if(u_(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(X(n?n.getParent():void 0)&&Z(n)&&X(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=bc(e),i=bc(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=bc(e),o=bc(t);a.append(o),h_(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function w_(e=!1){let t=q();if(!G(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(Z(n)&&n.getChildrenSize()===0)r=n;else if(P(n)){let e=n.getParent();Z(e)&&e.getChildren().every(e=>P(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=c_(r),a=r.getParent();X(a)||o_(40);let o=a.getParent(),s;if(B(o))s=F(),i.insertAfter(s);else{if(!Z(o))return!1;s=bc(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?d_(0,r):1,n=bc(a).setStart(t);if(Z(s)){let e=bc(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Z(e)&&!X(e))break;t=e}t.remove()}(r),!0}var T_=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function E_(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!T_.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function D_(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var O_=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`),i=Hr(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=E_(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=E_(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=E_(t.start,1),e},afterCloneFrom:D_}};function k_(e,t){e.__checked=t.__checked,e.__value=t.__value}var A_=e=>{let t=Br(e,`format`),n=Vr(e,`format`),r=Ur(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=E_(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=E_(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=E_(t.value,1),e},afterCloneFrom:k_}},j_={ol:`number`,ul:`bullet`},M_=/* @__PURE__ */ ci()({listType:/* @__PURE__ */ di(/* @__PURE__ */ li(/* @__PURE__ */ ai([`number`,`bullet`,`check`]),j_),{getter:{field:`__listType`}}),start:/* @__PURE__ */ ui(/* @__PURE__ */ ri(1),{field:`__start`}),tag:/* @__PURE__ */ di(/* @__PURE__ */ ai([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),N_=class extends ao{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&Qa(H())&&Za(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();X(t)&&e.getListType()===t.getListType()&&__(e,t)}(e),x_(e)},children:[R_],extends:ao,generated:O_,importDOM:Da({ol:()=>({conversion:F_,priority:0}),ul:()=>({conversion:F_,priority:0})}),json:M_,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=j_[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Nc().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,P_(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(P_(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(V(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){y_(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)Z(e)&&!X(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];if(!Z(t)){r===n&&(r=[...n]);let i=this.createListItemNode();!j(t)||X(t)||t.isInline()?i.append(t):i.append(...t.getChildren()),r[e]=i}}return super.splice(e,t,r)}extractWithChild(e){return Z(e)}createListItemNode(){return H_()}};function P_(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=s_(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...mm(s));for(let t=0;t<e.length;t++)t!==o&&i.push(...mm(e[t]))}if(l!==void 0){let e=mm(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&gm(e,...i),r.length>0&&hm(e,...r)}function F_(e){let t;if(function(e){return V(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=I_(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(V(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?I_(`check`):I_(`bullet`);return sl(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(Z(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{X(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function I_(e=`number`,t=1){return xc(new N_(e,t))}function X(e){return e instanceof N_}var L_=/* @__PURE__ */ ci()({checked:/* @__PURE__ */ di(/* @__PURE__ */ si(/* @__PURE__ */ ii()),{setter:{field:`__checked`}}),indent:/* @__PURE__ */ di(/* @__PURE__ */ ri(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:/* @__PURE__ */ ui(/* @__PURE__ */ ri(1),{derived:!0,field:`__value`})}),R_=class extends ao{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(X(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();X(n)||o_(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of J(e,t)){if(!Z(n))break;r.push(n)}}let i=Qa(H()),a=i?function(e,t){let n=q();if(!G(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n<i+t.length){let r=t[n-i-1];e.set(r.getKey(),r.getChildrenSize(),`element`)}else e.set(r,n-t.length+1,`element`)}}(t,r):null;if(e.insertBefore(n),n.splice(0,0,r),a!==null&&a(n),i)for(let e=t;e!==null&&!B(e);e=e.getParent())e.markDirty();B(t)||i||($o(n,Ro(J(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,N_],extends:ao,generated:A_,importDOM:Da({li:()=>({conversion:z_,priority:0})}),json:L_})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=Nc().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!X(n)||n.getListType()!==`check`||X(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=X(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>X(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...mm(a)),u.length>0&&gm(e,...u);let d=[];if(i!==void 0&&d.push(...mm(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...mm(a)),d.length>0&&hm(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&po(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=uo(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in uo(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),u_(this)?{after(e){if(V(e)){let t=e.previousElementSibling;if(V(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(j(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Z(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!X(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=bc(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(j(e)||o_(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&j(e)){let t=q();if(G(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(X(n)||o_(39),Z(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=bc(n),a=r[0];i.getListType()===`number`&&Z(a)&&i.setStart(d_(0,a)),r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&u_(t)&&u_(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(__(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=bc(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(u_(this))return!1;let t=this.getParentOrThrow();if(Z(t.getParentOrThrow()))return C_(this),!0;let n=F().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=bc(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return X(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Z(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&o_(117),(e=Math.floor(e))>=0||o_(199);let t=e,n=this.getIndent();for(;n!==t;)n<t?(S_(this),n++):(C_(this),n--);return this}canInsertAfter(e){return Z(e)}canReplaceWith(e){return Z(e)}canMergeWith(e){return Z(e)||rs(e)}extractWithChild(e,t){if(!G(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return I_(`bullet`)}canMergeWhenEmpty(){return!0}};function z_(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return B_(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return B_(t.children[0])}let t=e.getAttribute(`aria-checked`),n=H_(t===`true`||t!==`false`&&void 0);return cl(n,e),{after:V_.bind(null,n),node:sl(n,e)}}function B_(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=H_(e.hasAttribute(`checked`));return{after:V_.bind(null,t),node:t}}function V_(e,t){let n=t[0];return t.length===1&&rs(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function H_(e){return xc(new R_(void 0,e))}function Z(e){return e instanceof R_}var U_=/* @__PURE__ */ new Set([` `,`Alt`,`ArrowDown`,`ArrowLeft`,`ArrowUp`,`CapsLock`,`Control`,`Escape`,`Meta`,`Shift`]),W_=/* @__PURE__ */ O(`INSERT_CHECK_LIST_COMMAND`);function G_(e,t){let n=t&&t.disableTakeFocusOnClick||!1,r=typeof n==`boolean`?()=>n:n.peek.bind(n),i=e=>{let t=e.target;if(!V(t))return!1;let n=t.__lexicalCheckListLastHandled;return n!==void 0&&e.timeStamp-n<500},a=`none`,o=e=>{a=function(e,t){let n=!1;return K_(e,()=>{n=!0,e.preventDefault(),t&&e.stopPropagation()}),n}(e,r())?`checkMark`:`content`},s=()=>{a===`content`&&J_(e),a=`none`};return ed(e.registerCommand(W_,()=>(m_(`check`),!0),1),e.registerCommand(kn,t=>Z_(t,e,!1),1),e.registerCommand(On,t=>Z_(t,e,!0),1),e.registerCommand(Nn,()=>X_(e)!=null&&(e.getRootElement()?.focus(),!0),1),e.registerCommand(jn,t=>{let n=X_(e);return!(n==null||!e.isEditable()||(e.update(()=>{let e=Ls(n);Z(e)&&(t.preventDefault(),e.toggleChecked())}),0))},1),e.registerCommand(En,t=>X_(e)===null?e.read(`latest`,()=>{let n=q();if(G(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=U(n,e=>j(e)&&!e.isInline());if(Z(a)){let r=a.getParent();if(X(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&Bc(n)!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}):(J_(e),!1),1),e.registerRootListener(t=>{if(t!==null)return ed(nd(t,{click:e=>{s(),(e=>{i(e)||q_(e,r())})(e)},pointerup:e=>{s(),(e=>{e.pointerType===`touch`&&(i(e)||((e=>{let t=e.target;V(t)&&(t.__lexicalCheckListLastHandled=e.timeStamp)})(e),q_(e,r())))})(e)}}),nd(t,{beforeinput:()=>J_(e),focusin:()=>{Mt&&a===`content`&&J_(e)},keydown:t=>{U_.has(t.key)||J_(e)},mousedown:o,pointerdown:o},{capture:!0}),td(t,`touchstart`,o,{capture:!0,passive:!1}))}))}function K_(e,t){let n=e.target;if(!V(n))return;let r=n.firstChild;if(V(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=null,o=null;if(`clientX`in e)a=e.clientX;else if(`touches`in e){let t=e.touches;t.length>0&&(a=t[0].clientX,o=`touch`)}if(a==null)return;let s=n.getBoundingClientRect(),c=a/_h(n),l=n.ownerDocument.defaultView,u=l?l.getComputedStyle(n,`::before`):{width:`0px`},d=parseFloat(u.width),f=o===`touch`||`pointerType`in e&&e.pointerType===`touch`?32:0;(n.dir===`rtl`?c<s.right+f&&c>s.right-d-f:c>s.left-f&&c<s.left+d+f)&&t()}function q_(e,t){K_(e,()=>{if(V(e.target)){let n=e.target,r=ys(n);r!=null&&r.isEditable()&&r.update(()=>{let e=Ls(n);Z(e)&&(t?(fc(`skip-selection-focus`),fc(`skip-dom-selection`)):n.focus(),e.toggleChecked())})}})}function J_(e){let t=e.getRootElement(),n=t?Bc(t):null;t!==null&&V(n)&&Y_(n)&&t.focus({preventScroll:!0})}function Y_(e){let t=e.parentNode;return e.tagName===`LI`&&t!=null&&t.__lexicalListType===`check`}function X_(e){let t=e.getRootElement(),n=t?Bc(t):null;return V(n)&&Y_(n)?n:null}function Z_(e,t,n){let r=X_(t);if(r!=null){let i=null;t.update(()=>{let a=Ls(r);if(!Z(a))return;let o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&Z(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;Z(n);){let e=t?n.getLastChild():n.getFirstChild();if(!X(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(a,n);o!=null&&(o.selectStart(),t.getElementByKey(o.__key)!=null&&(e.preventDefault(),i=o.__key))},{onUpdate:()=>{(i===null?null:t.getElementByKey(i))?.focus()}})}return!1}var Q_=/* @__PURE__ */ O(`UPDATE_LIST_START_COMMAND`),$_=/* @__PURE__ */ O(`INSERT_UNORDERED_LIST_COMMAND`),ev=/* @__PURE__ */ O(`INSERT_ORDERED_LIST_COMMAND`),tv=/* @__PURE__ */ O(`REMOVE_LIST_COMMAND`);function nv(e,t){return ed(e.registerCommand(ev,()=>(m_(`number`),!0),1),e.registerCommand(Q_,e=>{let{listNodeKey:t,newStart:n}=e,r=I(t);return!!X(r)&&(r.getListType()===`number`&&(r.setStart(n),x_(r)),!0)},1),e.registerCommand($_,()=>(m_(`bullet`),!0),1),e.registerCommand(tv,()=>(b_(),!0),1),e.registerCommand(pn,()=>w_(!(!t||!t.restoreNumbering)),1),e.registerCommand(Mn,e=>{let t=q();if(!G(t)||!t.isCollapsed())return!1;let{anchor:n}=t;if(n.offset!==0)return!1;let r=n.getNode();for(;!Z(r);){if(r.getPreviousSibling()!==null)return!1;let e=r.getParent();if(e===null)return!1;r=e}return!(!Z(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(R_,e=>{let t=e.getFirstChild();if(t){if(P(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=q();G(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(So,e=>{let t=e.getParent();if(Z(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function rv(e){let t=e=>{let t=e.getParent();if(X(e.getFirstChild())||!X(t))return;let n=U(e,e=>Z(e)&&X(e.getParent())&&Z(e.getPreviousSibling()));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(Z(n)){let r=n.getPreviousSibling();if(Z(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;X(n);){let e=n.getLastChild();if(!Z(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(X(n)){let r=s_(n);r+1<s_(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(N_,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(X(e)){for(let r of e.getChildren())if(Z(r)){t(r);let e=r.getFirstChild();X(e)&&n.push(e)}}}})}lv.peek=uv;var iv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],av={canContainEols:[`highlight`],enter:{highlight:ov},exit:{highlight:sv}};function ov(e){this.enter({type:`highlight`,children:[]},e)}function sv(e){this.exit(e)}var cv={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:iv}],handlers:{highlight:lv}};function lv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function uv(){return`=`}var dv={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function fv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function pv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function mv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function hv(e){return mv(e)||fv(e)}var gv=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function _v(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let d=(c?c.line:0)||1,f=(c?c.column:0)||1,p=h(),m;for(a--;++a<=e.length;)if(m===10&&(f=(l?l[o]:0)||1),m=e.charCodeAt(a),m===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(m),f++;continue}let o=a+1,c=o,l=o,d;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(d=`hexadecimal`,l=++c):d=`decimal`}else d=`named`;let v=``,y=``,b=``,x=d===`named`?hv:d===`decimal`?fv:pv;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!x(t))break;b+=String.fromCharCode(t),d===`named`&&ae.includes(b)&&(v=b,y=u(b))}let S=e.charCodeAt(l)===59;if(S){l++;let e=d===`named`&&u(b);e&&(v=b,y=e)}let C=1+l-o,ee=``;if(S||n.nonTerminated!==!1){if(!b)d!==`named`&&g(4,C);else if(d===`named`){if(S&&!y)g(5,1);else if(v!==b&&(l=c+v.length,C=1+l-c,S=!1),!S){let t=v?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(g(t,C),y=``):hv(n)?y=``:g(t,C)}else g(t,C)}ee=y}else{S||g(2,C);let e=Number.parseInt(b,d===`hexadecimal`?16:10);if(vv(e))g(7,C),ee=`�`;else if(e in dv)g(6,C),ee=dv[e];else{let t=``;yv(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),ee=t+String.fromCharCode(e)}}}if(ee){_(),p=h(),a=l-1,f+=l-o+1,i.push(ee);let t=h();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,ee,{start:p,end:t},e.slice(o-1,l)),p=t}else b=e.slice(o-1,l),s+=b,f+=b.length,a=l-1}else m===10&&(d++,o++,f=0),Number.isNaN(m)?_():(s+=String.fromCharCode(m),f++);return i.join(``);function h(){return{line:d,column:f,offset:a+((c?c.offset:0)||0)}}function g(e,t){let r;n.warning&&(r=h(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,gv[e],r,e))}function _(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:p,end:h()}),``)}}function vv(e){return e>=55296&&e<=57343||e>1114111}function yv(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var bv=` `;function xv(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:i,mdxJsxFlowTagClosingMarker:a,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:s,mdxJsxTextTag:i,mdxJsxTextTagClosingMarker:a,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:s},exit:{mdxJsxFlowTagClosingMarker:c,mdxJsxFlowTagNamePrimary:l,mdxJsxFlowTagNameMember:u,mdxJsxFlowTagNameLocal:d,mdxJsxFlowTagExpressionAttribute:m,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:h,mdxJsxFlowTagAttributeNameLocal:g,mdxJsxFlowTagAttributeValueLiteral:_,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:v,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:y,mdxJsxFlowTag:b,mdxJsxTextTagClosingMarker:c,mdxJsxTextTagNamePrimary:l,mdxJsxTextTagNameMember:u,mdxJsxTextTagNameLocal:d,mdxJsxTextTagExpressionAttribute:m,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:h,mdxJsxTextTagAttributeNameLocal:g,mdxJsxTextTagAttributeValueLiteral:_,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:v,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:y,mdxJsxTextTag:b}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function i(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function a(e){if(this.data.mdxJsxTagStack.length===0)throw new r("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function o(e){if(this.data.mdxJsxTag.close)throw new r(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function s(e){if(this.data.mdxJsxTag.close)throw new r("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function c(){let e=this.data.mdxJsxTag;e.close=!0}function l(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function d(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function f(e){let n=this.data.mdxJsxTag;o.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function p(e){let n=this.data.mdxJsxTag;o.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=_v(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function v(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function y(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function b(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,i=n[n.length-1];if(t.close&&i.name!==t.name)throw new r("Unexpected closing tag `"+C(t)+"`, expected corresponding closing tag for `"+C(i)+"` ("+te(i)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,x),t.selfClosing||t.close?this.exit(e,S):n.push(t)}function x(e,t){let n=this.data.mdxJsxTagStack,i=n[n.length-1],a=e?" before the end of `"+e.type+"`":``,o=e?{start:e.start,end:e.end}:void 0;throw new r("Expected a closing tag for `"+C(i)+"` ("+te({start:t.start,end:t.end})+`)`+a,o,`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e,t){let n=this.data.mdxJsxTag;throw new r("Expected the closing tag `"+C(n)+"` either after the end of `"+t.type+"` ("+te(t.end)+") or another opening tag after the start of `"+t.type+"` ("+te(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function C(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Sv(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=Ev,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=Tv(wv(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null){if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&ie(e,n)>ie(e,o)?o:n;s=t+oe(e,{subset:[t]})+t}}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+bv+m[e];b+=y.move(`
|
|
12
|
-
`+
|
|
11
|
+
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Jf(e){let t=[];return qf(e,{linebreak:()=>t.push(su()),tab:()=>t.push(os()),text:e=>t.push(jo(e))}),t}function Yf(e){let t=[];for(let n of e)cu(n)||(!j(n)&&!M(n)||n.isInline()?t.push(n):j(n)&&t.push(...Yf(n.getChildren())));return t}function Xf(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=q();G(r)&&(n=r),G(n)||E(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Xc(a)&&fp(a)===null;){let e=a;if([a,o]=Zf(a,o,t),e.is(a))break}return[a,o]}function Zf(e,t,n=!1){let r=e.getParent();if(!r){let e=F();return L().append(e),e.select(),[L(),0]}if(P(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!j(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new cf($d(e.__key,t,`element`),$d(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function Qf(e){return cu(e)||_c(e)||P(e)||e.isParentRequired()}function $f(e){let t=F(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(Qf(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(cu(i)&&(a===void 0||!Qf(a)))continue}n.append(i)}else t.append(i),n=null}return t}function ep(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=No(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!Wo(c)){for(let e of c){l=!1;let{origin:t}=e;if(M(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of em(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Bp(e))e.origin.isInline()||(c=e);else{if(j(e.origin))continue;M(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&M(c.origin)&&c.origin.isKeyboardSelectable()){let e=Nf();return e.add(c.origin.getKey()),R(e),!0}return c=Uo(c),s&&Po(e.anchor,c),Po(e.focus,c),l||!o}function tp(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function np(e){let t=W();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=Pu(),r=t._movedNodes||=/* @__PURE__ */ new WeakMap,i=r.get(n);i===void 0&&(i=/* @__PURE__ */ new Set,r.set(n,i)),i.add(e.__key)}}function rp(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function ip(e){fp(e)!==null&&E(380,e.__key,String(fp(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();np(e);let r=e.getPreviousSibling(),i=e.getNextSibling();tp(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function ap(e,t){let n=t&&e.getParent(),r=t&&n&&zf(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),ip(e),t&&n&&r!==-1&&Bf(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function op(e,t,n,r){Mu();let i=t===`next`;Sc(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=q(),c=r&&G(s)?s:null,l=ap(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||zf(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(rp(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(Bf(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function sp(e,t,n){Mu();let{origin:r,direction:i}=e,a=i===`next`,o=pp(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(j(s))return a?s.select(0,0):s.select();if(P(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function cp(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var lp=/* @__PURE__ */ new Map;function up(e){return j(e)||M(e)}function dp(e){return j(e)||M(e)}function fp(e){let t=e.getLatest();return dp(t)?t.__slotHost:null}function pp(e){let t=fp(e);if(t===null)return null;let n=I(t);return j(n)||M(n)||E(370),n}function mp(e){let t=pp(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of _p(t))if(r===n)return e;return null}function hp(e){let t=e.getLatest();for(;t!==null;){if(fp(t)!==null)return t;t=t.getParent()}return null}function gp(e){if(e===null)return null;let t=G(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:hp(t)}function _p(e){let t=e.getLatest();return up(t)&&t.__slots!==null?t.__slots:lp}function vp(e){return Array.from(_p(e).keys())}function yp(e,t){let n=_p(e).get(t);return n===void 0?null:I(n)}var bp=[`__proto__`,`constructor`,`prototype`],xp=Symbol(`slotMapOwner`);function Sp(e){let t=e.__slots;return t!==null&&t[xp]===e||(t=new Map(t),t[xp]=e,e.__slots=t),t}var Cp=/* @__PURE__ */ new WeakMap,wp=[];function Tp(e){for(let{ownNodeConfig:t}of Hl(e)){let e=t&&t.slots;if(e)return e}return wp}function Ep(e){let t=``;for(let n of _p(e).values()){let e=I(n);e!==null&&(t+=e.getTextContent())}return t}function Dp(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Op(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||E(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!j(n)&&!M(n)||n.isInline())&&E(374,n.__key);let i=e.getWritable(),a=Sp(i),o=a.get(t);o!==void 0&&kp(o);let s=n.getWritable(),c=pp(s);if(c!==null){let e=mp(s);e!==null&&Sp(c.getWritable()).delete(e),s.__slotHost=null}return ip(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Cp.get(e);if(t===void 0){let n=Tp(e),r=/* @__PURE__ */ new Map;for(let t of n)bp.includes(t)&&E(371,e.name,t),r.has(t)&&E(372,e.name,t),r.set(t,r.size);t=r,Cp.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Dp(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Dp(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),W()._slotsUsed=!0,Pu()._slotsUsed=!0,i}function kp(e){let t=I(e);if(t===null)return;let n=t.getWritable();dp(n)||E(377,e),n.__slotHost=null,n.remove()}var Ap={next:`previous`,previous:`next`},jp=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return rm({hasNext:zp,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return J(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return J(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=/* @__PURE__ */ new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&E(263,Array.from(o).join(` `))}else i.insert(e);i=J(e,this.direction)}for(let e of o.values())e.remove();return this}},Mp=class e extends jp{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:qp(e,this.direction)}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pp(this.direction);return J(this.getNodeAtCaret(),e)||qp(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Np={root:N,shadowRoot:B};function Pp(e){return Ap[e]}function Fp(e,t=`root`){return e===null||Np[t](e)?null:fp(e)===null?e:null}var Ip=class e extends jp{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:J(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return j(this.origin)?qp(this.origin,this.direction):null}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Pp(this.direction);return J(this.getNodeAtCaret(),e)||qp(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Lp)&&this.direction===t.direction&&this.origin.is(t.origin)}},Lp=class e extends jp{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Wp(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return J(Fp(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Wp(this.origin,Pp(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Ip||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return J(this.origin,this.direction)}};function Rp(e){return e instanceof Lp}function zp(e){return e instanceof Ip}function Bp(e){return e instanceof Mp}var Vp={next:class extends Lp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Lp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Hp={next:class extends Ip{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Ip{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Up={next:class extends Mp{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Mp{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function J(e,t){return e?new Hp[t](e):null}function Wp(e,t,n){return e?new Vp[t](e,Gp(e,n)):null}function Gp(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Tt(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Kp(e,t){return new Zp(e,t)}function qp(e,t){return j(e)?new Up[t](e):null}function Jp(e){return e&&e.getChildCaret()||e}function Yp(e){return e&&Jp(e.getAdjacentCaret())}var Xp=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return Rp(e)&&Rp(t)&&e.isSameNodeCaret(t)?[Kp(e,t.offset-e.offset),null]:[Rp(e)?Qp(e,`anchor`):null,Rp(t)?Qp(t,`focus`):null]}iterNodeCarets(e=`root`){let t=Rp(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Rp(n),i=t=>t.isSameNodeCaret(n)?null:Yp(t)||t.getParentCaret(e);return rm({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Zp=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Wp(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Qp(e,t){let{direction:n,origin:r}=e;return Kp(e,Gp(r,t===`focus`?Pp(n):n)-e.offset)}function $p(e,t){return e.direction===t?e:e.getFlipped()}function em(e){return nm(e,$p(qp(L(),Pp(e.direction)),e.direction))}function tm(e){return nm(e,e)}function nm(e,t){return e.direction!==t.direction&&E(265),new Xp(e,t,e.direction)}function rm(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function im(e,t){let n=um(e.origin,t.origin);switch(n===null&&E(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return om(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return sm(n)}}function am(e){return e.getParent()||pp(e)}function om(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function sm(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function cm(e,t){return t.is(e)}function lm(e){return j(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function um(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=/* @__PURE__ */ new Map;for(let[t,r]=lm(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=lm(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(cm(e,r)||E(276),{commonAncestor:r,type:`ancestor`}):i===null?(cm(t,r)||E(277),{commonAncestor:r,type:`descendant`}):((j(a)||cm(e,a))&&(j(i)||cm(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||E(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function dm(e){return e}function fm(...e){return e}function pm(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function mm(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function hm(e,...t){let n=mm(...t);n.length>0&&e.classList.add(...n)}function gm(e,...t){let n=mm(...t);n.length>0&&e.classList.remove(...n)}function _m(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var vm={tag:$l};function ym(){let e=L();e.isEmpty()&&e.append(F())}var bm={config:{setOptions:vm,updateOptions:vm},init:({$initialEditorState:e=ym})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Yl(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[lo,So,au,as,ts]};function Y(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function xm(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Sm=/* @__PURE__ */ xm(),Cm=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);function wm(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!Cm.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=wm(n[e],r[e]));return e}return t}function Tm(e){return e.id===0}function Em(e){return e.id===2}var Dm=/* @__PURE__ */ new Set,Om=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=/* @__PURE__ */ new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):pm;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;Em(t)||Y(306,String(t.id));let 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(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&Y(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&Y(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&Y(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&Y(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&Y(311),this._signal}getInitResult(){this.extension.init===void 0&&Y(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||Y(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||Y(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Y(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Y(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||Y(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Dm}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||Y(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},km=Symbol.for(`@lexical/extension/LexicalBuilder`);function Am(...e){return Fm.fromExtensions(e).buildEditor()}function jm(){}function Mm(e){throw e}function Nm(e){return Array.isArray(e)?e:[e]}var Pm=Sm,Fm=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=/* @__PURE__ */ new Map,this.incomingEdges=/* @__PURE__ */ new Map,this.extensionNameMap=/* @__PURE__ */ new Map,this.conflicts=/* @__PURE__ */ new Map,this.PACKAGE_VERSION=Pm,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Nm(bm)];for(let e of t)n.push(Nm(e));return new e(n)}static maybeFromEditor(t){let n=t[km];return n&&(n.PACKAGE_VERSION!==Pm&&Y(292,n.PACKAGE_VERSION,Pm),n instanceof e||Y(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Y(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(gu({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[km]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=jm;function t(){try{e()}finally{e=jm}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=ed(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Y(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,/* @__PURE__ */ new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,/* @__PURE__ */ new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Y(296);let[t]=Nm(e);typeof t.name!=`string`&&Y(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Y(298,t.name),!n){n=new Om(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Y(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Y(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Nm(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(Em(i))return;let a=n.extension.name;var o;Tm(i)||Y(300,a,r||`[unknown]`),Tm(o=i)||Y(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||Y(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Tm(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Y(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return ed(...r)}buildCreateEditorArgs(){let e={},t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of _m(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Y(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&wm(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=Mm,e}};function Im(e,t){let n=Fm.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function Lm(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=mt(i===void 0?e[r]:i)}return n}function Rm(e){return JSON.stringify([e.exportJSON(),j(e)?e.getChildrenKeys():null])}function zm(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=/* @__PURE__ */ new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(ru);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(G(a)&&G(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||N(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&P(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!P(l)||!P(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(Ql),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>Rm(e))===n.read(()=>Rm(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(G(a)&&G(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!P(r)||!P(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function Bm(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function Vm(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function Hm(e,t,n,r=Date.now,i,a=null){let o=zm(e,n,r),s=()=>{i&&i(t)};return s(),ed(e.registerCommand(Sn,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=Bm(o,a);t!==null&&(r.push(t),e.dispatchCommand(Xn,!0))}i.length===0&&e.dispatchCommand(Zn,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Cn,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=Bm(o,a);t!==null&&(i.push(t),e.dispatchCommand(Zn,!0))}r.length===0&&e.dispatchCommand(Xn,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Jn,()=>(Vm(t,i),!1),0),e.registerCommand(Yn,()=>(Vm(t,i),e.dispatchCommand(Xn,!1),e.dispatchCommand(Zn,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Xn,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Zn,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function Um(){return{current:null,redoStack:[],undoStack:[]}}var Wm={build:(e,{delay:t,createInitialHistoryState:n,disabled:r,maxDepth:i,now:a},o)=>({...Lm({delay:t,disabled:r,historyState:n(e),maxDepth:i,now:a}),...o.getInitResult()}),config:{createInitialHistoryState:Um,delay:300,disabled:typeof window>`u`,maxDepth:null,now:()=>Date.now()},init:()=>({canRedo:mt(!1),canUndo:mt(!1)}),name:`@lexical/history/History`,register:(e,t,n)=>{let{canUndo:r,canRedo:i}=n.getInitResult(),a=n.getOutput(),o=e=>tt(()=>{r.value=e!=null&&e.undoStack.length>0,i.value=e!=null&&e.redoStack.length>0});return Ct(()=>{if(!a.disabled.value)return Hm(e,a.historyState.value,a.delay,()=>a.now.peek()(),o,a.maxDepth);o(null)})}};function Gm(e){let t=e?Im(e,`@lexical/extension/HMR`):void 0;return t?t.output.restoreCount.value:0}var Km={build:(e,{disabled:t,parentEditor:n})=>Lm({disabled:t,parentEditor:n||e._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[[Wm,{disabled:!0}]],name:`@lexical/history/SharedHistory`,register:(e,t,n)=>Ct(()=>{let{disabled:t,parentEditor:r}=n.getOutput();if(!t.value){let{output:t}=n.getDependency(Wm);Gm(e),Gm(r.value);let i=function(e){return e?Im(e,Wm.name):null}(r.value);if(!i)return;let a=i.output;tt(()=>{t.delay.value=a.delay.value,t.historyState.value=a.historyState.value,t.now.value=a.now.value,t.maxDepth.value=a.maxDepth.value,t.disabled.value=a.disabled.value})}})};function qm(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Jm(e){let t=H().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Ym(e){let t=N(e)?e:e.getParent();return t&&Jm(t)}function Xm(e){let t=Ym(e);return t!==null&&t.direction===`rtl`}function Zm(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!Ss(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!G(e)||i.type!==`element`&&a.type!==`element`?void 0:Yo(Lo(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=al(t)),t.__text=l)}return t}function Qm(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return j(t)||qm(177),e.offset===t.getChildrenSize()}function $m(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function eh(e,t,n){let r=No(e,n);if(Wo(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function th(e,t,n=$m){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=/* @__PURE__ */ new Map;if(r){let[t,n]=r,s=U(t.getNode(),Xc);a=U(n.getNode(),Xc);let c=e.isBackward()?`previous`:`next`;i=j(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!j(r)||!r.isEmpty())&&eh(e,t,n)}(n,a,Pp(c)),j(s)&&o.set(s.getKey(),s),j(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(j(t)&&Xc(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=U(t,Xc);j(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(pp(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function nh(e){let t=rh(e);return t!==null&&t.writingMode===`vertical-rl`}function rh(e){let t=e.anchor.getNode();return j(t)?Jm(t):Ym(t)}function ih(e,t){let n=nh(e)?!t:t;oh(e)&&(n=!n);let r=No(e.focus,n?`previous`:`next`);if(Wo(r))return!1;if(Rp(r)&&!ss(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(P(e)&&!ss(e))return!0}for(let e of em(r)){if(Bp(e))return!e.origin.isInline();if(!j(e.origin)){if(M(e.origin))return!0;break}}return!1}function ah(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function oh(e){let t=rh(e);return t!==null&&t.direction===`rtl`}function sh(e,t,n){let r=oh(e),i;i=nh(e)||r?!n:n,ah(e,t,i,`character`)}function ch(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function lh(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function uh(e){let t=U(e,e=>j(e)&&!e.isInline());return j(t)||ch(4,e.__key),t}function dh(e){let t=q()||Rf(),n;if(G(t))n=No(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=J(r,`next`))}n||=qp(L(),`previous`).getFlipped().insert(F())}let r=$o(e,n,Wo(i=n)||qo(Rp(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=Yp(r);return Fo(tm(Bp(a)?Uo(a):r)),e.getLatest()}function fh(e,t){let n=t();return e.replace(n),n.append(e),n}function ph(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function mh(e){let t=null;if(ph(e,DragEvent)?t=e.dataTransfer:ph(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function hh(e){let t=q();if(!G(t))return!1;let n=/* @__PURE__ */ new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=U(i,e=>j(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}var gh=!(Nt||!Dt)&&void 0;function _h(e,t=!1){let n=1;if(function(){if(gh===void 0){let e=document.createElement(`div`);e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`100px`,e.style.left=`-1000px`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),gh=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return gh}()||t){let t=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(t.getComputedStyle(e).getPropertyValue(`zoom`)),e=cc(e)}return n}function vh(e,t){return eh(e,t,`previous`)}function yh(e,t){return eh(e,t,`next`)}function bh(e){return Im(H(),e)}function xh(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Sh(e){if(!ws(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=/* @__PURE__ */ new Map;function r(e){let t=n.get(e);if(t===void 0){t=/* @__PURE__ */ new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!ph(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!V(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var Ch;function wh(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Th(e){return Ch&&Ch.editor===e?Ch:void 0}function Eh(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(wh(e,n))]}return t}function Dh(e,t){let n=t;for(let r of e){let[e,i]=Eh(n,r),a=e.key;if(n===t&&wh(n,e)===i)continue;let o=n===t||n===void 0?Oh(t):n;o[a]=i,n=o}return n}function Oh(e){return Object.create(e||null)}function kh(e,t){return[e,t]}function Ah(e,t,n,r=H()){let i=Ch,a=Th(r);try{return Ch={...a,editor:r,[e]:t},n()}finally{Ch=i}}function jh(e,t=()=>{}){return(n,r=H())=>i=>{let a=Th(r),o=a&&a[e],s=Dh(n,o||t(r));return s&&s!==o?Ah(e,s,i,r):i()}}function Mh(e,t,n,r){return Object.assign(gi(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var Nh=`@lexical/html/DOM`,Ph=Symbol.for(`@lexical/html/DOMExportContext`);function Fh(e,t,n){return Mh(Ph,e,t,n)}var Ih=/* @__PURE__ */ Fh(`isExport`,Boolean);function Lh(e){let t=Im(e,Nh);return t?t.output.defaults:void 0}function Rh(e){let t=Im(e,Nh);return t?t.output.runtime:void 0}function zh(e=H()){let t=Rh(e);return t?t.getSessionConfig():Zc(e)}var Bh=/* @__PURE__ */ jh(Ph,Lh),Vh=/* @__PURE__ */ new Set([`STYLE`,`SCRIPT`]);function Hh(e,t){Sh(t);let n=ws(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Vh.has(t.nodeName)){let n=Kh(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof iu&&t.insertAfter(su());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Uh(e,t=null,n=H()){return Bh([kh(Ih,!0)],n)(()=>{let r=L(),i=zh(n),a=gp(t),o=e.append.bind(e);for(let e of(j(a)?a:r).getChildren())Gh(n,e,o,t,i);return e})}function Wh(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&xh(338),Fu(e),Uh(Nc().createElement(`div`),t,e).innerHTML}function Gh(e,t,n,r=null,i=Zc(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&P(t)&&(s=Zm(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Nc().createDocumentFragment(),p=d?d():j(s)?s.getChildren():[],m=a&&K(r)&&j(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=Gh(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((V(c)||Gc(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(cu(t)&&V(e)&&Yc(e)&&n!==null&&n.nodeName===`BR`){let t=Nc().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Gc(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function Kh(e,t,n,r,i=/* @__PURE__ */ new Map,a){let o=[];if(Vh.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!B(s))&&(s!=null&&Af(s)||r);for(let e=0;e<d.length;e++)f.push(...Kh(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),Yc(e)&&(f=function(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(Af(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&Af(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,f,p?()=>{let e=new iu;return n.push(e),e}:F)),s==null){if(f.length>0)for(let e of f)o.push(e);else Yc(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&qc(e.nextSibling)&&qc(e.previousSibling)}(e)&&o.push(su())}else j(s)&&s.append(...f);return o}function qh(e,t,n=null){let r=Mc(n),i=n?Ac(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=cc(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Oc(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function Jh(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Yh={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function Xh(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var Zh=(e,t)=>{if(!G(t))return t.insertRawText(e),!0;t!==q()&&R(t);let n=e=>{let t=q();G(t)&&e(t)};return qf(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([os()])),text:e=>n(t=>t.insertText(e))}),!0},Qh={"application/x-lexical-editor":[(e,t,n)=>{try{let n=H(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return dg(n,mg(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=H();return dg(n,Hh(n,new DOMParser().parseFromString(Xh(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[Zh],"text/uri-list":[Zh]};function $h(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function eg(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&$h(e.$importMimeType[i],a,n,t))return!0}return!1}var tg={$importMimeType:Qh,$insertDataTransfer:(e,t)=>eg({$importMimeType:Qh,priority:Yh},e,t),priority:Yh},ng={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>eg(t,e,n),priority:t.priority}),config:{$importMimeType:Qh,priority:Yh},mergeConfig(e,t){let n=pm(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function rg(e,t=q()){return t??Jh(166),G(t)&&t.isCollapsed()||t.getNodes().length===0?``:Wh(e,t)}function ig(e,t=q()){return t??Jh(166),G(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(pg(e,t))}function ag(e,t,n){(function(){let e=bh(ng.name);return e?e.output:tg})().$insertDataTransfer(e,t)}var og=`application/x-lexical-drag`;function sg(e,t){let n={editorKey:t.getKey()};e.setData(og,JSON.stringify(n))}function cg(e){let t=e;if(Rp(t)){if(t.offset===0)t=Ro(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(Bp(t))t=Ro(J(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=J(e,`next`)}}}function lg(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(og);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=qh(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Ls(n.node);if(r===null)return null;if(P(r))return Wp(r,`next`,n.offset);let i=r.getParent();if(j(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=Qc(r,e,t);return n.node===a.element||i?Ko(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&Ko(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=q();if(o){if(!G(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Go(Lo(t),`next`),i=cg(e);return im(cg(n),i)<=0&&im(i,cg(r))<=0}(a,s))return e.preventDefault(),!0}let c=Uo(a),l=Rp(c)?Qo(c):c;if(l===null)return!1;let u=l.getFlipped();o&&G(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||Jh(438),n(r,Fo(tm(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of jc(t)){let t=bs(n);if(vs(t)&&t.getKey()===e&&V(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function ug(e,t){return lg(e,t,ag)}function dg(e,t,n){e.dispatchCommand(on,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(G(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=No(t,`previous`);if(r){if(Rp(r))n=r.origin;else{let e=nm(r,qp(L(),`next`).getFlipped());for(let t of e){if(P(t.origin)){n=t.origin;break}if(j(t.origin)&&!t.origin.isInline())break}}}if(n&&P(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function fg(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=j(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&P(o)&&(o=Zm(t,o,`clone`));let s=vr(o),c=j(o)?o.getChildren():[],l=s.children||[];P(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&K(t)&&j(n)?null:t;for(let r=0;r<c.length;r++){let a=c[r],o=fg(e,u,a,l);!i&&j(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=vp(o);if(t.length>0){let n={};for(let r of t){let t=yp(o,r);t===null&&Jh(366,o.constructor.name,r);let i=[];fg(e,null,t,i),(i.length!==1||j(t)&&t.excludeFromCopy(`clone`))&&Jh(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e<l.length;e++)r.push(l[e]);return i}function pg(e,t){let n=[],r=L(),i=gp(t),a=(j(i)?i:r).getChildren();for(let r=0;r<a.length;r++)fg(e,t,a[r],n);return{namespace:e._config.namespace,nodes:n}}function mg(e){let t=[];for(let n of e)t.push(Hu(n));return t}var hg=null;async function gg(e,t,n){if(hg!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(_g(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Ec(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Gn,r=>(ph(r,ClipboardEvent)&&(o(),hg!==null&&(i.clearTimeout(hg),hg=null),t(_g(e,r,n))),!0),4);hg=i.setTimeout(()=>{o(),hg=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function _g(e,t,n){if(n===void 0){let t=Ec(e._window),r=q();if(!r||r.isCollapsed()||!t)return!1;let i=Ic(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!_s(e,a,o))return!1;n=yg(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(bg(r,n),!0)}var vg=[[`text/html`,rg],[`application/x-lexical-editor`,ig]];function yg(e=q()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Cg(i,t);e!==null&&(n[r]=e)}return n}(xg(),e)}function bg(e,t){for(let[n]of vg)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function xg(e=H()){let t=Im(e,wg.name);return t?t.output:Sg}var Sg={"application/x-lexical-editor":[(e,t)=>e?ig(H(),e):t()],"text/html":[(e,t)=>e?rg(H(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Cg(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var wg={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:Sg},mergeConfig(e,t){let n=pm(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},Tg=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Eg(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Tg.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Dg(e,t,n,r,i){let a=Eg(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Og(e,t){e.__tag=t.__tag}var kg=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Dg(t.indent,0,0,1/0),e.__textFormat=Eg(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Og}},Ag=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Dg(t.indent,0,0,1/0),e.__textFormat=Eg(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},jg=/* @__PURE__ */ D(`DRAG_DROP_PASTE_FILE`),Mg=/* @__PURE__ */ gi(`shadowRoot`,{parse:/* @__PURE__ */ ai()}),Ng=class extends ao{$config(){return this.config(`quote`,{children:`inline`,extends:ao,generated:Ag,importDOM:{blockquote:()=>({conversion:Bg,priority:0})},stateConfigs:[{flat:!0,stateConfig:Mg}]})}isShadowRoot(){return _i(this,Mg)}setIsShadowRoot(e){return vi(this,Mg,e)}createDOM(e){let t=Nc().createElement(`blockquote`);return hm(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Pg().updateFromJSON(e)}insertNewAfter(e,t){let n=F();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=F();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Pg(e){let t=xc(new Ng);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function Fg(e){return e instanceof Ng}var Ig=/* @__PURE__ */ li()({tag:/* @__PURE__ */ di(/* @__PURE__ */ oi([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),Lg=class extends ao{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:ao,generated:kg,importDOM:{h1:()=>({conversion:zg,priority:0}),h2:()=>({conversion:zg,priority:0}),h3:()=>({conversion:zg,priority:0}),h4:()=>({conversion:zg,priority:0}),h5:()=>({conversion:zg,priority:0}),h6:()=>({conversion:zg,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Rg(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Rg(e)?{conversion:()=>({node:Vg(`h1`)}),priority:3}:null},json:Ig})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Nc().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];hm(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(V(t)){this.isEmpty()&&t.append(Nc().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&yh(e.anchor,this),r=e&&vh(e.anchor,this),i=n||!e?F():Vg(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=F();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=F();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function Rg(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function zg(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=Vg(t),ol(e,n),cl(n,e),sl(n,e)),{node:n}}function Bg(e){let t=Pg();return cl(t,e),ol(e,t),sl(t,e),{node:t}}function Vg(e=`h1`){return xc(new Lg(e))}function Hg(e){return e instanceof Lg}function Ug(e){return M(Ls(e))&&!(V(e)&&e.hasAttribute(`data-lexical-slot`))}function Wg(e){let t=e.focus;return t.key===`root`&&t.offset===L().getChildrenSize()}function Gg(e){let t=e.focus;return t.key===`root`&&t.offset===0}function Kg(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?Wg(e):Gg(e)))return!1;let r=e.focus.offset;return wc(L().getChildAtIndex(n?r-1:r))}function qg(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(P(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&P(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Jg={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function Yg(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=No(e.focus,t),r=U(n.origin,yc);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!mc(i,r))return!1;let a=nm(n,J(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=nm(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!zp(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of em(J(r,t))){if(!e.origin.is(c.getParent())){if(wc(e.origin)){let e=J(c,t);return Fo(nm(e,e)),!0}break}if(!yc(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=No(e.anchor,t).getNodeAtCaret();return!(!yc(n)||n.isInline()||(Fo(tm(Uo(qp(n,t)))),0))}(e,t)}function Xg(e){return M(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function Zg(e){let t=Nf();t.add(e),R(t)}function Qg(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=No(n,i);if(n.type===`element`&&j(r)&&B(r)){let e=a.getNodeAtCaret();return!(e===null||!Xg(e)||(Zg(e.__key),0))}let o=U(j(r)?r:r.getParentOrThrow(),e=>j(e)&&!e.isInline()&&B(e.getParent()));if(o===null)return!1;let s=J(o,i).getNodeAtCaret();if(s===null||!Xg(s))return!1;if(o.getTextContentSize()===0)return Zg(s.__key),!0;let c=H().getRootElement();if(c===null)return!1;let l=Ec(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return $g(l,u,d,f,p),!1;let g=Ls(m);return $g(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!mc(g,o))&&(Zg(s.__key),!0)}function $g(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function e_(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=U(j(n)?n:n.getParentOrThrow(),e=>j(e)&&!e.isInline());if(r===null)return!1;let i=H(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(j(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=J(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!j(c)){if(t){let e=r.getFirstDescendant();P(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(P(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=Ec(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=qh(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(P(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function t_(e,t){let n=J(e,t),r=n.getAdjacentCaret();r!==null&&j(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Fo(tm(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function n_(e,t){let n=e.getNodes().map(e=>J(e,`next`)).sort(im),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e<n.length-1;e++)if(!n[e+1].origin.is(n[e].getNodeAtCaret()))return!1;return Fo(Go(nm(Ro(r),i),t)),Zu(),!0}function r_(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>J(e,`next`)).sort(im),a=(t?i[0]:i[i.length-1]).origin,o=U(a,e=>e!==a&&j(e)&&!e.isInline())??L(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function i_(e,t){return e.length>0&&!t}function a_(e,t=mt(Jg),n=mt(i_)){return ed(e.registerCommand(sn,n=>{let r=q();if(K(r)){let t=n.target;if(V(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return G(r)&&qg(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(fn,e=>{let t=q();return G(t)?(t.deleteCharacter(e),!0):!!K(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(vn,e=>{let t=q();return!!G(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(yn,e=>{let t=q();return!!G(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(hn,t=>{let n=q();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)ag(r,n,e);else if(G(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(_n,()=>{let e=q();return!!G(e)&&(e.removeText(),!0)},0),e.registerCommand(bn,e=>{let t=q();return!(!G(t)&&!K(t)||(ff(t,e),0))},0),e.registerCommand(xn,e=>{let t=q();return!(!G(t)&&!K(t)||(df(t,e),0))},0),e.registerCommand(Vn,e=>{let t=q();if(!G(t)&&!K(t))return!1;let n=t.getNodes();for(let t of n){let n=U(t,e=>j(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(pn,e=>{let t=q();return!!G(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(mn,()=>{let e=q();return!!G(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(Ln,()=>{let e=os(),t=q();return G(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Kf([e]),!0},0),e.registerCommand(Rn,()=>hh(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(zn,()=>hh(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(kn,e=>{let t=q();if(K(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!n_(t,`previous`))return e.preventDefault(),t_(n[0],`previous`),!0;t=q()}}return G(t)&&(Gg(t)||!e.shiftKey&&Yg(t,`previous`)||!e.shiftKey&&Qg(t,!0)||!e.shiftKey&&e_(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(An,e=>{let t=q();if(K(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!n_(t,`next`))return e.preventDefault(),t_(n[0],`next`),!0;t=q()}}return G(t)&&(Wg(t)||!e.shiftKey&&Yg(t,`next`)||!e.shiftKey&&Qg(t,!1)||!e.shiftKey&&e_(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(Dn,e=>{let n=q();if(K(n)){let t=n.getNodes();if(t.length>0){let r=Xm(t[0])?`next`:`previous`;if(!e.shiftKey||!n_(n,r))return e.preventDefault(),t_(t[0],r),!0;n=q()}}if(!G(n))return!1;let r=Xm(n.anchor.getNode())?`next`:`previous`;if(Kg(n,r)||!e.shiftKey&&Yg(n,r))return e.preventDefault(),!0;if(e.shiftKey||qg(n,`arrow`,`start`,t.peek()),ih(n,!0)){let t=e.shiftKey;return e.preventDefault(),sh(n,t,!0),!0}return!1},0),e.registerCommand(Tn,e=>{let n=q();if(K(n)){let t=n.getNodes();if(t.length>0){let r=Xm(t[0])?`previous`:`next`;if(!e.shiftKey||!n_(n,r))return e.preventDefault(),t_(t[0],r),!0;n=q()}}if(!G(n))return!1;let r=Xm(n.anchor.getNode())?`previous`:`next`;if(Kg(n,r)||!e.shiftKey&&Yg(n,r))return e.preventDefault(),!0;if(e.shiftKey||qg(n,`arrow`,`end`,t.peek()),ih(n,!1)){let t=e.shiftKey;return e.preventDefault(),sh(n,t,!1),!0}return!1},0),e.registerCommand(Nn,t=>{let n=q();if(!K(n)&&Ug(t.target))return!1;if(G(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(N(n))return!1;let r=uh(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(zn);if(Lt&&Ft)return!1}else if(!K(n))return!1;return t.preventDefault(),e.dispatchCommand(fn,!0)},0),e.registerCommand(Fn,t=>{let n=q();return!(!K(n)&&Ug(t.target))&&!(!G(n)&&!K(n))&&(t.preventDefault(),e.dispatchCommand(fn,!1))},0),e.registerCommand(jn,n=>{let r=q();if(K(r)){let e=r.getNodes();e.length===1&&M(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!G(r))return!1;if(qg(r,`enter`,`both`,t.peek()),n!==null){if((Lt||zt||Ht)&&Ft)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(pn,!1)}return e.dispatchCommand(mn)},0),e.registerCommand(Pn,()=>!!G(q())&&(e.blur(),!0),0),e.registerCommand(Bn,t=>{let[,n]=mh(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=qh(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=Ls(t);if(n!==null){let t=Mf();if(P(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}R(Ia(t))}}return!(!e.dispatchCommand(jg,n)&&Lt&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return ug(t,e)},0),e.registerCommand(Hn,t=>{let[n]=mh(t),r=q();return!(n&&!G(r)||(G(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(bg(t.dataTransfer,yg(r)),sg(t.dataTransfer,e)),0))},0),e.registerCommand(Un,t=>{let[n]=mh(t),r=q();if(n&&!G(r))return!1;let i=t.clientX,a=t.clientY,o=qh(i,a,e.getRootElement());return o!==null&&M(Ls(o.node))&&t.preventDefault(),!0},0),e.registerCommand(qn,()=>{let e=q();return ec(G(e)&&hp(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Gn,t=>!gs(t)&&(gg(e,ph(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Kn,t=>!gs(t)&&(async function(e,t){t.update(()=>{let e=q();G(e)&&!e.isCollapsed()&&pf(e)},{discrete:!0,tag:`cut`}),await gg(t,ph(e,ClipboardEvent)?e:null),t.update(()=>{let e=q();G(e)?e.removeText():K(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(gn,t=>{let[,r,i]=mh(t);return!(!n.peek()(r,i)||!e.dispatchCommand(jg,r))||!gs(t)&&q()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=q(),r=ph(e,InputEvent)||ph(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&ag(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Mn,()=>{let e=q();return G(e)&&qg(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(In,()=>{let e=q();return G(e)&&qg(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(En,e=>{let t=q();if(K(t))return r_(t,!1,e);if(!G(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!j(r))return!1;let i=r.getFirstChild();if(!M(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(On,e=>{let t=q();if(K(t))return r_(t,!0,e);if(!G(t))return!1;let{anchor:n,focus:r}=t,i=U(r.getNode(),e=>j(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!M(a)||!a.isInline()||U(n.getNode(),e=>j(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function o_(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function s_(e){let t=1,n=e.getParent();for(;n!=null;){if(Z(n)){let e=n.getParent();if(X(e)){t++,n=e.getParent();continue}o_(40)}return t}return t}function c_(e){let t=e.getParent();X(t)||o_(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),X(r)&&(n=r);return n}function l_(e){let t=[],n=e.getChildren().filter(Z);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();X(i)?t=t.concat(l_(i)):t.push(r)}return t}function u_(e){return Z(e)&&X(e.getFirstChild())}function d_(e,t){return t.getValue()}function f_(e,t){return Z(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function p_(e,t){return X(e)?bc(e).setListType(t):I_(t)}function m_(e){let t=q();if(t!==null){let n=t.getNodes();if(G(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(B(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=F();i.append(e),n=e.select().getNodes()}}else if(f_(i,n)){if(B(a)){let t=I_(e);i.replace(t);let n=H_();j(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(Z(i)){let t=i.getParentOrThrow();if(pp(t)===null){let n=p_(t,e);h_(n,t.getChildren()),t.replace(n)}}return}}let r=/* @__PURE__ */ new Set;for(let t=0;t<n.length;t++){let i=n[t];if(j(i)&&i.isEmpty()&&!Z(i)&&pp(i)===null&&!r.has(i.getKey())){g_(i,e);continue}let a=Ds(i)?i.getParent():Z(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(X(a)){if(!r.has(t)&&pp(a)===null){let n=p_(a,e);h_(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(B(n)&&!r.has(t)){r.add(t),g_(a,e);break}a=n}}}}}function h_(e,t){e.splice(e.getChildrenSize(),0,t)}function g_(e,t){if(X(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=H_(),a;if(h_(i,e.getChildren()),X(n)&&t===n.getListType())n.append(i),X(r)&&t===r.getListType()&&(h_(n,r.getChildren()),r.remove()),a=n;else if(X(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=I_(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=q();return G(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function __(e,t){v_(e,t,!1)}function v_(e,t,n){y_(e.getLastChild(),t.getFirstChild(),n);let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function y_(e,t,n=!1){if(e&&t&&u_(e)&&u_(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(v_(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();ao.prototype.remove.call(t)}}function b_(){let e=q();if(G(e)){let t=/* @__PURE__ */ new Set,n=e.getNodes(),r=e.anchor.getNode();if(f_(r,n))t.add(c_(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Ds(r)){let e=lh(r,R_);e!=null&&t.add(c_(e))}}for(let n of t){if(pp(n)!==null)continue;let t=n,r=l_(n);for(let n of r){let r=F().setTextStyle(e.style).setTextFormat(e.format);r.setFormat(n.getFormatType()).setIndent(n.getIndent()).setDirection(n.getDirection()).setStyle(n.getStyle()),h_(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Po(e.anchor,Uo(Ko(r,e.anchor.offset,`next`))),n.__key===e.focus.key&&Po(e.focus,Uo(Ko(r,e.focus.offset,`next`))),n.remove()}n.remove()}}}function x_(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())Z(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),X(r.getFirstChild())||n++)}function S_(e){let t=/* @__PURE__ */ new Set;if(u_(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(u_(r)&&u_(i)){let n=i.getFirstChild();if(X(n)){n.append(e);let i=r.getFirstChild();X(i)&&n.getListType()===i.getListType()&&(h_(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(u_(r)){let t=r.getFirstChild();if(X(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(u_(i)){let t=i.getFirstChild();X(t)&&t.append(e)}else if(X(n)){let t=bc(e),a=bc(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function C_(e){if(u_(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(X(n?n.getParent():void 0)&&Z(n)&&X(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=bc(e),i=bc(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=bc(e),o=bc(t);a.append(o),h_(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function w_(e=!1){let t=q();if(!G(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(Z(n)&&n.getChildrenSize()===0)r=n;else if(P(n)){let e=n.getParent();Z(e)&&e.getChildren().every(e=>P(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=c_(r),a=r.getParent();X(a)||o_(40);let o=a.getParent(),s;if(B(o))s=F(),i.insertAfter(s);else{if(!Z(o))return!1;s=bc(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?d_(0,r):1,n=bc(a).setStart(t);if(Z(s)){let e=bc(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!Z(e)&&!X(e))break;t=e}t.remove()}(r),!0}var T_=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function E_(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!T_.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function D_(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var O_=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`),i=Ur(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=E_(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=E_(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=E_(t.start,1),e},afterCloneFrom:D_}};function k_(e,t){e.__checked=t.__checked,e.__value=t.__value}var A_=e=>{let t=Vr(e,`format`),n=Hr(e,`format`),r=Wr(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=E_(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=E_(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=E_(t.value,1),e},afterCloneFrom:k_}},j_={ol:`number`,ul:`bullet`},M_=/* @__PURE__ */ li()({listType:/* @__PURE__ */ fi(/* @__PURE__ */ ui(/* @__PURE__ */ oi([`number`,`bullet`,`check`]),j_),{getter:{field:`__listType`}}),start:/* @__PURE__ */ di(/* @__PURE__ */ ii(1),{field:`__start`}),tag:/* @__PURE__ */ fi(/* @__PURE__ */ oi([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),N_=class extends ao{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&Qa(H())&&Za(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();X(t)&&e.getListType()===t.getListType()&&__(e,t)}(e),x_(e)},children:[R_],extends:ao,generated:O_,importDOM:Da({ol:()=>({conversion:F_,priority:0}),ul:()=>({conversion:F_,priority:0})}),json:M_,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=j_[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Nc().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,P_(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(P_(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(V(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){y_(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)Z(e)&&!X(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];if(!Z(t)){r===n&&(r=[...n]);let i=this.createListItemNode();!j(t)||X(t)||t.isInline()?i.append(t):i.append(...t.getChildren()),r[e]=i}}return super.splice(e,t,r)}extractWithChild(e){return Z(e)}createListItemNode(){return H_()}};function P_(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=s_(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...mm(s));for(let t=0;t<e.length;t++)t!==o&&i.push(...mm(e[t]))}if(l!==void 0){let e=mm(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&gm(e,...i),r.length>0&&hm(e,...r)}function F_(e){let t;if(function(e){return V(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=I_(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(V(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?I_(`check`):I_(`bullet`);return sl(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(Z(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{X(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function I_(e=`number`,t=1){return xc(new N_(e,t))}function X(e){return e instanceof N_}var L_=/* @__PURE__ */ li()({checked:/* @__PURE__ */ fi(/* @__PURE__ */ ci(/* @__PURE__ */ ai()),{setter:{field:`__checked`}}),indent:/* @__PURE__ */ fi(/* @__PURE__ */ ii(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:/* @__PURE__ */ di(/* @__PURE__ */ ii(1),{derived:!0,field:`__value`})}),R_=class extends ao{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(X(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();X(n)||o_(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of J(e,t)){if(!Z(n))break;r.push(n)}}let i=Qa(H()),a=i?function(e,t){let n=q();if(!G(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n<i+t.length){let r=t[n-i-1];e.set(r.getKey(),r.getChildrenSize(),`element`)}else e.set(r,n-t.length+1,`element`)}}(t,r):null;if(e.insertBefore(n),n.splice(0,0,r),a!==null&&a(n),i)for(let e=t;e!==null&&!B(e);e=e.getParent())e.markDirty();B(t)||i||($o(n,Ro(J(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,N_],extends:ao,generated:A_,importDOM:Da({li:()=>({conversion:z_,priority:0})}),json:L_})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=Nc().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!X(n)||n.getListType()!==`check`||X(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=X(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>X(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...mm(a)),u.length>0&&gm(e,...u);let d=[];if(i!==void 0&&d.push(...mm(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...mm(a)),d.length>0&&hm(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&po(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=uo(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in uo(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),u_(this)?{after(e){if(V(e)){let t=e.previousElementSibling;if(V(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(j(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Z(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!X(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=bc(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(j(e)||o_(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&j(e)){let t=q();if(G(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(X(n)||o_(39),Z(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=bc(n),a=r[0];i.getListType()===`number`&&Z(a)&&i.setStart(d_(0,a)),r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&u_(t)&&u_(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(__(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=bc(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(u_(this))return!1;let t=this.getParentOrThrow();if(Z(t.getParentOrThrow()))return C_(this),!0;let n=F().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=bc(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return X(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Z(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&o_(117),(e=Math.floor(e))>=0||o_(199);let t=e,n=this.getIndent();for(;n!==t;)n<t?(S_(this),n++):(C_(this),n--);return this}canInsertAfter(e){return Z(e)}canReplaceWith(e){return Z(e)}canMergeWith(e){return Z(e)||rs(e)}extractWithChild(e,t){if(!G(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return I_(`bullet`)}canMergeWhenEmpty(){return!0}};function z_(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return B_(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return B_(t.children[0])}let t=e.getAttribute(`aria-checked`),n=H_(t===`true`||t!==`false`&&void 0);return cl(n,e),{after:V_.bind(null,n),node:sl(n,e)}}function B_(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=H_(e.hasAttribute(`checked`));return{after:V_.bind(null,t),node:t}}function V_(e,t){let n=t[0];return t.length===1&&rs(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function H_(e){return xc(new R_(void 0,e))}function Z(e){return e instanceof R_}var U_=/* @__PURE__ */ new Set([` `,`Alt`,`ArrowDown`,`ArrowLeft`,`ArrowUp`,`CapsLock`,`Control`,`Escape`,`Meta`,`Shift`]),W_=/* @__PURE__ */ D(`INSERT_CHECK_LIST_COMMAND`);function G_(e,t){let n=t&&t.disableTakeFocusOnClick||!1,r=typeof n==`boolean`?()=>n:n.peek.bind(n),i=e=>{let t=e.target;if(!V(t))return!1;let n=t.__lexicalCheckListLastHandled;return n!==void 0&&e.timeStamp-n<500},a=`none`,o=e=>{a=function(e,t){let n=!1;return K_(e,()=>{n=!0,e.preventDefault(),t&&e.stopPropagation()}),n}(e,r())?`checkMark`:`content`},s=()=>{a===`content`&&J_(e),a=`none`};return ed(e.registerCommand(W_,()=>(m_(`check`),!0),1),e.registerCommand(An,t=>Z_(t,e,!1),1),e.registerCommand(kn,t=>Z_(t,e,!0),1),e.registerCommand(Pn,()=>X_(e)!=null&&(e.getRootElement()?.focus(),!0),1),e.registerCommand(Mn,t=>{let n=X_(e);return!(n==null||!e.isEditable()||(e.update(()=>{let e=Ls(n);Z(e)&&(t.preventDefault(),e.toggleChecked())}),0))},1),e.registerCommand(Dn,t=>X_(e)===null?e.read(`latest`,()=>{let n=q();if(G(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=U(n,e=>j(e)&&!e.isInline());if(Z(a)){let r=a.getParent();if(X(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&Bc(n)!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}):(J_(e),!1),1),e.registerRootListener(t=>{if(t!==null)return ed(nd(t,{click:e=>{s(),(e=>{i(e)||q_(e,r())})(e)},pointerup:e=>{s(),(e=>{e.pointerType===`touch`&&(i(e)||((e=>{let t=e.target;V(t)&&(t.__lexicalCheckListLastHandled=e.timeStamp)})(e),q_(e,r())))})(e)}}),nd(t,{beforeinput:()=>J_(e),focusin:()=>{Nt&&a===`content`&&J_(e)},keydown:t=>{U_.has(t.key)||J_(e)},mousedown:o,pointerdown:o},{capture:!0}),td(t,`touchstart`,o,{capture:!0,passive:!1}))}))}function K_(e,t){let n=e.target;if(!V(n))return;let r=n.firstChild;if(V(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=null,o=null;if(`clientX`in e)a=e.clientX;else if(`touches`in e){let t=e.touches;t.length>0&&(a=t[0].clientX,o=`touch`)}if(a==null)return;let s=n.getBoundingClientRect(),c=a/_h(n),l=n.ownerDocument.defaultView,u=l?l.getComputedStyle(n,`::before`):{width:`0px`},d=parseFloat(u.width),f=o===`touch`||`pointerType`in e&&e.pointerType===`touch`?32:0;(n.dir===`rtl`?c<s.right+f&&c>s.right-d-f:c>s.left-f&&c<s.left+d+f)&&t()}function q_(e,t){K_(e,()=>{if(V(e.target)){let n=e.target,r=ys(n);r!=null&&r.isEditable()&&r.update(()=>{let e=Ls(n);Z(e)&&(t?(fc(`skip-selection-focus`),fc(`skip-dom-selection`)):n.focus(),e.toggleChecked())})}})}function J_(e){let t=e.getRootElement(),n=t?Bc(t):null;t!==null&&V(n)&&Y_(n)&&t.focus({preventScroll:!0})}function Y_(e){let t=e.parentNode;return e.tagName===`LI`&&t!=null&&t.__lexicalListType===`check`}function X_(e){let t=e.getRootElement(),n=t?Bc(t):null;return V(n)&&Y_(n)?n:null}function Z_(e,t,n){let r=X_(t);if(r!=null){let i=null;t.update(()=>{let a=Ls(r);if(!Z(a))return;let o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&Z(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;Z(n);){let e=t?n.getLastChild():n.getFirstChild();if(!X(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(a,n);o!=null&&(o.selectStart(),t.getElementByKey(o.__key)!=null&&(e.preventDefault(),i=o.__key))},{onUpdate:()=>{(i===null?null:t.getElementByKey(i))?.focus()}})}return!1}var Q_=/* @__PURE__ */ D(`UPDATE_LIST_START_COMMAND`),$_=/* @__PURE__ */ D(`INSERT_UNORDERED_LIST_COMMAND`),ev=/* @__PURE__ */ D(`INSERT_ORDERED_LIST_COMMAND`),tv=/* @__PURE__ */ D(`REMOVE_LIST_COMMAND`);function nv(e,t){return ed(e.registerCommand(ev,()=>(m_(`number`),!0),1),e.registerCommand(Q_,e=>{let{listNodeKey:t,newStart:n}=e,r=I(t);return!!X(r)&&(r.getListType()===`number`&&(r.setStart(n),x_(r)),!0)},1),e.registerCommand($_,()=>(m_(`bullet`),!0),1),e.registerCommand(tv,()=>(b_(),!0),1),e.registerCommand(mn,()=>w_(!(!t||!t.restoreNumbering)),1),e.registerCommand(Nn,e=>{let t=q();if(!G(t)||!t.isCollapsed())return!1;let{anchor:n}=t;if(n.offset!==0)return!1;let r=n.getNode();for(;!Z(r);){if(r.getPreviousSibling()!==null)return!1;let e=r.getParent();if(e===null)return!1;r=e}return!(!Z(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(R_,e=>{let t=e.getFirstChild();if(t){if(P(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=q();G(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(So,e=>{let t=e.getParent();if(Z(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function rv(e){let t=e=>{let t=e.getParent();if(X(e.getFirstChild())||!X(t))return;let n=U(e,e=>Z(e)&&X(e.getParent())&&Z(e.getPreviousSibling()));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(Z(n)){let r=n.getPreviousSibling();if(Z(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;X(n);){let e=n.getLastChild();if(!Z(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(X(n)){let r=s_(n);r+1<s_(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(N_,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(X(e)){for(let r of e.getChildren())if(Z(r)){t(r);let e=r.getFirstChild();X(e)&&n.push(e)}}}})}lv.peek=uv;var iv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],av={canContainEols:[`highlight`],enter:{highlight:ov},exit:{highlight:sv}};function ov(e){this.enter({type:`highlight`,children:[]},e)}function sv(e){this.exit(e)}var cv={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:iv}],handlers:{highlight:lv}};function lv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function uv(){return`=`}var dv={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function fv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function pv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function mv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function hv(e){return mv(e)||fv(e)}var gv=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function _v(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,a=[],o=0,s=-1,c=``,l,u;n.position&&(`start`in n.position||`indent`in n.position?(u=n.position.indent,l=n.position.start):l=n.position);let d=(l?l.line:0)||1,f=(l?l.column:0)||1,p=h(),m;for(o--;++o<=e.length;)if(m===10&&(f=(u?u[s]:0)||1),m=e.charCodeAt(o),m===38){let t=e.charCodeAt(o+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){c+=String.fromCharCode(m),f++;continue}let s=o+1,l=s,u=s,d;if(t===35){u=++l;let t=e.charCodeAt(u);t===88||t===120?(d=`hexadecimal`,u=++l):d=`decimal`}else d=`named`;let v=``,y=``,b=``,x=d===`named`?hv:d===`decimal`?fv:pv;for(u--;++u<=e.length;){let t=e.charCodeAt(u);if(!x(t))break;b+=String.fromCharCode(t),d===`named`&&ae.includes(b)&&(v=b,y=i(b))}let S=e.charCodeAt(u)===59;if(S){u++;let e=d===`named`&&i(b);e&&(v=b,y=e)}let C=1+u-s,ee=``;if(S||n.nonTerminated!==!1){if(!b)d!==`named`&&g(4,C);else if(d===`named`){if(S&&!y)g(5,1);else if(v!==b&&(u=l+v.length,C=1+u-l,S=!1),!S){let t=v?1:3;if(n.attribute){let n=e.charCodeAt(u);n===61?(g(t,C),y=``):hv(n)?y=``:g(t,C)}else g(t,C)}ee=y}else{S||g(2,C);let e=Number.parseInt(b,d===`hexadecimal`?16:10);if(vv(e))g(7,C),ee=`�`;else if(e in dv)g(6,C),ee=dv[e];else{let t=``;yv(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),ee=t+String.fromCharCode(e)}}}if(ee){_(),p=h(),o=u-1,f+=u-s+1,a.push(ee);let t=h();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,ee,{start:p,end:t},e.slice(s-1,u)),p=t}else b=e.slice(s-1,u),c+=b,f+=b.length,o=u-1}else m===10&&(d++,s++,f=0),Number.isNaN(m)?_():(c+=String.fromCharCode(m),f++);return a.join(``);function h(){return{line:d,column:f,offset:o+((l?l.offset:0)||0)}}function g(e,t){let r;n.warning&&(r=h(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,gv[e],r,e))}function _(){c&&=(a.push(c),n.text&&n.text.call(n.textContext||void 0,c,{start:p,end:h()}),``)}}function vv(e){return e>=55296&&e<=57343||e>1114111}function yv(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var bv=` `;function xv(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:d,mdxJsxFlowTagExpressionAttribute:m,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:h,mdxJsxFlowTagAttributeNameLocal:g,mdxJsxFlowTagAttributeValueLiteral:_,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:v,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:y,mdxJsxFlowTag:b,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:d,mdxJsxTextTagExpressionAttribute:m,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:h,mdxJsxTextTagAttributeNameLocal:g,mdxJsxTextTagAttributeValueLiteral:_,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:v,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:y,mdxJsxTextTag:b}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new ne("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new ne(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new ne("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function d(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function p(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let{estree:i}=e;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=_v(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function v(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},{estree:a}=e;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function y(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function b(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new ne("Unexpected closing tag `"+C(t)+"`, expected corresponding closing tag for `"+C(r)+"` ("+u(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,x),t.selfClosing||t.close?this.exit(e,S):n.push(t)}function x(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new ne("Expected a closing tag for `"+C(r)+"` ("+u({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e,t){let n=this.data.mdxJsxTag;throw new ne("Expected the closing tag `"+C(n)+"` either after the end of `"+t.type+"` ("+u(t.end)+") or another opening tag after the start of `"+t.type+"` ("+u(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function C(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Sv(e){let t=e||{},n=t.quote||`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");let r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;return s.peek=Ev,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=wv(s),f=Tv(d),p=l||d===0?bv:``,m=s.createTracker(c),h=s.createTracker(c),g=[],_=(l?f:``)+`<`+(e.name||``),v=s.enter(e.type);if(m.move(_),h.move(_),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=Dv(s,i.value||``,p);else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let{value:e}=i,t=i.name,c=``;if(e!=null){if(typeof e==`object`)c=Dv(s,e.value||``,p);else{let t=r&&ie(e,n)>ie(e,o)?o:n;c=t+oe(e,{subset:[t]})+t}}a=t+(c?`=`:``)+c}g.push(a)}}let y=!1,b=g.join(` `);l&&(/\r?\n|\r/.test(b)||m.current().now.column+b.length+(u?i?2:3:1)>a)&&(y=!0);let x=m,S=_;if(y){x=h;let e=-1;for(;++e<g.length;)g[e]=f+bv+g[e];S+=x.move(`
|
|
12
|
+
`+g.join(`
|
|
13
13
|
`)+`
|
|
14
|
-
`+
|
|
15
|
-
`),
|
|
16
|
-
`))),u||(
|
|
14
|
+
`+f)}else b&&(S+=x.move(` `+b));return u&&(S+=x.move((i||y?``:` `)+`/`)),S+=x.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?S+=x.move(s.containerPhrasing(e,{...x.current(),before:`>`,after:`<`})):(x.shift(2),S+=x.move(`
|
|
15
|
+
`),S+=x.move(Cv(e,s,x.current())),S+=x.move(`
|
|
16
|
+
`))),u||(S+=x.move((l?f:``)+`</`+(e.name||``)+`>`)),v(),S}}function Cv(e,t,n){let{indexStack:r}=t,{children:i}=e,a=t.createTracker(n),o=Tv(wv(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
|
|
17
17
|
`,after:`
|
|
18
18
|
`,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
|
|
19
19
|
|
|
20
|
-
`))}return r.pop(),s.join(``)}function wv(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function Tv(e){return bv.repeat(e)}function Ev(){return`<`}
|
|
21
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var
|
|
20
|
+
`))}return r.pop(),s.join(``)}function wv(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function Tv(e){return bv.repeat(e)}function Ev(){return`<`}function Dv(e,t,n){let r=t;return n&&(r=e.indentLines(r,function(e,t,r){return(t===0||r?``:n)+e})),`{`+r+`}`}var Ov=Object.prototype.hasOwnProperty;function kv(e,t,n){for(n of e.keys())if(Av(n,t))return n}function Av(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Av(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=kv(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=kv(t,i),!i)||!Av(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(Ov.call(e,n)&&++r&&!Ov.call(t,n)||!(n in t)||!Av(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var jv,Mv,Nv,Pv,Fv=!0;typeof process<`u`&&({FORCE_COLOR:jv,NODE_DISABLE_COLORS:Mv,NO_COLOR:Nv,TERM:Pv}=process.env||{},Fv=process.stdout&&process.stdout.isTTY);var Q={enabled:!Mv&&Nv==null&&Pv!==`dumb`&&(jv!=null&&jv!==`0`||Fv),reset:$(0,0),bold:$(1,22),dim:$(2,22),italic:$(3,23),underline:$(4,24),inverse:$(7,27),hidden:$(8,28),strikethrough:$(9,29),black:$(30,39),red:$(31,39),green:$(32,39),yellow:$(33,39),blue:$(34,39),magenta:$(35,39),cyan:$(36,39),white:$(37,39),gray:$(90,39),grey:$(90,39),bgBlack:$(40,49),bgRed:$(41,49),bgGreen:$(42,49),bgYellow:$(43,49),bgBlue:$(44,49),bgMagenta:$(45,49),bgCyan:$(46,49),bgWhite:$(47,49)};function Iv(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function Lv(e,t){let n={has:e,keys:t};return n.reset=Q.reset.bind(n),n.bold=Q.bold.bind(n),n.dim=Q.dim.bind(n),n.italic=Q.italic.bind(n),n.underline=Q.underline.bind(n),n.inverse=Q.inverse.bind(n),n.hidden=Q.hidden.bind(n),n.strikethrough=Q.strikethrough.bind(n),n.black=Q.black.bind(n),n.red=Q.red.bind(n),n.green=Q.green.bind(n),n.yellow=Q.yellow.bind(n),n.blue=Q.blue.bind(n),n.magenta=Q.magenta.bind(n),n.cyan=Q.cyan.bind(n),n.white=Q.white.bind(n),n.gray=Q.gray.bind(n),n.grey=Q.grey.bind(n),n.bgBlack=Q.bgBlack.bind(n),n.bgRed=Q.bgRed.bind(n),n.bgGreen=Q.bgGreen.bind(n),n.bgYellow=Q.bgYellow.bind(n),n.bgBlue=Q.bgBlue.bind(n),n.bgMagenta=Q.bgMagenta.bind(n),n.bgCyan=Q.bgCyan.bind(n),n.bgWhite=Q.bgWhite.bind(n),n}function $(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:Q.enabled?Iv(this.keys,t+``):t+``):t===void 0?Lv([e],[n]):Q.enabled?Iv([n],t+``):t+``}}function Rv(){}Rv.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_)f[n]=void 0;else{if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(zv(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function zv(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}new Rv;var Bv=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Vv=/\S/,Hv=new Rv;Hv.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Vv.test(e)&&!Vv.test(t)},Hv.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&Bv.test(t[n])&&Bv.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Uv=new Rv;Uv.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
21
|
+
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var Wv=new Rv;Wv.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Gv=new Rv;Gv.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Kv(e){"@babel/helpers - typeof";return Kv=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Kv(e)}var qv=Object.prototype.toString,Jv=new Rv;Jv.useLongestToken=!0,Jv.tokenize=Uv.tokenize,Jv.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(Yv(e,null,null,i),i,` `)},Jv.equals=function(e,t){return Rv.prototype.equals.call(Jv,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function Yv(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));for(var a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(qv.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Yv(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Kv(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)
|
|
22
22
|
/* istanbul ignore else */
|
|
23
|
-
e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=
|
|
24
|
-
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var Zv=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function Qv(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new Zv({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function $v(e,t){Qv(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function ey(e,t){Qv(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}ey.ok=ey,ey.equal=function(e,t,n){Qv(!kv(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},ey.type=function(e,t,n){let r=typeof e;Qv(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},ey.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";Qv(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},ey.snapshot=function(e,t,n){e=Xv(e),t=Xv(t),Qv(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},ey.fixture=function(e,t,n){e=Xv(e),t=Xv(t),Qv(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},ey.match=function(e,t,n){typeof t==`string`?Qv(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):Qv(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},ey.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?Qv(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?Qv(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||Qv(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var ty={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},ny={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},ry={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},iy=`highlightSequenceTemporary`,ay=`highlightSequence`,oy=`highlight`,sy=`highlightText`;function cy(){let e={name:`highlight`,tokenize:i,resolveAll:r};return{text:{[ty.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[ty.equalsTo]}};function r(e,r){let i=-1;for(;++i<e.length;)if(e[i][0]===`enter`&&e[i][1].type===iy&&e[i][1]._close){let a=i;for(;a--;)if(e[a][0]===`exit`&&e[a][1].type===iy&&e[a][1]._open&&e[i][1].end.offset-e[i][1].start.offset===e[a][1].end.offset-e[a][1].start.offset){e[i][1].type=ay,e[a][1].type=ay;let o={type:oy,start:Object.assign({},e[a][1].start),end:Object.assign({},e[i][1].end)},s={type:sy,start:Object.assign({},e[a][1].end),end:Object.assign({},e[i][1].start)},c=[[`enter`,o,r],[`enter`,e[a][1],r],[`exit`,e[a][1],r],[`enter`,s,r]],l=r.parser.constructs.insideSpan.null;l&&n(c,c.length,0,t(l,e.slice(a+1,i),r)),n(c,c.length,0,[[`exit`,s,r],[`enter`,e[i][1],r],[`exit`,e[i][1],r],[`exit`,o,r]]),n(e,a-1,i-a+3,c),i=a+c.length-2;break}}for(i=-1;++i<e.length;)e[i][1].type===iy&&(e[i][1].type=ry.data);return e}function i(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return $v(t===ty.equalsTo,"expected `=`"),r===ty.equalsTo&&i[i.length-1][1].type!==ry.characterEscape?n(t):(e.enter(iy),s(t))}function s(i){let o=v(r);if(i===ty.equalsTo)return a>1?n(i):(e.consume(i),a++,s);if(a<2)return n(i);let c=e.exit(iy),l=v(i);return c._open=!l||l===ny.attentionSideAfter&&!!o,c._close=!o||o===ny.attentionSideAfter&&!!l,t(i)}}}function ly(e){return e}var uy={}.hasOwnProperty,dy=Symbol(`continue`),fy=Symbol(`exit`),py=Symbol(`skip`);function my(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return gy(e)&&(s.displayName=`node (`+ly(e.type)+`)`),s;function s(){let s=n?hy(n(e,t,a,o)):[];if(s[0]===fy)return s;if(s[0]!==py){let t;for(t in e)if(uy.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(gy(r)){let e=i(r,t,a,n)();if(e[0]===fy)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(gy(r)){let e=i(r,t,void 0,n)();if(e[0]===fy)return e}}}return r?hy(r(e,t,a,o)):s}}}function hy(e){return Array.isArray(e)?e:typeof e==`number`?[dy,e]:[e]}function gy(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function _y(e,t){let n=t.prefix||``,i=t.suffix||``,a=Object.assign({},t.acornOptions),o=[],s=[],c=a.onComment,l=a.onToken,u=!1,d,f,p=Object.assign({},a,{onComment:o,preserveParens:!0});l&&(p.onToken=s);let m=yy(e,t.tokenTypes),h=m.value,g=n+h+i,_=t.expression&&vy(h);if(_&&!t.allowEmpty)throw new r(`Unexpected empty expression`,{place:y(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{d=t.expression&&!_?t.acorn.parseExpressionAt(g,0,p):t.acorn.parse(g,p)}catch(e){let t=e,r=y(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},f=t,u=t.raisedAt>=n.length+h.length||t.message===`Unterminated comment`}if(d&&t.expression&&!_){if(vy(g.slice(d.end,g.length-i.length)))d={type:`Program`,start:0,end:n.length+h.length,body:[{type:`ExpressionStatement`,expression:d,start:0,end:n.length+h.length}],sourceType:`module`,comments:[]};else{let e=y(d.end),t=/* @__PURE__ */ Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},f=t,d=void 0}}if(d){if(d.comments=o,my(d,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&
|
|
23
|
+
e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=Yv(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var Xv=new Rv;Xv.tokenize=function(e){return e.slice()},Xv.join=Xv.removeEmpty=function(e){return e},Q.red,Q.grey,Q.green,Q.dim().italic,Q.dim(`→`),Q.dim(`·`),Q.dim(`↵`);function Zv(e){e=e.replace(/\r?\n/g,`
|
|
24
|
+
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var Qv=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function $v(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new Qv({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function ey(e,t){$v(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function ty(e,t){$v(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}ty.ok=ty,ty.equal=function(e,t,n){$v(!Av(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},ty.type=function(e,t,n){let r=typeof e;$v(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},ty.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";$v(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},ty.snapshot=function(e,t,n){e=Zv(e),t=Zv(t),$v(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},ty.fixture=function(e,t,n){e=Zv(e),t=Zv(t),$v(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},ty.match=function(e,t,n){typeof t==`string`?$v(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):$v(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},ty.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?$v(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?$v(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||$v(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var ny={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},ry={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},iy={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},ay=`highlightSequenceTemporary`,oy=`highlightSequence`,sy=`highlight`,cy=`highlightText`;function ly(){let e={name:`highlight`,tokenize:n,resolveAll:t};return{text:{[ny.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[ny.equalsTo]}};function t(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===ay&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===ay&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=oy,e[r][1].type=oy;let i={type:sy,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:cy,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&d(o,o.length,0,v(s,e.slice(r+1,n),t)),d(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),d(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===ay&&(e[n][1].type=iy.data);return e}function n(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return ey(t===ny.equalsTo,"expected `=`"),r===ny.equalsTo&&i[i.length-1][1].type!==iy.characterEscape?n(t):(e.enter(ay),c(t))}function c(i){let o=s(r);if(i===ny.equalsTo)return a>1?n(i):(e.consume(i),a++,c);if(a<2)return n(i);let l=e.exit(ay),u=s(i);return l._open=!u||u===ry.attentionSideAfter&&!!o,l._close=!o||o===ry.attentionSideAfter&&!!u,t(i)}}}function uy(e){return e}var dy={}.hasOwnProperty,fy=Symbol(`continue`),py=Symbol(`exit`),my=Symbol(`skip`);function hy(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return _y(e)&&(s.displayName=`node (`+uy(e.type)+`)`),s;function s(){let s=n?gy(n(e,t,a,o)):[];if(s[0]===py)return s;if(s[0]!==my){let t;for(t in e)if(dy.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(_y(r)){let e=i(r,t,a,n)();if(e[0]===py)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(_y(r)){let e=i(r,t,void 0,n)();if(e[0]===py)return e}}}return r?gy(r(e,t,a,o)):s}}}function gy(e){return Array.isArray(e)?e:typeof e==`number`?[fy,e]:[e]}function _y(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function vy(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=by(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&yy(m);if(g&&!t.allowEmpty)throw new ne(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(yy(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=/* @__PURE__ */ Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,hy(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&
|
|
25
25
|
/* c8 ignore next 5 */
|
|
26
|
-
(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),
|
|
26
|
+
(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=xy(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function yy(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function by(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=Sy(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function xy(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function Sy(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
27
27
|
`;break;case-3:a=`\r
|
|
28
28
|
`;break;case-2:a=` `;break;
|
|
29
29
|
/* c8 ignore next 6 */
|
|
30
|
-
case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Sy(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=Cy(n.start,r[0]||t.start),a=Cy(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function Cy(e,t){if(e&&typeof e==`object`){let n=`line`in e?wy(e.line):void 0,r=`column`in e?wy(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:wy(t)}}}function wy(e){return typeof e==`number`&&e>-1?e:void 0}var Ty=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,Ey=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,Dy=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,Oy=`#unexpected-type-in-code-expected-an-object-spread-spread`,ky=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,Ay=`#could-not-parse-expression-with-acorn`;function jy(e,t,n,i,o,c,l,u,d,f,p){let m=this,h=this.events.length+3,g=0,_,v;return y;function y(t){return e.enter(n),e.enter(i),e.consume(t),e.exit(i),_=m.now(),b}function b(s){if(s===null){if(v)throw v;let e=new r("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:m.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=Ty+Ey,e}if(a(s))return e.enter(`lineEnding`),e.consume(s),e.exit(`lineEnding`),S;if(s===125&&g===0){let r=c?My.call(m,c,l,o,h,_,f||!1,d||!1):{type:`ok`,estree:void 0};if(r.type===`ok`){e.enter(i),e.consume(s),e.exit(i);let a=e.exit(n);return u&&r.estree&&Object.assign(a,{estree:r.estree}),t}return v=r.message,e.enter(o),e.consume(s),x}return e.enter(o),x(s)}function x(t){return t===125&&g===0||t===null||a(t)?(e.exit(o),b(t)):(t===123&&!c?g+=1:t===125&&--g,e.consume(t),x)}function S(t){let n=m.now();if(n.line!==_.line&&!p&&m.parser.lazy[n.line]){let e=new r("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:m.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=Ty+Dy,e}return s(t)?ne(e,b,`linePrefix`,3)(t):b(t)}}function My(e,t,n,i,a,o,s){let c=_y(this.events.slice(i),{acorn:e,tokenTypes:[n],acornOptions:t,start:a,expression:!0,allowEmpty:o,prefix:s?`({`:``,suffix:s?`})`:``}),l=c.estree;if(s&&l){let e=l.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Sy(e),n=new r("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Ty+Oy,n}if(e.expression.properties[1]){let t=Sy(e.expression.properties[1]),n=new r(`Unexpected extra content in spread: only a single spread is supported`,{place:t.start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw n.url=Ty+ky,n}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Sy(e.expression.properties[0]),n=new r("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Ty+Oy,n}}if(c.error){let e=new r(`Could not parse expression with acorn`,{cause:c.error,place:{line:c.error.loc.line,column:c.error.loc.column+1,offset:c.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=Ty+Ay,{type:`nok`,message:e}}return{type:`ok`,estree:l}}var Ny=`https://github.com/micromark/micromark-extension-mdx-jsx`;function Py(e,t,n,i,c,u,d,f,m,h,g,_,v,y,b,x,S,C,ee,te,ne,ie,ae,oe,se,ce,le,ue,de,fe,pe,me){let he=this,ge,_e;return ve;function ve(t){return e.enter(f),e.enter(m),e.consume(t),e.exit(m),ye}function ye(e){return o(e)?n(e):(ge=be,He(e))}function be(t){if(t===47)return e.enter(h),e.consume(t),e.exit(h),ge=xe,He;if(t===62)return Ve(t);if(t!==null&&t>=0&&l(t))return e.enter(_),e.enter(v),e.consume(t),Se;T(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function xe(t){if(t===62)return Ve(t);if(t!==null&&t>=0&&l(t))return e.enter(_),e.enter(v),e.consume(t),Se;T(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Se(t){if(t!==null&&t>=0&&p(t,{jsx:!0}))return e.consume(t),Se;if(t===46||t===47||t===58||t===62||t===123||o(t)||re(t))return e.exit(v),ge=Ce,He(t);T(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function Ce(t){if(t===46)return e.enter(y),e.consume(t),e.exit(y),ge=we,He;if(t===58)return e.enter(x),e.consume(t),e.exit(x),ge=De,He;if(t===47||t===62||t===123||t!==null&&t>=0&&l(t))return e.exit(_),Ae(t);T(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function we(t){if(t!==null&&t>=0&&l(t))return e.enter(b),e.consume(t),Te;T(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Te(t){if(t!==null&&t>=0&&p(t,{jsx:!0}))return e.consume(t),Te;if(t===46||t===47||t===62||t===123||o(t)||re(t))return e.exit(b),ge=Ee,He(t);T(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function Ee(t){if(t===46)return e.enter(y),e.consume(t),e.exit(y),ge=we,He;if(t===47||t===62||t===123||t!==null&&t>=0&&l(t))return e.exit(_),Ae(t);T(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function De(t){if(t!==null&&t>=0&&l(t))return e.enter(S),e.consume(t),Oe;T(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function Oe(t){if(t!==null&&t>=0&&p(t,{jsx:!0}))return e.consume(t),Oe;if(t===47||t===62||t===123||o(t)||re(t))return e.exit(S),ge=ke,He(t);T(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ke(t){if(t===47||t===62||t===123||t!==null&&t>=0&&l(t))return e.exit(_),Ae(t);T(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ae(t){if(t===47)return e.enter(g),e.consume(t),e.exit(g),ge=Be,He;if(t===62)return Ve(t);if(t===123)return jy.call(he,e,je,C,ee,te,i,c,u,!0,!1,d)(t);if(t!==null&&t>=0&&l(t))return e.enter(ne),e.enter(ie),e.enter(ae),e.consume(t),Me;T(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function je(e){return ge=Ae,He(e)}function Me(t){if(t!==null&&t>=0&&p(t,{jsx:!0}))return e.consume(t),Me;if(t===47||t===58||t===61||t===62||t===123||o(t)||re(t))return e.exit(ae),ge=Ne,He(t);T(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ne(t){if(t===58)return e.enter(oe),e.consume(t),e.exit(oe),ge=Pe,He;if(t===61)return e.exit(ie),e.enter(ce),e.consume(t),e.exit(ce),ge=w,He;if(t===47||t===62||t===123||o(t)||re(t)||t!==null&&t>=0&&l(t))return e.exit(ie),e.exit(ne),ge=Ae,He(t);T(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Pe(t){if(t!==null&&t>=0&&l(t))return e.enter(se),e.consume(t),Fe;T(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Fe(t){if(t!==null&&t>=0&&p(t,{jsx:!0}))return e.consume(t),Fe;if(t===47||t===61||t===62||t===123||o(t)||re(t))return e.exit(se),e.exit(ie),ge=Ie,He(t);T(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ie(t){if(t===61)return e.enter(ce),e.consume(t),e.exit(ce),ge=w,He;if(t===47||t===62||t===123||t!==null&&t>=0&&l(t))return e.exit(ne),Ae(t);T(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function w(t){if(t===34||t===39)return e.enter(le),e.enter(ue),e.consume(t),e.exit(ue),_e=t,Re;if(t===123)return jy.call(he,e,Le,fe,pe,me,i,c,u,!1,!1,d)(t);T(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Le(t){return e.exit(ne),ge=Ae,He(t)}function Re(t){return t===null&&T(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(_e)+"`"),t===_e?(e.enter(ue),e.consume(t),e.exit(ue),e.exit(le),e.exit(ne),_e=void 0,ge=Ae,He):a(t)?(ge=Re,He(t)):(e.enter(de),ze(t))}function ze(t){return t===null||t===_e||a(t)?(e.exit(de),Re(t)):(e.consume(t),ze)}function Be(e){if(e===62)return Ve(e);T(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ve(n){return e.enter(m),e.consume(n),e.exit(m),e.exit(f),t}function He(t){return a(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),We):s(t)||re(t)?(e.enter(`esWhitespace`),Ue(t)):ge(t)}function Ue(t){return a(t)?(e.exit(`esWhitespace`),He(t)):s(t)||re(t)?(e.consume(t),Ue):(e.exit(`esWhitespace`),ge(t))}function We(e){if(!d&&he.parser.lazy[he.now().line]){let e=new r("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",he.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=Ny+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return He(e)}function T(e,t,n){let i=new r(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Fy(e)+`)`)+` `+t+`, expected `+n,he.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw i.url=Ny+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),i}}function Fy(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Iy(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return Py.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function Ly(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let o=this;return c;function c(e){return l(e)}function l(r){return Py.call(o,n,u,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function u(e){return s(e)?ne(n,d,`whitespace`)(e):d(e)}function d(e){let t=o.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],l;for(let e of s)if(e.name===`mdxFlowExpression`){l=e;break}return e===60?c(e):e===123&&l?n.attempt(l,d,i)(e):e===null||a(e)?r(e):i(e)}}}function Ry(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Ly(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Iy(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function zy(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var By={}.hasOwnProperty;function Vy(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Vy(e,t.extensions[n]);for(r in t)if(By.call(t,r))switch(r){case`extensions`:break;
|
|
30
|
+
case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Cy(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=wy(n.start,r[0]||t.start),a=wy(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function wy(e,t){if(e&&typeof e==`object`){let n=`line`in e?Ty(e.line):void 0,r=`column`in e?Ty(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:Ty(t)}}}function Ty(e){return typeof e==`number`&&e>-1?e:void 0}var Ey=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,Dy=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,Oy=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,ky=`#unexpected-type-in-code-expected-an-object-spread-spread`,Ay=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,jy=`#could-not-parse-expression-with-acorn`;function My(e,t,n,r,i,o,s,c,u,d,f){let p=this,h=this.events.length+3,g=0,_,v;return y;function y(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),_=p.now(),b}function b(l){if(l===null){if(v)throw v;let e=new ne("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:p.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=Ey+Dy,e}if(a(l))return e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),S;if(l===125&&g===0){let a=o?Ny.call(p,o,s,i,h,_,d||!1,u||!1):{type:`ok`,estree:void 0};if(a.type===`ok`){e.enter(r),e.consume(l),e.exit(r);let i=e.exit(n);return c&&a.estree&&Object.assign(i,{estree:a.estree}),t}return v=a.message,e.enter(i),e.consume(l),x}return e.enter(i),x(l)}function x(t){return t===125&&g===0||t===null||a(t)?(e.exit(i),b(t)):(t===123&&!o?g+=1:t===125&&--g,e.consume(t),x)}function S(t){let n=p.now();if(n.line!==_.line&&!f&&p.parser.lazy[n.line]){let e=new ne("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:p.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=Ey+Oy,e}return l(t)?m(e,b,`linePrefix`,3)(t):b(t)}}function Ny(e,t,n,r,i,a,o){let s=vy(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Cy(e),n=new ne("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Ey+ky,n}if(e.expression.properties[1]){let t=Cy(e.expression.properties[1]),n=new ne(`Unexpected extra content in spread: only a single spread is supported`,{place:t.start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw n.url=Ey+Ay,n}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Cy(e.expression.properties[0]),n=new ne("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Ey+ky,n}}if(s.error){let e=new ne(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=Ey+jy,{type:`nok`,message:e}}return{type:`ok`,estree:c}}var Py=`https://github.com/micromark/micromark-extension-mdx-jsx`;function Fy(e,t,i,s,c,u,d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,ie,ae,oe,se,ce,le,ue,de,fe,pe,me){let he=this,ge,_e;return ve;function ve(t){return e.enter(f),e.enter(p),e.consume(t),e.exit(p),ye}function ye(e){return o(e)?i(e):(ge=be,He(e))}function be(t){if(t===47)return e.enter(m),e.consume(t),e.exit(m),ge=xe,He;if(t===62)return Ve(t);if(t!==null&&t>=0&&r(t))return e.enter(g),e.enter(_),e.consume(t),Se;T(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function xe(t){if(t===62)return Ve(t);if(t!==null&&t>=0&&r(t))return e.enter(g),e.enter(_),e.consume(t),Se;T(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Se(t){if(t!==null&&t>=0&&re(t,{jsx:!0}))return e.consume(t),Se;if(t===46||t===47||t===58||t===62||t===123||o(t)||n(t))return e.exit(_),ge=Ce,He(t);T(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function Ce(t){if(t===46)return e.enter(v),e.consume(t),e.exit(v),ge=we,He;if(t===58)return e.enter(b),e.consume(t),e.exit(b),ge=De,He;if(t===47||t===62||t===123||t!==null&&t>=0&&r(t))return e.exit(g),Ae(t);T(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function we(t){if(t!==null&&t>=0&&r(t))return e.enter(y),e.consume(t),Te;T(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Te(t){if(t!==null&&t>=0&&re(t,{jsx:!0}))return e.consume(t),Te;if(t===46||t===47||t===62||t===123||o(t)||n(t))return e.exit(y),ge=Ee,He(t);T(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function Ee(t){if(t===46)return e.enter(v),e.consume(t),e.exit(v),ge=we,He;if(t===47||t===62||t===123||t!==null&&t>=0&&r(t))return e.exit(g),Ae(t);T(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function De(t){if(t!==null&&t>=0&&r(t))return e.enter(x),e.consume(t),Oe;T(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function Oe(t){if(t!==null&&t>=0&&re(t,{jsx:!0}))return e.consume(t),Oe;if(t===47||t===62||t===123||o(t)||n(t))return e.exit(x),ge=ke,He(t);T(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ke(t){if(t===47||t===62||t===123||t!==null&&t>=0&&r(t))return e.exit(g),Ae(t);T(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ae(t){if(t===47)return e.enter(h),e.consume(t),e.exit(h),ge=Be,He;if(t===62)return Ve(t);if(t===123)return My.call(he,e,je,S,C,ee,s,c,u,!0,!1,d)(t);if(t!==null&&t>=0&&r(t))return e.enter(te),e.enter(ie),e.enter(ae),e.consume(t),Me;T(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function je(e){return ge=Ae,He(e)}function Me(t){if(t!==null&&t>=0&&re(t,{jsx:!0}))return e.consume(t),Me;if(t===47||t===58||t===61||t===62||t===123||o(t)||n(t))return e.exit(ae),ge=Ne,He(t);T(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ne(t){if(t===58)return e.enter(oe),e.consume(t),e.exit(oe),ge=Pe,He;if(t===61)return e.exit(ie),e.enter(ce),e.consume(t),e.exit(ce),ge=w,He;if(t===47||t===62||t===123||o(t)||n(t)||t!==null&&t>=0&&r(t))return e.exit(ie),e.exit(te),ge=Ae,He(t);T(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Pe(t){if(t!==null&&t>=0&&r(t))return e.enter(se),e.consume(t),Fe;T(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Fe(t){if(t!==null&&t>=0&&re(t,{jsx:!0}))return e.consume(t),Fe;if(t===47||t===61||t===62||t===123||o(t)||n(t))return e.exit(se),e.exit(ie),ge=Ie,He(t);T(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Ie(t){if(t===61)return e.enter(ce),e.consume(t),e.exit(ce),ge=w,He;if(t===47||t===62||t===123||t!==null&&t>=0&&r(t))return e.exit(te),Ae(t);T(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function w(t){if(t===34||t===39)return e.enter(le),e.enter(ue),e.consume(t),e.exit(ue),_e=t,Re;if(t===123)return My.call(he,e,Le,fe,pe,me,s,c,u,!1,!1,d)(t);T(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Le(t){return e.exit(te),ge=Ae,He(t)}function Re(t){return t===null&&T(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(_e)+"`"),t===_e?(e.enter(ue),e.consume(t),e.exit(ue),e.exit(le),e.exit(te),_e=void 0,ge=Ae,He):a(t)?(ge=Re,He(t)):(e.enter(de),ze(t))}function ze(t){return t===null||t===_e||a(t)?(e.exit(de),Re(t)):(e.consume(t),ze)}function Be(e){if(e===62)return Ve(e);T(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ve(n){return e.enter(p),e.consume(n),e.exit(p),e.exit(f),t}function He(t){return a(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),We):l(t)||n(t)?(e.enter(`esWhitespace`),Ue(t)):ge(t)}function Ue(t){return a(t)?(e.exit(`esWhitespace`),He(t)):l(t)||n(t)?(e.consume(t),Ue):(e.exit(`esWhitespace`),ge(t))}function We(e){if(!d&&he.parser.lazy[he.now().line]){let e=new ne("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",he.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=Py+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return He(e)}function T(e,t,n){let r=new ne(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Iy(e)+`)`)+` `+t+`, expected `+n,he.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=Py+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Iy(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Ly(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return Fy.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function Ry(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let o=this;return s;function s(e){return c(e)}function c(r){return Fy.call(o,n,u,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function u(e){return l(e)?m(n,d,`whitespace`)(e):d(e)}function d(e){let t=o.parser.constructs.flow[123],c=Array.isArray(t)?t:t?[t]:[],l;for(let e of c)if(e.name===`mdxFlowExpression`){l=e;break}return e===60?s(e):e===123&&l?n.attempt(l,d,i)(e):e===null||a(e)?r(e):i(e)}}}function zy(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:Ry(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Ly(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function By(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var Vy={}.hasOwnProperty;function Hy(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Hy(e,t.extensions[n]);for(r in t)if(Vy.call(t,r))switch(r){case`extensions`:break;
|
|
31
31
|
/* c8 ignore next 4 */
|
|
32
|
-
case`unsafe`:
|
|
32
|
+
case`unsafe`:Uy(e[r],t[r]);break;case`join`:Uy(e[r],t[r]);break;case`handlers`:Wy(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Uy(e,t){t&&e.push(...t)}function Wy(e,t){t&&Object.assign(e,t)}var Gy=[Ky];function Ky(e,t,n,r){if(t.type===`code`&&g(t,r)&&(e.type===`list`||e.type===t.type&&g(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`){if(n.spread)return 1;if(e.type===`html`){let t=b(e.value);if(t===void 0||t===6||t===7)return 1}if(e.type===`blockquote`&&t.type===`blockquote`||(e.type===`definition`||e.type===`paragraph`)&&t.type===`list`&&(t.ordered&&typeof t.start==`number`&&t.start!==1||t.children.length>0&&t.children[0].children.length===0)||e.type===`paragraph`&&t.type===`thematicBreak`&&C(r)===`-`&&!r.options.ruleSpaces)return 1;let i=e;for(;(i.type===`blockquote`||i.type===`list`||i.type===`listItem`)&&i.children.length>0;)i=i.children[i.children.length-1];if(i.type!==`definition`&&i.type!==`paragraph`)return 0;if(t.type===`code`&&g(t,r))return 1;if(t.type===`html`){let e=b(t.value);if(e===void 0||e===7)return 1}return(e.type===`paragraph`||e!==i)&&(t.type===`definition`||t.type===`heading`&&h(t,r)||t.type===`paragraph`)?1:0}}for(var qy=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Jy=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
33
33
|
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`\r`,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:`\r`,after:`\\r`,inConstruct:`phrasing`},{character:`
|
|
34
34
|
`,before:`\\n`,inConstruct:`phrasing`},{character:`
|
|
35
|
-
`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:
|
|
36
|
-
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`destinationRaw`,`phrasing`,`titleApostrophe`,`titleQuote`]},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:
|
|
37
|
-
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:
|
|
35
|
+
`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:qy},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
36
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`destinationRaw`,`phrasing`,`titleApostrophe`,`titleQuote`]},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:qy},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
37
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:qy},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
38
38
|
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
39
39
|
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
40
|
-
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:
|
|
40
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:qy},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:qy},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:qy},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:qy},{atBreak:!0,character:`~`},{character:`<`,inConstruct:`autolink`},{character:`>`,inConstruct:`autolink`},{character:``,inConstruct:`autolink`}],Yy=-1;++Yy<33;)Jy.push({character:String.fromCharCode(Yy),inConstruct:`autolink`});function Xy(e){return e.label||!e.identifier?e.label||``:p(e.identifier)}function Zy(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((e.beforeNode?`^`:t?`(`+t+`)`:``)+(/[$()*+.?[\\\]^{|}]/.test(e.character)?`\\`:``)+e.character+(e.afterNode?`$`:e.after?`(?:`+e.after+`)`:``),e.unicode?`gu`:`g`)}return e._compiled}function Qy(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
41
41
|
`,after:`
|
|
42
|
-
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(
|
|
42
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move($y(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function $y(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
43
43
|
`.repeat(1+a);if(a===!1)return`
|
|
44
44
|
|
|
45
45
|
<!---->
|
|
46
46
|
|
|
47
47
|
`}return`
|
|
48
48
|
|
|
49
|
-
`}var
|
|
49
|
+
`}var eb=/\r?\n|\r/g;function tb(e,t){let n=[],r=0,i=0,a;for(;a=eb.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}var nb={}.hasOwnProperty;function rb(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},c=e.stack.includes(`autolink`),l=n.before?n.before.length:0,u=r.length-(n.after?n.after.length:0),d=-1;for(;++d<e.unsafe.length;){let t=e.unsafe[d];if(!f(e.stack,t)||!ib(t.beforeNode,n.beforeNode)||!ib(t.afterNode,n.afterNode))continue;let a=e.compilePattern(t),s=t.beforeNode?l:0,c=r.slice(s,t.afterNode?u:void 0),p;for(;p=a.exec(c);){let e=!!(t.before||t.atBreak),n=!!t.after,r=s+p.index+(e?p[1].length:0);nb.call(o,r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(ab);let p=l;for(d=-1;++d<i.length;){let e=i[d];if(!(e<p||e>=u)){if(r.charAt(e)===`_`&&e>0&&s(r.charCodeAt(e-1))===void 0&&!nb.call(o,e-1)&&!(e-1===l&&/[*_]/.test(r.charAt(l-1)))){let t=e+1;for(;t<u&&r.charAt(t)===`_`;)t++;let n=t-e-1;if(i[d+n]===t-1&&t<r.length&&s(r.charCodeAt(t))===void 0&&!nb.call(o,t)&&!(t===u-1&&/[*_]/.test(r.charAt(u)))){d+=n;continue}}if(!(e+1<u&&i[d+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||e-1>=l&&i[d-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after)){if(p!==e){let t=r.slice(p,e);a.push(c?t:ob(t,`\\`))}p=e+1,c?a.push(`%`+r.charCodeAt(e).toString(16).toUpperCase().padStart(2,`0`)):/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`+r.charAt(e)):a.push(_(r.charCodeAt(e)))}}}let m=r.slice(p,u);return a.push(c?m:ob(m,n.after)),a.join(``)}function ib(e,t){return e?t?typeof e==`string`?e===t.type:e.includes(t.type):!1:!0}function ab(e,t){return e-t}function ob(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function sb(e){
|
|
50
50
|
/* c8 ignore next 5 */
|
|
51
|
-
let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function
|
|
51
|
+
let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function cb(e,t){let n=t||{},r={associationId:Xy,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:fb,containerFlow:pb,createTracker:sb,compilePattern:Zy,enter:a,handlers:{...x},handle:void 0,indentLines:tb,indexStack:[],join:[...Gy],options:{},safe:mb,stack:[],unsafe:[...Jy]};Hy(r,n),r.options.tightDefinitions&&r.join.push(db),r.handle=se(`type`,{invalid:lb,unknown:ub,handlers:r.handlers});let i=r.handle(te(e)?{type:`root`,children:[e]}:e,void 0,r,{before:`
|
|
52
52
|
`,after:`
|
|
53
53
|
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
54
|
-
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function
|
|
55
|
-
`}var
|
|
56
|
-
`})}},rx={testLexicalNode:rs,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},ix={testLexicalNode:N,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function ax(e){return e.type===`text`}var ox=[`u`,`span`,`sub`,`sup`];function sx(e,t){return{format:e,isTag:!0,matches:e=>e.type===`mdxJsxTextElement`&&e.name===t&&e.attributes.length===0,create:()=>({type:`mdxJsxTextElement`,name:t,children:[],attributes:[]})}}function cx(e,t){return{format:e,isTag:!1,matches:e=>e.type===t,create:()=>({type:t,children:[]})}}var lx=[sx(8,`u`),sx(64,`sup`),sx(32,`sub`),cx(2,`emphasis`),cx(1,`strong`),cx(4,`delete`),cx(128,`highlight`)];function ux(e,t){let n=e.getStyle(),r=0,i=e.getNextSibling();for(;P(i)&&i.getFormat()&t&&i.getStyle()===n;)r++,i=i.getNextSibling();return r}var dx={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&ox.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return ax(e)&&ax(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:P,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getTextContent(),i=e.getFormat(),a=e.getStyle(),o=t;a&&(o=n.appendToParent(o,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:a}]}));let s=0;for(;;){let e=o.children.at(-1),t=e&&lx.find(t=>i&t.format&&!(s&t.format)&&t.matches(e));if(!t)break;s|=t.format,o=e}let c=lx.filter(e=>i&e.format&&!(s&e.format)).map(t=>({container:t,runLength:ux(e,t.format)})).sort((e,t)=>Number(t.container.isTag)-Number(e.container.isTag)||t.runLength-e.runLength);for(let{container:e}of c)o=n.appendToParent(o,e.create());i&16?n.appendToParent(o,{type:`inlineCode`,value:r}):n.appendToParent(o,{type:`text`,value:r})}},fx={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(su())}};function px(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var mx={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},hx={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},gx={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(jo(e.value).setFormat(t.getParentFormatting()|16))}},_x=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...px(`u`,8),...px(`code`,16),gx,mx,hx,...px(`sup`,64),...px(`sub`,32)],vx={testNode:hb,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto($b(e.name,e.type,e.attributes))},priority:-100},yx=[`listitem`,`admonition`],bx={testNode:`paragraph`,visitNode:function({mdastNode:e,mdastParent:t,lexicalParent:n,actions:r}){let i=n.getType();if(yx.includes(i)){let a=t?.children.indexOf(e)??-1,o=a>0?t?.children.at(a-1):void 0;i===`listitem`&&o?.type===`paragraph`&&n.append(su(),su()),r.visitChildren(e,n)}else r.addAndStepInto(F())}},xx={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},Sx={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=jo(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},Cx={dash:45,eof:null,exclamationMark:33,greaterThan:62},wx={data:`data`,lineEnding:`lineEnding`,linePrefix:`linePrefix`};function Tx(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var Ex=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===Cx.exclamationMark?(e.consume(t),o):n(t)}function o(t){return t===Cx.dash?(e.consume(t),s):n(t)}function s(t){return t===Cx.dash?(e.consume(t),c):n(t)}function c(t){return t===Cx.greaterThan?n(t):a(t)?d(t):(e.enter(wx.data),t===Cx.dash?(e.consume(t),l):u(t))}function l(e){return e===Cx.greaterThan?n(e):u(e)}function u(t){return t===Cx.eof?n(t):t===Cx.dash?(e.consume(t),p):a(t)?(e.exit(wx.data),d(t)):(e.consume(t),u)}function d(t){return e.enter(wx.lineEnding),e.consume(t),e.exit(wx.lineEnding),ne(e,f,wx.linePrefix)}function f(t){return a(t)?d(t):(e.enter(wx.data),u(t))}function p(t){return t===Cx.dash?(e.consume(t),m):u(t)}function m(n){return n===Cx.greaterThan?(e.exit(wx.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===Cx.dash?(e.consume(n),m):u(n)}},Dx={flow:{60:{tokenize:Ex,concrete:!0}},text:{60:{tokenize:Ex}}},Ox={bold:`_bold_6j9u9_10`,italic:`_italic_6j9u9_14`,underline:`_underline_6j9u9_18`,strikethrough:`_strikethrough_6j9u9_34`,underlineStrikethrough:`_underlineStrikethrough_6j9u9_38`,subscript:`_subscript_6j9u9_42`,superscript:`_superscript_6j9u9_47`,code:`_code_6j9u9_52`,quote:`_quote_6j9u9_59`,nestedListItem:`_nestedListItem_6j9u9_66`,listitem:`_listitem_6j9u9_76`,listItemChecked:`_listItemChecked_6j9u9_80`,listItemUnchecked:`_listItemUnchecked_6j9u9_81`,admonitionDanger:`_admonitionDanger_6j9u9_158`,admonitionInfo:`_admonitionInfo_6j9u9_159`,admonitionNote:`_admonitionNote_6j9u9_160`,admonitionTip:`_admonitionTip_6j9u9_161`,admonitionCaution:`_admonitionCaution_6j9u9_162`,mdxExpression:`_mdxExpression_6j9u9_195`},kx={quote:Ox.quote,text:{bold:Ox.bold,italic:Ox.italic,underline:Ox.underline,code:Ox.code,strikethrough:Ox.strikethrough,subscript:Ox.subscript,superscript:Ox.superscript,underlineStrikethrough:Ox.underlineStrikethrough},list:{listitem:Ox.listitem,listitemChecked:Ox.listItemChecked,listitemUnchecked:Ox.listItemUnchecked,nested:{listitem:Ox.nestedListItem}},admonition:{danger:Ox.admonitionDanger,info:Ox.admonitionInfo,note:Ox.admonitionNote,tip:Ox.admonitionTip,caution:Ox.admonitionCaution}},Ax={build:(e,t)=>Lm({inheritEditableFromParent:t.inheritEditableFromParent}),config:{$getParentEditor:function(){let e=H();return Fm.fromEditor(e),e},inheritEditableFromParent:!1},init:(e,t,n)=>{let r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},name:`@lexical/extension/NestedEditor`,register:(e,t,n)=>St(()=>{let t=e._parentEditor;if(t&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(t.isEditable()),t.registerEditableListener(e.setEditable.bind(e))})},jx=/* @__PURE__ */ fe(null);function Mx(){let e=he(jx);return e??function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(8),e}function Nx(){return L().getTextContent()}function Px(e,t=!0){if(e)return!1;let n=Nx();return t&&(n=n.trim()),n===``}function Fx(e){if(!Px(e,!1))return!1;let t=L().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(M(n))return!1;if(j(n)){if(!rs(n)||n.__indent!==0)return!1;let e=n.getChildren(),t=e.length;for(let n=0;n<t;n++){let t=e[n];if(!P(t))return!1}}}return!0}function Ix(e){return()=>Fx(e)}var Lx=Et?_e:ge;function Rx({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,ee]=ye(e.isEditable()),te=me(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),ne=ve(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,te),[te,S]);Lx(()=>(ee(e.isEditable()),e.registerEditableListener(e=>{ee(e)})),[e]);let re={"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":g===`combobox`?o??!1:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,...x},ie=[re[`aria-label`],re[`aria-labelledby`],re.title].some(e=>typeof e==`string`&&e.trim()!==``),ae=g===void 0?C||ie?`textbox`:void 0:g;return ae??(re[`aria-activedescendant`]=void 0,re[`aria-autocomplete`]=void 0,re[`aria-expanded`]=void 0,re[`aria-multiline`]=void 0,re[`aria-placeholder`]=void 0,re[`aria-readonly`]=void 0,re[`aria-required`]=void 0),/*#__PURE__*/ Se(`div`,{autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:ne,role:ae,spellCheck:_,style:v,tabIndex:y??(C?void 0:-1),...re})}var zx=/* @__PURE__ */ pe(Rx);function Bx(e){return e.read(`latest`,Ix(e.isComposing()))}var Vx=/* @__PURE__ */ pe(Hx);function Hx(e,t){let{placeholder:n,...r}=e,[i]=Mx();return Ce(xe,{children:[/*#__PURE__*/ Se(zx,{editor:i,...r,ref:t}),n!=null&&/*#__PURE__*/ Se(Ux,{editor:i,content:n})]})}function Ux({content:e,editor:t}){let n=function(e){let[t,n]=ye(()=>Bx(e));return Lx(()=>{function t(){let t=Bx(e);n(t)}return t(),ed(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=ye(t.isEditable());if(Lx(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:/*#__PURE__*/ Se(`div`,{"aria-hidden":!0,children:a})}var Wx=class extends ue{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Gx({children:e,fallback:t,onError:n}){return Se(Wx,{fallback:t===void 0?/*#__PURE__*/ Se(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}):t,onError:n,children:e})}var Kx={name:`@lexical/react/ReactProvider`};function qx({contentEditable:e,children:t}){return Ce(xe,{children:[e,t]})}var Jx={build(e,t,n){n.getPeer(Kx.name)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(321,[...n.getDirectDependentNames()].join(` `));let r=[e,{getTheme:()=>e._config.theme}];return{Component:function(e,t){let[n]=t,r=e.decorators.map(e=>typeof e==`function`?/*#__PURE__*/ Se(e,{context:t}):e);return function(i){let{EditorChildrenComponent:a=e.EditorChildrenComponent,ErrorBoundary:o=e.ErrorBoundary,contentEditable:s=e.contentEditable,children:c}=i,l=function(e,t){let[n,r]=ve(()=>[t=>e.registerDecoratorListener(t),()=>e.getDecorators()],[e]),i=be(n,r,r),a=function(e){let[t,n]=ve(()=>[e.registerRootListener.bind(e),e.getRootElement.bind(e)],[e]);return be(t,n,n)}(e);return ve(()=>{let n=t=>e._onError(t),r=[];for(let a in i){let o=e.getElementByKey(a);if(o!==null){let e=/*#__PURE__*/ Se(t,{onError:n,children:/*#__PURE__*/ Se(de,{fallback:null,children:i[a]})});r.push(/*#__PURE__*/ we(e,o,a))}}return r},[t,i,e,a])}(n,o),u=ve(()=>r.map((e,t)=>/*#__PURE__*/ Se(o,{onError:e=>{n._onError(e)},children:/*#__PURE__*/ Se(de,{fallback:null,children:e})},t)),[o]);return Se(jx.Provider,{value:t,children:/*#__PURE__*/ Ce(a,{context:t,contentEditable:s,children:[c,u,l]})})}}(t,r),context:r}},config:{EditorChildrenComponent:qx,ErrorBoundary:Gx,contentEditable:/*#__PURE__*/ Se(Vx,{}),decorators:[]},mergeConfig(e,t){let n=pm(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:`@lexical/react/React`,peerDependencies:[[`@lexical/react/ReactProvider`]]},Yx=/* @__PURE__ */ new WeakSet,Xx=/* @__PURE__ */ new WeakMap,Zx=/* @__PURE__ */ new Set([lo,So,au,as,ts]),Qx=/* @__PURE__ */ new WeakMap;function $x(e){return fm(Wm,{createInitialHistoryState:()=>e,disabled:!1})}function eS({name:e,namespace:t,nodes:n,theme:r,editable:i=!0,parentEditor:a,historyMode:o,historyState:s,initialEditorState:c,onError:l=e=>{throw e}}){let u=[Kx,fm(Jx,{contentEditable:null}),fm(bm,{setOptions:{tag:Zl},updateOptions:{tag:Zl}})];if(a&&u.push(fm(Ax,{$getParentEditor:()=>a,inheritEditableFromParent:!0})),o===`nested-shared`)u.push(Km);else if(o===`root-shared`||o===`nested-external`){if(!s)throw Error(`${o} requires a historyState`);u.push($x(s))}else o===`table-local`&&u.push(fm(Wm,{disabled:!1}));let d=Am(dm({name:e,namespace:t,nodes:n?.filter(e=>!Zx.has(e)),theme:r,editable:i,$initialEditorState:c,onError:l,dependencies:u})),f=Im(d,Wm.name)?.output.historyState.value;f&&Xx.set(d,f),f&&(Qx.has(f)||Qx.set(f,f.current));let p=f?d.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{let r=f.current;if(n.has(`historic`)||e.size>0||t.size>0){Qx.set(f,r);return}let i=Qx.get(f);r?.editor===d&&i&&i.editor!==d&&(f.undoStack.push({...i}),f.redoStack=[],d.dispatchCommand(Xn,!0),d.dispatchCommand(Yn,!1)),Qx.set(f,r)}):()=>void 0,m=/* @__PURE__ */ new Set,h=f?d.registerCommand(Zn,()=>{let e=setTimeout(()=>{m.delete(e),d.dispatchCommand(Xn,f.undoStack.length>0),d.dispatchCommand(Yn,f.redoStack.length>0)});return m.add(e),!1},1):()=>void 0,g=d.dispose.bind(d),_=!1;return d.dispose=()=>{_||(_=!0,m.forEach(clearTimeout),m.clear(),h(),p(),g())},o===`root-shared`&&Yx.add(d),d}function tS(e){return Yx.has(e)}var nS=O(`NESTED_EDITOR_UPDATED_COMMAND`),rS=w(null),iS=w(null),aS=w(``),oS=w(!0),sS=w(!1,e=>{e.sub(e.pipe(sS,T(rS)),([e,t])=>{t?.setEditable(!e)})}),cS=w(``),lS=w(!1),uS=w(!1),dS=w(0),fS=w(null),pS=Le(e=>{e.link(e.pipe(fS,Ke(e=>e!==null)),pS)}),mS=Le(e=>{e.sub(e.pipe(mS,T(iS)),([e,t])=>{t?.dispatchCommand(yn,e)})}),hS=w(null,e=>{e.sub(e.pipe(hS,T(iS)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:U(r,e=>{let t=e.getParent();return t!==null&&B(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=Hg(i)?i.getTag():i.getType();e.pub(yC,t)}})}),gS=w(``),_S=w(``),vS=w(!1),yS=Le(e=>{e.link(_S,yS),e.sub(gS,t=>{e.pubIn({[vS]:!0,[_S]:t})})}),bS=Le(e=>{e.link(e.pipe(yS,T(US),Ke(([,e])=>!e),We(([e])=>e)),bS)},!0),xS=w([]),SS=w([]),CS=w([]),wS=w([]),TS=w([]),ES=w([]),DS=w({}),OS=w(!1),kS=w([]),AS=w(`source`),jS=w([]),MS=w([]),NS=w(``),PS=w(null),FS=w(null),IS=w(null),LS=eC(SS),RS=eC(xS),zS=eC(CS),BS=eC(wS),VS=eC(TS),HS=eC(ES),US=w(!1),WS=Le(e=>{e.sub(e.pipe(WS,T(_S,rS,uS)),([t,n,r,i])=>{if(e.getValue(CC)!==`rich-text`){if(t!==e.getValue(wC)){let n=e.getValue(US);e.pub(US,!0);try{e.pub(wC,t)}finally{e.pub(US,n)}}}else t.trim()!==n.trim()&&(e.pub(US,!0),r?.update(()=>{L().clear(),iC(e,L(),t),i?r.focus():R(null)},{onUpdate:()=>{e.pub(US,!1)}}))})}),GS=w(null),KS=Le(e=>{e.sub(e.pipe(KS,T(iS,uS)),([t,n,r])=>{e.getValue(GS)?.(t)||n?.update(()=>{let i=q();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};iC(e,n,t),Kf(n.children)}r?n.focus():R(null)})})});function qS(){return qe((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var JS=w(null),YS=w([],e=>{e.pipe(e.combine(YS,iS),qS())}),XS=w([],e=>{e.pipe(e.combine(XS,rS),qS())}),ZS=w(null,qb,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),QS=Le(),$S=w(e=>{throw Error(`No icon component for ${e}`)});function eC(e,t){return Le((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function tC(e){let t=q();G(t)&&e.pubIn({[hS]:t,[dS]:t.format})}var nC=eC(XS,(e,t)=>{e.pub(t,[t=>t.registerCommand(rn,(t,n)=>(e.pubIn({[iS]:n,[uS]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(ZS,{rootNode:L(),editorType:`lexical`,editorRef:n})}),tC(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(fS)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{L().getLastChild()instanceof so&&t.update(()=>{L().append(F())},{discrete:!0}),a=Ab({root:L(),visitors:e.getValue(TS),jsxComponentDescriptors:e.getValue(kS),toMarkdownExtensions:e.getValue(ES),toMarkdownOptions:e.getValue(DS),jsxIsAvailable:e.getValue(OS)})}),e.pub(_S,a.trim()),e.pub(vS,!1)}),t=>t.registerCommand(Zn,()=>(e.pub(uS,!0),!1),4)])}),rC=eC(YS,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{tC(e)})}),t=>t.registerCommand(Qn,t=>{let n=e.getValue(rS);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[uS]:!1,[QS]:t})),!1},4)])});function iC(e,t,n){try{Gb({root:t,visitors:e.getValue(xS),mdastExtensions:e.getValue(wS),markdown:n,syntaxExtensions:e.getValue(CS),jsxComponentDescriptors:e.getValue(kS),jsxKindMismatchPolicy:e.getValue(AS),directiveDescriptors:e.getValue(jS),codeBlockEditorDescriptors:e.getValue(MS),defaultCodeBlockLanguage:e.getValue(NS)}),e.pub(fS,null)}catch(t){if(t instanceof Hb||t instanceof Ub||t instanceof jb)e.pubIn({[_S]:n,[fS]:{error:t.message,source:n}});else throw t}}var aC=w([]),oC=eC(aC),sC=w([]),cC=eC(sC),lC=w([]),uC=eC(lC),dC=w([]),fC=eC(dC),pC=w([]),mC=eC(pC),hC=w([]),gC=eC(hC),_C=w(!1,e=>{e.link(e.pipe(iS,We(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),_C)}),vC=w(Um()),yC=w(``);Le();var bC=Le(e=>{e.sub(e.pipe(bC,T(iS)),([e,t])=>{t?.update(()=>{let n=q();G(n)&&(th(n,e),setTimeout(()=>{t.focus()}))})})});function xC(e){if(e.isInline()){Kf([e]),B(e.getParentOrThrow())&&fh(e,F).selectEnd();return}let t=q();if(G(t)){let n=U(t.focus.getNode(),Z);if(Z(n)){let r=No(t.focus,`next`);for(;r!==null&&(Rp(r)||!n.is(r.getParentAtCaret()));)r=Qo(r);if(r!==null){r.insert(e);return}}}dh(e)}var SC=Le(e=>{e.sub(e.pipe(SC,T(iS)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{G(q())&&(t.update(()=>{let t=e();xC(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(nS,void 0)}))})},{defaultSelection:`rootEnd`})})}),CC=w(`rich-text`,e=>{function t(){return qe((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(CC,t(),T(wC)),([{current:t,next:n},r])=>{(t===`source`||t===`diff`)&&n===`rich-text`&&e.pub(WS,r)}),e.sub(e.pipe(CC,t(),Ke(e=>e.current===`rich-text`),T(iS)),([,e])=>{e?.dispatchCommand(nS,void 0)})}),wC=w(``,e=>{e.link(_S,wC),e.link(wC,yS)},!0),TC=w([]),EC=eC(TC),DC=w(()=>{throw Error(`No translation function provided`)}),OC=w(kx),kC=Ze({init(e,t){let n=t?.initialMarkdown??``;e.register(nC),e.register(rC),e.register(yS),e.register(wC),e.pubIn({[gS]:t?.trim?n.trim():n,[$S]:t?.iconComponentFor,[RS]:[xx,bx,Sx,fx,..._x],[LS]:[ts,So,Qb],[VS]:[ix,rx,dx,nx,tx],[aS]:t?.contentEditableClassName,[oS]:t?.spellCheck,[DS]:t?.toMarkdownOptions,[lS]:t?.autoFocus,[cS]:t?.placeholder,[sS]:t?.readOnly,[DC]:t?.translation,[vC]:Um(),[BS]:[i(),av],[zS]:[y(),cy()],[HS]:[Sv(),c(),cv],[OC]:t?.lexicalTheme??kx}),e.singletonSub(pS,t?.onError),e.singletonSub(bS,n=>{t?.onChange(n,e.getValue(vS))}),e.singletonSub(QS,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[BS]:[xv(),Tx()],[zS]:[Ry(),zy(),Dx],[RS]:vx})},postInit(e,t){let n=eS({name:`@mdxeditor/root`,editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(SS),...t?.additionalLexicalNodes??[]],theme:e.getValue(OC),historyMode:t?.suppressSharedHistory?`none`:`root-shared`,historyState:e.getValue(vC),initialEditorState:t?.editorState===null?null:()=>{let n=t?.initialMarkdown.trim()??``;iC(e,L(),n)}});Ye(e,()=>{n.dispose()});let r=t?.autoFocus;if(t?.editorState!==null&&r){let t=setTimeout(()=>{n.focus(qb,{defaultSelection:r===!0?`rootStart`:r.defaultSelection??`rootStart`})});Ye(e,()=>{clearTimeout(t)})}e.pub(rS,n),e.pub(iS,n)},update(e,t){e.pubIn({[aS]:t?.contentEditableClassName,[oS]:t?.spellCheck,[DS]:t?.toMarkdownOptions,[lS]:t?.autoFocus,[cS]:t?.placeholder,[sS]:t?.readOnly}),e.singletonSub(bS,n=>{t?.onChange(n,e.getValue(vS))}),e.singletonSub(QS,t?.onBlur),e.singletonSub(pS,t?.onError)}});function AC(){return Ve(DC)}var jC=/* @__PURE__ */ e(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),MC={editorRoot:`_editorRoot_eoiyl_53`,editorWrapper:`_editorWrapper_eoiyl_155`,toolbarRoot:`_toolbarRoot_eoiyl_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_eoiyl_189`,toolbarToggleItem:`_toolbarToggleItem_eoiyl_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_eoiyl_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_eoiyl_224`,toolbarButton:`_toolbarButton_eoiyl_239`,activeToolbarButton:`_activeToolbarButton_eoiyl_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_eoiyl_286`,selectContainer:`_selectContainer_eoiyl_288`,selectItem:`_selectItem_eoiyl_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_eoiyl_307`,selectTrigger:`_selectTrigger_eoiyl_308`,selectDropdownArrow:`_selectDropdownArrow_eoiyl_373`,contentEditable:`_contentEditable_eoiyl_379`,codeMirrorWrapper:`_codeMirrorWrapper_eoiyl_391`,codeMirrorToolbar:`_codeMirrorToolbar_eoiyl_408`,propertyPanelTitle:`_propertyPanelTitle_eoiyl_430`,propertyEditorTable:`_propertyEditorTable_eoiyl_438`,iconButton:`_iconButton_eoiyl_456`,readOnlyColumnCell:`_readOnlyColumnCell_eoiyl_461`,buttonsFooter:`_buttonsFooter_eoiyl_474`,propertyEditorInput:`_propertyEditorInput_eoiyl_480`,primaryButton:`_primaryButton_eoiyl_506`,secondaryButton:`_secondaryButton_eoiyl_507`,smallButton:`_smallButton_eoiyl_522`,dialogForm:`_dialogForm_eoiyl_534`,linkDialogEditForm:`_linkDialogEditForm_eoiyl_540`,linkDialogInputContainer:`_linkDialogInputContainer_eoiyl_548`,linkDialogInputWrapper:`_linkDialogInputWrapper_eoiyl_554`,linkDialogInput:`_linkDialogInput_eoiyl_548`,linkDialogAnchor:`_linkDialogAnchor_eoiyl_586`,linkDialogPopoverContent:`_linkDialogPopoverContent_eoiyl_600`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_eoiyl_601`,dialogContent:`_dialogContent_eoiyl_602`,largeDialogContent:`_largeDialogContent_eoiyl_614`,dialogTitle:`_dialogTitle_eoiyl_624`,visuallyHidden:`_visuallyHidden_eoiyl_631`,dialogCloseButton:`_dialogCloseButton_eoiyl_644`,popoverContent:`_popoverContent_eoiyl_651`,popoverArrow:`_popoverArrow_eoiyl_663`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_eoiyl_667`,tooltipTrigger:`_tooltipTrigger_eoiyl_690`,tooltipContent:`_tooltipContent_eoiyl_694`,actionButton:`_actionButton_eoiyl_708`,primaryActionButton:`_primaryActionButton_eoiyl_715`,tableEditor:`_tableEditor_eoiyl_727`,toolCell:`_toolCell_eoiyl_738`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_eoiyl_757`,addRowButton:`_addRowButton_eoiyl_759`,addColumnButton:`_addColumnButton_eoiyl_760`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_eoiyl_802`,toggleGroupRoot:`_toggleGroupRoot_eoiyl_815`,tableToolsColumn:`_tableToolsColumn_eoiyl_833`,leftAlignedCell:`_leftAlignedCell_eoiyl_842`,rightAlignedCell:`_rightAlignedCell_eoiyl_846`,centeredCell:`_centeredCell_eoiyl_850`,dialogOverlay:`_dialogOverlay_eoiyl_883`,focusedImage:`_focusedImage_eoiyl_929`,imageWrapper:`_imageWrapper_eoiyl_933`,editImageToolbar:`_editImageToolbar_eoiyl_946`,editImageButton:`_editImageButton_eoiyl_950`,inlineEditor:`_inlineEditor_eoiyl_956`,blockEditor:`_blockEditor_eoiyl_965`,nestedEditor:`_nestedEditor_eoiyl_974`,genericComponentName:`_genericComponentName_eoiyl_993`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_eoiyl_999`,ggDiffSourceToggle:`_ggDiffSourceToggle_eoiyl_1007`,diffSourceToggle:`_diffSourceToggle_eoiyl_999`,selectWithLabel:`_selectWithLabel_eoiyl_1025`,toolbarTitleMode:`_toolbarTitleMode_eoiyl_1040`,imageControlWrapperResizing:`_imageControlWrapperResizing_eoiyl_1045`,imageResizer:`_imageResizer_eoiyl_1049`,imageResizerN:`_imageResizerN_eoiyl_1058`,imageResizerNe:`_imageResizerNe_eoiyl_1064`,imageResizerE:`_imageResizerE_eoiyl_1070`,imageResizerSe:`_imageResizerSe_eoiyl_1076`,imageResizerS:`_imageResizerS_eoiyl_1076`,imageResizerSw:`_imageResizerSw_eoiyl_1088`,imageResizerW:`_imageResizerW_eoiyl_1094`,imageResizerNw:`_imageResizerNw_eoiyl_1100`,imagePlaceholder:`_imagePlaceholder_eoiyl_1106`,imageDimensionsContainer:`_imageDimensionsContainer_eoiyl_1114`,placeholder:`_placeholder_eoiyl_1119`,rootContentEditableWrapper:`_rootContentEditableWrapper_eoiyl_1132`,downshiftInputWrapper:`_downshiftInputWrapper_eoiyl_1142`,downshiftInput:`_downshiftInput_eoiyl_1142`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_eoiyl_1173`,textInput:`_textInput_eoiyl_1219`,multiFieldForm:`_multiFieldForm_eoiyl_1227`,formField:`_formField_eoiyl_1233`,markdownParseError:`_markdownParseError_eoiyl_1244`,popupContainer:`_popupContainer_eoiyl_1253`,inputSizer:`_inputSizer_eoiyl_1258`};export{fS as $,No as $n,Et as $r,Ng as $t,nC as A,Br as An,Ul as Ar,gb as At,dC as B,B as Bn,Uc as Br,tv as Bt,aC as C,Le as Ci,Ln as Cn,_n as Cr,Ix as Ct,bC as D,Ge as Di,Af as Dn,ss as Dr,Kb as Dt,JS as E,We as Ei,I as En,N as Er,qb as Et,jS as F,Po as Fn,ed as Fr,Sy as Ft,SC as G,tu as Gn,ui as Gr,W_ as Gt,vC as H,Gn as Hn,os as Hr,ev as Ht,ZS as I,Hn as In,Ql as Ir,_y as It,kS as J,Pn as Jn,F as Jr,X as Jt,KS as K,P as Kn,j as Kr,Z as Kt,_C as L,L as Ln,Mf as Lr,xv as Lt,dS as M,In as Mn,xn as Mr,zy as Mt,hS as N,ru as Nn,Hc as Nr,Ry as Nt,kC as O,Re as Oi,ys as On,po as Or,xb as Ot,NS as P,Hr as Pn,M as Pr,jy as Pt,_S as Q,Vr as Qn,Qa as Qr,H_ as Qt,PS as R,Ur as Rn,hi as Rr,Sv as Rt,MS as S,Ve as Si,Zn as Sn,Cn as Sr,Vx as St,IS as T,He as Ti,Kf as Tn,bs as Tr,Ox as Tt,$S as U,bc as Un,hn as Ur,rv as Ut,TS as V,xc as Vn,si as Vr,s_ as Vt,xS as W,Wn,H as Wr,nv as Wt,AS as X,jo as Xn,gu as Xr,I_ as Xt,OS as Y,q as Yn,dn as Yr,R_ as Yt,OC as Z,Rn as Zn,gm as Zr,N_ as Zt,gC as _,pt as _i,Lm as _n,Ia as _r,eS as _t,iS as a,V as ai,a_ as an,So as ar,sS as at,mS as b,w as bi,Uo as bn,U as br,Kx as bt,uC as c,vn as ci,lh as cn,Nf as cr,oS as ct,VS as d,Fn as di,dh as dn,qp as dr,ES as dt,Vc as ei,Fg as en,Vn as er,wC as et,RS as f,di as fi,uh as fn,Qn as fr,DS as ft,zS as g,St as gi,Um as gn,Nc as gr,CC as gt,mC as h,Ro as hi,Hm as hn,O as hr,SS as ht,nS as i,ti as ii,Hg as in,wc as ir,cS as it,yC as j,eu as jn,Sn as jr,sb as jt,rC as k,T as ki,An as kn,ao as kr,Ab as kt,oC as l,fc as li,fh as ln,gi as lr,CS as lt,BS as m,su as mi,Qm as mn,G as mr,AC as mt,jC as n,rs as ni,Pg as nn,K as nr,pC as nt,TC as o,ci as oi,pg as on,vs as or,rS as ot,LS as p,qt as pi,hh as pn,rn as pr,sC as pt,GS as q,zn as qn,ii as qr,G_ as qt,eC as r,oi as ri,Vg as rn,J as rr,QS as rt,EC as s,Za as si,mg as sn,$l as sr,WS as st,MC as t,so as ti,Lg as tn,on as tr,wS as tt,fC as u,_i as ui,ph as un,Nn as ur,hC as ut,HS as v,Qe as vi,Im as vn,R as vr,tS as vt,aS as w,Be as wi,cu as wn,Zl as wr,Mx as wt,lC as x,Ue as xi,Ls as xn,hm as xr,Gx as xt,cC as y,Ze as yi,Fm as yn,$o as yr,Jx as yt,FS as z,zp as zn,Mn as zr,$_ as zt};
|
|
54
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function lb(e){throw Error("Cannot handle value `"+e+"`, expected node")}function ub(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function db(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function fb(e,t){return S(e,this,t)}function pb(e,t){return Qy(e,this,t)}function mb(e,t){return rb(this,e,t)}var hb=[`mdxJsxTextElement`,`mdxJsxFlowElement`];function gb(e){return hb.includes(e.type)&&_b.includes(e.name)}var _b=/* @__PURE__ */ `a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.input.ins.kbd.label.legend.li.link.main.map.mark.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function vb(e,t){let n=yb(e),r=yb(t);return bb({...n,...r})}function yb(e){let t={};return e.split(`;`).filter(e=>e.trim()!==``).forEach(e=>{let[n,r]=e.split(`:`).map(e=>e.trim());t[n]=r}),t}function bb(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function xb(e){return e.data?.mdxEditorImport}function Sb(e){return e&&`localName`in e?e:void 0}function Cb(e,t){return{...e,data:{...e.data,mdxEditorImport:t}}}function wb(e){return e.data?.mdxEditorImports||(e.data?.estree?.body??[]).flatMap(e=>e.type===`ImportDeclaration`?e.specifiers.map(t=>{let n=t.type===`ImportDefaultSpecifier`?`default`:t.type===`ImportNamespaceSpecifier`?`namespace`:`named`;return{source:String(e.source.value),defaultExport:n==="default",kind:n,importedName:t.type===`ImportSpecifier`?t.imported.type===`Identifier`?t.imported.name:String(t.imported.value):n==="default"?`default`:`*`,localName:t.local.name}}):[])}function Tb(e){return(e.data?.estree?.body??[]).flatMap(e=>{if(e.type!==`ExportNamedDeclaration`||!e.declaration)return[];let t=e.declaration;return t.type===`VariableDeclaration`?t.declarations.flatMap(e=>e.id.type===`Identifier`?[e.id.name]:[]):[t.id.name]})}function Eb(e){return`'${JSON.stringify(e).slice(1,-1).replace(/'/g,`\\'`)}'`}function Db(e){let t=e[0],n=t.kind==="default"?t.localName:t.kind===`namespace`?`* as ${t.localName}`:`{ ${e.map(({importedName:e,localName:t})=>e===t?t:`${/^[$_\p{ID_Start}][$\u200C\u200D\p{ID_Continue}]*$/u.test(e)?e:Eb(e)} as ${t}`).join(`, `)} }`,r={mdxEditorImports:e};return{type:`mdxjsEsm`,value:`import ${n} from ${Eb(t.source)}`,data:r}}function Ob(e){return e.children instanceof Array}function kb({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let a=null,o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Map;t=[...t].sort((e,t)=>(t.priority??0)-(e.priority??0)),d(e,null);function c(e,t){e!==null&&(Sb(t)||(/* @__PURE__ */ RegExp(`^(?!\\p{Ll})[\\p{ID_Start}_$][\\p{ID_Continue}$\\u200C\\u200D]*$`,`u`)).test(e))&&(o.add(e),t&&s.set(e,{...t}))}function l(e,n){if(a===null)return a=n,a;if(!Ob(e))throw Error(`Attempting to append children to a non-parent`);let r=e.children,i=r.at(-1);if(i){let e=t.find(e=>e.shouldJoin?.call(e,i,n));if(e){let t=e.join(i,n);return r.splice(r.length-1,1,t),t}}return r.push(n),n}function u(e,t){e.getChildren().forEach(e=>{d(e,t)})}function d(e,n,r=null){var i;let a=t.find((t,n)=>!r?.has(n)&&t.testLexicalNode?.call(t,e));if(!a)throw Error(`no lexical visitor found for ${e.getType()}`,{cause:e});(i=a.visitLexicalNode)==null||i.call(a,{lexicalNode:e,mdastParent:n,actions:{addAndStepInto(t,r={},i=!0){let a={type:t,...r,...i?{children:[]}:{}};l(n,a),j(e)&&i&&u(e,a)},appendToParent:l,visitChildren:u,visit:d,registerReferredComponent:c,nextVisitor(){d(e,n,(r??/* @__PURE__ */ new Set).add(t.indexOf(a)))}}})}if(a===null)throw Error(`traversal ended with no root element`);let f=a,p=/* @__PURE__ */ new Set,m=e=>{if(e.type===`mdxjsEsm`){for(let t of wb(e))p.add(t.localName);for(let t of Tb(e))p.add(t)}`children`in e&&e.children.forEach(m)};if(m(f),i){let e=t=>{(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name!==null&&((n.find(e=>e.name===t.name)??n.find(e=>e.name===`*`))?.source||xb(t))&&c(t.name,xb(t)),`children`in t&&t.children.forEach(e)};e(f)}let h=/* @__PURE__ */ new Map;for(let e of o){let t=s.get(e),r=Sb(t),a=r!==void 0&&r.localName!==e.split(`.`)[0],o=a?void 0:t,c=a?void 0:r,l=c?.localName??e;if(p.has(l)||h.has(l)||!i&&(!o||c?.inherited))continue;if(c){h.set(l,c);continue}let u=n.find(t=>t.name===e)??o??n.find(e=>e.name===`*`);if(!u)throw Error(`Component ${e} is used but not imported`);u.source&&h.set(l,{source:u.source,defaultExport:u.defaultExport??!1,kind:u.defaultExport?`default`:`named`,importedName:u.defaultExport?`default`:l,localName:l})}let g=/* @__PURE__ */ new Map,_=[];for(let e of h.values())if(e.kind===`named`){let t=g.get(e.source)??[];t.push(e),g.set(e.source,t)}else _.push(e);let v=[...Array.from(g.values(),Db),..._.map(e=>Db([e]))],y=f.children.find(e=>e.type===`yaml`);return y?f.children.splice(f.children.indexOf(y)+1,0,...v):f.children.unshift(...v),Nb(f),Lb(f,[]),Ab(f),r||jb(f),f}function Ab(e){if(`children`in e&&e.children.length>0){if(gb(e)&&e.children.length===1){let t=e.children[0];t.type===`mdxJsxTextElement`&&t.name===`span`&&(t.attributes.forEach(t=>{if(t.type===`mdxJsxAttribute`){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t.name);if(n){if(t.name===`className`){let e=/* @__PURE__ */ new Set([...n.value.split(` `),...t.value.split(` `)]);n.value=Array.from(e).join(` `)}else t.name===`style`&&(n.value=vb(n.value,t.value))}else e.attributes.push(t)}}),e.children=t.children)}e.children.forEach(e=>{Ab(e)})}}function jb(e){if(Object.hasOwn(e,`children`)){let t=e,n=[];t.children.forEach(e=>{e.type===`mdxJsxTextElement`&&e.name===`u`?n.push({type:`html`,value:`<u>`},...e.children,{type:`html`,value:`</u>`}):(n.push(e),jb(e))}),t.children=n}}var Mb=/\n(?:[^\S\n]*\n)+/;function Nb(e){if(!(`children`in e))return;let t=[];for(let n of e.children)n.type===`paragraph`&&n.children.some(e=>e.type===`text`&&Mb.test(e.value))?t.push(...Pb(n)):(Nb(n),t.push(n));e.children=t}function Pb(e){let t=[{type:`paragraph`,children:[]}];for(let n of e.children)n.type===`text`?n.value.split(Mb).forEach((e,n)=>{n>0&&t.push({type:`paragraph`,children:[]}),e&&t.at(-1).children.push({type:`text`,value:e})}):t.at(-1).children.push(n);let n=t.filter(e=>e.children.length>0);return n.length>0?n:[{type:`paragraph`,children:[]}]}var Fb=/\s+$/,Ib=/^\s+/;function Lb(e,t){if(e.type===`strong`||e.type===`emphasis`){let n=e.children.at(-1);if(n?.type===`text`){let r=Fb.exec(n.value);if(r){n.value=n.value.replace(Fb,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e)+1,0,{type:`text`,value:r[0]}),Lb(i,t.slice(0,-1)))}}let r=e.children.at(0);if(r?.type===`text`){let n=Ib.exec(r.value);if(n){r.value=r.value.replace(Ib,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e),0,{type:`text`,value:n[0]}),Lb(i,t.slice(0,-1)))}}}if(`children`in e&&e.children.length>0){let n=e;n.children.forEach(e=>{Lb(e,[...t,n])})}}function Rb({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}){return cb(kb({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}),{extensions:n,...t})+`
|
|
55
|
+
`}var zb=class extends Error{constructor(e,t,n,r){let i=e.name??`Fragment`,a=e.type===`mdxJsxFlowElement`?`flow`:`text`,o=r?` ${r}`:``;super(`JSX component "${i}" was parsed as ${a} but is declared as ${t.kind} (kindMismatchPolicy: "${n}").${o}`),this.name=`JsxKindMismatchError`}},Bb=/* @__PURE__ */ new Set([`paragraph`,`heading`,`emphasis`,`strong`,`delete`,`link`,`linkReference`,`tableCell`,`footnote`,`mdxJsxTextElement`,`textDirective`,`leafDirective`]),Vb=/* @__PURE__ */ new Set([`root`,`blockquote`,`listItem`,`footnoteDefinition`,`mdxJsxFlowElement`,`containerDirective`]);function Hb(e){return e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`}function Ub(e,t){return t.find(t=>t.name===e.name)??t.find(e=>e.name===`*`)}function Wb(e,t){return(e.type===`mdxJsxFlowElement`?`flow`:`text`)!==t.kind}function Gb(e,t,n){if(Hb(e)){let r=Ub(e,t);if(r&&n(e)&&Wb(e,r))throw new zb(e,r,`error`)}`children`in e&&e.children.forEach(e=>{Gb(e,t,n)})}function Kb(e,t,n){let r=e=>n(e)?Ub(e,t):void 0;function i(e){let t=Bb.has(e.type)?`phrasing`:Vb.has(e.type)?`flow`:`structural`;return e.children=t===`phrasing`?e.children.flatMap(t=>s(t,e.type)):t===`flow`?e.children.flatMap(e=>l(e)):e.children.map(t=>o(t,e.type)),e}function a(e){return`children`in e&&i(e),e}function o(e,t){if(Hb(e)){let n=r(e);if(n&&Wb(e,n))throw new zb(e,n,`normalize`,`The ${t} parent does not declare whether its children are flow or phrasing content.`)}return a(e)}function s(e,t){if(!Hb(e))return[a(e)];let n=r(e);if(!n||!Wb(e,n))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new zb(e,n,`normalize`,`It cannot be lifted from ${t} without changing surrounding phrasing content.`);return[a(u(e,n))]}function c(e){let t=e.children.find(e=>e.type===`mdxJsxTextElement`&&r(e)?.kind===`flow`);if(!t)return[i(e)];let n=r(t);if(e.children.length!==1)throw new zb(t,n,`normalize`,`It has surrounding phrasing content, and normalization would need to split the paragraph.`);return[a({...t,type:`mdxJsxFlowElement`,children:t.children.length===0?[]:[{type:`paragraph`,children:t.children}]})]}function l(e){if(e.type===`paragraph`)return c(e);if(!Hb(e))return[a(e)];let t=r(e);if(!t||!Wb(e,t))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new zb(e,t,`normalize`,`A text JSX node can be normalized to flow only when it is the sole child of a paragraph.`);return[{type:`paragraph`,children:[a(u(e,t))]}]}function u(e,t){if(e.children.length===0)return{...e,type:`mdxJsxTextElement`,children:[]};if(e.children.length!==1||e.children[0].type!==`paragraph`)throw new zb(e,t,`normalize`,`Its block children cannot be represented as one phrasing-content sequence without data loss.`);return{...e,type:`mdxJsxTextElement`,children:e.children[0].children}}return i(e)}function qb(e,t,n,r=()=>!0){return n===`source`?e:n===`error`?(Gb(e,t,r),e):Kb(structuredClone(e),t,r)}function Jb(e){return _b.includes(e)}function Yb(e){return e.children instanceof Array}var Xb=[`paragraph`,`heading`,`tableCell`],Zb=class extends Error{constructor(e,t){super(e),this.name=`MarkdownParseError`,this.cause=t}},Qb=class extends Error{constructor(e){super(e),this.name=`UnrecognizedMarkdownConstructError`}};function $b(e){let t=/* @__PURE__ */ new Map;if(e.type!==`root`)return{importDeclarations:{}};for(let n of e.children)if(n.type===`mdxjsEsm`)for(let e of wb(n))t.set(e.localName,e);function n(e,r=!1){if((e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&e.name){let n=t.get(e.name.split(`.`)[0]);n&&(e.data=Cb(e,{...n,inherited:r}).data)}if(`children`in e){let t=r||e.type===`containerDirective`||e.type===`textDirective`||e.type===`leafDirective`||e.type===`table`||(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`)&&(e.name===null||!Jb(e.name));e.children.forEach(e=>{n(e,t)})}}return n(e),{importDeclarations:Object.fromEntries(t.entries())}}function ex({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...a}){let o;try{o=ee(t,{extensions:r,mdastExtensions:i})}catch(e){throw e instanceof Error?new Zb(`Error parsing markdown: ${e.message}`,e):new Zb(`Error parsing markdown: ${e}`,e)}o.children.length===0&&o.children.push({type:`paragraph`,children:[]}),o.children.at(-1)?.type!==`paragraph`&&o.children.push({type:`paragraph`,children:[]}),tx({root:e,mdastRoot:o,visitors:n,...a})}function tx({root:e,mdastRoot:t,visitors:n,...r}){n=n.sort((e,t)=>(t.priority??0)-(e.priority??0));function i(e,t=null){return n.find((n,i)=>t?.has(i)?!1:typeof n.testNode==`string`?n.testNode===e.type:n.testNode(e,r))}t=qb(t,r.jsxComponentDescriptors,r.jsxKindMismatchPolicy??`source`,e=>i(e)?.jsxKindReconciliationOwner===!0);let a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap,s=$b(t);function c(e,t){if(!Yb(e))throw Error(`Attempting to visit children of a non-parent`);e.children.forEach(n=>{if(Yb(n)&&!Xb.includes(n.type)){let t=a.get(e);t!==void 0&&!a.has(n)&&a.set(n,t);let r=o.get(e);r!==void 0&&!o.has(n)&&o.set(n,r)}l(n,t,e)})}function l(e,t,u,d=null){let f=i(e,d);if(!f)try{throw new Qb(`Unsupported markdown syntax: ${cb(e)}`)}catch{throw new Qb(`Parsing of the following markdown structure failed: ${JSON.stringify({type:e.type,name:`name`in e?e.name:`N/A`})}`)}f.visitNode({mdastNode:e,lexicalParent:t,mdastParent:u,descriptors:r,metaData:s,actions:{visitChildren:c,nextVisitor(){l(e,t,u,(d??/* @__PURE__ */ new Set).add(n.indexOf(f)))},addAndStepInto(n){t.append(n),Yb(e)&&c(e,n)},addFormatting(t,n){n||Yb(e)&&(n=e),n&&a.set(n,t|(a.get(u)??0))},removeFormatting(t,n){n||Yb(e)&&(n=e),n&&a.set(n,t^(a.get(u)??0))},getParentFormatting(){return a.get(u)??0},addStyle(t,n){n||Yb(e)&&(n=e),n&&o.set(n,t)},getParentStyle(){return o.get(u)??``}}})}l(t,e,null)}function nx(){}var rx=Object.defineProperty,ix=(e,t,n)=>t in e?rx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ax=(e,t,n)=>ix(e,typeof t==`symbol`?t:t+``,n),ox=`generic-html`,sx=class e extends ao{constructor(e,t,n,r){super(r),ax(this,`__tag`),ax(this,`__nodeType`),ax(this,`__attributes`),this.__tag=e,this.__nodeType=t,this.__attributes=n}static getType(){return ox}static clone(t){return new e(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){let t=this.getWritable();t.__attributes=e}getStyle(){return this.__attributes.find(e=>e.name===`style`)?.value}createDOM(){let e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(e=>{t.setAttribute(e.name,e.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){let{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){let t=cx(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:ox,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType===`mdxJsxTextElement`}};function cx(e,t,n){return xc(new sx(e,t,n))}function lx(e){return e instanceof sx}var ux={testLexicalNode:lx,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto(`mdxJsxTextElement`,{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},dx={testLexicalNode:cu,visitLexicalNode:({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:`text`,value:`
|
|
56
|
+
`})}},fx={testLexicalNode:rs,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},px={testLexicalNode:N,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function mx(e){return e.type===`text`}var hx=[`u`,`span`,`sub`,`sup`];function gx(e,t){return{format:e,isTag:!0,matches:e=>e.type===`mdxJsxTextElement`&&e.name===t&&e.attributes.length===0,create:()=>({type:`mdxJsxTextElement`,name:t,children:[],attributes:[]})}}function _x(e,t){return{format:e,isTag:!1,matches:e=>e.type===t,create:()=>({type:t,children:[]})}}var vx=[gx(8,`u`),gx(64,`sup`),gx(32,`sub`),_x(2,`emphasis`),_x(1,`strong`),_x(4,`delete`),_x(128,`highlight`)];function yx(e,t){let n=e.getStyle(),r=0,i=e.getNextSibling();for(;P(i)&&i.getFormat()&t&&i.getStyle()===n;)r++,i=i.getNextSibling();return r}var bx={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&hx.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return mx(e)&&mx(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:P,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getTextContent(),i=e.getFormat(),a=e.getStyle(),o=t;a&&(o=n.appendToParent(o,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:a}]}));let s=0;for(;;){let e=o.children.at(-1),t=e&&vx.find(t=>i&t.format&&!(s&t.format)&&t.matches(e));if(!t)break;s|=t.format,o=e}let c=vx.filter(e=>i&e.format&&!(s&e.format)).map(t=>({container:t,runLength:yx(e,t.format)})).sort((e,t)=>Number(t.container.isTag)-Number(e.container.isTag)||t.runLength-e.runLength);for(let{container:e}of c)o=n.appendToParent(o,e.create());i&16?n.appendToParent(o,{type:`inlineCode`,value:r}):n.appendToParent(o,{type:`text`,value:r})}},xx={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(su())}};function Sx(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var Cx={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},wx={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},Tx={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(jo(e.value).setFormat(t.getParentFormatting()|16))}},Ex=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...Sx(`u`,8),...Sx(`code`,16),Tx,Cx,wx,...Sx(`sup`,64),...Sx(`sub`,32)],Dx={testNode:gb,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(cx(e.name,e.type,e.attributes))},priority:-100},Ox=[`listitem`,`admonition`],kx={testNode:`paragraph`,visitNode:function({mdastNode:e,mdastParent:t,lexicalParent:n,actions:r}){let i=n.getType();if(Ox.includes(i)){let a=t?.children.indexOf(e)??-1,o=a>0?t?.children.at(a-1):void 0;i===`listitem`&&o?.type===`paragraph`&&n.append(su(),su()),r.visitChildren(e,n)}else r.addAndStepInto(F())}},Ax={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},jx={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=jo(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},Mx={dash:45,eof:null,exclamationMark:33,greaterThan:62},Nx={data:`data`,lineEnding:`lineEnding`,linePrefix:`linePrefix`};function Px(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var Fx=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===Mx.exclamationMark?(e.consume(t),o):n(t)}function o(t){return t===Mx.dash?(e.consume(t),s):n(t)}function s(t){return t===Mx.dash?(e.consume(t),c):n(t)}function c(t){return t===Mx.greaterThan?n(t):a(t)?d(t):(e.enter(Nx.data),t===Mx.dash?(e.consume(t),l):u(t))}function l(e){return e===Mx.greaterThan?n(e):u(e)}function u(t){return t===Mx.eof?n(t):t===Mx.dash?(e.consume(t),p):a(t)?(e.exit(Nx.data),d(t)):(e.consume(t),u)}function d(t){return e.enter(Nx.lineEnding),e.consume(t),e.exit(Nx.lineEnding),m(e,f,Nx.linePrefix)}function f(t){return a(t)?d(t):(e.enter(Nx.data),u(t))}function p(t){return t===Mx.dash?(e.consume(t),h):u(t)}function h(n){return n===Mx.greaterThan?(e.exit(Nx.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===Mx.dash?(e.consume(n),h):u(n)}},Ix={flow:{60:{tokenize:Fx,concrete:!0}},text:{60:{tokenize:Fx}}},Lx={bold:`_bold_6j9u9_10`,italic:`_italic_6j9u9_14`,underline:`_underline_6j9u9_18`,strikethrough:`_strikethrough_6j9u9_34`,underlineStrikethrough:`_underlineStrikethrough_6j9u9_38`,subscript:`_subscript_6j9u9_42`,superscript:`_superscript_6j9u9_47`,code:`_code_6j9u9_52`,quote:`_quote_6j9u9_59`,nestedListItem:`_nestedListItem_6j9u9_66`,listitem:`_listitem_6j9u9_76`,listItemChecked:`_listItemChecked_6j9u9_80`,listItemUnchecked:`_listItemUnchecked_6j9u9_81`,admonitionDanger:`_admonitionDanger_6j9u9_158`,admonitionInfo:`_admonitionInfo_6j9u9_159`,admonitionNote:`_admonitionNote_6j9u9_160`,admonitionTip:`_admonitionTip_6j9u9_161`,admonitionCaution:`_admonitionCaution_6j9u9_162`,mdxExpression:`_mdxExpression_6j9u9_195`},Rx={quote:Lx.quote,text:{bold:Lx.bold,italic:Lx.italic,underline:Lx.underline,code:Lx.code,strikethrough:Lx.strikethrough,subscript:Lx.subscript,superscript:Lx.superscript,underlineStrikethrough:Lx.underlineStrikethrough},list:{listitem:Lx.listitem,listitemChecked:Lx.listItemChecked,listitemUnchecked:Lx.listItemUnchecked,nested:{listitem:Lx.nestedListItem}},admonition:{danger:Lx.admonitionDanger,info:Lx.admonitionInfo,note:Lx.admonitionNote,tip:Lx.admonitionTip,caution:Lx.admonitionCaution}},zx={build:(e,t)=>Lm({inheritEditableFromParent:t.inheritEditableFromParent}),config:{$getParentEditor:function(){let e=H();return Fm.fromEditor(e),e},inheritEditableFromParent:!1},init:(e,t,n)=>{let r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},name:`@lexical/extension/NestedEditor`,register:(e,t,n)=>Ct(()=>{let t=e._parentEditor;if(t&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(t.isEditable()),t.registerEditableListener(e.setEditable.bind(e))})},Bx=/* @__PURE__ */ fe(null);function Vx(){let e=he(Bx);return e??function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(8),e}function Hx(){return L().getTextContent()}function Ux(e,t=!0){if(e)return!1;let n=Hx();return t&&(n=n.trim()),n===``}function Wx(e){if(!Ux(e,!1))return!1;let t=L().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(M(n))return!1;if(j(n)){if(!rs(n)||n.__indent!==0)return!1;let e=n.getChildren(),t=e.length;for(let n=0;n<t;n++){let t=e[n];if(!P(t))return!1}}}return!0}function Gx(e){return()=>Wx(e)}var Kx=Dt?_e:ge;function qx({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,ee]=ye(e.isEditable()),te=me(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),ne=ve(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,te),[te,S]);Kx(()=>(ee(e.isEditable()),e.registerEditableListener(e=>{ee(e)})),[e]);let re={"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":g===`combobox`?o??!1:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,...x},ie=[re[`aria-label`],re[`aria-labelledby`],re.title].some(e=>typeof e==`string`&&e.trim()!==``),ae=g===void 0?C||ie?`textbox`:void 0:g;return ae??(re[`aria-activedescendant`]=void 0,re[`aria-autocomplete`]=void 0,re[`aria-expanded`]=void 0,re[`aria-multiline`]=void 0,re[`aria-placeholder`]=void 0,re[`aria-readonly`]=void 0,re[`aria-required`]=void 0),/*#__PURE__*/ Se(`div`,{autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:ne,role:ae,spellCheck:_,style:v,tabIndex:y??(C?void 0:-1),...re})}var Jx=/* @__PURE__ */ pe(qx);function Yx(e){return e.read(`latest`,Gx(e.isComposing()))}var Xx=/* @__PURE__ */ pe(Zx);function Zx(e,t){let{placeholder:n,...r}=e,[i]=Vx();return Ce(xe,{children:[/*#__PURE__*/ Se(Jx,{editor:i,...r,ref:t}),n!=null&&/*#__PURE__*/ Se(Qx,{editor:i,content:n})]})}function Qx({content:e,editor:t}){let n=function(e){let[t,n]=ye(()=>Yx(e));return Kx(()=>{function t(){let t=Yx(e);n(t)}return t(),ed(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=ye(t.isEditable());if(Kx(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:/*#__PURE__*/ Se(`div`,{"aria-hidden":!0,children:a})}var $x=class extends ue{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function eS({children:e,fallback:t,onError:n}){return Se($x,{fallback:t===void 0?/*#__PURE__*/ Se(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}):t,onError:n,children:e})}var tS={name:`@lexical/react/ReactProvider`};function nS({contentEditable:e,children:t}){return Ce(xe,{children:[e,t]})}var rS={build(e,t,n){n.getPeer(tS.name)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),/* @__PURE__ */ Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(321,[...n.getDirectDependentNames()].join(` `));let r=[e,{getTheme:()=>e._config.theme}];return{Component:function(e,t){let[n]=t,r=e.decorators.map(e=>typeof e==`function`?/*#__PURE__*/ Se(e,{context:t}):e);return function(i){let{EditorChildrenComponent:a=e.EditorChildrenComponent,ErrorBoundary:o=e.ErrorBoundary,contentEditable:s=e.contentEditable,children:c}=i,l=function(e,t){let[n,r]=ve(()=>[t=>e.registerDecoratorListener(t),()=>e.getDecorators()],[e]),i=be(n,r,r),a=function(e){let[t,n]=ve(()=>[e.registerRootListener.bind(e),e.getRootElement.bind(e)],[e]);return be(t,n,n)}(e);return ve(()=>{let n=t=>e._onError(t),r=[];for(let a in i){let o=e.getElementByKey(a);if(o!==null){let e=/*#__PURE__*/ Se(t,{onError:n,children:/*#__PURE__*/ Se(de,{fallback:null,children:i[a]})});r.push(/*#__PURE__*/ we(e,o,a))}}return r},[t,i,e,a])}(n,o),u=ve(()=>r.map((e,t)=>/*#__PURE__*/ Se(o,{onError:e=>{n._onError(e)},children:/*#__PURE__*/ Se(de,{fallback:null,children:e})},t)),[o]);return Se(Bx.Provider,{value:t,children:/*#__PURE__*/ Ce(a,{context:t,contentEditable:s,children:[c,u,l]})})}}(t,r),context:r}},config:{EditorChildrenComponent:nS,ErrorBoundary:eS,contentEditable:/*#__PURE__*/ Se(Xx,{}),decorators:[]},mergeConfig(e,t){let n=pm(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:`@lexical/react/React`,peerDependencies:[[`@lexical/react/ReactProvider`]]},iS=/* @__PURE__ */ new WeakSet,aS=/* @__PURE__ */ new WeakMap,oS=/* @__PURE__ */ new Set([lo,So,au,as,ts]),sS=/* @__PURE__ */ new WeakMap;function cS(e){return fm(Wm,{createInitialHistoryState:()=>e,disabled:!1})}function lS({name:e,namespace:t,nodes:n,theme:r,editable:i=!0,parentEditor:a,historyMode:o,historyState:s,initialEditorState:c,onError:l=e=>{throw e}}){let u=[tS,fm(rS,{contentEditable:null}),fm(bm,{setOptions:{tag:Zl},updateOptions:{tag:Zl}})];if(a&&u.push(fm(zx,{$getParentEditor:()=>a,inheritEditableFromParent:!0})),o===`nested-shared`)u.push(Km);else if(o===`root-shared`||o===`nested-external`){if(!s)throw Error(`${o} requires a historyState`);u.push(cS(s))}else o===`table-local`&&u.push(fm(Wm,{disabled:!1}));let d=Am(dm({name:e,namespace:t,nodes:n?.filter(e=>!oS.has(e)),theme:r,editable:i,$initialEditorState:c,onError:l,dependencies:u})),f=Im(d,Wm.name)?.output.historyState.value;f&&aS.set(d,f),f&&(sS.has(f)||sS.set(f,f.current));let p=f?d.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{let r=f.current;if(n.has(`historic`)||e.size>0||t.size>0){sS.set(f,r);return}let i=sS.get(f);r?.editor===d&&i&&i.editor!==d&&(f.undoStack.push({...i}),f.redoStack=[],d.dispatchCommand(Zn,!0),d.dispatchCommand(Xn,!1)),sS.set(f,r)}):()=>void 0,m=/* @__PURE__ */ new Set,h=f?d.registerCommand(Qn,()=>{let e=setTimeout(()=>{m.delete(e),d.dispatchCommand(Zn,f.undoStack.length>0),d.dispatchCommand(Xn,f.redoStack.length>0)});return m.add(e),!1},1):()=>void 0,g=d.dispose.bind(d),_=!1;return d.dispose=()=>{_||(_=!0,m.forEach(clearTimeout),m.clear(),h(),p(),g())},o===`root-shared`&&iS.add(d),d}function uS(e){return iS.has(e)}var dS=D(`NESTED_EDITOR_UPDATED_COMMAND`),fS=w(null),pS=w(null),mS=w(``),hS=w(!0),gS=w(!1,e=>{e.sub(e.pipe(gS,T(fS)),([e,t])=>{t?.setEditable(!e)})}),_S=w(``),vS=w(!1),yS=w(!1),bS=w(0),xS=w(null),SS=Le(e=>{e.link(e.pipe(xS,Ke(e=>e!==null)),SS)}),CS=Le(e=>{e.sub(e.pipe(CS,T(pS)),([e,t])=>{t?.dispatchCommand(bn,e)})}),wS=w(null,e=>{e.sub(e.pipe(wS,T(pS)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:U(r,e=>{let t=e.getParent();return t!==null&&B(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=Hg(i)?i.getTag():i.getType();e.pub(OC,t)}})}),TS=w(``),ES=w(``),DS=w(!1),OS=Le(e=>{e.link(ES,OS),e.sub(TS,t=>{e.pubIn({[DS]:!0,[ES]:t})})}),kS=Le(e=>{e.link(e.pipe(OS,T(QS),Ke(([,e])=>!e),We(([e])=>e)),kS)},!0),AS=w([]),jS=w([]),MS=w([]),NS=w([]),PS=w([]),FS=w([]),IS=w({}),LS=w(!1),RS=w([]),zS=w(`source`),BS=w([]),VS=w([]),HS=w(``),US=w(null),WS=w(null),GS=w(null),KS=lC(jS),qS=lC(AS),JS=lC(MS),YS=lC(NS),XS=lC(PS),ZS=lC(FS),QS=w(!1),$S=Le(e=>{e.sub(e.pipe($S,T(ES,fS,yS)),([t,n,r,i])=>{if(e.getValue(MC)!==`rich-text`){if(t!==e.getValue(NC)){let n=e.getValue(QS);e.pub(QS,!0);try{e.pub(NC,t)}finally{e.pub(QS,n)}}}else t.trim()!==n.trim()&&(e.pub(QS,!0),r?.update(()=>{L().clear(),pC(e,L(),t),i?r.focus():R(null)},{onUpdate:()=>{e.pub(QS,!1)}}))})}),eC=w(null),tC=Le(e=>{e.sub(e.pipe(tC,T(pS,yS)),([t,n,r])=>{e.getValue(eC)?.(t)||n?.update(()=>{let i=q();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};pC(e,n,t),Kf(n.children)}r?n.focus():R(null)})})});function nC(){return qe((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var rC=w(null),iC=w([],e=>{e.pipe(e.combine(iC,pS),nC())}),aC=w([],e=>{e.pipe(e.combine(aC,fS),nC())}),oC=w(null,nx,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),sC=Le(),cC=w(e=>{throw Error(`No icon component for ${e}`)});function lC(e,t){return Le((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function uC(e){let t=q();G(t)&&e.pubIn({[wS]:t,[bS]:t.format})}var dC=lC(aC,(e,t)=>{e.pub(t,[t=>t.registerCommand(an,(t,n)=>(e.pubIn({[pS]:n,[yS]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(oC,{rootNode:L(),editorType:`lexical`,editorRef:n})}),uC(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(xS)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{L().getLastChild()instanceof so&&t.update(()=>{L().append(F())},{discrete:!0}),a=Rb({root:L(),visitors:e.getValue(PS),jsxComponentDescriptors:e.getValue(RS),toMarkdownExtensions:e.getValue(FS),toMarkdownOptions:e.getValue(IS),jsxIsAvailable:e.getValue(LS)})}),e.pub(ES,a.trim()),e.pub(DS,!1)}),t=>t.registerCommand(Qn,()=>(e.pub(yS,!0),!1),4)])}),fC=lC(iC,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{uC(e)})}),t=>t.registerCommand($n,t=>{let n=e.getValue(fS);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[yS]:!1,[sC]:t})),!1},4)])});function pC(e,t,n){try{ex({root:t,visitors:e.getValue(AS),mdastExtensions:e.getValue(NS),markdown:n,syntaxExtensions:e.getValue(MS),jsxComponentDescriptors:e.getValue(RS),jsxKindMismatchPolicy:e.getValue(zS),directiveDescriptors:e.getValue(BS),codeBlockEditorDescriptors:e.getValue(VS),defaultCodeBlockLanguage:e.getValue(HS)}),e.pub(xS,null)}catch(t){if(t instanceof Zb||t instanceof Qb||t instanceof zb)e.pubIn({[ES]:n,[xS]:{error:t.message,source:n}});else throw t}}var mC=w([]),hC=lC(mC),gC=w([]),_C=lC(gC),vC=w([]),yC=lC(vC),bC=w([]),xC=lC(bC),SC=w([]),CC=lC(SC),wC=w([]),TC=lC(wC),EC=w(!1,e=>{e.link(e.pipe(pS,We(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),EC)}),DC=w(Um()),OC=w(``);Le();var kC=Le(e=>{e.sub(e.pipe(kC,T(pS)),([e,t])=>{t?.update(()=>{let n=q();G(n)&&(th(n,e),setTimeout(()=>{t.focus()}))})})});function AC(e){if(e.isInline()){Kf([e]),B(e.getParentOrThrow())&&fh(e,F).selectEnd();return}let t=q();if(G(t)){let n=U(t.focus.getNode(),Z);if(Z(n)){let r=No(t.focus,`next`);for(;r!==null&&(Rp(r)||!n.is(r.getParentAtCaret()));)r=Qo(r);if(r!==null){r.insert(e);return}}}dh(e)}var jC=Le(e=>{e.sub(e.pipe(jC,T(pS)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{G(q())&&(t.update(()=>{let t=e();AC(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(dS,void 0)}))})},{defaultSelection:`rootEnd`})})}),MC=w(`rich-text`,e=>{function t(){return qe((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(MC,t(),T(NC)),([{current:t,next:n},r])=>{(t===`source`||t===`diff`)&&n===`rich-text`&&e.pub($S,r)}),e.sub(e.pipe(MC,t(),Ke(e=>e.current===`rich-text`),T(pS)),([,e])=>{e?.dispatchCommand(dS,void 0)})}),NC=w(``,e=>{e.link(ES,NC),e.link(NC,OS)},!0),PC=w([]),FC=lC(PC),IC=w(()=>{throw Error(`No translation function provided`)}),LC=w(Rx),RC=Ze({init(e,n){let r=n?.initialMarkdown??``;e.register(dC),e.register(fC),e.register(OS),e.register(NC),e.pubIn({[TS]:n?.trim?r.trim():r,[cC]:n?.iconComponentFor,[qS]:[Ax,kx,jx,xx,...Ex],[KS]:[ts,So,sx],[XS]:[px,fx,bx,dx,ux],[mS]:n?.contentEditableClassName,[hS]:n?.spellCheck,[IS]:n?.toMarkdownOptions,[vS]:n?.autoFocus,[_S]:n?.placeholder,[gS]:n?.readOnly,[IC]:n?.translation,[DC]:Um(),[YS]:[c(),av],[JS]:[t(),ly()],[ZS]:[Sv(),y(),cv],[LC]:n?.lexicalTheme??Rx}),e.singletonSub(SS,n?.onError),e.singletonSub(kS,t=>{n?.onChange(t,e.getValue(DS))}),e.singletonSub(sC,n?.onBlur),n?.suppressHtmlProcessing||e.pubIn({[YS]:[xv(),Px()],[JS]:[zy(),By(),Ix],[qS]:Dx})},postInit(e,t){let n=lS({name:`@mdxeditor/root`,editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(jS),...t?.additionalLexicalNodes??[]],theme:e.getValue(LC),historyMode:t?.suppressSharedHistory?`none`:`root-shared`,historyState:e.getValue(DC),initialEditorState:t?.editorState===null?null:()=>{let n=t?.initialMarkdown.trim()??``;pC(e,L(),n)}});Ye(e,()=>{n.dispose()});let r=t?.autoFocus;if(t?.editorState!==null&&r){let t=setTimeout(()=>{n.focus(nx,{defaultSelection:r===!0?`rootStart`:r.defaultSelection??`rootStart`})});Ye(e,()=>{clearTimeout(t)})}e.pub(fS,n),e.pub(pS,n)},update(e,t){e.pubIn({[mS]:t?.contentEditableClassName,[hS]:t?.spellCheck,[IS]:t?.toMarkdownOptions,[vS]:t?.autoFocus,[_S]:t?.placeholder,[gS]:t?.readOnly}),e.singletonSub(kS,n=>{t?.onChange(n,e.getValue(DS))}),e.singletonSub(sC,t?.onBlur),e.singletonSub(SS,t?.onError)}});function zC(){return Ve(IC)}var BC=/* @__PURE__ */ e(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),VC={editorRoot:`_editorRoot_eoiyl_53`,editorWrapper:`_editorWrapper_eoiyl_155`,toolbarRoot:`_toolbarRoot_eoiyl_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_eoiyl_189`,toolbarToggleItem:`_toolbarToggleItem_eoiyl_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_eoiyl_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_eoiyl_224`,toolbarButton:`_toolbarButton_eoiyl_239`,activeToolbarButton:`_activeToolbarButton_eoiyl_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_eoiyl_286`,selectContainer:`_selectContainer_eoiyl_288`,selectItem:`_selectItem_eoiyl_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_eoiyl_307`,selectTrigger:`_selectTrigger_eoiyl_308`,selectDropdownArrow:`_selectDropdownArrow_eoiyl_373`,contentEditable:`_contentEditable_eoiyl_379`,codeMirrorWrapper:`_codeMirrorWrapper_eoiyl_391`,codeMirrorToolbar:`_codeMirrorToolbar_eoiyl_408`,propertyPanelTitle:`_propertyPanelTitle_eoiyl_430`,propertyEditorTable:`_propertyEditorTable_eoiyl_438`,iconButton:`_iconButton_eoiyl_456`,readOnlyColumnCell:`_readOnlyColumnCell_eoiyl_461`,buttonsFooter:`_buttonsFooter_eoiyl_474`,propertyEditorInput:`_propertyEditorInput_eoiyl_480`,primaryButton:`_primaryButton_eoiyl_506`,secondaryButton:`_secondaryButton_eoiyl_507`,smallButton:`_smallButton_eoiyl_522`,dialogForm:`_dialogForm_eoiyl_534`,linkDialogEditForm:`_linkDialogEditForm_eoiyl_540`,linkDialogInputContainer:`_linkDialogInputContainer_eoiyl_548`,linkDialogInputWrapper:`_linkDialogInputWrapper_eoiyl_554`,linkDialogInput:`_linkDialogInput_eoiyl_548`,linkDialogAnchor:`_linkDialogAnchor_eoiyl_586`,linkDialogPopoverContent:`_linkDialogPopoverContent_eoiyl_600`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_eoiyl_601`,dialogContent:`_dialogContent_eoiyl_602`,largeDialogContent:`_largeDialogContent_eoiyl_614`,dialogTitle:`_dialogTitle_eoiyl_624`,visuallyHidden:`_visuallyHidden_eoiyl_631`,dialogCloseButton:`_dialogCloseButton_eoiyl_644`,popoverContent:`_popoverContent_eoiyl_651`,popoverArrow:`_popoverArrow_eoiyl_663`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_eoiyl_667`,tooltipTrigger:`_tooltipTrigger_eoiyl_690`,tooltipContent:`_tooltipContent_eoiyl_694`,actionButton:`_actionButton_eoiyl_708`,primaryActionButton:`_primaryActionButton_eoiyl_715`,tableEditor:`_tableEditor_eoiyl_727`,toolCell:`_toolCell_eoiyl_738`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_eoiyl_757`,addRowButton:`_addRowButton_eoiyl_759`,addColumnButton:`_addColumnButton_eoiyl_760`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_eoiyl_802`,toggleGroupRoot:`_toggleGroupRoot_eoiyl_815`,tableToolsColumn:`_tableToolsColumn_eoiyl_833`,leftAlignedCell:`_leftAlignedCell_eoiyl_842`,rightAlignedCell:`_rightAlignedCell_eoiyl_846`,centeredCell:`_centeredCell_eoiyl_850`,dialogOverlay:`_dialogOverlay_eoiyl_883`,focusedImage:`_focusedImage_eoiyl_929`,imageWrapper:`_imageWrapper_eoiyl_933`,editImageToolbar:`_editImageToolbar_eoiyl_946`,editImageButton:`_editImageButton_eoiyl_950`,inlineEditor:`_inlineEditor_eoiyl_956`,blockEditor:`_blockEditor_eoiyl_965`,nestedEditor:`_nestedEditor_eoiyl_974`,genericComponentName:`_genericComponentName_eoiyl_993`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_eoiyl_999`,ggDiffSourceToggle:`_ggDiffSourceToggle_eoiyl_1007`,diffSourceToggle:`_diffSourceToggle_eoiyl_999`,selectWithLabel:`_selectWithLabel_eoiyl_1025`,toolbarTitleMode:`_toolbarTitleMode_eoiyl_1040`,imageControlWrapperResizing:`_imageControlWrapperResizing_eoiyl_1045`,imageResizer:`_imageResizer_eoiyl_1049`,imageResizerN:`_imageResizerN_eoiyl_1058`,imageResizerNe:`_imageResizerNe_eoiyl_1064`,imageResizerE:`_imageResizerE_eoiyl_1070`,imageResizerSe:`_imageResizerSe_eoiyl_1076`,imageResizerS:`_imageResizerS_eoiyl_1076`,imageResizerSw:`_imageResizerSw_eoiyl_1088`,imageResizerW:`_imageResizerW_eoiyl_1094`,imageResizerNw:`_imageResizerNw_eoiyl_1100`,imagePlaceholder:`_imagePlaceholder_eoiyl_1106`,imageDimensionsContainer:`_imageDimensionsContainer_eoiyl_1114`,placeholder:`_placeholder_eoiyl_1119`,rootContentEditableWrapper:`_rootContentEditableWrapper_eoiyl_1132`,downshiftInputWrapper:`_downshiftInputWrapper_eoiyl_1142`,downshiftInput:`_downshiftInput_eoiyl_1142`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_eoiyl_1173`,textInput:`_textInput_eoiyl_1219`,multiFieldForm:`_multiFieldForm_eoiyl_1227`,formField:`_formField_eoiyl_1233`,markdownParseError:`_markdownParseError_eoiyl_1244`,popupContainer:`_popupContainer_eoiyl_1253`,inputSizer:`_inputSizer_eoiyl_1258`};export{xS as $,Hr as $n,fn as $r,H_ as $t,dC as A,He as Ai,jn as An,ss as Ar,xb as At,bC as B,zp as Bn,Ql as Br,$_ as Bt,mC as C,Ze as Ci,Qn as Cn,U as Cr,Gx as Ct,kC as D,Ve as Di,I as Dn,Zl as Dr,tx as Dt,rC as E,Ue as Ei,Kf as En,vn as Er,nx as Et,BS as F,T as Fi,Ur as Fn,Sn as Fr,My as Ft,jC as G,Gn,ci as Gr,nv as Gt,DC as H,xc as Hn,gi as Hr,s_ as Ht,oC as I,Po as In,Hc as Ir,Cy as It,RS as J,Bn as Jn,H as Jr,G_ as Jt,tC as K,tu as Kn,os as Kr,W_ as Kt,EC as L,Un as Ln,M as Lr,vy as Lt,bS as M,Ge as Mi,eu as Mn,ao as Mr,cb as Mt,wS as N,Ke as Ni,Ln as Nn,Ul as Nr,By as Nt,RC as O,Le as Oi,Af as On,bs as Or,kb as Ot,HS as P,Re as Pi,ru as Pn,Cn as Pr,zy as Pt,ES as Q,zn as Qn,F as Qr,N_ as Qt,US as R,L as Rn,Zn as Rr,xv as Rt,VS as S,Qe as Si,Ls as Sn,$o as Sr,Xx as St,GS as T,w as Ti,cu as Tn,wn as Tr,Lx as Tt,cC as U,Kn as Un,Nn as Ur,ev as Ut,PS as V,B as Vn,Mf as Vr,tv as Vt,AS as W,bc as Wn,Uc as Wr,rv as Wt,zS as X,q as Xn,j as Xr,R_ as Xt,LS as Y,Fn as Yn,di as Yr,X as Yt,LC as Z,jo as Zn,ai as Zr,I_ as Zt,TC as _,Jt as _i,Um as _n,G as _r,lS as _t,pS as a,so as ai,Hg as an,wc as ar,gS as at,CS as b,Ct as bi,Fm as bn,Ia as br,tS as bt,yC as c,ni as ci,mg as cn,vs as cr,hS as ct,XS as d,Za as di,ph as dn,_i as dr,FS as dt,gu as ei,Ng as en,No as er,NC as et,qS as f,yn as fi,dh as fn,Pn as fr,IS as ft,JS as g,fi as gi,Hm as gn,an as gr,MC as gt,CC as h,In as hi,Qm as hn,Xn as hr,jS as ht,dS as i,Vc as ii,Vg as in,J as ir,_S as it,OC as j,We as ji,Vr as jn,po as jr,Cb as jt,fC as k,Be as ki,ys as kn,N as kr,Rb as kt,hC as l,V as li,lh as ln,$l as lr,MS as lt,YS as m,vi as mi,hh as mn,$n as mr,zC as mt,BC as n,Qa as ni,Lg as nn,sn as nr,SC as nt,PC as o,rs as oi,a_ as on,Yn as or,fS as ot,KS as p,fc as pi,uh as pn,qp as pr,gC as pt,eC as q,P as qn,gn as qr,Z as qt,lC as r,Dt as ri,Pg as rn,K as rr,sC as rt,FC as s,si,pg as sn,So as sr,$S as st,VC as t,gm as ti,Fg as tn,Hn as tr,NS as tt,xC as u,li as ui,fh as un,Nf as ur,wC as ut,ZS as v,su as vi,Lm as vn,D as vr,uS as vt,mS as w,Ye as wi,Rn as wn,hm as wr,Vx as wt,vC as x,mt as xi,Uo as xn,R as xr,eS as xt,_C as y,Ro as yi,Im as yn,Nc as yr,rS as yt,WS as z,Wr as zn,ed as zr,Sv as zt};
|