keystone_ui-pages 0.13.0 → 0.14.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.
@@ -1,12 +1,12 @@
1
- (()=>{var Gx=Object.defineProperty;var kk=(e,t,n)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t)=>{for(var n in t)Gx(e,n,{get:t[n],enumerable:!0})};var w=(e,t,n)=>kk(e,typeof t!="symbol"?t+"":t,n);var Ak=globalThis.ReactDOM;var{createPortal:qx,createRoot:Xx,flushSync:aW,hydrateRoot:lW,preconnect:cW,prefetchDNS:uW,preinit:dW,preinitModule:fW,preload:pW,preloadModule:hW,requestFormReset:gW,unstable_batchedUpdates:mW,useFormState:_W,useFormStatus:yW,version:xW}=Ak;var Jx=globalThis.React,E=Jx,{Children:SW,Component:Qx,Fragment:CW,PureComponent:bW,StrictMode:EW,Suspense:Zx,cloneElement:NW,createContext:ev,createElement:TW,createRef:OW,forwardRef:zr,isValidElement:DW,lazy:wW,memo:MW,startTransition:kW,useCallback:tv,useContext:nv,useDebugValue:AW,useDeferredValue:IW,useEffect:et,useId:$W,useImperativeHandle:RW,useLayoutEffect:fo,useMemo:Dn,useReducer:PW,useRef:Xo,useState:Ie,useSyncExternalStore:vp,useTransition:LW}=Jx;var ov=new Map,Pc=new Map,rv=(e,t)=>ov.set(e,t),sv=()=>{Pc.forEach(e=>e.unmount()),Pc.clear()},iv=(e,t)=>e.querySelectorAll("[data-react-ui]").forEach(n=>{if(Pc.has(n))return;let o=ov.get(n.dataset.reactUi),r=t(n);Pc.set(n,r),r.render(E.createElement(o,JSON.parse(n.dataset.props)))});var av=(e,t)=>{let n=()=>iv(e,t);e.addEventListener("turbo:load",n),e.addEventListener("turbo:frame-load",n),e.addEventListener("turbo:before-cache",sv),e.readyState==="loading"?e.addEventListener("DOMContentLoaded",n):n()};var Ik=Symbol.for("preact-signals");function zc(){if(Eo>1)Eo--;else{var e,t=!1;for((function(){var r=Fc;for(Fc=void 0;r!==void 0;){var s=r.S;if(s.v===r.v)for(var i=s.t;i!==void 0;i=i.x)i.i===r.i&&(i.i=s.i);r=r.o}})();Da!==void 0;){var n=Da;for(Da=void 0,Lc++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&cv(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(Lc=0,Eo--,t)throw e}}function Oe(e){if(Eo>0)return e();Sp=++$k,Eo++;try{return e()}finally{zc()}}var Oa,ze=void 0;function ie(e){var t=ze,n=Oa;ze=void 0,Oa=void 0;try{return e()}finally{ze=t,Oa=n}}var Da=void 0,Eo=0,Lc=0,$k=0,Sp=0,Fc=void 0,Bc=0;function lv(e){if(ze!==void 0){var t=e.n;if(t===void 0||t.t!==ze)return t={i:0,S:e,p:ze.s,n:void 0,t:ze,e:void 0,x:void 0,r:t},ze.s!==void 0&&(ze.s.n=t),ze.s=t,e.n=t,32&ze.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=ze.s,t.n=void 0,ze.s.n=t,ze.s=t),t}}function kt(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}kt.prototype.brand=Ik;kt.prototype.h=function(){return!0};kt.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?n.e=e:ie(function(){var o;(o=t.W)==null||o.call(t)}))};kt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&ie(function(){var r;(r=t.Z)==null||r.call(t)}))}};kt.prototype.subscribe=function(e){var t=this;return gt(function(){var n=t.value;ie(function(){return e(n)})},{name:"sub"})};kt.prototype.valueOf=function(){return this.value};kt.prototype.toString=function(){return this.value+""};kt.prototype.toJSON=function(){return this.value};kt.prototype.peek=function(){var e=this;return ie(function(){return e.value})};Object.defineProperty(kt.prototype,"value",{get:function(){var e=lv(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Lc>100)throw new Error("Cycle detected");(function(n){Eo!==0&&Lc===0&&n.l!==Sp&&(n.l=Sp,Fc={S:n,v:n.v,i:n.i,o:Fc})})(this),this.v=e,this.i++,Bc++,Eo++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{zc()}}}});function wn(e,t){return new kt(e,t)}function cv(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 uv(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 dv(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Wr(e,t){kt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Bc-1,this.f=4}Wr.prototype=new kt;Wr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Bc))return!0;if(this.g=Bc,this.f|=1,this.i>0&&!cv(this))return this.f&=-2,!0;var e=ze;try{uv(this),ze=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ze=e,dv(this),this.f&=-2,!0};Wr.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)}kt.prototype.S.call(this,e)};Wr.prototype.U=function(e){if(this.t!==void 0&&(kt.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)}};Wr.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(Wr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=lv(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function wa(e,t){return new Wr(e,t)}function fv(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Eo++;var n=ze;ze=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Cp(e),o}finally{ze=n,zc()}}}function Cp(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,fv(e)}function Rk(e){if(ze!==this)throw new Error("Out-of-order effect");dv(this),ze=e,this.f&=-2,8&this.f&&Cp(this),zc()}function Ys(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Oa&&Oa.push(this)}Ys.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.m=t)}finally{e()}};Ys.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,fv(this),uv(this),Eo++;var e=ze;return ze=this,Rk.bind(this,e)};Ys.prototype.N=function(){2&this.f||(this.f|=2,this.u=Da,Da=this)};Ys.prototype.d=function(){this.f|=8,1&this.f||Cp(this)};Ys.prototype.dispose=function(){this.d()};function gt(e,t){var n=new Ys(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Pk=Object.create,Ip=Object.defineProperty,Lk=Object.defineProperties,Fk=Object.getOwnPropertyDescriptor,Bk=Object.getOwnPropertyDescriptors,pv=Object.getOwnPropertySymbols,zk=Object.prototype.hasOwnProperty,Wk=Object.prototype.propertyIsEnumerable,gv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Gs=e=>{throw TypeError(e)},Op=(e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kk=(e,t)=>{for(var n in t||(t={}))zk.call(t,n)&&Op(e,n,t[n]);if(pv)for(var n of pv(t))Wk.call(t,n)&&Op(e,n,t[n]);return e},Uk=(e,t)=>Lk(e,Bk(t)),hv=(e,t)=>Ip(e,"name",{value:t,configurable:!0}),Hk=e=>{var t;return[,,,Pk((t=e?.[gv("metadata")])!=null?t:null)]},mv=["class","method","getter","setter","accessor","field","value","get","set"],Ma=e=>e!==void 0&&typeof e!="function"?Gs("Function expected"):e,Vk=(e,t,n,o,r)=>({kind:mv[e],name:t,metadata:o,addInitializer:s=>n._?Gs("Already initialized"):r.push(Ma(s||null))}),_v=(e,t)=>Op(t,gv("metadata"),e[3]),Kr=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},qs=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=mv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&Fk(d<4?r:{get[n](){return Mn(this,s)},set[n](v){return Jo(this,s,v)}},n));d?p&&d<4&&hv(s,(d>2?"set ":d>1?"get ":"")+n):hv(r,n);for(var x=o.length-1;x>=0;x--)c=Vk(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>jk(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Mn:Yk)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Jo(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Ma(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Gs("Object expected"):(Ma(i=a.get)&&(_.get=i),Ma(i=a.set)&&(_.set=i),Ma(i=a.init)&&y.unshift(i));return d||_v(e,r),_&&Ip(r,n,_),p?d^4?s:_:r},$p=(e,t,n)=>t.has(e)||Gs("Cannot "+n),jk=(e,t)=>Object(t)!==t?Gs('Cannot use the "in" operator on this value'):e.has(t),Mn=(e,t,n)=>($p(e,t,"read from private field"),n?n.call(e):t.get(e)),ka=(e,t,n)=>t.has(e)?Gs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Jo=(e,t,n,o)=>($p(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Yk=(e,t,n)=>($p(e,t,"access private method"),n);function Kc(e,t){if(t){let n;return wa(()=>{let o=e();return o&&n&&t(n,o)?n:(n=o,o)})}return wa(e)}function Wc(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((o,r)=>!Wc(o,t[r]));if(typeof e=="object"&&typeof t=="object"){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?!1:!n.some(s=>!Wc(e[s],t[s]))}return!1}function fe({get:e},t){return{init(n){return wn(n)},get(){return e.call(this).value},set(n){let o=e.call(this);o.peek()!==n&&(o.value=n)}}}function Ve(e,t){let n=new WeakMap;return function(){let o=n.get(this);return o||(o=Kc(e.bind(this)),n.set(this,o)),o.value}}function bp(e=!0){return function(t,n){n.addInitializer(function(){let o=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(o,n.name);r&&Object.defineProperty(o,n.name,Uk(Kk({},r),{enumerable:e}))})}}function Hr(...e){let t=e.map(n=>gt(n));return()=>t.forEach(n=>n())}var yv,xv,vv,Sv,Cv,bv,Kt,Rp,Ep,Dp,wp,At,Pp,Np,Ev,Mp,Lp,Tp,kp,Ap;bv=[fe],Cv=[fe],Sv=[fe],vv=[bp()],xv=[bp()],yv=[bp()];var Qo=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Kr(Kt,5,this),ka(this,At),ka(this,Rp,Kr(Kt,8,this)),Kr(Kt,11,this),ka(this,Pp,Kr(Kt,12,this)),Kr(Kt,15,this),ka(this,Lp,Kr(Kt,16,this)),Kr(Kt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Mn(this,At,kp)}get initial(){return Mn(this,At,Dp)}get previous(){return Mn(this,At,Ev)}set current(e){let t=ie(()=>Mn(this,At,kp));e&&t&&this.equals(t,e)||Oe(()=>{Mn(this,At,Dp)||Jo(this,At,e,wp),Jo(this,At,t,Mp),Jo(this,At,e,Ap)})}reset(e=this.defaultValue){Oe(()=>{Jo(this,At,void 0,Mp),Jo(this,At,e,wp),Jo(this,At,e,Ap)})}};Kt=Hk(null);Rp=new WeakMap;At=new WeakSet;Pp=new WeakMap;Lp=new WeakMap;Ep=qs(Kt,20,"#initial",bv,At,Rp),Dp=Ep.get,wp=Ep.set;Np=qs(Kt,20,"#previous",Cv,At,Pp),Ev=Np.get,Mp=Np.set;Tp=qs(Kt,20,"#current",Sv,At,Lp),kp=Tp.get,Ap=Tp.set;qs(Kt,2,"current",vv,Qo);qs(Kt,2,"initial",xv,Qo);qs(Kt,2,"previous",yv,Qo);_v(Kt,Qo);function Uc(e){return ie(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var Ur,Nv=class{constructor(){ka(this,Ur,new WeakMap)}get(e,t){var n;return e?(n=Mn(this,Ur).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var o;if(e)return Mn(this,Ur).has(e)||Mn(this,Ur).set(e,new Map),(o=Mn(this,Ur).get(e))==null?void 0:o.set(t,n)}clear(e){var t;return e?(t=Mn(this,Ur).get(e))==null?void 0:t.clear():void 0}};Ur=new WeakMap;var Gk=Object.create,Up=Object.defineProperty,qk=Object.getOwnPropertyDescriptor,Tv=Object.getOwnPropertySymbols,Xk=Object.prototype.hasOwnProperty,Jk=Object.prototype.propertyIsEnumerable,wv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Xs=e=>{throw TypeError(e)},Ov=Math.pow,Fp=(e,t,n)=>t in e?Up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qk=(e,t)=>{for(var n in t||(t={}))Xk.call(t,n)&&Fp(e,n,t[n]);if(Tv)for(var n of Tv(t))Jk.call(t,n)&&Fp(e,n,t[n]);return e},Dv=(e,t)=>Up(e,"name",{value:t,configurable:!0}),Zk=e=>{var t;return[,,,Gk((t=e?.[wv("metadata")])!=null?t:null)]},Mv=["class","method","getter","setter","accessor","field","value","get","set"],Aa=e=>e!==void 0&&typeof e!="function"?Xs("Function expected"):e,eA=(e,t,n,o,r)=>({kind:Mv[e],name:t,metadata:o,addInitializer:s=>n._?Xs("Already initialized"):r.push(Aa(s||null))}),kv=(e,t)=>Fp(t,wv("metadata"),e[3]),tA=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},Av=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=Mv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&qk(d<4?r:{get[n](){return Bp(this,s)},set[n](v){return zp(this,s,v)}},n));d?p&&d<4&&Dv(s,(d>2?"set ":d>1?"get ":"")+n):Dv(r,n);for(var x=o.length-1;x>=0;x--)c=eA(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>nA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Bp:rA)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>zp(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Aa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Xs("Object expected"):(Aa(i=a.get)&&(_.get=i),Aa(i=a.set)&&(_.set=i),Aa(i=a.init)&&y.unshift(i));return d||kv(e,r),_&&Up(r,n,_),p?d^4?s:_:r},Hp=(e,t,n)=>t.has(e)||Xs("Cannot "+n),nA=(e,t)=>Object(t)!==t?Xs('Cannot use the "in" operator on this value'):e.has(t),Bp=(e,t,n)=>(Hp(e,t,"read from private field"),n?n.call(e):t.get(e)),oA=(e,t,n)=>t.has(e)?Xs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zp=(e,t,n,o)=>(Hp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),rA=(e,t,n)=>(Hp(e,t,"access private method"),n),It=class Wp{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Wp(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new Wp(t,n)}},tn=class Vr{constructor(t,n,o,r){this.left=t,this.top=n,this.width=o,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:o,left:r,width:s,height:i,scale:a}=this,l=new Vr(r+t,o+n,s,i);return l.scale=Qk({},a),l}get boundingRectangle(){let{width:t,height:n,left:o,top:r,right:s,bottom:i}=this;return{width:t,height:n,left:o,top:r,right:s,bottom:i}}get center(){let{left:t,top:n,right:o,bottom:r}=this;return new It((t+o)/2,(n+r)/2)}get area(){let{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof Vr))return!1;let{left:n,top:o,width:r,height:s}=this;return n===t.left&&o===t.top&&r===t.width&&s===t.height}containsPoint(t){let{top:n,left:o,bottom:r,right:s}=this;return n<=t.y&&t.y<=r&&o<=t.x&&t.x<=s}intersectionArea(t){return t instanceof Vr?sA(this,t):0}intersectionRatio(t){let{area:n}=this,o=this.intersectionArea(t);return o/(t.area+n-o)}get bottom(){let{top:t,height:n}=this;return t+n}get right(){let{left:t,width:n}=this;return t+n}get aspectRatio(){let{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:o,height:r}){return new Vr(n,t,o,r)}static delta(t,n,o={x:"center",y:"center"}){let r=(s,i)=>{let a=o[i],l=i==="x"?s.left:s.top,c=i==="x"?s.width:s.height;return a=="start"?l:a=="end"?l+c:l+c/2};return It.delta({x:r(t,"x"),y:r(t,"y")},{x:r(n,"x"),y:r(n,"y")})}static intersectionRatio(t,n){return Vr.from(t).intersectionRatio(Vr.from(n))}};function sA(e,t){let n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=s-n;return o<r&&n<s?i*a:0}var Iv,$v,Kp,Hc,Ia,$a=class extends(Kp=Qo,$v=[Ve],Iv=[Ve],Kp){constructor(e){let t=It.from(e);super(t,(n,o)=>It.equals(n,o)),tA(Ia,5,this),oA(this,Hc,0),this.velocity={x:0,y:0}}get delta(){return It.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){let{current:t}=this,n=It.from(e),o={x:n.x-t.x,y:n.y-t.y},r=Date.now(),s=r-Bp(this,Hc),i=a=>Math.round(a/s*100);Oe(()=>{zp(this,Hc,r),this.velocity={x:i(o.x),y:i(o.y)},super.current=n})}reset(e=this.defaultValue){super.reset(It.from(e)),this.velocity={x:0,y:0}}};Ia=Zk(Kp);Hc=new WeakMap;Av(Ia,2,"delta",$v,$a);Av(Ia,2,"direction",Iv,$a);kv(Ia,$a);function Vc({x:e,y:t},n){let o=Math.abs(e),r=Math.abs(t);return typeof n=="number"?Math.sqrt(Ov(o,2)+Ov(r,2))>n:"x"in n&&"y"in n?o>n.x&&r>n.y:"x"in n?o>n.x:"y"in n?r>n.y:!1}var Rv=(e=>(e.Horizontal="x",e.Vertical="y",e))(Rv||{}),Vp=Object.values(Rv);var iA=Object.create,Xp=Object.defineProperty,aA=Object.defineProperties,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyDescriptors,Qc=Object.getOwnPropertySymbols,Bv=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable,Wv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ni=e=>{throw TypeError(e)},Yp=(e,t,n)=>t in e?Xp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jp=(e,t)=>{for(var n in t||(t={}))Bv.call(t,n)&&Yp(e,n,t[n]);if(Qc)for(var n of Qc(t))zv.call(t,n)&&Yp(e,n,t[n]);return e},Qp=(e,t)=>aA(e,cA(t)),Pv=(e,t)=>Xp(e,"name",{value:t,configurable:!0}),Kv=(e,t)=>{var n={};for(var o in e)Bv.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Qc)for(var o of Qc(e))t.indexOf(o)<0&&zv.call(e,o)&&(n[o]=e[o]);return n},oi=e=>{var t;return[,,,iA((t=e?.[Wv("metadata")])!=null?t:null)]},Uv=["class","method","getter","setter","accessor","field","value","get","set"],Ra=e=>e!==void 0&&typeof e!="function"?ni("Function expected"):e,uA=(e,t,n,o,r)=>({kind:Uv[e],name:t,metadata:o,addInitializer:s=>n._?ni("Already initialized"):r.push(Ra(s||null))}),Gr=(e,t)=>Yp(t,Wv("metadata"),e[3]),oe=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},ve=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=Uv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&lA(d<4?r:{get[n](){return tt(this,s)},set[n](v){return un(this,s,v)}},n));d?p&&d<4&&Pv(s,(d>2?"set ":d>1?"get ":"")+n):Pv(r,n);for(var x=o.length-1;x>=0;x--)c=uA(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>dA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?tt:Hv)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>un(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Ra(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?ni("Object expected"):(Ra(i=a.get)&&(_.get=i),Ra(i=a.set)&&(_.set=i),Ra(i=a.init)&&y.unshift(i));return d||Gr(e,r),_&&Xp(r,n,_),p?d^4?s:_:r},Zp=(e,t,n)=>t.has(e)||ni("Cannot "+n),dA=(e,t)=>Object(t)!==t?ni('Cannot use the "in" operator on this value'):e.has(t),tt=(e,t,n)=>(Zp(e,t,"read from private field"),n?n.call(e):t.get(e)),be=(e,t,n)=>t.has(e)?ni("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),un=(e,t,n,o)=>(Zp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Hv=(e,t,n)=>(Zp(e,t,"access private method"),n);function Vv(e,t){return{plugin:e,options:t}}function ri(e){return t=>Vv(e,t)}function ti(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var jv,Fa,eh,Yc;jv=[fe];var mt=class{constructor(e,t){this.manager=e,this.options=t,be(this,eh,oe(Fa,8,this,!1)),oe(Fa,11,this),be(this,Yc,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return ie(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=gt(e.bind(this));return tt(this,Yc).add(t),t}destroy(){tt(this,Yc).forEach(e=>e())}static configure(e){return Vv(this,e)}};Fa=oi(null);eh=new WeakMap;Yc=new WeakMap;ve(Fa,4,"disabled",jv,mt,eh);Gr(Fa,mt);var si=class extends mt{},Gc,jp=class{constructor(e){this.manager=e,this.instances=new Map,be(this,Gc,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(ti).reduce((o,r)=>{let s=o.find(({plugin:i})=>i===r.plugin);return s?(s.options=r.options,o):[...o,r]},[]),n=t.map(({plugin:o})=>o);for(let o of tt(this,Gc))if(!n.includes(o)){if(o.prototype instanceof si)continue;this.unregister(o)}for(let{plugin:o,options:r}of t)this.register(o,r);un(this,Gc,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let o=new e(this.manager,t);return this.instances.set(e,o),o}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Gc=new WeakMap;function fA(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var jc=[],Js,Qs,pA=class extends mt{constructor(e){super(e),be(this,Js),be(this,Qs),this.computeCollisions=this.computeCollisions.bind(this),un(this,Qs,wn(jc)),this.destroy=Hr(()=>{let t=this.computeCollisions(),n=ie(()=>this.manager.dragOperation.position.current);if(t!==jc){let o=tt(this,Js);if(un(this,Js,n),o&&n.x==o.x&&n.y==o.y)return}else un(this,Js,void 0);tt(this,Qs).value=t},()=>{let{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){ie(()=>{e?tt(this,Qs).value=this.computeCollisions():un(this,Js,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:o}=this.manager,{source:r,shape:s,status:i}=o;if(!i.initialized||!s)return jc;let a=[],l=[];for(let c of e??n.droppables){if(c.disabled||r&&!c.accepts(r))continue;let u=t??c.collisionDetector;if(!u)continue;l.push(c),c.shape;let d=ie(()=>u({droppable:c,dragOperation:o}));d&&(c.collisionPriority!=null&&(d.priority=c.collisionPriority),a.push(d))}return l.length===0?jc:(a.sort(fA),a)}get collisions(){return tt(this,Qs).value}};Js=new WeakMap;Qs=new WeakMap;var Yv,Gv,qv,th,Xv,Gn,nh,ei,oh,rh;qv=[fe],Gv=[fe],Yv=[fe];var No=class jr{constructor(t,n){be(this,nh,oe(Gn,8,this)),oe(Gn,11,this),be(this,ei),be(this,oh,oe(Gn,12,this)),oe(Gn,15,this),be(this,rh,oe(Gn,16,this)),oe(Gn,19,this);let{effects:o,id:r,data:s={},disabled:i=!1,register:a=!0}=t,l=r;un(this,ei,wn(r)),this.manager=n,this.data=s,this.disabled=i,this.effects=()=>{var c;return[()=>{let{id:u,manager:d}=this;if(u!==l)return l=u,d?.registry.register(this),()=>d?.registry.unregister(this)},...(c=o?.())!=null?c:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),n&&a&&queueMicrotask(this.register)}get id(){var t,n;let o=tt(this,ei).value;return(n=(t=jr.pendingIdChanges)==null?void 0:t.get(this))!=null?n:o}set id(t){var n,o;let r=(o=(n=jr.pendingIdChanges)==null?void 0:n.get(this))!=null?o:tt(this,ei).peek();t!==r&&(jr.pendingIdChanges||(jr.pendingIdChanges=new Map,queueMicrotask(()=>{var s;return Hv(s=jr,th,Xv).call(s)})),jr.pendingIdChanges.set(this,t))}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};Gn=oi(null);th=new WeakSet;Xv=function(){let e=No.pendingIdChanges;No.pendingIdChanges=null,e&&Oe(()=>{for(let[t,n]of e)tt(t,ei).value=n})};nh=new WeakMap;ei=new WeakMap;oh=new WeakMap;rh=new WeakMap;ve(Gn,4,"manager",qv,No,nh);ve(Gn,4,"data",Gv,No,oh);ve(Gn,4,"disabled",Yv,No,rh);be(No,th);Gr(Gn,No);No.pendingIdChanges=null;var Zc=No,Lv=class{constructor(){this.map=wn(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),o=n.get(e),r=()=>this.unregister(e,t);if(o===t)return r;if(o&&o.id===e){let a=this.cleanupFunctions.get(o);a?.(),this.cleanupFunctions.delete(o)}let s=new Map(n);for(let[a,l]of n)if(l===t&&a!==e){s.delete(a);break}s.set(e,t),this.map.value=s;let i=Hr(...t.effects());return this.cleanupFunctions.set(t,i),r},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;let o=this.cleanupFunctions.get(t);o?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this){let t=this.cleanupFunctions.get(e);t?.(),e.destroy()}this.map.value=new Map}},Jv,Qv,Zv,eS,tS,nS,Gp,Ut,sh,ih,ah,qn=class extends(Gp=Zc,nS=[fe],tS=[fe],eS=[fe],Zv=[Ve],Qv=[Ve],Jv=[Ve],Gp){constructor(e,t){var n=e,{modifiers:o,type:r,sensors:s,plugins:i,effects:a}=n,l=Kv(n,["modifiers","type","sensors","plugins","effects"]);super(Qp(Jp({},l),{effects:()=>{var c;return[...(c=a?.())!=null?c:[],()=>{let{manager:u,plugins:d}=this;if(!(!u||!d))for(let f of d){let{plugin:p}=ti(f);u.registry.plugins.register(p)}}]}}),t),oe(Ut,5,this),be(this,sh,oe(Ut,8,this)),oe(Ut,11,this),be(this,ih,oe(Ut,12,this)),oe(Ut,15,this),be(this,ah,oe(Ut,16,this,this.isDragSource?"dragging":"idle")),oe(Ut,19,this),this.type=r,this.sensors=s,this.modifiers=o,this.alignment=l.alignment,this.plugins=i}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=ti(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:t.id)===this.id}};Ut=oi(Gp);sh=new WeakMap;ih=new WeakMap;ah=new WeakMap;ve(Ut,4,"type",nS,qn,sh);ve(Ut,4,"modifiers",tS,qn,ih);ve(Ut,4,"status",eS,qn,ah);ve(Ut,2,"isDropping",Zv,qn);ve(Ut,2,"isDragging",Qv,qn);ve(Ut,2,"isDragSource",Jv,qn);Gr(Ut,qn);var oS,rS,sS,iS,aS,lS,qp,ct,lh,ch,uh,dh,fh,Xn=class extends(qp=Zc,lS=[fe],aS=[fe],iS=[fe],sS=[fe],rS=[fe],oS=[Ve],qp){constructor(e,t){var n=e,{accept:o,collisionDetector:r,collisionPriority:s,type:i}=n,a=Kv(n,["accept","collisionDetector","collisionPriority","type"]);super(a,t),oe(ct,5,this),be(this,lh,oe(ct,8,this)),oe(ct,11,this),be(this,ch,oe(ct,12,this)),oe(ct,15,this),be(this,uh,oe(ct,16,this)),oe(ct,19,this),be(this,dh,oe(ct,20,this)),oe(ct,23,this),be(this,fh,oe(ct,24,this)),oe(ct,27,this),this.accept=o,this.collisionDetector=r,this.collisionPriority=s,this.type=i}accepts(e){let{accept:t}=this;return t?typeof t=="function"?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:t.id)===this.id}};ct=oi(qp);lh=new WeakMap;ch=new WeakMap;uh=new WeakMap;dh=new WeakMap;fh=new WeakMap;ve(ct,4,"accept",lS,Xn,lh);ve(ct,4,"type",aS,Xn,ch);ve(ct,4,"collisionDetector",iS,Xn,uh);ve(ct,4,"collisionPriority",sS,Xn,dh);ve(ct,4,"shape",rS,Xn,fh);ve(ct,2,"isDropTarget",oS,Xn);Gr(ct,Xn);var hA=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,o=new Set(n.get(e));return o.add(t),n.set(e,o),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,o=new Set(n.get(e));o.delete(t),n.set(e,o)}dispatch(e,...t){let{registry:n}=this,o=n.get(e);if(o)for(let r of o)r(...t)}},gA=class extends hA{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function qc(e,t=!0){let n=!1;return Qp(Jp({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var mA=class extends si{constructor(e){super(e);let t=(o,r)=>o.map(({id:s})=>s).join("")===r.map(({id:s})=>s).join(""),n=[];this.destroy=Hr(()=>{let{dragOperation:o,collisionObserver:r}=e;o.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:o,monitor:r}=e,{collisions:s}=o;if(o.isDisabled()||Zc.pendingIdChanges)return;let i=qc({collisions:s});if(r.dispatch("collision",i),i.defaultPrevented||t(s,n))return;n=s;let[a]=s;ie(()=>{var l;a?.id!==((l=e.dragOperation.target)==null?void 0:l.id)&&(o.disable(),e.actions.setDropTarget(a?.id).then(()=>{o.enable()}))})})}},qr=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(qr||{}),Xr=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Xr||{}),cS,uS,dS,fS,pS,hS,gS,kn,ph;gS=[fe],hS=[Ve],pS=[Ve],fS=[Ve],dS=[Ve],uS=[Ve],cS=[Ve];var To=class{constructor(){oe(kn,5,this),be(this,ph,oe(kn,8,this,"idle")),oe(kn,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){let{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};kn=oi(null);ph=new WeakMap;ve(kn,4,"value",gS,To,ph);ve(kn,2,"current",hS,To);ve(kn,2,"idle",pS,To);ve(kn,2,"initializing",fS,To);ve(kn,2,"initialized",dS,To);ve(kn,2,"dragging",uS,To);ve(kn,2,"dropped",cS,To);Gr(kn,To);var _A=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return ie(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let o=qc({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",o),this.manager.renderer.rendering.then(()=>o.defaultPrevented)})}start(e){return ie(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");let o=new AbortController,{event:r,coordinates:s}=e;Oe(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(s)});let i=qc({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),o.abort(),o):(t.status.set("initializing"),t.controller=o,this.manager.renderer.rendering.then(()=>{if(o.signal.aborted)return;let{status:a}=t;a.current==="initializing"&&Oe(()=>{t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),o)})}move(e){return ie(()=>{var t,n;let{dragOperation:o}=this.manager,{status:r,controller:s}=o;if(!r.dragging||!s||s.signal.aborted)return;let i=qc({nativeEvent:e.event,operation:o.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",i),queueMicrotask(()=>{var a,l,c,u,d;if(i.defaultPrevented)return;let f=(d=e.to)!=null?d:{x:o.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:o.position.current.y+((u=(c=e.by)==null?void 0:c.y)!=null?u:0)};o.position.current=f})})}stop(e={}){return ie(()=>{var t,n;let{dragOperation:o}=this.manager,{controller:r}=o;if(!r||r.signal.aborted)return;let s,i=()=>{let l={resume:()=>{},abort:()=>{}};return s=new Promise((c,u)=>{l.resume=c,l.abort=u}),l};r.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{o.status.set("dropped");let l=ie(()=>{var u;return((u=o.source)==null?void 0:u.status)==="dropping"}),c=()=>{o.controller===r&&(o.controller=void 0),o.reset()};if(l){let{source:u}=o,d=gt(()=>{u?.status==="idle"&&(d(),c())})}else this.manager.renderer.rendering.then(c)})};o.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:o.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:i}),s?s.then(a).catch(()=>o.reset()):a()})}},Yr=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}},mS=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let n of e??[])n.controller=this}onEvent(e){var t;if(!this.activated)if((t=this.constraints)!=null&&t.length)for(let n of this.constraints)n.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Xc,hh=class{constructor(e){this.options=e,be(this,Xc)}set controller(e){un(this,Xc,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;(t=tt(this,Xc))==null||t.activate(e)}};Xc=new WeakMap;var Fv=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},yA=class{constructor(e){this.draggables=new Lv,this.droppables=new Lv,this.plugins=new jp(e),this.sensors=new jp(e),this.modifiers=new jp(e)}register(e,t){if(e instanceof qn)return this.draggables.register(e.id,e);if(e instanceof Xn)return this.droppables.register(e.id,e);if(e.prototype instanceof Fv)return this.modifiers.register(e,t);if(e.prototype instanceof Yr)return this.sensors.register(e,t);if(e.prototype instanceof mt)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Zc)return e instanceof qn?this.draggables.unregister(e.id,e):e instanceof Xn?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Fv)return this.modifiers.unregister(e);if(e.prototype instanceof Yr)return this.sensors.unregister(e);if(e.prototype instanceof mt)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},_S,yS,xS,vS,SS,CS,bS,ES,NS,Pa,Jc,Zs,je,gh,mh,_h,yh,xh,La;NS=[Ve],ES=[fe],bS=[fe],CS=[fe],SS=[fe],vS=[fe],xS=[Ve],yS=[Ve],_S=[Ve];var Jn=class{constructor(e){oe(je,5,this),be(this,Pa),be(this,Jc),be(this,Zs,new Qo(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new To,be(this,gh,oe(je,8,this,!1)),oe(je,11,this),be(this,mh,oe(je,12,this,null)),oe(je,15,this),be(this,_h,oe(je,16,this,null)),oe(je,19,this),be(this,yh,oe(je,20,this,null)),oe(je,23,this),be(this,xh,oe(je,24,this,[])),oe(je,27,this),this.position=new $a({x:0,y:0}),be(this,La,{x:0,y:0}),un(this,Pa,e)}get shape(){let{current:e,initial:t,previous:n}=tt(this,Zs);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?tt(this,Zs).current=e:tt(this,Zs).reset()}get source(){var e;let t=this.sourceIdentifier;if(t==null)return null;let n=tt(this,Pa).registry.draggables.get(t);return n&&un(this,Jc,n),(e=n??tt(this,Jc))!=null?e:null}get target(){var e;let t=this.targetIdentifier;return t!=null&&(e=tt(this,Pa).registry.droppables.get(t))!=null?e:null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let o of this.modifiers)n=o.apply(Qp(Jp({},this.snapshot()),{transform:n}));return un(this,La,n),n}snapshot(){return ie(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:tt(this,La),shape:this.shape?Uc(this.shape):null,position:Uc(this.position),status:Uc(this.status),canceled:this.canceled}))}reset(){Oe(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,tt(this,Zs).reset(),this.position.reset({x:0,y:0}),un(this,La,{x:0,y:0}),this.modifiers=[]})}};je=oi(null);Pa=new WeakMap;Jc=new WeakMap;Zs=new WeakMap;gh=new WeakMap;mh=new WeakMap;_h=new WeakMap;yh=new WeakMap;xh=new WeakMap;La=new WeakMap;ve(je,2,"shape",NS,Jn);ve(je,4,"canceled",ES,Jn,gh);ve(je,4,"activatorEvent",bS,Jn,mh);ve(je,4,"sourceIdentifier",CS,Jn,_h);ve(je,4,"targetIdentifier",SS,Jn,yh);ve(je,4,"modifiers",vS,Jn,xh);ve(je,2,"source",xS,Jn);ve(je,2,"target",yS,Jn);ve(je,2,"transform",_S,Jn);Gr(je,Jn);var xA={get rendering(){return Promise.resolve()}};function po(e,t){return typeof e=="function"?e(t):e??t}var TS=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(d=>d.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var t;let n=e??{},o=po(n.plugins,[]),r=po(n.sensors,[]),s=po(n.modifiers,[]),i=(t=n.renderer)!=null?t:xA,a=new gA(this),l=new yA(this);this.registry=l,this.monitor=a,this.renderer=i,this.actions=new _A(this),this.dragOperation=new Jn(this),this.collisionObserver=new pA(this),this.plugins=[mA,...o],this.modifiers=s,this.sensors=r;let{destroy:c}=this,u=Hr(()=>{var d,f,p;let h=ie(()=>this.dragOperation.modifiers),g=this.modifiers;for(let y of h)g.includes(y)||y.destroy();this.dragOperation.modifiers=(p=(f=(d=this.dragOperation.source)==null?void 0:d.modifiers)==null?void 0:f.map(y=>{let{plugin:m,options:_}=ti(y);return new m(this,_)}))!=null?p:g});this.destroy=()=>{u(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}};var IS=e=>{throw TypeError(e)},Ch=(e,t,n)=>t.has(e)||IS("Cannot "+n),re=(e,t,n)=>(Ch(e,t,"read from private field"),t.get(e)),nn=(e,t,n)=>t.has(e)?IS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),dn=(e,t,n,o)=>(Ch(e,t,"write to private field"),t.set(e,n),n),$S=(e,t,n)=>(Ch(e,t,"access private method"),n);function lu(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function bh(e,t){let n=e.getAnimations(),o=null;for(let r of n){if(r.playState!=="running")continue;let{effect:s}=r,a=(lu(s)?s.getKeyframes():[]).filter(t);a.length>0&&(o=[a[a.length-1],r])}return o}function cu(e){let{width:t,height:n,top:o,left:r,bottom:s,right:i}=e.getBoundingClientRect();return{width:t,height:n,top:o,left:r,bottom:s,right:i}}function Eh(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Va(e){return"nodeType"in e}function Ht(e){var t,n,o;return e?Eh(e)?e:Va(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window:window:window}function uu(e){let{Document:t}=Ht(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function Oo(e){return!e||Eh(e)?!1:e instanceof Ht(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function RS(e){return e instanceof Ht(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function es(e){return e?Eh(e)?e.document:Va(e)?uu(e)?e:Oo(e)||RS(e)?e.ownerDocument:document:document:document}function vA(e){var t,n,o,r;let{documentElement:s}=es(e),i=Ht(e).visualViewport,a=(t=i?.width)!=null?t:s.clientWidth,l=(n=i?.height)!=null?n:s.clientHeight,c=(o=i?.offsetTop)!=null?o:0,u=(r=i?.offsetLeft)!=null?r:0;return{top:c,left:u,right:u+a,bottom:c+l,width:a,height:l}}function SA(e,t){if(CA(e)&&e.open===!1)return!1;let{overflow:n,overflowX:o,overflowY:r}=getComputedStyle(e);return n==="visible"&&o==="visible"&&r==="visible"}function CA(e){return e.tagName==="DETAILS"}function ai(e,t=e.getBoundingClientRect(),n=0){var o,r,s,i,a;let l=t,{ownerDocument:c}=e,u=(o=c.defaultView)!=null?o:window,d=e.parentElement;for(;d&&d!==c.documentElement;){if(!SA(d)){let x=d.getBoundingClientRect(),v=n*(x.bottom-x.top),S=n*(x.right-x.left),b=n*(x.bottom-x.top),N=n*(x.right-x.left);l={top:Math.max(l.top,x.top-v),right:Math.min(l.right,x.right+S),bottom:Math.min(l.bottom,x.bottom+b),left:Math.max(l.left,x.left-N),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}let f=u.visualViewport,p=(r=f?.offsetTop)!=null?r:0,h=(s=f?.offsetLeft)!=null?s:0,g=(i=f?.width)!=null?i:u.innerWidth,y=(a=f?.height)!=null?a:u.innerHeight,m=n*y,_=n*g;return l={top:Math.max(l.top,p-m),right:Math.min(l.right,h+g+_),bottom:Math.min(l.bottom,p+y+m),left:Math.max(l.left,h-_),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function ts(e){return{x:e.clientX,y:e.clientY}}var PS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ru(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let o of Array.from(e.querySelectorAll("iframe, frame")))try{let r=o.contentDocument;r&&!t.has(r)&&n.push(...ru(r,t))}catch{}try{let o=e.defaultView;if(o&&o!==window.top){let r=o.parent;r&&r.document&&r.document!==e&&n.push(...ru(r.document,t))}}catch{}return n}function du(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Nh(){var e,t;let n=du()?window.visualViewport:null;return{x:(e=n?.offsetLeft)!=null?e:0,y:(t=n?.offsetTop)!=null?t:0}}function fu(e){return!e||!Va(e)?!1:e instanceof Ht(e).ShadowRoot}function ja(e){if(e&&Va(e)){let t=e.getRootNode();if(fu(t))return t;if(t instanceof Document)return t}return es(e)}function Ya(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function LS(e){let t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),o=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((s,i)=>{let a=o[i];if(OS(s)&&OS(a)&&(s.type!=="file"&&(s.value=a.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),DS(s)&&DS(a)&&a.width>0&&a.height>0){let l=s.getContext("2d");l?.drawImage(a,0,0)}}),n}function OS(e){return"value"in e}function DS(e){return e.tagName==="CANVAS"}function Th(e,{x:t,y:n}){let o=e.elementFromPoint(t,n);if(bA(o)){let{contentDocument:r}=o;if(r){let{left:s,top:i}=o.getBoundingClientRect();return Th(r,{x:t-s,y:n-i})}}return o}function bA(e){return e?.tagName==="IFRAME"}var Ga=new WeakMap;function FS(e){return e.closest(`
1
+ (()=>{var Gx=Object.defineProperty;var Ak=(e,t,n)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t)=>{for(var n in t)Gx(e,n,{get:t[n],enumerable:!0})};var w=(e,t,n)=>Ak(e,typeof t!="symbol"?t+"":t,n);var Ik=globalThis.ReactDOM;var{createPortal:qx,createRoot:Xx,flushSync:cW,hydrateRoot:uW,preconnect:dW,prefetchDNS:fW,preinit:pW,preinitModule:hW,preload:gW,preloadModule:mW,requestFormReset:_W,unstable_batchedUpdates:yW,useFormState:xW,useFormStatus:vW,version:SW}=Ik;var Jx=globalThis.React,E=Jx,{Children:bW,Component:Qx,Fragment:EW,PureComponent:NW,StrictMode:TW,Suspense:Zx,cloneElement:OW,createContext:ev,createElement:DW,createRef:wW,forwardRef:zr,isValidElement:MW,lazy:kW,memo:AW,startTransition:IW,useCallback:tv,useContext:nv,useDebugValue:$W,useDeferredValue:RW,useEffect:et,useId:PW,useImperativeHandle:LW,useLayoutEffect:po,useMemo:Dn,useReducer:FW,useRef:Xo,useState:Ie,useSyncExternalStore:vp,useTransition:BW}=Jx;var ov=new Map,Pc=new Map,rv=(e,t)=>ov.set(e,t),sv=()=>{Pc.forEach(e=>e.unmount()),Pc.clear()},iv=(e,t)=>e.querySelectorAll("[data-react-ui]").forEach(n=>{if(Pc.has(n))return;let o=ov.get(n.dataset.reactUi),r=t(n);Pc.set(n,r),r.render(E.createElement(o,JSON.parse(n.dataset.props)))});var av=(e,t)=>{let n=()=>iv(e,t);e.addEventListener("turbo:load",n),e.addEventListener("turbo:frame-load",n),e.addEventListener("turbo:before-cache",sv),e.readyState==="loading"?e.addEventListener("DOMContentLoaded",n):n()};var $k=Symbol.for("preact-signals");function zc(){if(Eo>1)Eo--;else{var e,t=!1;for((function(){var r=Fc;for(Fc=void 0;r!==void 0;){var s=r.S;if(s.v===r.v)for(var i=s.t;i!==void 0;i=i.x)i.i===r.i&&(i.i=s.i);r=r.o}})();Da!==void 0;){var n=Da;for(Da=void 0,Lc++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&cv(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(Lc=0,Eo--,t)throw e}}function Oe(e){if(Eo>0)return e();Sp=++Rk,Eo++;try{return e()}finally{zc()}}var Oa,ze=void 0;function ie(e){var t=ze,n=Oa;ze=void 0,Oa=void 0;try{return e()}finally{ze=t,Oa=n}}var Da=void 0,Eo=0,Lc=0,Rk=0,Sp=0,Fc=void 0,Bc=0;function lv(e){if(ze!==void 0){var t=e.n;if(t===void 0||t.t!==ze)return t={i:0,S:e,p:ze.s,n:void 0,t:ze,e:void 0,x:void 0,r:t},ze.s!==void 0&&(ze.s.n=t),ze.s=t,e.n=t,32&ze.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=ze.s,t.n=void 0,ze.s.n=t,ze.s=t),t}}function kt(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}kt.prototype.brand=$k;kt.prototype.h=function(){return!0};kt.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?n.e=e:ie(function(){var o;(o=t.W)==null||o.call(t)}))};kt.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&ie(function(){var r;(r=t.Z)==null||r.call(t)}))}};kt.prototype.subscribe=function(e){var t=this;return gt(function(){var n=t.value;ie(function(){return e(n)})},{name:"sub"})};kt.prototype.valueOf=function(){return this.value};kt.prototype.toString=function(){return this.value+""};kt.prototype.toJSON=function(){return this.value};kt.prototype.peek=function(){var e=this;return ie(function(){return e.value})};Object.defineProperty(kt.prototype,"value",{get:function(){var e=lv(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Lc>100)throw new Error("Cycle detected");(function(n){Eo!==0&&Lc===0&&n.l!==Sp&&(n.l=Sp,Fc={S:n,v:n.v,i:n.i,o:Fc})})(this),this.v=e,this.i++,Bc++,Eo++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{zc()}}}});function wn(e,t){return new kt(e,t)}function cv(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 uv(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 dv(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Wr(e,t){kt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Bc-1,this.f=4}Wr.prototype=new kt;Wr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Bc))return!0;if(this.g=Bc,this.f|=1,this.i>0&&!cv(this))return this.f&=-2,!0;var e=ze;try{uv(this),ze=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return ze=e,dv(this),this.f&=-2,!0};Wr.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)}kt.prototype.S.call(this,e)};Wr.prototype.U=function(e){if(this.t!==void 0&&(kt.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)}};Wr.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(Wr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=lv(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function wa(e,t){return new Wr(e,t)}function fv(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Eo++;var n=ze;ze=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Cp(e),o}finally{ze=n,zc()}}}function Cp(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,fv(e)}function Pk(e){if(ze!==this)throw new Error("Out-of-order effect");dv(this),ze=e,this.f&=-2,8&this.f&&Cp(this),zc()}function Ys(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Oa&&Oa.push(this)}Ys.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.m=t)}finally{e()}};Ys.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,fv(this),uv(this),Eo++;var e=ze;return ze=this,Pk.bind(this,e)};Ys.prototype.N=function(){2&this.f||(this.f|=2,this.u=Da,Da=this)};Ys.prototype.d=function(){this.f|=8,1&this.f||Cp(this)};Ys.prototype.dispose=function(){this.d()};function gt(e,t){var n=new Ys(e,t);try{n.c()}catch(r){throw n.d(),r}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Lk=Object.create,Ip=Object.defineProperty,Fk=Object.defineProperties,Bk=Object.getOwnPropertyDescriptor,zk=Object.getOwnPropertyDescriptors,pv=Object.getOwnPropertySymbols,Wk=Object.prototype.hasOwnProperty,Kk=Object.prototype.propertyIsEnumerable,gv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Gs=e=>{throw TypeError(e)},Op=(e,t,n)=>t in e?Ip(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uk=(e,t)=>{for(var n in t||(t={}))Wk.call(t,n)&&Op(e,n,t[n]);if(pv)for(var n of pv(t))Kk.call(t,n)&&Op(e,n,t[n]);return e},Hk=(e,t)=>Fk(e,zk(t)),hv=(e,t)=>Ip(e,"name",{value:t,configurable:!0}),Vk=e=>{var t;return[,,,Lk((t=e?.[gv("metadata")])!=null?t:null)]},mv=["class","method","getter","setter","accessor","field","value","get","set"],Ma=e=>e!==void 0&&typeof e!="function"?Gs("Function expected"):e,jk=(e,t,n,o,r)=>({kind:mv[e],name:t,metadata:o,addInitializer:s=>n._?Gs("Already initialized"):r.push(Ma(s||null))}),_v=(e,t)=>Op(t,gv("metadata"),e[3]),Kr=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},qs=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=mv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&Bk(d<4?r:{get[n](){return Mn(this,s)},set[n](v){return Jo(this,s,v)}},n));d?p&&d<4&&hv(s,(d>2?"set ":d>1?"get ":"")+n):hv(r,n);for(var x=o.length-1;x>=0;x--)c=jk(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>Yk(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Mn:Gk)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Jo(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Ma(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Gs("Object expected"):(Ma(i=a.get)&&(_.get=i),Ma(i=a.set)&&(_.set=i),Ma(i=a.init)&&y.unshift(i));return d||_v(e,r),_&&Ip(r,n,_),p?d^4?s:_:r},$p=(e,t,n)=>t.has(e)||Gs("Cannot "+n),Yk=(e,t)=>Object(t)!==t?Gs('Cannot use the "in" operator on this value'):e.has(t),Mn=(e,t,n)=>($p(e,t,"read from private field"),n?n.call(e):t.get(e)),ka=(e,t,n)=>t.has(e)?Gs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Jo=(e,t,n,o)=>($p(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Gk=(e,t,n)=>($p(e,t,"access private method"),n);function Kc(e,t){if(t){let n;return wa(()=>{let o=e();return o&&n&&t(n,o)?n:(n=o,o)})}return wa(e)}function Wc(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((o,r)=>!Wc(o,t[r]));if(typeof e=="object"&&typeof t=="object"){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?!1:!n.some(s=>!Wc(e[s],t[s]))}return!1}function fe({get:e},t){return{init(n){return wn(n)},get(){return e.call(this).value},set(n){let o=e.call(this);o.peek()!==n&&(o.value=n)}}}function Ve(e,t){let n=new WeakMap;return function(){let o=n.get(this);return o||(o=Kc(e.bind(this)),n.set(this,o)),o.value}}function bp(e=!0){return function(t,n){n.addInitializer(function(){let o=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(o,n.name);r&&Object.defineProperty(o,n.name,Hk(Uk({},r),{enumerable:e}))})}}function Hr(...e){let t=e.map(n=>gt(n));return()=>t.forEach(n=>n())}var yv,xv,vv,Sv,Cv,bv,Kt,Rp,Ep,Dp,wp,At,Pp,Np,Ev,Mp,Lp,Tp,kp,Ap;bv=[fe],Cv=[fe],Sv=[fe],vv=[bp()],xv=[bp()],yv=[bp()];var Qo=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Kr(Kt,5,this),ka(this,At),ka(this,Rp,Kr(Kt,8,this)),Kr(Kt,11,this),ka(this,Pp,Kr(Kt,12,this)),Kr(Kt,15,this),ka(this,Lp,Kr(Kt,16,this)),Kr(Kt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Mn(this,At,kp)}get initial(){return Mn(this,At,Dp)}get previous(){return Mn(this,At,Ev)}set current(e){let t=ie(()=>Mn(this,At,kp));e&&t&&this.equals(t,e)||Oe(()=>{Mn(this,At,Dp)||Jo(this,At,e,wp),Jo(this,At,t,Mp),Jo(this,At,e,Ap)})}reset(e=this.defaultValue){Oe(()=>{Jo(this,At,void 0,Mp),Jo(this,At,e,wp),Jo(this,At,e,Ap)})}};Kt=Vk(null);Rp=new WeakMap;At=new WeakSet;Pp=new WeakMap;Lp=new WeakMap;Ep=qs(Kt,20,"#initial",bv,At,Rp),Dp=Ep.get,wp=Ep.set;Np=qs(Kt,20,"#previous",Cv,At,Pp),Ev=Np.get,Mp=Np.set;Tp=qs(Kt,20,"#current",Sv,At,Lp),kp=Tp.get,Ap=Tp.set;qs(Kt,2,"current",vv,Qo);qs(Kt,2,"initial",xv,Qo);qs(Kt,2,"previous",yv,Qo);_v(Kt,Qo);function Uc(e){return ie(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var Ur,Nv=class{constructor(){ka(this,Ur,new WeakMap)}get(e,t){var n;return e?(n=Mn(this,Ur).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var o;if(e)return Mn(this,Ur).has(e)||Mn(this,Ur).set(e,new Map),(o=Mn(this,Ur).get(e))==null?void 0:o.set(t,n)}clear(e){var t;return e?(t=Mn(this,Ur).get(e))==null?void 0:t.clear():void 0}};Ur=new WeakMap;var qk=Object.create,Up=Object.defineProperty,Xk=Object.getOwnPropertyDescriptor,Tv=Object.getOwnPropertySymbols,Jk=Object.prototype.hasOwnProperty,Qk=Object.prototype.propertyIsEnumerable,wv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Xs=e=>{throw TypeError(e)},Ov=Math.pow,Fp=(e,t,n)=>t in e?Up(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zk=(e,t)=>{for(var n in t||(t={}))Jk.call(t,n)&&Fp(e,n,t[n]);if(Tv)for(var n of Tv(t))Qk.call(t,n)&&Fp(e,n,t[n]);return e},Dv=(e,t)=>Up(e,"name",{value:t,configurable:!0}),eA=e=>{var t;return[,,,qk((t=e?.[wv("metadata")])!=null?t:null)]},Mv=["class","method","getter","setter","accessor","field","value","get","set"],Aa=e=>e!==void 0&&typeof e!="function"?Xs("Function expected"):e,tA=(e,t,n,o,r)=>({kind:Mv[e],name:t,metadata:o,addInitializer:s=>n._?Xs("Already initialized"):r.push(Aa(s||null))}),kv=(e,t)=>Fp(t,wv("metadata"),e[3]),nA=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},Av=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=Mv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&Xk(d<4?r:{get[n](){return Bp(this,s)},set[n](v){return zp(this,s,v)}},n));d?p&&d<4&&Dv(s,(d>2?"set ":d>1?"get ":"")+n):Dv(r,n);for(var x=o.length-1;x>=0;x--)c=tA(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>oA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Bp:sA)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>zp(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Aa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Xs("Object expected"):(Aa(i=a.get)&&(_.get=i),Aa(i=a.set)&&(_.set=i),Aa(i=a.init)&&y.unshift(i));return d||kv(e,r),_&&Up(r,n,_),p?d^4?s:_:r},Hp=(e,t,n)=>t.has(e)||Xs("Cannot "+n),oA=(e,t)=>Object(t)!==t?Xs('Cannot use the "in" operator on this value'):e.has(t),Bp=(e,t,n)=>(Hp(e,t,"read from private field"),n?n.call(e):t.get(e)),rA=(e,t,n)=>t.has(e)?Xs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zp=(e,t,n,o)=>(Hp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),sA=(e,t,n)=>(Hp(e,t,"access private method"),n),It=class Wp{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Wp(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new Wp(t,n)}},tn=class Vr{constructor(t,n,o,r){this.left=t,this.top=n,this.width=o,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:o,left:r,width:s,height:i,scale:a}=this,l=new Vr(r+t,o+n,s,i);return l.scale=Zk({},a),l}get boundingRectangle(){let{width:t,height:n,left:o,top:r,right:s,bottom:i}=this;return{width:t,height:n,left:o,top:r,right:s,bottom:i}}get center(){let{left:t,top:n,right:o,bottom:r}=this;return new It((t+o)/2,(n+r)/2)}get area(){let{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof Vr))return!1;let{left:n,top:o,width:r,height:s}=this;return n===t.left&&o===t.top&&r===t.width&&s===t.height}containsPoint(t){let{top:n,left:o,bottom:r,right:s}=this;return n<=t.y&&t.y<=r&&o<=t.x&&t.x<=s}intersectionArea(t){return t instanceof Vr?iA(this,t):0}intersectionRatio(t){let{area:n}=this,o=this.intersectionArea(t);return o/(t.area+n-o)}get bottom(){let{top:t,height:n}=this;return t+n}get right(){let{left:t,width:n}=this;return t+n}get aspectRatio(){let{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:o,height:r}){return new Vr(n,t,o,r)}static delta(t,n,o={x:"center",y:"center"}){let r=(s,i)=>{let a=o[i],l=i==="x"?s.left:s.top,c=i==="x"?s.width:s.height;return a=="start"?l:a=="end"?l+c:l+c/2};return It.delta({x:r(t,"x"),y:r(t,"y")},{x:r(n,"x"),y:r(n,"y")})}static intersectionRatio(t,n){return Vr.from(t).intersectionRatio(Vr.from(n))}};function iA(e,t){let n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=s-n;return o<r&&n<s?i*a:0}var Iv,$v,Kp,Hc,Ia,$a=class extends(Kp=Qo,$v=[Ve],Iv=[Ve],Kp){constructor(e){let t=It.from(e);super(t,(n,o)=>It.equals(n,o)),nA(Ia,5,this),rA(this,Hc,0),this.velocity={x:0,y:0}}get delta(){return It.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){let{current:t}=this,n=It.from(e),o={x:n.x-t.x,y:n.y-t.y},r=Date.now(),s=r-Bp(this,Hc),i=a=>Math.round(a/s*100);Oe(()=>{zp(this,Hc,r),this.velocity={x:i(o.x),y:i(o.y)},super.current=n})}reset(e=this.defaultValue){super.reset(It.from(e)),this.velocity={x:0,y:0}}};Ia=eA(Kp);Hc=new WeakMap;Av(Ia,2,"delta",$v,$a);Av(Ia,2,"direction",Iv,$a);kv(Ia,$a);function Vc({x:e,y:t},n){let o=Math.abs(e),r=Math.abs(t);return typeof n=="number"?Math.sqrt(Ov(o,2)+Ov(r,2))>n:"x"in n&&"y"in n?o>n.x&&r>n.y:"x"in n?o>n.x:"y"in n?r>n.y:!1}var Rv=(e=>(e.Horizontal="x",e.Vertical="y",e))(Rv||{}),Vp=Object.values(Rv);var aA=Object.create,Xp=Object.defineProperty,lA=Object.defineProperties,cA=Object.getOwnPropertyDescriptor,uA=Object.getOwnPropertyDescriptors,Qc=Object.getOwnPropertySymbols,Bv=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable,Wv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ni=e=>{throw TypeError(e)},Yp=(e,t,n)=>t in e?Xp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jp=(e,t)=>{for(var n in t||(t={}))Bv.call(t,n)&&Yp(e,n,t[n]);if(Qc)for(var n of Qc(t))zv.call(t,n)&&Yp(e,n,t[n]);return e},Qp=(e,t)=>lA(e,uA(t)),Pv=(e,t)=>Xp(e,"name",{value:t,configurable:!0}),Kv=(e,t)=>{var n={};for(var o in e)Bv.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Qc)for(var o of Qc(e))t.indexOf(o)<0&&zv.call(e,o)&&(n[o]=e[o]);return n},oi=e=>{var t;return[,,,aA((t=e?.[Wv("metadata")])!=null?t:null)]},Uv=["class","method","getter","setter","accessor","field","value","get","set"],Ra=e=>e!==void 0&&typeof e!="function"?ni("Function expected"):e,dA=(e,t,n,o,r)=>({kind:Uv[e],name:t,metadata:o,addInitializer:s=>n._?ni("Already initialized"):r.push(Ra(s||null))}),Gr=(e,t)=>Yp(t,Wv("metadata"),e[3]),oe=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},ve=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=Uv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&cA(d<4?r:{get[n](){return tt(this,s)},set[n](v){return un(this,s,v)}},n));d?p&&d<4&&Pv(s,(d>2?"set ":d>1?"get ":"")+n):Pv(r,n);for(var x=o.length-1;x>=0;x--)c=dA(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>fA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?tt:Hv)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>un(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Ra(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?ni("Object expected"):(Ra(i=a.get)&&(_.get=i),Ra(i=a.set)&&(_.set=i),Ra(i=a.init)&&y.unshift(i));return d||Gr(e,r),_&&Xp(r,n,_),p?d^4?s:_:r},Zp=(e,t,n)=>t.has(e)||ni("Cannot "+n),fA=(e,t)=>Object(t)!==t?ni('Cannot use the "in" operator on this value'):e.has(t),tt=(e,t,n)=>(Zp(e,t,"read from private field"),n?n.call(e):t.get(e)),be=(e,t,n)=>t.has(e)?ni("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),un=(e,t,n,o)=>(Zp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Hv=(e,t,n)=>(Zp(e,t,"access private method"),n);function Vv(e,t){return{plugin:e,options:t}}function ri(e){return t=>Vv(e,t)}function ti(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var jv,Fa,eh,Yc;jv=[fe];var mt=class{constructor(e,t){this.manager=e,this.options=t,be(this,eh,oe(Fa,8,this,!1)),oe(Fa,11,this),be(this,Yc,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return ie(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=gt(e.bind(this));return tt(this,Yc).add(t),t}destroy(){tt(this,Yc).forEach(e=>e())}static configure(e){return Vv(this,e)}};Fa=oi(null);eh=new WeakMap;Yc=new WeakMap;ve(Fa,4,"disabled",jv,mt,eh);Gr(Fa,mt);var si=class extends mt{},Gc,jp=class{constructor(e){this.manager=e,this.instances=new Map,be(this,Gc,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(ti).reduce((o,r)=>{let s=o.find(({plugin:i})=>i===r.plugin);return s?(s.options=r.options,o):[...o,r]},[]),n=t.map(({plugin:o})=>o);for(let o of tt(this,Gc))if(!n.includes(o)){if(o.prototype instanceof si)continue;this.unregister(o)}for(let{plugin:o,options:r}of t)this.register(o,r);un(this,Gc,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let o=new e(this.manager,t);return this.instances.set(e,o),o}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Gc=new WeakMap;function pA(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var jc=[],Js,Qs,hA=class extends mt{constructor(e){super(e),be(this,Js),be(this,Qs),this.computeCollisions=this.computeCollisions.bind(this),un(this,Qs,wn(jc)),this.destroy=Hr(()=>{let t=this.computeCollisions(),n=ie(()=>this.manager.dragOperation.position.current);if(t!==jc){let o=tt(this,Js);if(un(this,Js,n),o&&n.x==o.x&&n.y==o.y)return}else un(this,Js,void 0);tt(this,Qs).value=t},()=>{let{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){ie(()=>{e?tt(this,Qs).value=this.computeCollisions():un(this,Js,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:o}=this.manager,{source:r,shape:s,status:i}=o;if(!i.initialized||!s)return jc;let a=[],l=[];for(let c of e??n.droppables){if(c.disabled||r&&!c.accepts(r))continue;let u=t??c.collisionDetector;if(!u)continue;l.push(c),c.shape;let d=ie(()=>u({droppable:c,dragOperation:o}));d&&(c.collisionPriority!=null&&(d.priority=c.collisionPriority),a.push(d))}return l.length===0?jc:(a.sort(pA),a)}get collisions(){return tt(this,Qs).value}};Js=new WeakMap;Qs=new WeakMap;var Yv,Gv,qv,th,Xv,qn,nh,ei,oh,rh;qv=[fe],Gv=[fe],Yv=[fe];var No=class jr{constructor(t,n){be(this,nh,oe(qn,8,this)),oe(qn,11,this),be(this,ei),be(this,oh,oe(qn,12,this)),oe(qn,15,this),be(this,rh,oe(qn,16,this)),oe(qn,19,this);let{effects:o,id:r,data:s={},disabled:i=!1,register:a=!0}=t,l=r;un(this,ei,wn(r)),this.manager=n,this.data=s,this.disabled=i,this.effects=()=>{var c;return[()=>{let{id:u,manager:d}=this;if(u!==l)return l=u,d?.registry.register(this),()=>d?.registry.unregister(this)},...(c=o?.())!=null?c:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),n&&a&&queueMicrotask(this.register)}get id(){var t,n;let o=tt(this,ei).value;return(n=(t=jr.pendingIdChanges)==null?void 0:t.get(this))!=null?n:o}set id(t){var n,o;let r=(o=(n=jr.pendingIdChanges)==null?void 0:n.get(this))!=null?o:tt(this,ei).peek();t!==r&&(jr.pendingIdChanges||(jr.pendingIdChanges=new Map,queueMicrotask(()=>{var s;return Hv(s=jr,th,Xv).call(s)})),jr.pendingIdChanges.set(this,t))}register(){var t;return(t=this.manager)==null?void 0:t.registry.register(this)}unregister(){var t;(t=this.manager)==null||t.registry.unregister(this)}destroy(){var t;(t=this.manager)==null||t.registry.unregister(this)}};qn=oi(null);th=new WeakSet;Xv=function(){let e=No.pendingIdChanges;No.pendingIdChanges=null,e&&Oe(()=>{for(let[t,n]of e)tt(t,ei).value=n})};nh=new WeakMap;ei=new WeakMap;oh=new WeakMap;rh=new WeakMap;ve(qn,4,"manager",qv,No,nh);ve(qn,4,"data",Gv,No,oh);ve(qn,4,"disabled",Yv,No,rh);be(No,th);Gr(qn,No);No.pendingIdChanges=null;var Zc=No,Lv=class{constructor(){this.map=wn(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),o=n.get(e),r=()=>this.unregister(e,t);if(o===t)return r;if(o&&o.id===e){let a=this.cleanupFunctions.get(o);a?.(),this.cleanupFunctions.delete(o)}let s=new Map(n);for(let[a,l]of n)if(l===t&&a!==e){s.delete(a);break}s.set(e,t),this.map.value=s;let i=Hr(...t.effects());return this.cleanupFunctions.set(t,i),r},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;let o=this.cleanupFunctions.get(t);o?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this){let t=this.cleanupFunctions.get(e);t?.(),e.destroy()}this.map.value=new Map}},Jv,Qv,Zv,eS,tS,nS,Gp,Ut,sh,ih,ah,Xn=class extends(Gp=Zc,nS=[fe],tS=[fe],eS=[fe],Zv=[Ve],Qv=[Ve],Jv=[Ve],Gp){constructor(e,t){var n=e,{modifiers:o,type:r,sensors:s,plugins:i,effects:a}=n,l=Kv(n,["modifiers","type","sensors","plugins","effects"]);super(Qp(Jp({},l),{effects:()=>{var c;return[...(c=a?.())!=null?c:[],()=>{let{manager:u,plugins:d}=this;if(!(!u||!d))for(let f of d){let{plugin:p}=ti(f);u.registry.plugins.register(p)}}]}}),t),oe(Ut,5,this),be(this,sh,oe(Ut,8,this)),oe(Ut,11,this),be(this,ih,oe(Ut,12,this)),oe(Ut,15,this),be(this,ah,oe(Ut,16,this,this.isDragSource?"dragging":"idle")),oe(Ut,19,this),this.type=r,this.sensors=s,this.modifiers=o,this.alignment=l.alignment,this.plugins=i}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=ti(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.source)==null?void 0:t.id)===this.id}};Ut=oi(Gp);sh=new WeakMap;ih=new WeakMap;ah=new WeakMap;ve(Ut,4,"type",nS,Xn,sh);ve(Ut,4,"modifiers",tS,Xn,ih);ve(Ut,4,"status",eS,Xn,ah);ve(Ut,2,"isDropping",Zv,Xn);ve(Ut,2,"isDragging",Qv,Xn);ve(Ut,2,"isDragSource",Jv,Xn);Gr(Ut,Xn);var oS,rS,sS,iS,aS,lS,qp,ct,lh,ch,uh,dh,fh,Jn=class extends(qp=Zc,lS=[fe],aS=[fe],iS=[fe],sS=[fe],rS=[fe],oS=[Ve],qp){constructor(e,t){var n=e,{accept:o,collisionDetector:r,collisionPriority:s,type:i}=n,a=Kv(n,["accept","collisionDetector","collisionPriority","type"]);super(a,t),oe(ct,5,this),be(this,lh,oe(ct,8,this)),oe(ct,11,this),be(this,ch,oe(ct,12,this)),oe(ct,15,this),be(this,uh,oe(ct,16,this)),oe(ct,19,this),be(this,dh,oe(ct,20,this)),oe(ct,23,this),be(this,fh,oe(ct,24,this)),oe(ct,27,this),this.accept=o,this.collisionDetector=r,this.collisionPriority=s,this.type=i}accepts(e){let{accept:t}=this;return t?typeof t=="function"?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){var e,t;return((t=(e=this.manager)==null?void 0:e.dragOperation.target)==null?void 0:t.id)===this.id}};ct=oi(qp);lh=new WeakMap;ch=new WeakMap;uh=new WeakMap;dh=new WeakMap;fh=new WeakMap;ve(ct,4,"accept",lS,Jn,lh);ve(ct,4,"type",aS,Jn,ch);ve(ct,4,"collisionDetector",iS,Jn,uh);ve(ct,4,"collisionPriority",sS,Jn,dh);ve(ct,4,"shape",rS,Jn,fh);ve(ct,2,"isDropTarget",oS,Jn);Gr(ct,Jn);var gA=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,o=new Set(n.get(e));return o.add(t),n.set(e,o),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,o=new Set(n.get(e));o.delete(t),n.set(e,o)}dispatch(e,...t){let{registry:n}=this,o=n.get(e);if(o)for(let r of o)r(...t)}},mA=class extends gA{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function qc(e,t=!0){let n=!1;return Qp(Jp({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var _A=class extends si{constructor(e){super(e);let t=(o,r)=>o.map(({id:s})=>s).join("")===r.map(({id:s})=>s).join(""),n=[];this.destroy=Hr(()=>{let{dragOperation:o,collisionObserver:r}=e;o.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:o,monitor:r}=e,{collisions:s}=o;if(o.isDisabled()||Zc.pendingIdChanges)return;let i=qc({collisions:s});if(r.dispatch("collision",i),i.defaultPrevented||t(s,n))return;n=s;let[a]=s;ie(()=>{var l;a?.id!==((l=e.dragOperation.target)==null?void 0:l.id)&&(o.disable(),e.actions.setDropTarget(a?.id).then(()=>{o.enable()}))})})}},qr=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(qr||{}),Xr=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Xr||{}),cS,uS,dS,fS,pS,hS,gS,kn,ph;gS=[fe],hS=[Ve],pS=[Ve],fS=[Ve],dS=[Ve],uS=[Ve],cS=[Ve];var To=class{constructor(){oe(kn,5,this),be(this,ph,oe(kn,8,this,"idle")),oe(kn,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){let{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};kn=oi(null);ph=new WeakMap;ve(kn,4,"value",gS,To,ph);ve(kn,2,"current",hS,To);ve(kn,2,"idle",pS,To);ve(kn,2,"initializing",fS,To);ve(kn,2,"initialized",dS,To);ve(kn,2,"dragging",uS,To);ve(kn,2,"dropped",cS,To);Gr(kn,To);var yA=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return ie(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let o=qc({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",o),this.manager.renderer.rendering.then(()=>o.defaultPrevented)})}start(e){return ie(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");let o=new AbortController,{event:r,coordinates:s}=e;Oe(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(s)});let i=qc({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),o.abort(),o):(t.status.set("initializing"),t.controller=o,this.manager.renderer.rendering.then(()=>{if(o.signal.aborted)return;let{status:a}=t;a.current==="initializing"&&Oe(()=>{t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),o)})}move(e){return ie(()=>{var t,n;let{dragOperation:o}=this.manager,{status:r,controller:s}=o;if(!r.dragging||!s||s.signal.aborted)return;let i=qc({nativeEvent:e.event,operation:o.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",i),queueMicrotask(()=>{var a,l,c,u,d;if(i.defaultPrevented)return;let f=(d=e.to)!=null?d:{x:o.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:o.position.current.y+((u=(c=e.by)==null?void 0:c.y)!=null?u:0)};o.position.current=f})})}stop(e={}){return ie(()=>{var t,n;let{dragOperation:o}=this.manager,{controller:r}=o;if(!r||r.signal.aborted)return;let s,i=()=>{let l={resume:()=>{},abort:()=>{}};return s=new Promise((c,u)=>{l.resume=c,l.abort=u}),l};r.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{o.status.set("dropped");let l=ie(()=>{var u;return((u=o.source)==null?void 0:u.status)==="dropping"}),c=()=>{o.controller===r&&(o.controller=void 0),o.reset()};if(l){let{source:u}=o,d=gt(()=>{u?.status==="idle"&&(d(),c())})}else this.manager.renderer.rendering.then(c)})};o.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:o.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:i}),s?s.then(a).catch(()=>o.reset()):a()})}},Yr=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}},mS=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let n of e??[])n.controller=this}onEvent(e){var t;if(!this.activated)if((t=this.constraints)!=null&&t.length)for(let n of this.constraints)n.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Xc,hh=class{constructor(e){this.options=e,be(this,Xc)}set controller(e){un(this,Xc,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;(t=tt(this,Xc))==null||t.activate(e)}};Xc=new WeakMap;var Fv=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},xA=class{constructor(e){this.draggables=new Lv,this.droppables=new Lv,this.plugins=new jp(e),this.sensors=new jp(e),this.modifiers=new jp(e)}register(e,t){if(e instanceof Xn)return this.draggables.register(e.id,e);if(e instanceof Jn)return this.droppables.register(e.id,e);if(e.prototype instanceof Fv)return this.modifiers.register(e,t);if(e.prototype instanceof Yr)return this.sensors.register(e,t);if(e.prototype instanceof mt)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof Zc)return e instanceof Xn?this.draggables.unregister(e.id,e):e instanceof Jn?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Fv)return this.modifiers.unregister(e);if(e.prototype instanceof Yr)return this.sensors.unregister(e);if(e.prototype instanceof mt)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},_S,yS,xS,vS,SS,CS,bS,ES,NS,Pa,Jc,Zs,je,gh,mh,_h,yh,xh,La;NS=[Ve],ES=[fe],bS=[fe],CS=[fe],SS=[fe],vS=[fe],xS=[Ve],yS=[Ve],_S=[Ve];var Qn=class{constructor(e){oe(je,5,this),be(this,Pa),be(this,Jc),be(this,Zs,new Qo(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new To,be(this,gh,oe(je,8,this,!1)),oe(je,11,this),be(this,mh,oe(je,12,this,null)),oe(je,15,this),be(this,_h,oe(je,16,this,null)),oe(je,19,this),be(this,yh,oe(je,20,this,null)),oe(je,23,this),be(this,xh,oe(je,24,this,[])),oe(je,27,this),this.position=new $a({x:0,y:0}),be(this,La,{x:0,y:0}),un(this,Pa,e)}get shape(){let{current:e,initial:t,previous:n}=tt(this,Zs);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?tt(this,Zs).current=e:tt(this,Zs).reset()}get source(){var e;let t=this.sourceIdentifier;if(t==null)return null;let n=tt(this,Pa).registry.draggables.get(t);return n&&un(this,Jc,n),(e=n??tt(this,Jc))!=null?e:null}get target(){var e;let t=this.targetIdentifier;return t!=null&&(e=tt(this,Pa).registry.droppables.get(t))!=null?e:null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let o of this.modifiers)n=o.apply(Qp(Jp({},this.snapshot()),{transform:n}));return un(this,La,n),n}snapshot(){return ie(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:tt(this,La),shape:this.shape?Uc(this.shape):null,position:Uc(this.position),status:Uc(this.status),canceled:this.canceled}))}reset(){Oe(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,tt(this,Zs).reset(),this.position.reset({x:0,y:0}),un(this,La,{x:0,y:0}),this.modifiers=[]})}};je=oi(null);Pa=new WeakMap;Jc=new WeakMap;Zs=new WeakMap;gh=new WeakMap;mh=new WeakMap;_h=new WeakMap;yh=new WeakMap;xh=new WeakMap;La=new WeakMap;ve(je,2,"shape",NS,Qn);ve(je,4,"canceled",ES,Qn,gh);ve(je,4,"activatorEvent",bS,Qn,mh);ve(je,4,"sourceIdentifier",CS,Qn,_h);ve(je,4,"targetIdentifier",SS,Qn,yh);ve(je,4,"modifiers",vS,Qn,xh);ve(je,2,"source",xS,Qn);ve(je,2,"target",yS,Qn);ve(je,2,"transform",_S,Qn);Gr(je,Qn);var vA={get rendering(){return Promise.resolve()}};function ho(e,t){return typeof e=="function"?e(t):e??t}var TS=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(d=>d.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var t;let n=e??{},o=ho(n.plugins,[]),r=ho(n.sensors,[]),s=ho(n.modifiers,[]),i=(t=n.renderer)!=null?t:vA,a=new mA(this),l=new xA(this);this.registry=l,this.monitor=a,this.renderer=i,this.actions=new yA(this),this.dragOperation=new Qn(this),this.collisionObserver=new hA(this),this.plugins=[_A,...o],this.modifiers=s,this.sensors=r;let{destroy:c}=this,u=Hr(()=>{var d,f,p;let h=ie(()=>this.dragOperation.modifiers),g=this.modifiers;for(let y of h)g.includes(y)||y.destroy();this.dragOperation.modifiers=(p=(f=(d=this.dragOperation.source)==null?void 0:d.modifiers)==null?void 0:f.map(y=>{let{plugin:m,options:_}=ti(y);return new m(this,_)}))!=null?p:g});this.destroy=()=>{u(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}};var IS=e=>{throw TypeError(e)},Ch=(e,t,n)=>t.has(e)||IS("Cannot "+n),re=(e,t,n)=>(Ch(e,t,"read from private field"),t.get(e)),nn=(e,t,n)=>t.has(e)?IS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),dn=(e,t,n,o)=>(Ch(e,t,"write to private field"),t.set(e,n),n),$S=(e,t,n)=>(Ch(e,t,"access private method"),n);function lu(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function bh(e,t){let n=e.getAnimations(),o=null;for(let r of n){if(r.playState!=="running")continue;let{effect:s}=r,a=(lu(s)?s.getKeyframes():[]).filter(t);a.length>0&&(o=[a[a.length-1],r])}return o}function cu(e){let{width:t,height:n,top:o,left:r,bottom:s,right:i}=e.getBoundingClientRect();return{width:t,height:n,top:o,left:r,bottom:s,right:i}}function Eh(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Va(e){return"nodeType"in e}function Ht(e){var t,n,o;return e?Eh(e)?e:Va(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window:window:window}function uu(e){let{Document:t}=Ht(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function Oo(e){return!e||Eh(e)?!1:e instanceof Ht(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function RS(e){return e instanceof Ht(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function es(e){return e?Eh(e)?e.document:Va(e)?uu(e)?e:Oo(e)||RS(e)?e.ownerDocument:document:document:document}function SA(e){var t,n,o,r;let{documentElement:s}=es(e),i=Ht(e).visualViewport,a=(t=i?.width)!=null?t:s.clientWidth,l=(n=i?.height)!=null?n:s.clientHeight,c=(o=i?.offsetTop)!=null?o:0,u=(r=i?.offsetLeft)!=null?r:0;return{top:c,left:u,right:u+a,bottom:c+l,width:a,height:l}}function CA(e,t){if(bA(e)&&e.open===!1)return!1;let{overflow:n,overflowX:o,overflowY:r}=getComputedStyle(e);return n==="visible"&&o==="visible"&&r==="visible"}function bA(e){return e.tagName==="DETAILS"}function ai(e,t=e.getBoundingClientRect(),n=0){var o,r,s,i,a;let l=t,{ownerDocument:c}=e,u=(o=c.defaultView)!=null?o:window,d=e.parentElement;for(;d&&d!==c.documentElement;){if(!CA(d)){let x=d.getBoundingClientRect(),v=n*(x.bottom-x.top),S=n*(x.right-x.left),b=n*(x.bottom-x.top),N=n*(x.right-x.left);l={top:Math.max(l.top,x.top-v),right:Math.min(l.right,x.right+S),bottom:Math.min(l.bottom,x.bottom+b),left:Math.max(l.left,x.left-N),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}let f=u.visualViewport,p=(r=f?.offsetTop)!=null?r:0,h=(s=f?.offsetLeft)!=null?s:0,g=(i=f?.width)!=null?i:u.innerWidth,y=(a=f?.height)!=null?a:u.innerHeight,m=n*y,_=n*g;return l={top:Math.max(l.top,p-m),right:Math.min(l.right,h+g+_),bottom:Math.min(l.bottom,p+y+m),left:Math.max(l.left,h-_),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function ts(e){return{x:e.clientX,y:e.clientY}}var PS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ru(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let o of Array.from(e.querySelectorAll("iframe, frame")))try{let r=o.contentDocument;r&&!t.has(r)&&n.push(...ru(r,t))}catch{}try{let o=e.defaultView;if(o&&o!==window.top){let r=o.parent;r&&r.document&&r.document!==e&&n.push(...ru(r.document,t))}}catch{}return n}function du(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Nh(){var e,t;let n=du()?window.visualViewport:null;return{x:(e=n?.offsetLeft)!=null?e:0,y:(t=n?.offsetTop)!=null?t:0}}function fu(e){return!e||!Va(e)?!1:e instanceof Ht(e).ShadowRoot}function ja(e){if(e&&Va(e)){let t=e.getRootNode();if(fu(t))return t;if(t instanceof Document)return t}return es(e)}function Ya(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function LS(e){let t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),o=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((s,i)=>{let a=o[i];if(OS(s)&&OS(a)&&(s.type!=="file"&&(s.value=a.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),DS(s)&&DS(a)&&a.width>0&&a.height>0){let l=s.getContext("2d");l?.drawImage(a,0,0)}}),n}function OS(e){return"value"in e}function DS(e){return e.tagName==="CANVAS"}function Th(e,{x:t,y:n}){let o=e.elementFromPoint(t,n);if(EA(o)){let{contentDocument:r}=o;if(r){let{left:s,top:i}=o.getBoundingClientRect();return Th(r,{x:t-s,y:n-i})}}return o}function EA(e){return e?.tagName==="IFRAME"}var Ga=new WeakMap;function FS(e){return e.closest(`
2
2
  input:not([disabled]),
3
3
  select:not([disabled]),
4
4
  textarea:not([disabled]),
5
5
  button:not([disabled]),
6
6
  a[href],
7
7
  [contenteditable]:not([contenteditable="false"])
8
- `)}var Oh=class{constructor(){this.entries=new Set,this.clear=()=>{for(let e of this.entries){let[t,{type:n,listener:o,options:r}]=e;t.removeEventListener(n,o,r)}this.entries.clear()}}bind(e,t){let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t],r=[];for(let i of n)for(let a of o){let{type:l,listener:c,options:u}=a,d=[i,a];i.addEventListener(l,c,u),this.entries.add(d),r.push(d)}let s=this.entries;return function(){for(let a of r){let[l,{type:c,listener:u,options:d}]=a;l.removeEventListener(c,u,d),s.delete(a)}}}};function Zr(e){let t=e?.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function EA(e){let t=new Set,n=Zr(e);for(;n;)t.add(n),n=Zr(n);return t}function NA(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)}function BS(e,t){let n=()=>performance.now(),o,r;return function(...s){let i=this;r?(o?.(),o=NA(()=>{e.apply(i,s),r=n()},t-(n()-r))):(e.apply(i,s),r=n())}}function TA(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function OA(e,t=e.getBoundingClientRect()){let{width:n,height:o}=ai(e,t);return n>0&&o>0}var DA=PS?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},nu,wA=class extends DA{constructor(e){super(t=>{if(!re(this,nu)){dn(this,nu,!0);return}e(t,this)}),nn(this,nu,!1)}};nu=new WeakMap;var wS=Array.from({length:100},(e,t)=>t/100),zS=75,Jr,su,Zo,Qr,Ba,Ct,Ua,za,iu,WS,KS,US=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,nn(this,iu),this.disconnect=()=>{var s,i,a;dn(this,Ua,!0),(s=re(this,Zo))==null||s.disconnect(),(i=re(this,Qr))==null||i.disconnect(),re(this,Ba).disconnect(),(a=re(this,Ct))==null||a.remove()},nn(this,Jr,!0),nn(this,su),nn(this,Zo),nn(this,Qr),nn(this,Ba),nn(this,Ct),nn(this,Ua,!1),nn(this,za,BS(()=>{var s,i,a;let{element:l}=this;if((s=re(this,Qr))==null||s.disconnect(),re(this,Ua)||!re(this,Jr)||!l.isConnected)return;let c=(i=l.ownerDocument)!=null?i:document,{innerHeight:u,innerWidth:d}=(a=c.defaultView)!=null?a:window,f=l.getBoundingClientRect(),p=ai(l,f),{top:h,left:g,bottom:y,right:m}=p,_=-Math.floor(h),x=-Math.floor(g),v=-Math.floor(d-m),S=-Math.floor(u-y),b=`${_}px ${v}px ${S}px ${x}px`;this.boundingClientRect=f,dn(this,Qr,new IntersectionObserver(N=>{let[D]=N,{intersectionRect:O}=D;(D.intersectionRatio!==1?D.intersectionRatio:tn.intersectionRatio(O,ai(l)))!==1&&re(this,za).call(this)},{threshold:wS,rootMargin:b,root:c})),re(this,Qr).observe(l),$S(this,iu,WS).call(this)},zS)),this.boundingClientRect=e.getBoundingClientRect(),dn(this,Jr,OA(e,this.boundingClientRect));let o=!0;this.callback=s=>{o&&(o=!1,n.skipInitial)||t(s)};let r=e.ownerDocument;n?.debug&&(dn(this,Ct,document.createElement("div")),re(this,Ct).style.background="rgba(0,0,0,0.15)",re(this,Ct).style.position="fixed",re(this,Ct).style.pointerEvents="none",r.body.appendChild(re(this,Ct))),dn(this,Ba,new IntersectionObserver(s=>{var i,a;let l=s[s.length-1],{boundingClientRect:c,isIntersecting:u}=l,{width:d,height:f}=c,p=re(this,Jr);dn(this,Jr,u),!(!d&&!f)&&(p&&!u?((i=re(this,Qr))==null||i.disconnect(),this.callback(null),(a=re(this,Zo))==null||a.disconnect(),dn(this,Zo,void 0),re(this,Ct)&&(re(this,Ct).style.visibility="hidden")):re(this,za).call(this),u&&!re(this,Zo)&&(dn(this,Zo,new wA(re(this,za))),re(this,Zo).observe(e)))},{threshold:wS,root:r})),re(this,Jr)&&!n.skipInitial&&this.callback(this.boundingClientRect),re(this,Ba).observe(e)}};Jr=new WeakMap;su=new WeakMap;Zo=new WeakMap;Qr=new WeakMap;Ba=new WeakMap;Ct=new WeakMap;Ua=new WeakMap;za=new WeakMap;iu=new WeakSet;WS=function(){re(this,Ua)||($S(this,iu,KS).call(this),!TA(this.boundingClientRect,re(this,su))&&(this.callback(this.boundingClientRect),dn(this,su,this.boundingClientRect)))};KS=function(){if(re(this,Ct)){let{top:e,left:t,width:n,height:o}=ai(this.element);re(this,Ct).style.overflow="hidden",re(this,Ct).style.visibility="visible",re(this,Ct).style.top=`${Math.floor(e)}px`,re(this,Ct).style.left=`${Math.floor(t)}px`,re(this,Ct).style.width=`${Math.floor(n)}px`,re(this,Ct).style.height=`${Math.floor(o)}px`}};var eu=new WeakMap,tu=new WeakMap;function MA(e,t){let n=eu.get(e);return n||(n={disconnect:new US(e,r=>{let s=eu.get(e);s&&s.callbacks.forEach(i=>i(r))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),eu.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(eu.delete(e),n.disconnect())}}function kA(e,t){let n=new Set;for(let o of e){let r=MA(o,t);n.add(r)}return()=>n.forEach(o=>o())}function AA(e,t){var n;let o=e.ownerDocument;if(!tu.has(o)){let i=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(c=>c(l)),{capture:!0,passive:!0,signal:i.signal}),tu.set(o,{disconnect:()=>i.abort(),listeners:a})}let{listeners:r,disconnect:s}=(n=tu.get(o))!=null?n:{};return!r||!s?()=>{}:(r.add(t),()=>{r.delete(t),r.size===0&&(s(),tu.delete(o))})}var Wa,Ka,ou,Sh,HS=class{constructor(e,t,n){this.callback=t,nn(this,Wa),nn(this,Ka,!1),nn(this,ou),nn(this,Sh,BS(i=>{if(!re(this,Ka)&&i.target&&"contains"in i.target&&typeof i.target.contains=="function"){for(let a of re(this,ou))if(i.target.contains(a)){this.callback(re(this,Wa).boundingClientRect);break}}},zS));let o=EA(e),r=kA(o,t),s=AA(e,re(this,Sh));dn(this,ou,o),dn(this,Wa,new US(e,t,n)),this.disconnect=()=>{re(this,Ka)||(dn(this,Ka,!0),r(),s(),re(this,Wa).disconnect())}}};Wa=new WeakMap;Ka=new WeakMap;ou=new WeakMap;Sh=new WeakMap;function pu(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function ns(e){try{pu(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function MS(e){return!PS||!e?!1:e===es(e).scrollingElement}function VS(e){var t,n;let o=Ht(e),r=MS(e)?vA(e):cu(e),s=o.visualViewport,i=MS(e)?{height:(t=s?.height)!=null?t:o.innerHeight,width:(n=s?.width)!=null?n:o.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-i.width,y:e.scrollHeight-i.height}},l=a.current.y<=0,c=a.current.x<=0,u=a.current.y>=a.max.y,d=a.current.x>=a.max.x;return{rect:r,position:a,isTop:l,isLeft:c,isBottom:u,isRight:d}}function jS(e,t){let{isTop:n,isBottom:o,isLeft:r,isRight:s,position:i}=VS(e),{x:a,y:l}=t??{x:0,y:0},c=!n&&i.current.y+l>0,u=!o&&i.current.y+l<i.max.y,d=!r&&i.current.x+a>0,f=!s&&i.current.x+a<i.max.x;return{top:c,bottom:u,left:d,right:f,x:d||f,y:c||u}}var Dh=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let o of t)o();for(let o of n)o()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},qa=new Dh(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),IA=new Dh(e=>setTimeout(e,50)),au=new Map,$A=au.clear.bind(au);function An(e,t=!1){if(!t)return kS(e);let n=au.get(e);return n||(n=kS(e),au.set(e,n),IA.schedule($A),n)}function kS(e){return Ht(e).getComputedStyle(e)}function RA(e,t=An(e,!0)){return t.position==="fixed"||t.position==="sticky"}function PA(e,t=An(e,!0)){let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{let s=t[r];return typeof s=="string"?n.test(s):!1})}var LA={excludeElement:!0,escapeShadowDOM:!0};function hu(e,t=LA){let{limit:n,excludeElement:o,escapeShadowDOM:r}=t,s=new Set;function i(a){if(n!=null&&s.size>=n||!a)return s;if(uu(a)&&a.scrollingElement!=null&&!s.has(a.scrollingElement))return s.add(a.scrollingElement),s;if(r&&fu(a))return i(a.host);if(!Oo(a))return RS(a)?i(a.parentElement):s;if(s.has(a))return s;let l=An(a,!0);if(o&&a===e||PA(a,l)&&s.add(a),RA(a,l)){let{scrollingElement:c}=a.ownerDocument;return c&&s.add(c),s}return i(a.parentNode)}return e?i(e):s}function os(e,t=window.frameElement){let n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let o=Zr(e);for(;o;){if(o===t)return n;let r=cu(o),{x:s,y:i}=FA(o,r);n.x=n.x+r.left,n.y=n.y+r.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*i,o=Zr(o)}return n}function FA(e,t=cu(e)){let n=Math.round(t.width),o=Math.round(t.height);if(Oo(e))return{x:n/e.offsetWidth,y:o/e.offsetHeight};let r=An(e,!0);return{x:(parseFloat(r.width)||n)/n,y:(parseFloat(r.height)||o)/o}}function BA(e){if(!e||e==="none")return null;let t=e.split(" "),n=parseFloat(t[0]),o=parseFloat(t[1]);return isNaN(n)&&isNaN(o)?null:{x:isNaN(n)?o:n,y:isNaN(o)?n:o}}function li(e){if(!e||e==="none")return null;let[t,n,o="0"]=e.split(" "),r={x:parseFloat(t),y:parseFloat(n),z:parseInt(o,10)};return isNaN(r.x)&&isNaN(r.y)?null:{x:isNaN(r.x)?0:r.x,y:isNaN(r.y)?0:r.y,z:isNaN(r.z)?0:r.z}}function Xa(e){var t,n,o,r,s,i,a,l,c;let{scale:u,transform:d,translate:f}=e,p=BA(u),h=li(f),g=zA(d);if(!g&&!p&&!h)return null;let y={x:(t=p?.x)!=null?t:1,y:(n=p?.y)!=null?n:1},m={x:(o=h?.x)!=null?o:0,y:(r=h?.y)!=null?r:0},_={x:(s=g?.x)!=null?s:0,y:(i=g?.y)!=null?i:0,scaleX:(a=g?.scaleX)!=null?a:1,scaleY:(l=g?.scaleY)!=null?l:1};return{x:m.x+_.x,y:m.y+_.y,z:(c=h?.z)!=null?c:0,scaleX:y.x*_.scaleX,scaleY:y.y*_.scaleY}}function zA(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var fn=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(fn||{}),WA={x:.2,y:.2},KA={x:10,y:10};function YS(e,t,n,o=25,r=WA,s=KA){let{x:i,y:a}=t,{rect:l,isTop:c,isBottom:u,isLeft:d,isRight:f}=VS(e),p=os(e),h=An(e,!0),g=Xa(h),y=g!==null?g?.scaleX<0:!1,m=g!==null?g?.scaleY<0:!1,_=new tn(l.left*p.scaleX+p.x,l.top*p.scaleY+p.y,l.width*p.scaleX,l.height*p.scaleY),x={x:0,y:0},v={x:0,y:0},S={height:_.height*r.y,width:_.width*r.x};return S.height>0&&(!c||m&&!u)&&a<=_.top+S.height&&n?.y!==1&&i>=_.left-s.x&&i<=_.right+s.x?(x.y=m?1:-1,v.y=o*Math.abs((_.top+S.height-a)/S.height)):S.height>0&&(!u||m&&!c)&&a>=_.bottom-S.height&&n?.y!==-1&&i>=_.left-s.x&&i<=_.right+s.x&&(x.y=m?-1:1,v.y=o*Math.abs((_.bottom-S.height-a)/S.height)),S.width>0&&(!f||y&&!d)&&i>=_.right-S.width&&n?.x!==-1&&a>=_.top-s.y&&a<=_.bottom+s.y?(x.x=y?-1:1,v.x=o*Math.abs((_.right-S.width-i)/S.width)):S.width>0&&(!d||y&&!f)&&i<=_.left+S.width&&n?.x!==1&&a>=_.top-s.y&&a<=_.bottom+s.y&&(x.x=y?1:-1,v.x=o*Math.abs((_.left+S.width-i)/S.width)),{direction:x,speed:v}}function gu(e,{block:t="nearest",inline:n="nearest"}={}){if(!Oo(e))return;let o=hu(e),r=[];for(let s of o){if(!Oo(s))continue;let{top:i,left:a}=UA(e,s),l=i,c=a;for(let u of r)l-=u.scrollTop,c-=u.scrollLeft;if(t!=="none"){let u=l<s.scrollTop,d=l+e.offsetHeight>s.scrollTop+s.clientHeight;u!==d&&(t==="center"?s.scrollTop=l-s.clientHeight/2+e.offsetHeight/2:u?s.scrollTop=l:s.scrollTop=l+e.offsetHeight-s.clientHeight)}if(n!=="none"){let u=c<s.scrollLeft,d=c+e.offsetWidth>s.scrollLeft+s.clientWidth;u!==d&&(n==="center"?s.scrollLeft=c-s.clientWidth/2+e.offsetWidth/2:u?s.scrollLeft=c:s.scrollLeft=c+e.offsetWidth-s.clientWidth)}r.push(s)}}function AS(e){let t=0,n=0,o=e;for(;o;){t+=o.offsetTop,n+=o.offsetLeft;let r=o.offsetParent;if(!Oo(r))break;t+=r.clientTop,n+=r.clientLeft,o=r}return{top:t,left:n}}function UA(e,t){let n=AS(e),o=AS(t);return{top:n.top-o.top-t.clientTop,left:n.left-o.left-t.clientLeft}}function HA(e,t,n){let{scaleX:o,scaleY:r,x:s,y:i}=t,a=e.left+s+(1-o)*parseFloat(n),l=e.top+i+(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width*o:e.width,u=r?e.height*r:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function VA(e,t,n){let{scaleX:o,scaleY:r,x:s,y:i}=t,a=e.left-s-(1-o)*parseFloat(n),l=e.top-i-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,u=r?e.height/r:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function mu({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function wh(e,t=An(e).translate,n=!0){if(n){let o=bh(e,r=>"translate"in r);if(o){let{translate:r=""}=o[0];if(typeof r=="string"){let s=li(r);if(s)return s}}}if(t){let o=li(t);if(o)return o}return{x:0,y:0,z:0}}var jA=new Dh(e=>setTimeout(e,0)),Ha=new Map,YA=Ha.clear.bind(Ha);function GA(e){let t=e.ownerDocument,n=Ha.get(t);if(n)return n;n=t.getAnimations(),Ha.set(t,n),jA.schedule(YA);let o=n.filter(r=>lu(r.effect)&&r.effect.target===e);return Ha.set(e,o),n}function qA(e,t){let n=GA(e).filter(o=>{var r,s;if(lu(o.effect)){let{target:i}=o.effect;if((s=i&&((r=t.isValidTarget)==null?void 0:r.call(t,i)))!=null?s:!0)return o.effect.getKeyframes().some(l=>{for(let c of t.properties)if(l[c])return!0})}}).map(o=>{let{effect:r,currentTime:s}=o,i=r?.getComputedTiming().duration;if(!(o.pending||o.playState==="finished")&&typeof i=="number"&&typeof s=="number"&&s<i)return o.currentTime=i,()=>{o.currentTime=s}});if(n.length>0)return()=>n.forEach(o=>o?.())}var In=class extends tn{constructor(e,t={}){var n,o,r,s;let{frameTransform:i=os(e),ignoreTransforms:a,getBoundingClientRect:l=cu}=t,c=qA(e,{properties:["transform","translate","scale","width","height"],isValidTarget:S=>(S!==e||du())&&S.contains(e)}),u=l(e),{top:d,left:f,width:p,height:h}=u,g,y=An(e),m=Xa(y),_={x:(n=m?.scaleX)!=null?n:1,y:(o=m?.scaleY)!=null?o:1},x=XA(e,y);c?.(),m&&(g=VA(u,m,y.transformOrigin),(a||x)&&(d=g.top,f=g.left,p=g.width,h=g.height));let v={width:(r=g?.width)!=null?r:p,height:(s=g?.height)!=null?s:h};if(x&&!a&&g){let S=HA(g,x,y.transformOrigin);d=S.top,f=S.left,p=S.width,h=S.height,_.x=x.scaleX,_.y=x.scaleY}i&&(a||(f*=i.scaleX,p*=i.scaleX,d*=i.scaleY,h*=i.scaleY),f+=i.x,d+=i.y),super(f,d,p,h),this.scale=_,this.intrinsicWidth=v.width,this.intrinsicHeight=v.height}};function XA(e,t){let n=e.getAnimations();if(!n.length)return null;let o,r,s,i=!1;for(let a of n){if(a.playState!=="running")continue;let l=lu(a.effect)?a.effect.getKeyframes():[],c=l[l.length-1];if(!c)continue;let{transform:u,translate:d,scale:f}=c;typeof u=="string"&&u&&(o=u,i=!0),typeof d=="string"&&d&&(r=d,i=!0),typeof f=="string"&&f&&(s=f,i=!0)}return i?Xa({transform:o??t.transform,translate:r??t.translate,scale:s??t.scale}):null}function ii(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var GS=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){let{element:n}=this;if(ii(n))for(let[o,r]of Object.entries(e)){let s=`${t}${o}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof r=="string"?r:`${r}px`)}}remove(e,t=""){let{element:n}=this;if(ii(n))for(let o of e){let r=`${t}${o}`;n.style.removeProperty(r)}}reset(){let{element:e}=this;if(ii(e)){for(let[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function er(e){return e?e instanceof Ht(e).Element||Va(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function rs(e){if(!e)return!1;let{KeyboardEvent:t}=Ht(e.target);return e instanceof t}function qS(e){if(!e)return!1;let{PointerEvent:t}=Ht(e.target);return e instanceof t}function XS(e){if(!er(e))return!1;let{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||JA(e)}function JA(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var vh={};function _u(e){let t=vh[e]==null?0:vh[e]+1;return vh[e]=t,`${e}-${t}`}var QA=({dragOperation:e,droppable:t})=>{let n=e.position.current;if(!n)return null;let{id:o}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){let r=It.distance(t.shape.center,n);return{id:o,value:1/r,type:Xr.PointerIntersection,priority:qr.High}}return null},ZA=({dragOperation:e,droppable:t})=>{let{shape:n}=e;if(!t.shape||!n?.current)return null;let o=n.current.intersectionArea(t.shape);if(o){let{position:r}=e,s=It.distance(t.shape.center,r.current),a=o/(n.current.area+t.shape.area-o)/s;return{id:t.id,value:a,type:Xr.ShapeIntersection,priority:qr.Normal}}return null},yu=e=>{var t;return(t=QA(e))!=null?t:ZA(e)},JS=e=>{let{dragOperation:t,droppable:n}=e,{shape:o,position:r}=t;if(!n.shape)return null;let s=o?tn.from(o.current.boundingRectangle).corners:void 0,a=tn.from(n.shape.boundingRectangle).corners.reduce((l,c,u)=>{var d;return l+It.distance(It.from(c),(d=s?.[u])!=null?d:r.current)},0)/4;return{id:n.id,value:1/a,type:Xr.Collision,priority:qr.Normal}};var eI=Object.create,Hh=Object.defineProperty,tI=Object.defineProperties,nI=Object.getOwnPropertyDescriptor,oI=Object.getOwnPropertyDescriptors,Su=Object.getOwnPropertySymbols,i0=Object.prototype.hasOwnProperty,a0=Object.prototype.propertyIsEnumerable,l0=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),mi=e=>{throw TypeError(e)},Ih=(e,t,n)=>t in e?Hh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ol=(e,t)=>{for(var n in t||(t={}))i0.call(t,n)&&Ih(e,n,t[n]);if(Su)for(var n of Su(t))a0.call(t,n)&&Ih(e,n,t[n]);return e},Vh=(e,t)=>tI(e,oI(t)),QS=(e,t)=>Hh(e,"name",{value:t,configurable:!0}),c0=(e,t)=>{var n={};for(var o in e)i0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Su)for(var o of Su(e))t.indexOf(o)<0&&a0.call(e,o)&&(n[o]=e[o]);return n},_i=e=>{var t;return[,,,eI((t=e?.[l0("metadata")])!=null?t:null)]},u0=["class","method","getter","setter","accessor","field","value","get","set"],Qa=e=>e!==void 0&&typeof e!="function"?mi("Function expected"):e,rI=(e,t,n,o,r)=>({kind:u0[e],name:t,metadata:o,addInitializer:s=>n._?mi("Already initialized"):r.push(Qa(s||null))}),ls=(e,t)=>Ih(t,l0("metadata"),e[3]),ut=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},$n=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=u0[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&nI(d<4?r:{get[n](){return $e(this,s)},set[n](v){return Vt(this,s,v)}},n));d?p&&d<4&&QS(s,(d>2?"set ":d>1?"get ":"")+n):QS(r,n);for(var x=o.length-1;x>=0;x--)c=rI(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>sI(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?$e:as)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Vt(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Qa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?mi("Object expected"):(Qa(i=a.get)&&(_.get=i),Qa(i=a.set)&&(_.set=i),Qa(i=a.init)&&y.unshift(i));return d||ls(e,r),_&&Hh(r,n,_),p?d^4?s:_:r},jh=(e,t,n)=>t.has(e)||mi("Cannot "+n),sI=(e,t)=>Object(t)!==t?mi('Cannot use the "in" operator on this value'):e.has(t),$e=(e,t,n)=>(jh(e,t,"read from private field"),n?n.call(e):t.get(e)),nt=(e,t,n)=>t.has(e)?mi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Vt=(e,t,n,o)=>(jh(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),as=(e,t,n)=>(jh(e,t,"access private method"),n),ZS={role:"button",roleDescription:"draggable"},iI="dnd-kit-description",aI="dnd-kit-announcement",lI={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},cI={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===t?.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function uI(e){let t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function dI(e,t){let n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function fI(e){let t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var pI=["dragover","dragmove"],hI=class extends mt{constructor(e,t){super(e);let{id:n,idPrefix:{description:o=iI,announcement:r=aI}={},announcements:s=cI,screenReaderInstructions:i=lI,debounce:a=500}=t??{},l=n?`${o}-${n}`:_u(o),c=n?`${r}-${n}`:_u(r),u,d,f,p,h=(S=p)=>{!f||!S||f?.nodeValue!==S&&(f.nodeValue=S)},g=()=>qa.schedule(h),y=gI(g,a),m=Object.entries(s).map(([S,b])=>this.manager.monitor.addEventListener(S,(N,D)=>{let O=f;if(!O)return;let T=b?.(N,D);T&&O.nodeValue!==T&&(p=T,pI.includes(S)?y():(g(),y.cancel()))})),_=()=>{let S=[];u?.isConnected||(u=dI(l,i.draggable),S.push(u)),d?.isConnected||(d=fI(c),f=document.createTextNode(""),d.appendChild(f),S.push(d)),S.length>0&&document.body.append(...S)},x=new Set;function v(){for(let S of x)S()}this.registerEffect(()=>{var S;x.clear();for(let b of this.manager.registry.draggables.value){let N=(S=b.handle)!=null?S:b.element;if(N){(!u||!d)&&x.add(_),(!uI(N)||du())&&!N.hasAttribute("tabindex")&&x.add(()=>N.setAttribute("tabindex","0")),!N.hasAttribute("role")&&N.tagName.toLowerCase()!=="button"&&x.add(()=>N.setAttribute("role",ZS.role)),N.hasAttribute("aria-roledescription")||x.add(()=>N.setAttribute("aria-roledescription",ZS.roleDescription)),N.hasAttribute("aria-describedby")||x.add(()=>N.setAttribute("aria-describedby",l));for(let O of["aria-pressed","aria-grabbed"]){let T=String(b.isDragging);N.getAttribute(O)!==T&&x.add(()=>N.setAttribute(O,T))}let D=String(b.disabled);N.getAttribute("aria-disabled")!==D&&x.add(()=>N.setAttribute("aria-disabled",D))}}x.size>0&&qa.schedule(v)}),this.destroy=()=>{super.destroy(),u?.remove(),d?.remove(),m.forEach(S=>S())}}};function gI(e,t){let n,o=()=>{clearTimeout(n),n=setTimeout(e,t)};return o.cancel=()=>clearTimeout(n),o}var Cu=new Map,d0,f0,p0,h0,$h,tl,Do,Yh,hi,g0,m0,_0,y0,sr=class extends($h=si,h0=[fe],p0=[Ve],f0=[Ve],d0=[Ve],$h){constructor(t,n){super(t,n),ut(Do,5,this),nt(this,hi),nt(this,tl,new Set),nt(this,Yh,ut(Do,8,this,new Set)),ut(Do,11,this),this.registerEffect(as(this,hi,g0))}register(t){return $e(this,tl).add(t),()=>{$e(this,tl).delete(t)}}addRoot(t){return ie(()=>{let n=new Set(this.additionalRoots);n.add(t),this.additionalRoots=n}),()=>{ie(()=>{let n=new Set(this.additionalRoots);n.delete(t),this.additionalRoots=n})}}get sourceRoot(){var t;let{source:n}=this.manager.dragOperation;return ja((t=n?.element)!=null?t:null)}get targetRoot(){var t;let{target:n}=this.manager.dragOperation;return ja((t=n?.element)!=null?t:null)}get roots(){let{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){let n=[this.sourceRoot,this.targetRoot].filter(o=>o!=null);return new Set([...n,...this.additionalRoots])}return new Set}};Do=_i($h);tl=new WeakMap;Yh=new WeakMap;hi=new WeakSet;g0=function(){let{roots:e}=this,t=[];for(let n of e)for(let o of $e(this,tl))t.push(as(this,hi,m0).call(this,n,o));return()=>{for(let n of t)n()}};m0=function(e,t){let n=Cu.get(e);n||(n=new Map,Cu.set(e,n));let o=n.get(t);if(!o){let s=uu(e)?as(this,hi,_0).call(this,e,n,t):as(this,hi,y0).call(this,e,n,t);if(!s)return()=>{};o=s,n.set(t,o)}o.refCount++;let r=!1;return()=>{r||(r=!0,o.refCount--,o.refCount===0&&o.cleanup())}};_0=function(e,t,n){var o;let r=e.createElement("style"),{nonce:s}=(o=this.options)!=null?o:{};s&&r.setAttribute("nonce",s),r.textContent=n,e.head.prepend(r);let i=new MutationObserver(a=>{for(let l of a)for(let c of Array.from(l.removedNodes))if(c===r){e.head.prepend(r);return}});return i.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),t.delete(n),t.size===0&&Cu.delete(e)}}};y0=function(e,t,n){"adoptedStyleSheets"in e&&Array.isArray(e.adoptedStyleSheets);let o=e.ownerDocument.defaultView,{CSSStyleSheet:r}=o??{};if(!r)return null;let s=new r;return s.replaceSync(n),e.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var i;if(fu(e)&&((i=e.host)!=null&&i.isConnected)){let a=e.adoptedStyleSheets.indexOf(s);a!==-1&&e.adoptedStyleSheets.splice(a,1)}t.delete(n),t.size===0&&Cu.delete(e)}}};$n(Do,4,"additionalRoots",h0,sr,Yh);$n(Do,2,"sourceRoot",p0,sr);$n(Do,2,"targetRoot",f0,sr);$n(Do,2,"roots",d0,sr);ls(Do,sr);sr.configure=ri(sr);var Tu=sr,mI=class extends mt{constructor(e,t){super(e,t),this.manager=e;let{cursor:n="grabbing"}=t??{},o=e.registry.plugins.get(Tu),r=o?.register(`* { cursor: ${n} !important; }`);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}}},al="data-dnd-",Rh=`${al}dropping`,bt="--dnd-",ho=`${al}dragging`,bu=`${al}placeholder`,_I=[ho,bu,"popover","aria-pressed","aria-grabbing"],yI=["view-transition-name"],xI=`
9
- :is(:root,:host) [${ho}] {
8
+ `)}var Oh=class{constructor(){this.entries=new Set,this.clear=()=>{for(let e of this.entries){let[t,{type:n,listener:o,options:r}]=e;t.removeEventListener(n,o,r)}this.entries.clear()}}bind(e,t){let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t],r=[];for(let i of n)for(let a of o){let{type:l,listener:c,options:u}=a,d=[i,a];i.addEventListener(l,c,u),this.entries.add(d),r.push(d)}let s=this.entries;return function(){for(let a of r){let[l,{type:c,listener:u,options:d}]=a;l.removeEventListener(c,u,d),s.delete(a)}}}};function Zr(e){let t=e?.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function NA(e){let t=new Set,n=Zr(e);for(;n;)t.add(n),n=Zr(n);return t}function TA(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)}function BS(e,t){let n=()=>performance.now(),o,r;return function(...s){let i=this;r?(o?.(),o=TA(()=>{e.apply(i,s),r=n()},t-(n()-r))):(e.apply(i,s),r=n())}}function OA(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function DA(e,t=e.getBoundingClientRect()){let{width:n,height:o}=ai(e,t);return n>0&&o>0}var wA=PS?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},nu,MA=class extends wA{constructor(e){super(t=>{if(!re(this,nu)){dn(this,nu,!0);return}e(t,this)}),nn(this,nu,!1)}};nu=new WeakMap;var wS=Array.from({length:100},(e,t)=>t/100),zS=75,Jr,su,Zo,Qr,Ba,Ct,Ua,za,iu,WS,KS,US=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,nn(this,iu),this.disconnect=()=>{var s,i,a;dn(this,Ua,!0),(s=re(this,Zo))==null||s.disconnect(),(i=re(this,Qr))==null||i.disconnect(),re(this,Ba).disconnect(),(a=re(this,Ct))==null||a.remove()},nn(this,Jr,!0),nn(this,su),nn(this,Zo),nn(this,Qr),nn(this,Ba),nn(this,Ct),nn(this,Ua,!1),nn(this,za,BS(()=>{var s,i,a;let{element:l}=this;if((s=re(this,Qr))==null||s.disconnect(),re(this,Ua)||!re(this,Jr)||!l.isConnected)return;let c=(i=l.ownerDocument)!=null?i:document,{innerHeight:u,innerWidth:d}=(a=c.defaultView)!=null?a:window,f=l.getBoundingClientRect(),p=ai(l,f),{top:h,left:g,bottom:y,right:m}=p,_=-Math.floor(h),x=-Math.floor(g),v=-Math.floor(d-m),S=-Math.floor(u-y),b=`${_}px ${v}px ${S}px ${x}px`;this.boundingClientRect=f,dn(this,Qr,new IntersectionObserver(N=>{let[D]=N,{intersectionRect:O}=D;(D.intersectionRatio!==1?D.intersectionRatio:tn.intersectionRatio(O,ai(l)))!==1&&re(this,za).call(this)},{threshold:wS,rootMargin:b,root:c})),re(this,Qr).observe(l),$S(this,iu,WS).call(this)},zS)),this.boundingClientRect=e.getBoundingClientRect(),dn(this,Jr,DA(e,this.boundingClientRect));let o=!0;this.callback=s=>{o&&(o=!1,n.skipInitial)||t(s)};let r=e.ownerDocument;n?.debug&&(dn(this,Ct,document.createElement("div")),re(this,Ct).style.background="rgba(0,0,0,0.15)",re(this,Ct).style.position="fixed",re(this,Ct).style.pointerEvents="none",r.body.appendChild(re(this,Ct))),dn(this,Ba,new IntersectionObserver(s=>{var i,a;let l=s[s.length-1],{boundingClientRect:c,isIntersecting:u}=l,{width:d,height:f}=c,p=re(this,Jr);dn(this,Jr,u),!(!d&&!f)&&(p&&!u?((i=re(this,Qr))==null||i.disconnect(),this.callback(null),(a=re(this,Zo))==null||a.disconnect(),dn(this,Zo,void 0),re(this,Ct)&&(re(this,Ct).style.visibility="hidden")):re(this,za).call(this),u&&!re(this,Zo)&&(dn(this,Zo,new MA(re(this,za))),re(this,Zo).observe(e)))},{threshold:wS,root:r})),re(this,Jr)&&!n.skipInitial&&this.callback(this.boundingClientRect),re(this,Ba).observe(e)}};Jr=new WeakMap;su=new WeakMap;Zo=new WeakMap;Qr=new WeakMap;Ba=new WeakMap;Ct=new WeakMap;Ua=new WeakMap;za=new WeakMap;iu=new WeakSet;WS=function(){re(this,Ua)||($S(this,iu,KS).call(this),!OA(this.boundingClientRect,re(this,su))&&(this.callback(this.boundingClientRect),dn(this,su,this.boundingClientRect)))};KS=function(){if(re(this,Ct)){let{top:e,left:t,width:n,height:o}=ai(this.element);re(this,Ct).style.overflow="hidden",re(this,Ct).style.visibility="visible",re(this,Ct).style.top=`${Math.floor(e)}px`,re(this,Ct).style.left=`${Math.floor(t)}px`,re(this,Ct).style.width=`${Math.floor(n)}px`,re(this,Ct).style.height=`${Math.floor(o)}px`}};var eu=new WeakMap,tu=new WeakMap;function kA(e,t){let n=eu.get(e);return n||(n={disconnect:new US(e,r=>{let s=eu.get(e);s&&s.callbacks.forEach(i=>i(r))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),eu.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(eu.delete(e),n.disconnect())}}function AA(e,t){let n=new Set;for(let o of e){let r=kA(o,t);n.add(r)}return()=>n.forEach(o=>o())}function IA(e,t){var n;let o=e.ownerDocument;if(!tu.has(o)){let i=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(c=>c(l)),{capture:!0,passive:!0,signal:i.signal}),tu.set(o,{disconnect:()=>i.abort(),listeners:a})}let{listeners:r,disconnect:s}=(n=tu.get(o))!=null?n:{};return!r||!s?()=>{}:(r.add(t),()=>{r.delete(t),r.size===0&&(s(),tu.delete(o))})}var Wa,Ka,ou,Sh,HS=class{constructor(e,t,n){this.callback=t,nn(this,Wa),nn(this,Ka,!1),nn(this,ou),nn(this,Sh,BS(i=>{if(!re(this,Ka)&&i.target&&"contains"in i.target&&typeof i.target.contains=="function"){for(let a of re(this,ou))if(i.target.contains(a)){this.callback(re(this,Wa).boundingClientRect);break}}},zS));let o=NA(e),r=AA(o,t),s=IA(e,re(this,Sh));dn(this,ou,o),dn(this,Wa,new US(e,t,n)),this.disconnect=()=>{re(this,Ka)||(dn(this,Ka,!0),r(),s(),re(this,Wa).disconnect())}}};Wa=new WeakMap;Ka=new WeakMap;ou=new WeakMap;Sh=new WeakMap;function pu(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function ns(e){try{pu(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function MS(e){return!PS||!e?!1:e===es(e).scrollingElement}function VS(e){var t,n;let o=Ht(e),r=MS(e)?SA(e):cu(e),s=o.visualViewport,i=MS(e)?{height:(t=s?.height)!=null?t:o.innerHeight,width:(n=s?.width)!=null?n:o.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-i.width,y:e.scrollHeight-i.height}},l=a.current.y<=0,c=a.current.x<=0,u=a.current.y>=a.max.y,d=a.current.x>=a.max.x;return{rect:r,position:a,isTop:l,isLeft:c,isBottom:u,isRight:d}}function jS(e,t){let{isTop:n,isBottom:o,isLeft:r,isRight:s,position:i}=VS(e),{x:a,y:l}=t??{x:0,y:0},c=!n&&i.current.y+l>0,u=!o&&i.current.y+l<i.max.y,d=!r&&i.current.x+a>0,f=!s&&i.current.x+a<i.max.x;return{top:c,bottom:u,left:d,right:f,x:d||f,y:c||u}}var Dh=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let o of t)o();for(let o of n)o()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},qa=new Dh(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),$A=new Dh(e=>setTimeout(e,50)),au=new Map,RA=au.clear.bind(au);function An(e,t=!1){if(!t)return kS(e);let n=au.get(e);return n||(n=kS(e),au.set(e,n),$A.schedule(RA),n)}function kS(e){return Ht(e).getComputedStyle(e)}function PA(e,t=An(e,!0)){return t.position==="fixed"||t.position==="sticky"}function LA(e,t=An(e,!0)){let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{let s=t[r];return typeof s=="string"?n.test(s):!1})}var FA={excludeElement:!0,escapeShadowDOM:!0};function hu(e,t=FA){let{limit:n,excludeElement:o,escapeShadowDOM:r}=t,s=new Set;function i(a){if(n!=null&&s.size>=n||!a)return s;if(uu(a)&&a.scrollingElement!=null&&!s.has(a.scrollingElement))return s.add(a.scrollingElement),s;if(r&&fu(a))return i(a.host);if(!Oo(a))return RS(a)?i(a.parentElement):s;if(s.has(a))return s;let l=An(a,!0);if(o&&a===e||LA(a,l)&&s.add(a),PA(a,l)){let{scrollingElement:c}=a.ownerDocument;return c&&s.add(c),s}return i(a.parentNode)}return e?i(e):s}function os(e,t=window.frameElement){let n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let o=Zr(e);for(;o;){if(o===t)return n;let r=cu(o),{x:s,y:i}=BA(o,r);n.x=n.x+r.left,n.y=n.y+r.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*i,o=Zr(o)}return n}function BA(e,t=cu(e)){let n=Math.round(t.width),o=Math.round(t.height);if(Oo(e))return{x:n/e.offsetWidth,y:o/e.offsetHeight};let r=An(e,!0);return{x:(parseFloat(r.width)||n)/n,y:(parseFloat(r.height)||o)/o}}function zA(e){if(!e||e==="none")return null;let t=e.split(" "),n=parseFloat(t[0]),o=parseFloat(t[1]);return isNaN(n)&&isNaN(o)?null:{x:isNaN(n)?o:n,y:isNaN(o)?n:o}}function li(e){if(!e||e==="none")return null;let[t,n,o="0"]=e.split(" "),r={x:parseFloat(t),y:parseFloat(n),z:parseInt(o,10)};return isNaN(r.x)&&isNaN(r.y)?null:{x:isNaN(r.x)?0:r.x,y:isNaN(r.y)?0:r.y,z:isNaN(r.z)?0:r.z}}function Xa(e){var t,n,o,r,s,i,a,l,c;let{scale:u,transform:d,translate:f}=e,p=zA(u),h=li(f),g=WA(d);if(!g&&!p&&!h)return null;let y={x:(t=p?.x)!=null?t:1,y:(n=p?.y)!=null?n:1},m={x:(o=h?.x)!=null?o:0,y:(r=h?.y)!=null?r:0},_={x:(s=g?.x)!=null?s:0,y:(i=g?.y)!=null?i:0,scaleX:(a=g?.scaleX)!=null?a:1,scaleY:(l=g?.scaleY)!=null?l:1};return{x:m.x+_.x,y:m.y+_.y,z:(c=h?.z)!=null?c:0,scaleX:y.x*_.scaleX,scaleY:y.y*_.scaleY}}function WA(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var fn=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(fn||{}),KA={x:.2,y:.2},UA={x:10,y:10};function YS(e,t,n,o=25,r=KA,s=UA){let{x:i,y:a}=t,{rect:l,isTop:c,isBottom:u,isLeft:d,isRight:f}=VS(e),p=os(e),h=An(e,!0),g=Xa(h),y=g!==null?g?.scaleX<0:!1,m=g!==null?g?.scaleY<0:!1,_=new tn(l.left*p.scaleX+p.x,l.top*p.scaleY+p.y,l.width*p.scaleX,l.height*p.scaleY),x={x:0,y:0},v={x:0,y:0},S={height:_.height*r.y,width:_.width*r.x};return S.height>0&&(!c||m&&!u)&&a<=_.top+S.height&&n?.y!==1&&i>=_.left-s.x&&i<=_.right+s.x?(x.y=m?1:-1,v.y=o*Math.abs((_.top+S.height-a)/S.height)):S.height>0&&(!u||m&&!c)&&a>=_.bottom-S.height&&n?.y!==-1&&i>=_.left-s.x&&i<=_.right+s.x&&(x.y=m?-1:1,v.y=o*Math.abs((_.bottom-S.height-a)/S.height)),S.width>0&&(!f||y&&!d)&&i>=_.right-S.width&&n?.x!==-1&&a>=_.top-s.y&&a<=_.bottom+s.y?(x.x=y?-1:1,v.x=o*Math.abs((_.right-S.width-i)/S.width)):S.width>0&&(!d||y&&!f)&&i<=_.left+S.width&&n?.x!==1&&a>=_.top-s.y&&a<=_.bottom+s.y&&(x.x=y?1:-1,v.x=o*Math.abs((_.left+S.width-i)/S.width)),{direction:x,speed:v}}function gu(e,{block:t="nearest",inline:n="nearest"}={}){if(!Oo(e))return;let o=hu(e),r=[];for(let s of o){if(!Oo(s))continue;let{top:i,left:a}=HA(e,s),l=i,c=a;for(let u of r)l-=u.scrollTop,c-=u.scrollLeft;if(t!=="none"){let u=l<s.scrollTop,d=l+e.offsetHeight>s.scrollTop+s.clientHeight;u!==d&&(t==="center"?s.scrollTop=l-s.clientHeight/2+e.offsetHeight/2:u?s.scrollTop=l:s.scrollTop=l+e.offsetHeight-s.clientHeight)}if(n!=="none"){let u=c<s.scrollLeft,d=c+e.offsetWidth>s.scrollLeft+s.clientWidth;u!==d&&(n==="center"?s.scrollLeft=c-s.clientWidth/2+e.offsetWidth/2:u?s.scrollLeft=c:s.scrollLeft=c+e.offsetWidth-s.clientWidth)}r.push(s)}}function AS(e){let t=0,n=0,o=e;for(;o;){t+=o.offsetTop,n+=o.offsetLeft;let r=o.offsetParent;if(!Oo(r))break;t+=r.clientTop,n+=r.clientLeft,o=r}return{top:t,left:n}}function HA(e,t){let n=AS(e),o=AS(t);return{top:n.top-o.top-t.clientTop,left:n.left-o.left-t.clientLeft}}function VA(e,t,n){let{scaleX:o,scaleY:r,x:s,y:i}=t,a=e.left+s+(1-o)*parseFloat(n),l=e.top+i+(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width*o:e.width,u=r?e.height*r:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function jA(e,t,n){let{scaleX:o,scaleY:r,x:s,y:i}=t,a=e.left-s-(1-o)*parseFloat(n),l=e.top-i-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,u=r?e.height/r:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function mu({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function wh(e,t=An(e).translate,n=!0){if(n){let o=bh(e,r=>"translate"in r);if(o){let{translate:r=""}=o[0];if(typeof r=="string"){let s=li(r);if(s)return s}}}if(t){let o=li(t);if(o)return o}return{x:0,y:0,z:0}}var YA=new Dh(e=>setTimeout(e,0)),Ha=new Map,GA=Ha.clear.bind(Ha);function qA(e){let t=e.ownerDocument,n=Ha.get(t);if(n)return n;n=t.getAnimations(),Ha.set(t,n),YA.schedule(GA);let o=n.filter(r=>lu(r.effect)&&r.effect.target===e);return Ha.set(e,o),n}function XA(e,t){let n=qA(e).filter(o=>{var r,s;if(lu(o.effect)){let{target:i}=o.effect;if((s=i&&((r=t.isValidTarget)==null?void 0:r.call(t,i)))!=null?s:!0)return o.effect.getKeyframes().some(l=>{for(let c of t.properties)if(l[c])return!0})}}).map(o=>{let{effect:r,currentTime:s}=o,i=r?.getComputedTiming().duration;if(!(o.pending||o.playState==="finished")&&typeof i=="number"&&typeof s=="number"&&s<i)return o.currentTime=i,()=>{o.currentTime=s}});if(n.length>0)return()=>n.forEach(o=>o?.())}var In=class extends tn{constructor(e,t={}){var n,o,r,s;let{frameTransform:i=os(e),ignoreTransforms:a,getBoundingClientRect:l=cu}=t,c=XA(e,{properties:["transform","translate","scale","width","height"],isValidTarget:S=>(S!==e||du())&&S.contains(e)}),u=l(e),{top:d,left:f,width:p,height:h}=u,g,y=An(e),m=Xa(y),_={x:(n=m?.scaleX)!=null?n:1,y:(o=m?.scaleY)!=null?o:1},x=JA(e,y);c?.(),m&&(g=jA(u,m,y.transformOrigin),(a||x)&&(d=g.top,f=g.left,p=g.width,h=g.height));let v={width:(r=g?.width)!=null?r:p,height:(s=g?.height)!=null?s:h};if(x&&!a&&g){let S=VA(g,x,y.transformOrigin);d=S.top,f=S.left,p=S.width,h=S.height,_.x=x.scaleX,_.y=x.scaleY}i&&(a||(f*=i.scaleX,p*=i.scaleX,d*=i.scaleY,h*=i.scaleY),f+=i.x,d+=i.y),super(f,d,p,h),this.scale=_,this.intrinsicWidth=v.width,this.intrinsicHeight=v.height}};function JA(e,t){let n=e.getAnimations();if(!n.length)return null;let o,r,s,i=!1;for(let a of n){if(a.playState!=="running")continue;let l=lu(a.effect)?a.effect.getKeyframes():[],c=l[l.length-1];if(!c)continue;let{transform:u,translate:d,scale:f}=c;typeof u=="string"&&u&&(o=u,i=!0),typeof d=="string"&&d&&(r=d,i=!0),typeof f=="string"&&f&&(s=f,i=!0)}return i?Xa({transform:o??t.transform,translate:r??t.translate,scale:s??t.scale}):null}function ii(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var GS=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){let{element:n}=this;if(ii(n))for(let[o,r]of Object.entries(e)){let s=`${t}${o}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof r=="string"?r:`${r}px`)}}remove(e,t=""){let{element:n}=this;if(ii(n))for(let o of e){let r=`${t}${o}`;n.style.removeProperty(r)}}reset(){let{element:e}=this;if(ii(e)){for(let[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function er(e){return e?e instanceof Ht(e).Element||Va(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function rs(e){if(!e)return!1;let{KeyboardEvent:t}=Ht(e.target);return e instanceof t}function qS(e){if(!e)return!1;let{PointerEvent:t}=Ht(e.target);return e instanceof t}function XS(e){if(!er(e))return!1;let{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||QA(e)}function QA(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var vh={};function _u(e){let t=vh[e]==null?0:vh[e]+1;return vh[e]=t,`${e}-${t}`}var ZA=({dragOperation:e,droppable:t})=>{let n=e.position.current;if(!n)return null;let{id:o}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){let r=It.distance(t.shape.center,n);return{id:o,value:1/r,type:Xr.PointerIntersection,priority:qr.High}}return null},eI=({dragOperation:e,droppable:t})=>{let{shape:n}=e;if(!t.shape||!n?.current)return null;let o=n.current.intersectionArea(t.shape);if(o){let{position:r}=e,s=It.distance(t.shape.center,r.current),a=o/(n.current.area+t.shape.area-o)/s;return{id:t.id,value:a,type:Xr.ShapeIntersection,priority:qr.Normal}}return null},yu=e=>{var t;return(t=ZA(e))!=null?t:eI(e)},JS=e=>{let{dragOperation:t,droppable:n}=e,{shape:o,position:r}=t;if(!n.shape)return null;let s=o?tn.from(o.current.boundingRectangle).corners:void 0,a=tn.from(n.shape.boundingRectangle).corners.reduce((l,c,u)=>{var d;return l+It.distance(It.from(c),(d=s?.[u])!=null?d:r.current)},0)/4;return{id:n.id,value:1/a,type:Xr.Collision,priority:qr.Normal}};var tI=Object.create,Hh=Object.defineProperty,nI=Object.defineProperties,oI=Object.getOwnPropertyDescriptor,rI=Object.getOwnPropertyDescriptors,Su=Object.getOwnPropertySymbols,i0=Object.prototype.hasOwnProperty,a0=Object.prototype.propertyIsEnumerable,l0=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),mi=e=>{throw TypeError(e)},Ih=(e,t,n)=>t in e?Hh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ol=(e,t)=>{for(var n in t||(t={}))i0.call(t,n)&&Ih(e,n,t[n]);if(Su)for(var n of Su(t))a0.call(t,n)&&Ih(e,n,t[n]);return e},Vh=(e,t)=>nI(e,rI(t)),QS=(e,t)=>Hh(e,"name",{value:t,configurable:!0}),c0=(e,t)=>{var n={};for(var o in e)i0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Su)for(var o of Su(e))t.indexOf(o)<0&&a0.call(e,o)&&(n[o]=e[o]);return n},_i=e=>{var t;return[,,,tI((t=e?.[l0("metadata")])!=null?t:null)]},u0=["class","method","getter","setter","accessor","field","value","get","set"],Qa=e=>e!==void 0&&typeof e!="function"?mi("Function expected"):e,sI=(e,t,n,o,r)=>({kind:u0[e],name:t,metadata:o,addInitializer:s=>n._?mi("Already initialized"):r.push(Qa(s||null))}),ls=(e,t)=>Ih(t,l0("metadata"),e[3]),ut=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},$n=(e,t,n,o,r,s)=>{var i,a,l,c,u,d=t&7,f=!!(t&8),p=!!(t&16),h=d>3?e.length+1:d?f?1:2:0,g=u0[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&oI(d<4?r:{get[n](){return $e(this,s)},set[n](v){return Vt(this,s,v)}},n));d?p&&d<4&&QS(s,(d>2?"set ":d>1?"get ":"")+n):QS(r,n);for(var x=o.length-1;x>=0;x--)c=sI(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>iI(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?$e:as)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Vt(v,r,S,d^4?s:_.set):(v,S)=>v[n]=S)),a=(0,o[x])(d?d<4?p?s:_[g]:d>4?void 0:{get:_.get,set:_.set}:r,c),l._=1,d^4||a===void 0?Qa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?mi("Object expected"):(Qa(i=a.get)&&(_.get=i),Qa(i=a.set)&&(_.set=i),Qa(i=a.init)&&y.unshift(i));return d||ls(e,r),_&&Hh(r,n,_),p?d^4?s:_:r},jh=(e,t,n)=>t.has(e)||mi("Cannot "+n),iI=(e,t)=>Object(t)!==t?mi('Cannot use the "in" operator on this value'):e.has(t),$e=(e,t,n)=>(jh(e,t,"read from private field"),n?n.call(e):t.get(e)),nt=(e,t,n)=>t.has(e)?mi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Vt=(e,t,n,o)=>(jh(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),as=(e,t,n)=>(jh(e,t,"access private method"),n),ZS={role:"button",roleDescription:"draggable"},aI="dnd-kit-description",lI="dnd-kit-announcement",cI={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},uI={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===t?.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function dI(e){let t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function fI(e,t){let n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function pI(e){let t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var hI=["dragover","dragmove"],gI=class extends mt{constructor(e,t){super(e);let{id:n,idPrefix:{description:o=aI,announcement:r=lI}={},announcements:s=uI,screenReaderInstructions:i=cI,debounce:a=500}=t??{},l=n?`${o}-${n}`:_u(o),c=n?`${r}-${n}`:_u(r),u,d,f,p,h=(S=p)=>{!f||!S||f?.nodeValue!==S&&(f.nodeValue=S)},g=()=>qa.schedule(h),y=mI(g,a),m=Object.entries(s).map(([S,b])=>this.manager.monitor.addEventListener(S,(N,D)=>{let O=f;if(!O)return;let T=b?.(N,D);T&&O.nodeValue!==T&&(p=T,hI.includes(S)?y():(g(),y.cancel()))})),_=()=>{let S=[];u?.isConnected||(u=fI(l,i.draggable),S.push(u)),d?.isConnected||(d=pI(c),f=document.createTextNode(""),d.appendChild(f),S.push(d)),S.length>0&&document.body.append(...S)},x=new Set;function v(){for(let S of x)S()}this.registerEffect(()=>{var S;x.clear();for(let b of this.manager.registry.draggables.value){let N=(S=b.handle)!=null?S:b.element;if(N){(!u||!d)&&x.add(_),(!dI(N)||du())&&!N.hasAttribute("tabindex")&&x.add(()=>N.setAttribute("tabindex","0")),!N.hasAttribute("role")&&N.tagName.toLowerCase()!=="button"&&x.add(()=>N.setAttribute("role",ZS.role)),N.hasAttribute("aria-roledescription")||x.add(()=>N.setAttribute("aria-roledescription",ZS.roleDescription)),N.hasAttribute("aria-describedby")||x.add(()=>N.setAttribute("aria-describedby",l));for(let O of["aria-pressed","aria-grabbed"]){let T=String(b.isDragging);N.getAttribute(O)!==T&&x.add(()=>N.setAttribute(O,T))}let D=String(b.disabled);N.getAttribute("aria-disabled")!==D&&x.add(()=>N.setAttribute("aria-disabled",D))}}x.size>0&&qa.schedule(v)}),this.destroy=()=>{super.destroy(),u?.remove(),d?.remove(),m.forEach(S=>S())}}};function mI(e,t){let n,o=()=>{clearTimeout(n),n=setTimeout(e,t)};return o.cancel=()=>clearTimeout(n),o}var Cu=new Map,d0,f0,p0,h0,$h,tl,Do,Yh,hi,g0,m0,_0,y0,sr=class extends($h=si,h0=[fe],p0=[Ve],f0=[Ve],d0=[Ve],$h){constructor(t,n){super(t,n),ut(Do,5,this),nt(this,hi),nt(this,tl,new Set),nt(this,Yh,ut(Do,8,this,new Set)),ut(Do,11,this),this.registerEffect(as(this,hi,g0))}register(t){return $e(this,tl).add(t),()=>{$e(this,tl).delete(t)}}addRoot(t){return ie(()=>{let n=new Set(this.additionalRoots);n.add(t),this.additionalRoots=n}),()=>{ie(()=>{let n=new Set(this.additionalRoots);n.delete(t),this.additionalRoots=n})}}get sourceRoot(){var t;let{source:n}=this.manager.dragOperation;return ja((t=n?.element)!=null?t:null)}get targetRoot(){var t;let{target:n}=this.manager.dragOperation;return ja((t=n?.element)!=null?t:null)}get roots(){let{status:t}=this.manager.dragOperation;if(t.initializing||t.initialized){let n=[this.sourceRoot,this.targetRoot].filter(o=>o!=null);return new Set([...n,...this.additionalRoots])}return new Set}};Do=_i($h);tl=new WeakMap;Yh=new WeakMap;hi=new WeakSet;g0=function(){let{roots:e}=this,t=[];for(let n of e)for(let o of $e(this,tl))t.push(as(this,hi,m0).call(this,n,o));return()=>{for(let n of t)n()}};m0=function(e,t){let n=Cu.get(e);n||(n=new Map,Cu.set(e,n));let o=n.get(t);if(!o){let s=uu(e)?as(this,hi,_0).call(this,e,n,t):as(this,hi,y0).call(this,e,n,t);if(!s)return()=>{};o=s,n.set(t,o)}o.refCount++;let r=!1;return()=>{r||(r=!0,o.refCount--,o.refCount===0&&o.cleanup())}};_0=function(e,t,n){var o;let r=e.createElement("style"),{nonce:s}=(o=this.options)!=null?o:{};s&&r.setAttribute("nonce",s),r.textContent=n,e.head.prepend(r);let i=new MutationObserver(a=>{for(let l of a)for(let c of Array.from(l.removedNodes))if(c===r){e.head.prepend(r);return}});return i.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{i.disconnect(),r.remove(),t.delete(n),t.size===0&&Cu.delete(e)}}};y0=function(e,t,n){"adoptedStyleSheets"in e&&Array.isArray(e.adoptedStyleSheets);let o=e.ownerDocument.defaultView,{CSSStyleSheet:r}=o??{};if(!r)return null;let s=new r;return s.replaceSync(n),e.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var i;if(fu(e)&&((i=e.host)!=null&&i.isConnected)){let a=e.adoptedStyleSheets.indexOf(s);a!==-1&&e.adoptedStyleSheets.splice(a,1)}t.delete(n),t.size===0&&Cu.delete(e)}}};$n(Do,4,"additionalRoots",h0,sr,Yh);$n(Do,2,"sourceRoot",p0,sr);$n(Do,2,"targetRoot",f0,sr);$n(Do,2,"roots",d0,sr);ls(Do,sr);sr.configure=ri(sr);var Tu=sr,_I=class extends mt{constructor(e,t){super(e,t),this.manager=e;let{cursor:n="grabbing"}=t??{},o=e.registry.plugins.get(Tu),r=o?.register(`* { cursor: ${n} !important; }`);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}}},al="data-dnd-",Rh=`${al}dropping`,bt="--dnd-",go=`${al}dragging`,bu=`${al}placeholder`,yI=[go,bu,"popover","aria-pressed","aria-grabbing"],xI=["view-transition-name"],vI=`
9
+ :is(:root,:host) [${go}] {
10
10
  position: fixed !important;
11
11
  pointer-events: none !important;
12
12
  touch-action: none;
@@ -32,21 +32,21 @@
32
32
  visibility: hidden;
33
33
  }
34
34
 
35
- [${ho}] * {
35
+ [${go}] * {
36
36
  pointer-events: none !important;
37
37
  }
38
38
 
39
- [${ho}]:not([${Rh}]) {
39
+ [${go}]:not([${Rh}]) {
40
40
  translate: var(${bt}translate) !important;
41
41
  }
42
42
 
43
- [${ho}][style*='${bt}scale'] {
43
+ [${go}][style*='${bt}scale'] {
44
44
  scale: var(${bt}scale) !important;
45
45
  transform-origin: var(${bt}transform-origin) !important;
46
46
  }
47
47
 
48
48
  @layer dnd-kit {
49
- :where([${ho}][popover]) {
49
+ :where([${go}][popover]) {
50
50
  overflow: visible;
51
51
  background: unset;
52
52
  border: unset;
@@ -60,21 +60,21 @@
60
60
  }
61
61
  }
62
62
  }
63
- [${ho}]::backdrop, [${al}overlay]:not([${ho}]) {
63
+ [${go}]::backdrop, [${al}overlay]:not([${go}]) {
64
64
  display: none;
65
65
  visibility: hidden;
66
66
  }
67
- `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function vI(e,t="hidden"){return ie(()=>{let{element:n,manager:o}=e;if(!n||!o)return;let r=SI(n,o.registry.droppables),s=[],i=LS(n),{remove:a}=i;return CI(r,i,s),bI(i,t),i.remove=()=>{s.forEach(l=>l()),a.call(i)},i})}function SI(e,t){let n=new Map;for(let o of t)if(o.element&&(e===o.element||e.contains(o.element))){let r=`${al}${_u("dom-id")}`;o.element.setAttribute(r,""),n.set(o,r)}return n}function CI(e,t,n){for(let[o,r]of e){if(!o.element)continue;let s=`[${r}]`,i=t.matches(s)?t:t.querySelector(s);if(o.element.removeAttribute(r),!i)continue;let a=o.element;o.proxy=i,i.removeAttribute(r),Ga.set(a,i),n.push(()=>{Ga.delete(a),o.proxy=void 0})}}function bI(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(bu,t)}function x0(e,t){return e===t?!0:Zr(e)===Zr(t)}function e0(e){let{target:t}=e;"newState"in e&&e.newState==="closed"&&er(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>ns(t))}function Ph(e){return e.tagName==="TR"}function EI(e,t,n){let o=new MutationObserver(r=>{let s=!1;for(let i of r){if(i.target!==e){s=!0;continue}if(i.type!=="attributes")continue;let a=i.attributeName;if(a.startsWith("aria-")||_I.includes(a))continue;let l=e.getAttribute(a);if(a==="style"){if(ii(e)&&ii(t)){let c=e.style;for(let u of Array.from(t.style))c.getPropertyValue(u)===""&&t.style.removeProperty(u);for(let u of Array.from(c)){if(yI.includes(u)||u.startsWith(bt))continue;let d=c.getPropertyValue(u);t.style.setProperty(u,d)}}}else l!==null?t.setAttribute(a,l):t.removeAttribute(a)}s&&n&&t.replaceChildren(...e.cloneNode(!0).childNodes)});return o.observe(e,{attributes:!0,subtree:!0,childList:!0}),o}function NI(e,t,n){let o=new MutationObserver(r=>{for(let s of r)if(s.addedNodes.length!==0)for(let i of Array.from(s.addedNodes)){if(i.contains(e)&&e.nextElementSibling!==t){e.insertAdjacentElement("afterend",t),ns(n);return}if(i.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement("beforebegin",e),ns(n);return}}e.isConnected&&t.isConnected&&e.nextElementSibling!==t&&(e.insertAdjacentElement("afterend",t),ns(n))});return o.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),o}function TI(e){return new ResizeObserver(()=>{var t,n,o;let r=new In(e.placeholder,{frameTransform:e.frameTransform,ignoreTransforms:!0}),s=(t=e.transformOrigin)!=null?t:{x:1,y:1},i=(e.width-r.width)*s.x+e.delta.x,a=(e.height-r.height)*s.y+e.delta.y,l=Nh();if(e.styles.set({width:r.width-e.widthOffset,height:r.height-e.heightOffset,top:e.top+a+l.y,left:e.left+i+l.x},bt),(n=e.getElementMutationObserver())==null||n.takeRecords(),Ph(e.element)&&Ph(e.placeholder)){let g=Array.from(e.element.cells),y=Array.from(e.placeholder.cells);e.getSavedCellWidths()||e.setSavedCellWidths(g.map(m=>m.style.width));for(let[m,_]of g.entries()){let x=y[m];_.style.width=`${x.getBoundingClientRect().width}px`}}let c=(o=e.getTranslate())!=null?o:{x:0,y:0},u=e.left+i+l.x+c.x,d=e.top+a+l.y+c.y,f=r.width-e.widthOffset,p=r.height-e.heightOffset,h=e.frameTransform;e.dragOperation.shape=new tn(u*h.scaleX+h.x,d*h.scaleY+h.y,f*h.scaleX,p*h.scaleY)})}var OI=250,DI="ease";function wI(e){var t,n,o,r;let{animation:s}=e;if(typeof s=="function"){let _=s({source:e.source,element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});Promise.resolve(_).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)});return}let{duration:i=OI,easing:a=DI}=s??{};ns(e.feedbackElement);let[,l]=(t=bh(e.feedbackElement,_=>"translate"in _))!=null?t:[];l?.pause();let c=(n=e.placeholder)!=null?n:e.element,u={frameTransform:x0(e.feedbackElement,c)?null:void 0},d=new In(e.feedbackElement,u),f=(o=li(An(e.feedbackElement).translate))!=null?o:e.translate,p=new In(c,u),h=tn.delta(d,p,e.alignment),g={x:f.x-h.x,y:f.y-h.y},y=Math.round(d.intrinsicHeight)!==Math.round(p.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${p.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${p.intrinsicHeight}px`]}:{},m=Math.round(d.intrinsicWidth)!==Math.round(p.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${p.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${p.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},bt),e.feedbackElement.setAttribute(Rh,""),(r=e.getElementMutationObserver())==null||r.takeRecords(),mu({element:e.feedbackElement,keyframes:Vh(ol(ol({},y),m),{translate:[`${f.x}px ${f.y}px 0`,`${g.x}px ${g.y}px 0`]}),options:{duration:Ya(Ht(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?i:0,easing:a}}).then(()=>{e.feedbackElement.removeAttribute(Rh),l?.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}var v0,Lh,rl,Gh,vu,S0,C0,gi=class extends(Lh=mt,v0=[fe],Lh){constructor(t,n){super(t,n),nt(this,vu),nt(this,Gh,ut(rl,8,this)),ut(rl,11,this),this.state={initial:{},current:{}};let o=t.registry.plugins.get(Tu),r=o?.register(xI);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}this.registerEffect(as(this,vu,S0).bind(this,o)),this.registerEffect(as(this,vu,C0))}};rl=_i(Lh);Gh=new WeakMap;vu=new WeakSet;S0=function(e){let{overlay:t}=this;if(!t||!e)return;let n=ja(t);if(n)return e.addRoot(n)};C0=function(){var e,t,n,o,r,s,i;let{state:a,manager:l,options:c}=this,{dragOperation:u}=l,{position:d,source:f,status:p}=u;if(p.idle){a.current={},a.initial={};return}if(!f)return;let{element:h}=f,g=f.pluginConfig(gi),y=(t=(e=g?.feedback)!=null?e:c?.feedback)!=null?t:"default",m=typeof y=="function"?y(f,l):y;if(!h||m==="none"||!p.initialized||p.initializing)return;let{initial:_}=a,x=(n=this.overlay)!=null?n:h,v=os(x),S=os(h),b=!x0(h,x),N=new In(h,{frameTransform:b?S:null,ignoreTransforms:!b}),D={x:S.scaleX/v.scaleX,y:S.scaleY/v.scaleY},{width:O,height:T,top:A,left:$}=N;b&&(O=O/D.x,T=T/D.y);let I=new GS(x),L=An(h),{transition:P,translate:Y,boxSizing:Q,paddingBlockStart:ee,paddingBlockEnd:Z,paddingInlineStart:ne,paddingInlineEnd:ae,borderInlineStartWidth:xe,borderInlineEndWidth:ue,borderBlockStartWidth:q,borderBlockEndWidth:le}=L,Fe=P.split(",").filter(Ce=>!/^\s*(transform|translate|scale)\b/.test(Ce)).join(","),Te=Xa(L),Ot=L.transform,Dt=m==="clone",Ze=Q==="content-box",Hs=Ze?parseInt(ne)+parseInt(ae)+parseInt(xe)+parseInt(ue):0,bo=Ze?parseInt(ee)+parseInt(Z)+parseInt(q)+parseInt(le):0,lt=m!=="move"&&!this.overlay?vI(f,Dt?"clone":"hidden"):null,Go=ie(()=>rs(l.dragOperation.activatorEvent));if(!_.translate){if(this.overlay&&Te)_.translate={x:Te.x,y:Te.y};else if(Y!=="none"){let Ce=li(Y);Ce&&(_.translate=Ce)}}if(!_.transformOrigin){let Ce=ie(()=>d.current),rt=$+((o=Te?.x)!=null?o:0),cn=A+((r=Te?.y)!=null?r:0);_.transformOrigin={x:(Ce.x-rt*v.scaleX-v.x)/(O*v.scaleX),y:(Ce.y-cn*v.scaleY-v.y)/(T*v.scaleY)}}let{transformOrigin:_e}=_,Be=A*v.scaleY+v.y,pt=$*v.scaleX+v.x;if(!_.coordinates&&(_.coordinates={x:pt,y:Be},D.x!==1||D.y!==1)){let{scaleX:Ce,scaleY:rt}=S,{x:cn,y:qo}=_e;_.coordinates.x+=(O*Ce-O)*cn,_.coordinates.y+=(T*rt-T)*qo}_.dimensions||(_.dimensions={width:O,height:T}),_.frameTransform||(_.frameTransform=v);let en={x:_.coordinates.x-pt,y:_.coordinates.y-Be},Yn={width:(_.dimensions.width*_.frameTransform.scaleX-O*v.scaleX)*_e.x,height:(_.dimensions.height*_.frameTransform.scaleY-T*v.scaleY)*_e.y},Wt={x:en.x/v.scaleX+Yn.width,y:en.y/v.scaleY+Yn.height},Ke={left:$+Wt.x,top:A+Wt.y};x.setAttribute(ho,"true");let wt=ie(()=>u.transform),Ic=(s=_.translate)!=null?s:{x:0,y:0},mp=wt.x*v.scaleX+Ic.x,_p=wt.y*v.scaleY+Ic.y,Tn=Nh();I.set({width:O-Hs,height:T-bo,top:Ke.top+Tn.y,left:Ke.left+Tn.x,translate:`${mp}px ${_p}px 0`,transform:this.overlay?"none":Ot,transition:Fe?`${Fe}, translate 0ms linear`:"translate 0ms linear",scale:b?`${D.x} ${D.y}`:"","transform-origin":`${_e.x*100}% ${_e.y*100}%`},bt),lt&&(h.insertAdjacentElement("afterend",lt),c?.rootElement&&(typeof c.rootElement=="function"?c.rootElement(f):c.rootElement).appendChild(h)),pu(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),ns(x),x.addEventListener("beforetoggle",e0));let On,ba,Br,ln=TI({placeholder:lt,element:h,feedbackElement:x,frameTransform:v,transformOrigin:_e,width:O,height:T,top:A,left:$,widthOffset:Hs,heightOffset:bo,delta:Wt,styles:I,dragOperation:u,getTranslate:()=>a.current.translate,getElementMutationObserver:()=>On,getSavedCellWidths:()=>Br,setSavedCellWidths:Ce=>{Br=Ce}}),$c=new In(x);ie(()=>u.shape=$c);let Ea=Ht(x),B=Ce=>{this.manager.actions.stop({event:Ce})},X=Ya(Ea);Go&&Ea.addEventListener("resize",B),ie(()=>f.status)==="idle"&&requestAnimationFrame(()=>f.status="dragging"),lt&&(ln.observe(lt),On=EI(h,lt,Dt),ba=NI(h,lt,x));let V=(i=l.dragOperation.source)==null?void 0:i.id,ye=()=>{var Ce;if(!Go||V==null)return;let rt=l.registry.draggables.get(V),cn=(Ce=rt?.handle)!=null?Ce:rt?.element;Oo(cn)&&cn.focus()},Mt=()=>{On?.disconnect(),ba?.disconnect(),ln.disconnect(),Ea.removeEventListener("resize",B),pu(x)&&(x.removeEventListener("beforetoggle",e0),x.removeAttribute("popover")),x.removeAttribute(ho),I.reset();let Ce=()=>{var rt;if(Br&&Ph(h)){let yp=Array.from(h.cells);for(let[Rc,js]of yp.entries())js.style.width=(rt=Br[Rc])!=null?rt:""}f.status="idle";let cn=a.current.translate!=null,qo=u.status.dragging;lt&&(!qo&&cn||lt.parentElement!==x.parentElement)&&x.isConnected&&lt.replaceWith(x),lt?.remove()};x===this.overlay?setTimeout(Ce,0):Ce()},He=c?.dropAnimation,ht=this,Vs=Hr(()=>{var Ce,rt,cn;let{transform:qo,status:yp}=u;if(!(!qo.x&&!qo.y&&!a.current.translate)&&yp.dragging){let Rc=(Ce=_.translate)!=null?Ce:{x:0,y:0},js={x:qo.x/v.scaleX+Rc.x,y:qo.y/v.scaleY+Rc.y},jx=a.current.translate,Mk=ie(()=>u.modifiers),xp=ie(()=>{var Ta;return(Ta=u.shape)==null?void 0:Ta.current}),Na=c?.keyboardTransition,Yx=Go&&!X&&Na!==null?`${(rt=Na?.duration)!=null?rt:250}ms ${(cn=Na?.easing)!=null?cn:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(I.set({transition:Fe?`${Fe}, translate ${Yx}`:`translate ${Yx}`,translate:`${js.x}px ${js.y}px 0`},bt),On?.takeRecords(),xp&&xp!==$c&&jx&&!Mk.length){let Ta=It.delta(js,jx);u.shape=tn.from(xp.boundingRectangle).translate(Ta.x*v.scaleX,Ta.y*v.scaleY)}else u.shape=new In(x);a.current.translate=js}},function(){if(u.status.dropped){this.dispose(),f.status="dropping";let Ce=g?.dropAnimation!==void 0?g.dropAnimation:ht.dropAnimation!==void 0?ht.dropAnimation:He,rt=a.current.translate,cn=rt!=null;if(!rt&&h!==x&&(rt={x:0,y:0}),!rt||Ce===null){Mt();return}l.renderer.rendering.then(()=>{wI({source:f,element:h,feedbackElement:x,placeholder:lt,translate:rt,moved:cn,transition:P,alignment:f.alignment,styles:I,animation:Ce??void 0,getElementMutationObserver:()=>On,cleanup:Mt,restoreFocus:ye})})}});return()=>{Mt(),Vs()}};$n(rl,4,"overlay",v0,gi,Gh);ls(rl,gi);gi.configure=ri(gi);var qh=gi,Ja=!0,MI=!1,b0,E0,N0,T0,nr,Xh,Jh;T0=(N0=[fe],fn.Forward),E0=(b0=[fe],fn.Reverse);var sl=class{constructor(){nt(this,Xh,ut(nr,8,this,Ja)),ut(nr,11,this),nt(this,Jh,ut(nr,12,this,Ja)),ut(nr,15,this)}isLocked(e){return e===fn.Idle?!1:e==null?this[fn.Forward]===Ja&&this[fn.Reverse]===Ja:this[e]===Ja}unlock(e){e!==fn.Idle&&(this[e]=MI)}};nr=_i(null);Xh=new WeakMap;Jh=new WeakMap;$n(nr,4,T0,N0,sl,Xh);$n(nr,4,E0,b0,sl,Jh);ls(nr,sl);var kI=[fn.Forward,fn.Reverse],t0=class{constructor(){this.x=new sl,this.y=new sl}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},AI=class extends mt{constructor(e){super(e);let t=wn(new t0),n=null;this.signal=t,gt(()=>{let{status:o}=e.dragOperation;if(!o.initialized){n=null,t.value=new t0;return}let{delta:r}=e.dragOperation.position;if(n){let s={x:n0(r.x,n.x),y:n0(r.y,n.y)},i=t.peek();Oe(()=>{for(let a of Vp)for(let l of kI)s[a]===l&&i[a].unlock(l);t.value=i})}n=r})}get current(){return this.signal.peek()}};function n0(e,t){return Math.sign(e-t)}var O0,Fh,il,Qh,tr,Bh,yi=class extends(Fh=si,O0=[fe],Fh){constructor(e){super(e),nt(this,Qh,ut(il,8,this,!1)),ut(il,11,this),nt(this,tr),nt(this,Bh,()=>{if(!$e(this,tr))return;let{element:s,by:i}=$e(this,tr);i.y&&(s.scrollTop+=i.y),i.x&&(s.scrollLeft+=i.x)}),this.scroll=(s,i)=>{var a;if(this.disabled)return!1;let l=this.getScrollableElements();if(!l)return Vt(this,tr,void 0),!1;let{position:c}=this.manager.dragOperation,u=c?.current;if(u){let{by:d}=s??{},f=d?{x:o0(d.x),y:o0(d.y)}:void 0,p=f?void 0:this.scrollIntentTracker.current;if(p?.isLocked())return!1;for(let h of l){let g=jS(h,d);if(g.x||g.y){let{speed:y,direction:m}=YS(h,u,f,i?.acceleration,i?.threshold);if(p)for(let _ of Vp)p[_].isLocked(m[_])&&(y[_]=0,m[_]=0);if(m.x||m.y){let{x:_,y:x}=d??m,v=_*y.x,S=x*y.y;if(v||S){let b=(a=$e(this,tr))==null?void 0:a.by;if(this.autoScrolling&&b&&(b.x&&!v||b.y&&!S))continue;return Vt(this,tr,{element:h,by:{x:v,y:S}}),qa.schedule($e(this,Bh)),!0}}}}}return Vt(this,tr,void 0),!1};let t=null,n=null,o=Kc(()=>{let{position:s,source:i}=e.dragOperation;if(!s)return null;let a=Th(ja(i?.element),s.current);return a&&(t=a),a??t}),r=Kc(()=>{let s=o.value,{documentElement:i}=es(s);if(!s||s===i){let{target:a}=e.dragOperation,l=a?.element;if(l){let c=hu(l,{excludeElement:!1});return n=c,c}}if(s){let a=hu(s,{excludeElement:!1});return this.autoScrolling&&n&&a.size<n?.size?n:(n=a,a)}return n=null,null},Wc);this.getScrollableElements=()=>r.value,this.scrollIntentTracker=new AI(e),this.destroy=e.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!rs(e.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};il=_i(Fh);Qh=new WeakMap;tr=new WeakMap;Bh=new WeakMap;$n(il,4,"autoScrolling",O0,yi,Qh);ls(il,yi);function o0(e){return e>0?fn.Forward:e<0?fn.Reverse:fn.Idle}var II=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let o of t)o();for(let o of n)o()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},$I=new II(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),RI=10,zh=class extends mt{constructor(t,n){super(t,n);let o=t.registry.plugins.get(yi);if(!o)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=gt(()=>{var r,s,i;if(this.disabled)return;let{position:a,status:l}=t.dragOperation;if(l.dragging){let c={acceleration:(r=this.options)==null?void 0:r.acceleration,threshold:typeof((s=this.options)==null?void 0:s.threshold)=="number"?{x:this.options.threshold,y:this.options.threshold}:(i=this.options)==null?void 0:i.threshold};if(o.scroll(void 0,c)){o.autoScrolling=!0;let d=setInterval(()=>$I.schedule(()=>o.scroll(void 0,c)),RI);return()=>{clearInterval(d)}}else o.autoScrolling=!1}})}};zh.configure=ri(zh);var D0=zh,r0={capture:!0,passive:!0},Za,PI=class extends si{constructor(e){super(e),nt(this,Za),this.handleScroll=()=>{$e(this,Za)==null&&Vt(this,Za,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Vt(this,Za,void 0)},50))};let{dragOperation:t}=this.manager;this.destroy=gt(()=>{var n,o,r;if(t.status.dragging){let i=(r=(o=(n=t.source)==null?void 0:n.element)==null?void 0:o.ownerDocument)!=null?r:document;return i.addEventListener("scroll",this.handleScroll,r0),()=>{i.removeEventListener("scroll",this.handleScroll,r0)}}})}};Za=new WeakMap;var LI="* { user-select: none !important; -webkit-user-select: none !important; }",FI=class extends mt{constructor(e){super(e),this.manager=e;let t=e.registry.plugins.get(Tu),n=t?.register(LI);if(this.destroy=gt(()=>{let{dragOperation:o}=this.manager;if(o.status.initialized)return Mh(),document.addEventListener("selectionchange",Mh,{capture:!0}),()=>{document.removeEventListener("selectionchange",Mh,{capture:!0})}}),n){let o=this.destroy.bind(this);this.destroy=()=>{n(),o()}}}};function Mh(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var el=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;let o=(n=t.handle)!=null?n:t.element;return e.target!==o}}),ui,Eu=class extends Yr{constructor(t,n){super(t),this.manager=t,this.options=n,nt(this,ui,[]),this.listeners=new Oh,this.handleSourceKeyDown=(o,r,s)=>{if(this.disabled||o.defaultPrevented||!er(o.target)||r.disabled)return;let{keyboardCodes:i=el.keyboardCodes,preventActivation:a=el.preventActivation}=s??{};i.start.includes(o.code)&&this.manager.dragOperation.status.idle&&(a?.(o,r)||this.handleStart(o,r,s))}}bind(t,n=this.options){return gt(()=>{var r;let s=(r=t.handle)!=null?r:t.element,i=a=>{rs(a)&&this.handleSourceKeyDown(a,t,n)};if(s)return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}})}handleStart(t,n,o){let{element:r}=n;if(!r)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),gu(r);let{center:s}=new In(r);if(this.manager.actions.start({event:t,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();let a=es(r),l=[this.listeners.bind(a,[{type:"keydown",listener:c=>this.handleKeyDown(c,n,o),options:{capture:!0}}])];$e(this,ui).push(...l)}handleKeyDown(t,n,o){let{keyboardCodes:r=el.keyboardCodes}=o??{};if(ci(t,[...r.end,...r.cancel])){t.preventDefault();let s=ci(t,r.cancel);this.handleEnd(t,s);return}ci(t,r.up)?this.handleMove("up",t):ci(t,r.down)&&this.handleMove("down",t),ci(t,r.left)?this.handleMove("left",t):ci(t,r.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var o,r;let{shape:s}=this.manager.dragOperation,i=n.shiftKey?5:1,a={x:0,y:0},l=(r=(o=this.options)==null?void 0:o.offset)!=null?r:el.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!s){switch(t){case"up":a={x:0,y:-l.y*i};break;case"down":a={x:0,y:l.y*i};break;case"left":a={x:-l.x*i,y:0};break;case"right":a={x:l.x*i,y:0};break}(a.x||a.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:a}))}}sideEffects(){let t=this.manager.registry.plugins.get(D0);t?.disabled===!1&&(t.disable(),$e(this,ui).push(()=>{t.enable()}))}cleanup(){$e(this,ui).forEach(t=>t()),Vt(this,ui,[])}destroy(){this.cleanup(),this.listeners.clear()}};ui=new WeakMap;Eu.configure=ri(Eu);Eu.defaults=el;var Zh=Eu;function ci(e,t){return t.includes(e.code)}var ss,BI=class extends hh{constructor(){super(...arguments),nt(this,ss)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,ss,ts(e));break;case"pointermove":if(!$e(this,ss))return;let{x:t,y:n}=ts(e),o={x:t-$e(this,ss).x,y:n-$e(this,ss).y},{tolerance:r}=this.options;if(r&&Vc(o,r)){this.abort();return}Vc(o,this.options.value)&&this.activate(e);break;case"pointerup":this.abort();break}}abort(){Vt(this,ss,void 0)}};ss=new WeakMap;var di,is,zI=class extends hh{constructor(){super(...arguments),nt(this,di),nt(this,is)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,is,ts(e)),Vt(this,di,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!$e(this,is))return;let{x:t,y:n}=ts(e),o={x:t-$e(this,is).x,y:n-$e(this,is).y};Vc(o,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){$e(this,di)&&(clearTimeout($e(this,di)),Vt(this,is,void 0),Vt(this,di,void 0))}};di=new WeakMap;is=new WeakMap;var pi=class{};pi.Delay=zI;pi.Distance=BI;var Wh=Object.freeze({activationConstraints(e,t){var n;let{pointerType:o,target:r}=e;if(!(o==="mouse"&&er(r)&&(t.handle===r||(n=t.handle)!=null&&n.contains(r))))return o==="touch"?[new pi.Delay({value:250,tolerance:5})]:XS(r)&&!e.defaultPrevented?[new pi.Delay({value:200,tolerance:0})]:[new pi.Delay({value:200,tolerance:10}),new pi.Distance({value:5})]},preventActivation(e,t){var n;let{target:o}=e;if(o===t.element||o===t.handle||!er(o)||(n=t.handle)!=null&&n.contains(o))return!1;let r=FS(o);return r===t.element?!1:!!r}}),fi,Nu=class extends Yr{constructor(t,n){super(t),this.manager=t,this.options=n,nt(this,fi,new Set),this.listeners=new Oh,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{let{event:o,coordinates:r}=this.latest;!o||!r||this.manager.actions.move({event:o,to:r})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n,o=this.options){let{activationConstraints:r=Wh.activationConstraints}=o??{};return typeof r=="function"?r(t,n):r}bind(t,n=this.options){return gt(()=>{var r;let s=new AbortController,{signal:i}=s,a=c=>{qS(c)&&this.handlePointerDown(c,t,n)},l=[(r=t.handle)!=null?r:t.element];n?.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(let c of l)c&&(UI(c.ownerDocument.defaultView),c.addEventListener("pointerdown",a,{signal:i}));return()=>s.abort()})}handlePointerDown(t,n,o){if(this.disabled||!t.isPrimary||t.button!==0||!er(t.target)||n.disabled||WI(t)||!this.manager.dragOperation.status.idle)return;let{preventActivation:r=Wh.preventActivation}=o??{};if(r?.(t,n))return;let{target:s}=t,i=Oo(s)&&s.draggable&&s.getAttribute("draggable")==="true",a=os(n.element),{x:l,y:c}=ts(t);this.initialCoordinates={x:l*a.scaleX+a.x,y:c*a.scaleY+a.y};let u=this.activationConstraints(t,n,o);t.sensor=this;let d=new mS(u,g=>this.handleStart(n,g));d.signal.onabort=()=>this.handleCancel(t),d.onEvent(t),this.controller=d;let f=ru(),p=this.listeners.bind(f,[{type:"pointermove",listener:g=>this.handlePointerMove(g,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:i?this.handleCancel:xu,options:{capture:!0}}]),h=()=>{p(),this.initialCoordinates=void 0};$e(this,fi).add(h)}handlePointerMove(t,n){var o,r;if(((o=this.controller)==null?void 0:o.activated)===!1){(r=this.controller)==null||r.onEvent(t);return}if(this.manager.dragOperation.status.dragging){let s=ts(t),i=os(n.element);s.x=s.x*i.scaleX+i.x,s.y=s.y*i.scaleY+i.y,t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=s,qa.schedule(this.handleMove)}}handlePointerUp(t){let{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();let o=!n.initialized;this.manager.actions.stop({event:t,canceled:o})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){let{manager:o,initialCoordinates:r}=this;if(!r||!o.dragOperation.status.idle||n.defaultPrevented)return;if(o.actions.start({coordinates:r,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();let a=es(n.target).body;try{a.setPointerCapture(n.pointerId)}catch{this.handleCancel(n);return}let l=er(n.target)?[n.target,a]:a,c=this.listeners.bind(l,[{type:"touchmove",listener:xu,options:{passive:!1}},{type:"click",listener:xu},{type:"contextmenu",listener:xu},{type:"keydown",listener:this.handleKeyDown}]);$e(this,fi).add(c)}handleCancel(t){let{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){let{controller:t}=this;this.controller=void 0,t&&!t.signal.aborted&&t.abort(),this.latest={event:void 0,coordinates:void 0},$e(this,fi).forEach(n=>n()),$e(this,fi).clear()}destroy(){this.cleanup(),this.listeners.clear()}};fi=new WeakMap;Nu.configure=ri(Nu);Nu.defaults=Wh;var eg=Nu;function WI(e){return"sensor"in e}function xu(e){e.preventDefault()}function KI(){}var s0=new WeakSet;function UI(e){!e||s0.has(e)||(e.addEventListener("touchmove",KI,{capture:!1,passive:!1}),s0.add(e))}var kh={modifiers:[],plugins:[hI,D0,mI,qh,FI],sensors:[eg,Zh]},w0=class extends TS{constructor(e={}){let t=po(e.plugins,kh.plugins),n=po(e.sensors,kh.sensors),o=po(e.modifiers,kh.modifiers);super(Vh(ol({},e),{plugins:[PI,yi,Tu,...t],sensors:n,modifiers:o}))}},M0,k0,Kh,or,tg,ng,cs=class extends(Kh=qn,k0=[fe],M0=[fe],Kh){constructor(e,t){var n=e,{element:o,effects:r=()=>[],handle:s}=n,i=c0(n,["element","effects","handle"]);super(ol({effects:()=>[...r(),()=>{var a,l;let{manager:c}=this;if(!c)return;let d=((l=(a=this.sensors)==null?void 0:a.map(ti))!=null?l:[...c.sensors]).map(f=>{let p=f instanceof Yr?f:c.registry.register(f.plugin),h=f instanceof Yr?void 0:f.options;return p.bind(this,h)});return function(){d.forEach(p=>p())}}]},i),t),nt(this,tg,ut(or,8,this)),ut(or,11,this),nt(this,ng,ut(or,12,this)),ut(or,15,this),this.element=o,this.handle=s}};or=_i(Kh);tg=new WeakMap;ng=new WeakMap;$n(or,4,"handle",k0,cs,tg);$n(or,4,"element",M0,cs,ng);ls(or,cs);var A0,I0,Uh,rr,og,Ah,$0,R0,nl,rg,xi=class extends(Uh=Xn,I0=[fe],A0=[fe],Uh){constructor(e,t){var n=e,{element:o,effects:r=()=>[]}=n,s=c0(n,["element","effects"]);let{collisionDetector:i=yu}=s,a=c=>{let{manager:u,element:d}=this;if(!d||c===null){this.shape=void 0;return}if(!u)return;let f=new In(d),p=ie(()=>this.shape);return f&&p?.equals(f)?p:(this.shape=f,f)},l=wn(!1);super(Vh(ol({},s),{collisionDetector:i,effects:()=>[...r(),()=>{let{element:c,manager:u}=this;if(!u)return;let{dragOperation:d}=u,{source:f}=d;l.value=!!(f&&d.status.initialized&&c&&!this.disabled&&this.accepts(f))},()=>{let{element:c}=this;if(l.value&&c){let u=new HS(c,a);return()=>{u.disconnect(),this.shape=void 0}}},()=>{var c;if((c=this.manager)!=null&&c.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),nt(this,nl),nt(this,og,ut(rr,8,this)),ut(rr,11,this),nt(this,rg,ut(rr,12,this)),ut(rr,15,this),this.element=o,this.refreshShape=()=>a()}set element(e){Vt(this,nl,e,R0)}get element(){var e;return(e=this.proxy)!=null?e:$e(this,nl,$0)}};rr=_i(Uh);og=new WeakMap;nl=new WeakSet;rg=new WeakMap;Ah=$n(rr,20,"#element",I0,nl,og),$0=Ah.get,R0=Ah.set;$n(rr,4,"proxy",A0,xi,rg);ls(rr,xi);var HI=Object.create,H0=Object.defineProperty,VI=Object.defineProperties,jI=Object.getOwnPropertyDescriptor,YI=Object.getOwnPropertyDescriptors,Au=Object.getOwnPropertySymbols,V0=Object.prototype.hasOwnProperty,j0=Object.prototype.propertyIsEnumerable,GI=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),pl=e=>{throw TypeError(e)},lg=(e,t,n)=>t in e?H0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sg=(e,t)=>{for(var n in t||(t={}))V0.call(t,n)&&lg(e,n,t[n]);if(Au)for(var n of Au(t))j0.call(t,n)&&lg(e,n,t[n]);return e},ig=(e,t)=>VI(e,YI(t)),qI=(e,t)=>{var n={};for(var o in e)V0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Au)for(var o of Au(e))t.indexOf(o)<0&&j0.call(e,o)&&(n[o]=e[o]);return n},XI=e=>{var t;return[,,,HI((t=void 0)!=null?t:null)]},Y0=["class","method","getter","setter","accessor","field","value","get","set"],cl=e=>e!==void 0&&typeof e!="function"?pl("Function expected"):e,JI=(e,t,n,o,r)=>({kind:Y0[e],name:t,metadata:o,addInitializer:s=>n._?pl("Already initialized"):r.push(cl(s||null))}),QI=(e,t)=>lg(t,GI("metadata"),e[3]),Ou=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},G0=(e,t,n,o,r,s)=>{for(var i,a,l,c,u,d=t&7,f=!1,p=!1,h=e.length+1,g=Y0[d+5],y=e[h-1]=[],m=e[h]||(e[h]=[]),_=(r=r.prototype,jI({get[n](){return ul(this,s)},set[n](v){return us(this,s,v)}},n)),x=o.length-1;x>=0;x--)c=JI(d,n,l={},e[3],m),c.static=f,c.private=p,u=c.access={has:v=>n in v},u.get=v=>v[n],u.set=(v,S)=>v[n]=S,a=(0,o[x])({get:_.get,set:_.set},c),l._=1,a===void 0?cl(a)&&(_[g]=a):typeof a!="object"||a===null?pl("Object expected"):(cl(i=a.get)&&(_.get=i),cl(i=a.set)&&(_.set=i),cl(i=a.init)&&y.unshift(i));return _&&H0(r,n,_),r},q0=(e,t,n)=>t.has(e)||pl("Cannot "+n),ul=(e,t,n)=>(q0(e,t,"read from private field"),t.get(e)),ll=(e,t,n)=>t.has(e)?pl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),us=(e,t,n,o)=>(q0(e,t,"write to private field"),t.set(e,n),n);function ds(e){return e instanceof dg||e instanceof Q0}var Du=10,ZI=class extends mt{constructor(e){super(e);let t=gt(()=>{let{dragOperation:o}=e;if(rs(o.activatorEvent)&&ds(o.source)&&o.status.initialized){let r=e.registry.plugins.get(yi);if(r)return r.disable(),()=>r.enable()}}),n=e.monitor.addEventListener("dragmove",(o,r)=>{queueMicrotask(()=>{if(this.disabled||o.defaultPrevented||!o.nativeEvent)return;let{dragOperation:s}=r;if(!rs(o.nativeEvent)||!ds(s.source)||!s.shape)return;let{actions:i,collisionObserver:a,registry:l}=r,{by:c}=o;if(!c)return;let u=e$(c),{source:d,target:f}=s,{center:p}=s.shape.current,h=[],g=[];Oe(()=>{for(let S of l.droppables){let{id:b}=S;if(!S.accepts(d)||b===f?.id&&ds(S)||!S.element)continue;let N=S.shape,D=new In(S.element,{getBoundingClientRect:O=>ai(O,void 0,.2)});!D.height||!D.width||(u=="down"&&p.y+Du<D.center.y||u=="up"&&p.y-Du>D.center.y||u=="left"&&p.x-Du>D.center.x||u=="right"&&p.x+Du<D.center.x)&&(h.push(S),S.shape=D,g.push(()=>S.shape=N))}}),o.preventDefault(),a.disable();let y=a.computeCollisions(h,JS);Oe(()=>g.forEach(S=>S()));let[m]=y;if(!m)return;let{id:_}=m,{index:x,group:v}=d.sortable;i.setDropTarget(_).then(()=>{let{source:S,target:b,shape:N}=s;if(!S||!ds(S)||!N)return;let{index:D,group:O,target:T}=S.sortable,A=x!==D||v!==O,$=A?T:b?.element;if(!$)return;gu($);let I=new In($);if(!I)return;let L=tn.delta(I,tn.from(N.current.boundingRectangle),S.alignment);i.move({by:L}),A?i.setDropTarget(S.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function e$(e){let{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var t$=Object.defineProperty,n$=Object.defineProperties,o$=Object.getOwnPropertyDescriptors,P0=Object.getOwnPropertySymbols,r$=Object.prototype.hasOwnProperty,s$=Object.prototype.propertyIsEnumerable,L0=(e,t,n)=>t in e?t$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t)=>{for(var n in t||(t={}))r$.call(t,n)&&L0(e,n,t[n]);if(P0)for(var n of P0(t))s$.call(t,n)&&L0(e,n,t[n]);return e},Si=(e,t)=>n$(e,o$(t));function i$(e,t,n){if(t===n)return e;let o=e.slice();return o.splice(n,0,o.splice(t,1)[0]),o}function wu(e,t){let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?n:void 0}function ag(e){return"initialIndex"in e&&typeof e.initialIndex=="number"&&"index"in e&&typeof e.index=="number"}function a$(e,t,n){var o,r;let{source:s,target:i,canceled:a}=t.operation;if(!s||!i||a)return"preventDefault"in t&&t.preventDefault(),e;let l=(x,v)=>x===v||x!==null&&typeof x=="object"&&"id"in x&&x.id===v;if(Array.isArray(e)){let x=e.findIndex(S=>l(S,s.id)),v=e.findIndex(S=>l(S,i.id));if(x===-1||v===-1){if(ag(s)){let S=s.initialIndex,b=s.index;return S===b||S<0||S>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,S,b)}return e}if(!a&&"index"in s&&typeof s.index=="number"){let S=s.index;if(S!==x)return n(e,x,S)}return n(e,x,v)}let c=Object.entries(e),u=-1,d,f=-1,p;for(let[x,v]of c)if(u===-1&&(u=v.findIndex(S=>l(S,s.id)),u!==-1&&(d=x)),f===-1&&(f=v.findIndex(S=>l(S,i.id)),f!==-1&&(p=x)),u!==-1&&f!==-1)break;if(u===-1&&ag(s)){let x=s.initialGroup==null?void 0:wu(e,s.initialGroup),v=s.initialIndex,S=s.group==null?void 0:wu(e,s.group),b=s.index;if(x==null||S==null||x===S&&v===b)return"preventDefault"in t&&t.preventDefault(),e;if(x===S)return Si(vi({},e),{[x]:n(e[x],v,b)});let N=e[x][v];return Si(vi({},e),{[x]:[...e[x].slice(0,v),...e[x].slice(v+1)],[S]:[...e[S].slice(0,b),N,...e[S].slice(b)]})}if(!s.manager)return e;let{dragOperation:h}=s.manager,g=(r=(o=h.shape)==null?void 0:o.current.center)!=null?r:h.position.current;if(p==null){let x=wu(e,i.id);if(x!=null){let v=i.shape&&g.y>i.shape.center.y?e[x].length:0;p=x,f=v}}if(d==null||p==null||d===p&&u===f){if(d!=null&&d===p&&u===f&&ag(s)){let x=s.group==null?void 0:wu(e,s.group),v=s.group!=null&&x!==d,S=s.index!==u;if(v||S){let b=s.group==null?d:x;if(b!=null){if(d===b)return Si(vi({},e),{[d]:n(e[d],u,s.index)});let N=e[d][u];return Si(vi({},e),{[d]:[...e[d].slice(0,u),...e[d].slice(u+1)],[b]:[...e[b].slice(0,s.index),N,...e[b].slice(s.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return Si(vi({},e),{[d]:n(e[d],u,f)});let m=i.shape&&Math.round(g.y)>Math.round(i.shape.center.y)?1:0,_=e[d][u];return Si(vi({},e),{[d]:[...e[d].slice(0,u),...e[d].slice(u+1)],[p]:[...e[p].slice(0,f+m),_,...e[p].slice(f+m)]})}function l$(e,t){return a$(e,t,i$)}function F0(e){let t=new Map;for(let[,n]of e)for(let o of n)t.set(o.id,o.index);return t}function B0(e,t,n){var o;for(let[r,s]of t)for(let i of s){let a=e.get(i.id);if(i.index!==a||i.group!==r||!((o=n.get(r))!=null&&o.has(i)))return!0}return!1}var z0="__default__",c$=class extends mt{constructor(e){super(e);let t=()=>{let o=new Map;for(let r of e.registry.droppables)if(r instanceof dg){let{sortable:s}=r,{group:i}=s,a=o.get(i);a||(a=new Set,o.set(i,a)),a.add(s)}return o},n=[e.monitor.addEventListener("dragover",(o,r)=>{if(this.disabled)return;let{dragOperation:s}=r,{source:i,target:a}=s;if(!ds(i)||!ds(a)||i.sortable===a.sortable)return;let l=t(),c=F0(l),u=i.sortable.group===a.sortable.group,d=l.get(i.sortable.group),f=u?d:l.get(a.sortable.group);!d||!f||queueMicrotask(()=>{o.defaultPrevented||r.renderer.rendering.then(()=>{var p,h;let g=t();if(B0(c,l,g))return;let y=i.sortable.element,m=a.sortable.element;if(!m||!y||!u&&a.id===i.sortable.group)return;let _=Mu(d),x=u?_:Mu(f),v=(p=i.sortable.group)!=null?p:z0,S=(h=a.sortable.group)!=null?h:z0,b={[v]:_,[S]:x},N=l$(b,o);if(b===N)return;let D=N[S].indexOf(i.sortable),O=N[S].indexOf(a.sortable);r.collisionObserver.disable(),W0(y,D,m,O),Oe(()=>{for(let[T,A]of N[v].entries())A.index=T;if(!u)for(let[T,A]of N[S].entries())A.group=a.sortable.group,A.index=T}),r.actions.setDropTarget(i.id).then(()=>r.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(o,r)=>{if(!o.canceled)return;let{dragOperation:s}=r,{source:i}=s;ds(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{let a=t(),l=F0(a),c=a.get(i.sortable.initialGroup);c&&r.renderer.rendering.then(()=>{let u=t();if(B0(l,a,u))return;let d=Mu(c),f=Mu(c,d$),p=i.sortable.element,h=f.indexOf(i.sortable),g=d[h],y=g?.element;!g||!y||!p||(W0(p,g.index,y,i.index),Oe(()=>{for(let m of a.values()){let _=Array.from(m).values();for(let x of _)x.index=x.initialIndex,x.group=x.initialGroup}}))})}))})];this.destroy=()=>{for(let o of n)o()}}};function W0(e,t,n,o){let r=o<t?"afterend":"beforebegin";n.insertAdjacentElement(r,e)}function u$(e,t){return e.index-t.index}function d$(e,t){return e.initialIndex-t.initialIndex}function Mu(e,t=u$){return Array.from(e).sort(t)}var K0=[ZI,c$],f$={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1};function U0(e){var t,n;return typeof e=="boolean"?{draggable:e,droppable:e}:{draggable:(t=e?.draggable)!=null?t:!1,droppable:(n=e?.droppable)!=null?n:!1}}var ku=new Nv,X0,J0,ir,cg,dl,fl,ug,Ci;J0=[fe],X0=[fe];var bi=class{constructor(e,t){ll(this,cg,Ou(ir,8,this)),Ou(ir,11,this),ll(this,dl),ll(this,fl),ll(this,ug,Ou(ir,12,this)),Ou(ir,15,this),ll(this,Ci),this.register=()=>(Oe(()=>{var h,g;(h=this.manager)==null||h.registry.register(this.droppable),(g=this.manager)==null||g.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{Oe(()=>{var h,g;(h=this.manager)==null||h.registry.unregister(this.droppable),(g=this.manager)==null||g.registry.unregister(this.draggable)})},this.destroy=()=>{Oe(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:o=()=>[],disabled:r,group:s,index:i,sensors:a,type:l,transition:c=f$,plugins:u}=n,d=qI(n,["effects","disabled","group","index","sensors","type","transition","plugins"]);let f=po(u,K0),p=U0(r);this.droppable=new dg(ig(sg({},d),{disabled:p.droppable}),t,this),this.draggable=new Q0(ig(sg({},d),{disabled:p.draggable,plugins:f,effects:()=>[()=>{var h,g,y;let m=(h=this.manager)==null?void 0:h.dragOperation.status;m?.initializing&&this.id===((y=(g=this.manager)==null?void 0:g.dragOperation.source)==null?void 0:y.id)&&ku.clear(this.manager),m?.dragging&&ku.set(this.manager,this.id,ie(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:h,group:g,manager:y}=this,m=ul(this,fl),_=ul(this,dl);(h!==m||g!==_)&&(us(this,fl,h),us(this,dl,g),this.animate())},()=>{var h,g;let{target:y}=this,{isDragSource:m}=this.draggable;((g=(h=this.draggable.pluginConfig(qh))==null?void 0:h.feedback)!=null?g:"default")==="move"&&m&&(this.droppable.disabled=!y)},...o()],type:l,sensors:a}),t,this),us(this,Ci,d.element),this.manager=t,this.index=i,us(this,fl,i),this.group=s,us(this,dl,s),this.type=l,this.transition=c}get initialIndex(){var e,t;return(t=(e=ku.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=ku.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){ie(()=>{let{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;let{idle:o}=e.dragOperation.status;!n||!t||o&&!t.idle||e.renderer.rendering.then(()=>{let{element:r}=this;if(!r)return;for(let u of r.getAnimations())"transitionProperty"in u&&(u.transitionProperty==="transform"||u.transitionProperty==="translate"||u.transitionProperty==="scale")&&u.cancel();let s=this.refreshShape();if(!s)return;let i={x:n.boundingRectangle.left-s.boundingRectangle.left,y:n.boundingRectangle.top-s.boundingRectangle.top},{translate:a}=An(r),l=wh(r,a,!1),c=wh(r,a);if(i.x||i.y){let u=Ya(Ht(r))?ig(sg({},t),{duration:0}):t;mu({element:r,keyframes:{translate:[`${l.x+i.x}px ${l.y+i.y}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:u}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){Oe(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){Oe(()=>{let t=ul(this,Ci),n=this.droppable.element,o=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!o||o===t)&&(this.draggable.element=e),us(this,Ci,e)})}get element(){var e,t;let n=ul(this,Ci);if(n)return(t=(e=Ga.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){let{disabled:e}=this.draggable,{disabled:t}=this.droppable;return e===t?e:{draggable:e,droppable:t}}set plugins(e){this.draggable.plugins=po(e,K0)}set disabled(e){let t=U0(e);Oe(()=>{this.droppable.disabled=t.droppable,this.draggable.disabled=t.draggable})}set data(e){Oe(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){this.droppable.id=e,this.draggable.id=e}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??yu}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Oe(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};ir=XI();cg=new WeakMap;dl=new WeakMap;fl=new WeakMap;ug=new WeakMap;Ci=new WeakMap;G0(ir,4,"index",J0,bi,cg);G0(ir,4,"group",X0,bi,ug);QI(ir,bi);var Q0=class extends cs{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},dg=class extends xi{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}};var go=(...e)=>e.filter(Boolean).join(" ");var p$={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},h$={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},g$=({variant:e="primary",size:t="md",className:n,children:o,...r})=>{let s=r.href?"a":"button";return E.createElement(s,{...r,className:go("ks-button",p$[e],h$[t],n)},o)},Re=g$;var jt=(e,t,n,o={})=>fetch(e,{method:n,headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-Token":t},body:JSON.stringify(o)}).then(r=>r.json().then(s=>r.ok?s:Promise.reject(s))),Z0=(e,t,n,o)=>jt(e,t,"POST",{key:n,column_id:o}),eC=(e,t,n)=>jt(e,t,"POST",{title:n}),tC=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{field:o,value:r}),nC=(e,t)=>jt(e,t,"POST",{}),oC=(e,t,n)=>jt(e,t,"POST",{row_id:n}),rC=(e,t,n)=>jt(e,t,"POST",{section_id:n}),fg=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{setting:o,value:r}),Iu=(e,t,n)=>jt(`${e}/${n}`,t,"DELETE"),pg=(e,t,n,o,r)=>jt(`${e}/${n}/move`,t,"POST",{into:o,position:r}),sC=(e,t,n)=>jt(`${e}/${n}/duplicate`,t,"POST"),iC=(e,t,n,o,r,s)=>jt(`${e}/${n}/bind`,t,"POST",{field:o,name:r,fallback:s}),aC=(e,t,n)=>jt(e,t,"POST",{choice:n}),lC=(e,t,n)=>jt(e,t,"POST",{access_exception:n}),cC=(e,t,n,o,r)=>jt(`${e}/${n}/condition`,t,"POST",{name:o,equals:r}),hg=(e,t)=>jt(e,t,"POST");var m$=({as:e="input",disabled:t,className:n,...o})=>E.createElement(e,{...o,disabled:t,className:go("ks-input",t&&"ks-input-disabled",n)}),_t=m$;var _$=e=>E.createElement(_t,{...e,as:"select"}),yt=_$;var y$=({type:e="info",title:t,message:n,onDismiss:o,className:r})=>E.createElement("div",{className:go("ks-alert",`ks-alert-${e}`,r),role:"alert"},E.createElement("div",{className:"ks-alert-body"},E.createElement("div",{className:"ks-alert-content"},t&&E.createElement("p",{className:"ks-alert-title"},t),E.createElement("p",{className:t?"ks-alert-message-titled":"ks-alert-message"},n)),o&&E.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:o},"\xD7"))),hl=y$;var $u=(e,t)=>({className:n,children:o,...r})=>E.createElement(e,{...r,className:go(t,n)},o),on=$u("label","ks-label"),W2=$u("p","ks-hint"),K2=$u("p","ks-error"),U2=$u("span","ks-required");var x$={section:{spacing:"Section spacing",background:"Section background",width:"Section width"},row:{gap:"Row gap"},column:{wide:"Width on wide screens",narrow:"Width on narrow screens",align:"Vertical alignment"}};function gg({node:e,values:t,arrangements:n,refusal:o,onAddColumn:r,onAddRow:s,onArrange:i,onSelect:a,onRemove:l}){let c=x$[e.kind],u=Object.keys(n[e.kind]).filter(d=>c[d]);return E.createElement("aside",{"data-layout-panel":!0,className:"flex flex-col gap-3"},o&&E.createElement("div",{"data-layout-refusal":!0},E.createElement(hl,{type:"error",message:o})),u.map(d=>E.createElement("div",{key:`${e.id}-${d}`,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-${d}`},c[d]),E.createElement(yt,{id:`ks-pages-${d}`,defaultValue:t[d]??"",onChange:f=>i(e.id,d,f.target.value)},n[e.kind][d].map(f=>E.createElement("option",{key:f,value:f},f))))),e.kind==="column"&&E.createElement(E.Fragment,null,E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>r(e.rowId)},"Add column"),E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>s(e.sectionId)},"Add row"),E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>a({kind:"row",id:e.rowId,sectionId:e.sectionId})},"Select row")),e.kind==="row"&&E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>a({kind:"section",id:e.sectionId})},"Select section"),E.createElement(Re,{type:"button",variant:"danger",onClick:()=>l(e.id)},"Remove ",e.kind))}var gl=[{key:"phone",label:"Phone",width:"390px"},{key:"tablet",label:"Tablet",width:"768px"},{key:"desktop",label:"Desktop",width:"100%"},{key:"print",label:"Print",width:"794px",theme:"light"}];function mg({chosen:e,onChoose:t}){return E.createElement("div",{"data-device-width":!0,role:"group","aria-label":"Preview width",className:"flex rounded-md border border-(--ks-color-border) dark:border-(--ks-color-border-dark) p-0.5"},gl.map(n=>E.createElement("button",{key:n.key,type:"button","aria-pressed":e===n.key,onClick:()=>t(n.key),className:"rounded px-3 py-1 text-sm aria-pressed:bg-(--ks-color-accent) aria-pressed:text-white"},n.label)))}var v$=zr(function({place:t,onDuplicate:n,onRemove:o},r){return E.createElement("div",{"data-selection-toolbar":!0,hidden:!t,style:t??{},className:"absolute z-20 flex -translate-y-full overflow-hidden rounded-t-md bg-(--ks-color-accent) text-xs text-white shadow"},E.createElement("button",{ref:r,type:"button","data-move-handle":!0,className:"cursor-grab px-2 py-1 hover:bg-black/20"},"Move"),E.createElement("button",{type:"button",onClick:n,className:"px-2 py-1 hover:bg-black/20"},"Duplicate"),E.createElement("button",{type:"button",onClick:o,className:"px-2 py-1 hover:bg-black/20"},"Remove"))}),uC=v$;var dC={cursor:"M5 3l14 8-6 2-2 6z",tag:"M3 7v6l8 8 8-8-8-8H5a2 2 0 0 0-2 2zM7.5 7.5h.01",copy:"M8 8h11v11H8zM5 16V5h11",heading:"M6 4v16M18 4v16M6 12h12",text:"M4 6h16M4 12h16M4 18h10",list:"M4 6h4M12 6h8M4 12h4M12 12h8M4 18h4M12 18h8",info:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01",code:"M8 6l-6 6 6 6M16 6l6 6-6 6",alert:"M12 3l10 18H2zM12 10v4M12 17h.01",card:"M3 5h18v14H3zM3 10h18",megaphone:"M3 11v2l13 5V6zM16 9a3 3 0 0 1 0 6M6 14l1 5h3l-1-4",chart:"M4 20V10M10 20V4M16 20v-7M22 20H2",bars:"M3 21h18M6 17v-6h3v6M11 17V7h3v10M16 17v-4h3v4",number:"M10 3L8 21M16 3l-2 18M4 9h17M3 15h17",progress:"M3 12h18M3 12h10",box:"M3 3h18v18H3z"},S$=e=>{let t=new Map;return e.forEach(n=>{let o=n.group??"Other";t.set(o,[...t.get(o)??[],n])}),[...t]},C$=({element:e,shown:t})=>E.createElement("button",{type:"button","data-element-key":e.key,hidden:!t,className:"flex cursor-grab items-center gap-3 rounded-md border border-(--ks-color-border) bg-(--ks-color-surface) px-3 py-2 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark) text-left text-sm hover:border-(--ks-color-accent) dark:bg-transparent"},E.createElement("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"size-5 shrink-0 fill-none stroke-current stroke-2 text-(--ks-color-icon)",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("path",{d:dC[e.icon]??dC.box})),E.createElement("span",null,e.name)),b$=zr(function({elements:t,children:n},o){let[r,s]=Ie(""),i=a=>a.name.toLowerCase().includes(r.trim().toLowerCase());return E.createElement("aside",{ref:o,"data-element-palette":!0,className:"flex w-64 shrink-0 flex-col gap-5 overflow-y-auto border-r border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement(_t,{type:"search","aria-label":"Search elements",placeholder:"Search elements",value:r,onChange:a=>s(a.target.value)}),S$(t).map(([a,l])=>E.createElement("section",{key:a,"data-element-group":a,hidden:!l.some(i),className:"flex flex-col gap-2"},E.createElement("h2",{className:"text-xs font-semibold uppercase tracking-wide text-(--ks-color-icon)"},a),l.map(c=>E.createElement(C$,{key:c.key,element:c,shown:i(c)})))),n)}),fC=b$;function Ru({sequence:e}){return E.createElement("aside",{"data-sequence-pages":!0,className:"flex w-56 shrink-0 flex-col gap-3 overflow-y-auto border-r border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement("h2",{className:"text-sm font-semibold"},e.title),e.notice&&E.createElement(hl,{type:"success",message:e.notice}),e.refusal&&E.createElement(hl,{type:"error",message:e.refusal}),E.createElement("ol",{className:"flex flex-col gap-1"},e.pages.map((t,n)=>E.createElement("li",{key:t.id,"data-sequence-page":!0,"aria-current":t.current?"page":void 0,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm aria-[current=page]:bg-(--ks-color-accent)/10 aria-[current=page]:font-semibold"},E.createElement("span",{className:"text-(--ks-color-icon)"},n+1)," ",E.createElement("a",{href:t.url,className:"truncate hover:underline"},t.name),t.remove_url&&E.createElement("a",{href:t.remove_url,"aria-label":`Remove ${t.name}`,className:"ml-auto text-xs text-(--ks-color-icon) hover:underline"},"Remove")))),E.createElement(Re,{href:e.add_page_url,size:"sm",variant:"secondary"},"Add page"),e.publish_url&&E.createElement("form",{method:"post",action:e.publish_url,className:"flex flex-col"},E.createElement("input",{type:"hidden",name:"authenticity_token",value:e.token}),E.createElement(Re,{type:"submit",size:"sm"},"Publish")))}function _g({path:e,onChoose:t}){return e.length===0?null:E.createElement("nav",{"data-selection-path":!0,"aria-label":"Selection",className:"mb-4 flex flex-wrap items-center gap-1 text-xs"},e.map((n,o)=>E.createElement(E.Fragment,{key:n.id},o>0&&E.createElement("span",{"aria-hidden":"true",className:"text-(--ks-color-icon)"},"\u203A"),E.createElement("button",{type:"button","aria-current":o===e.length-1?"true":void 0,onClick:()=>t(n),className:"rounded px-1.5 py-0.5 hover:bg-(--ks-color-fill-muted) aria-[current=true]:font-semibold"},n.label))))}function yg({samples:e,chosen:t,onChoose:n}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",{className:"whitespace-nowrap"},"Preview with"),E.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},e.map(([o,r])=>E.createElement("option",{key:r,value:r},o))))}function xg({title:e,onChange:t}){let n=e??"";return E.createElement("div",{className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:"ks-pages-page-title"},"Page title"),E.createElement(_t,{id:"ks-pages-page-title",type:"text",defaultValue:n,onBlur:o=>o.target.value!==n&&t(o.target.value)}),E.createElement("p",{className:"ks-hint"},"Shown in the browser tab once the page is published"))}function vg({exceptions:e,chosen:t,onChoose:n}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",{className:"whitespace-nowrap"},"Access exception"),E.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},E.createElement("option",{value:""},"None"),e.map(([o,r])=>E.createElement("option",{key:r,value:r},o))))}function Sg({condition:e,valueNames:t,onChange:n}){let[o,r]=Ie(e?.value??""),[s,i]=Ie(e?.equals??""),a=Object.entries(t??{});if(a.length===0)return null;let l=c=>{r(c),(c===""||s!=="")&&n(c,s)};return E.createElement("div",{"data-show-when":!0,className:"mt-4 flex flex-col gap-2 border-t border-(--ks-color-border) pt-4 dark:border-(--ks-color-border-dark)"},E.createElement(on,{htmlFor:"ks-pages-show-when-value"},"Show only when"),E.createElement(yt,{id:"ks-pages-show-when-value",value:o,onChange:c=>l(c.target.value)},E.createElement("option",{value:""},"Always shown"),a.map(([c,u])=>E.createElement("option",{key:c,value:c},u))),o!==""&&E.createElement(E.Fragment,null,E.createElement(on,{htmlFor:"ks-pages-show-when-equals"},"equals"),E.createElement(_t,{id:"ks-pages-show-when-equals",type:"text",defaultValue:s,onBlur:c=>{i(c.target.value),c.target.value!==e?.equals&&n(o,c.target.value)}})))}var pC=[["light","Light"],["dark","Dark"],["system","System"]],E$=e=>{e==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e};function Cg(){let e=document.documentElement.dataset.theme??"system",t=e==="custom"?[...pC,["custom","Custom"]]:pC;return E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",null,"Mode"),E.createElement(yt,{"data-theme-mode":!0,defaultValue:e,onChange:n=>E$(n.target.value),className:"py-1"},t.map(([n,o])=>E.createElement("option",{key:n,value:n},o))))}var N$=e=>e.replace(/_/g," ").replace(/^./,t=>t.toUpperCase());function bg({looks:e}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",null,"Look"),E.createElement(yt,{"data-look-choice":!0,defaultValue:document.documentElement.dataset.look,onChange:t=>{document.documentElement.dataset.look=t.target.value},className:"py-1"},e.map(t=>E.createElement("option",{key:t,value:t},N$(t)))))}var T$=e=>E.createElement(_t,{...e,as:"textarea"}),hC=T$;var O$=({className:e,...t})=>E.createElement("input",{type:"checkbox",...t,className:go("ks-checkbox",e)}),Pu=O$;var gC=(e,t,n)=>{let o=[...e];return[o[t],o[n]]=[o[n],o[t]],o};function Eg({field:e,entries:t,onChange:n}){let o=(e.entry??[]).filter(s=>!s.hidden),r=s=>n(e.key,s);return E.createElement("div",{"data-list-field":e.key,className:"flex flex-col gap-2"},t.map((s,i)=>E.createElement("fieldset",{key:`${i}-${JSON.stringify(s)}`,"data-list-entry":!0,className:"flex flex-col gap-2 rounded-md border border-(--ks-color-border) dark:border-(--ks-color-border-dark) p-2"},o.map(a=>E.createElement("div",{key:a.key,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-${e.key}-${i}-${a.key}`},a.label),a.kind==="one_of"&&E.createElement(yt,{id:`ks-pages-${e.key}-${i}-${a.key}`,defaultValue:s[a.key]??a.default??"",onChange:l=>r(t.map((c,u)=>u===i?{...c,[a.key]:l.target.value}:c))},E.createElement("option",{value:""}),a.options.map(l=>E.createElement("option",{key:l,value:l},l))),a.kind!=="one_of"&&(a.kind==="yes_or_no"?E.createElement(Pu,{id:`ks-pages-${e.key}-${i}-${a.key}`,className:"self-start",defaultChecked:s[a.key]==="true",onChange:l=>r(t.map((c,u)=>u===i?{...c,[a.key]:String(l.target.checked)}:c))}):E.createElement(_t,{id:`ks-pages-${e.key}-${i}-${a.key}`,type:"text",defaultValue:s[a.key]??a.default??"",onBlur:l=>l.target.value!==(s[a.key]??a.default??"")&&r(t.map((c,u)=>u===i?{...c,[a.key]:l.target.value}:c))})))),E.createElement("div",{className:"flex flex-wrap gap-2"},E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:i===0,onClick:()=>r(gC(t,i,i-1))},"Move up"),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:i===t.length-1,onClick:()=>r(gC(t,i,i+1))},"Move down"),E.createElement(Re,{type:"button",size:"sm",variant:"danger",onClick:()=>r(t.filter((a,l)=>l!==i))},"Remove item")))),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",onClick:()=>r([...t,{}])},"Add item"))}var Ng={};de(Ng,{LexicalComposerContext:()=>mC,createLexicalComposerContext:()=>D$,useLexicalComposerContext:()=>w$});var mC=ev(null);function D$(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n!=null?n.getTheme():null)}}}function w$(){let e=nv(mC);return e==null&&(function(t,...n){throw(function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let a of r)i.append("v",a);return s.search=i.toString(),new Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(t,...n)})(8),e}var Tg=Ng,_C=Tg.LexicalComposerContext,yC=Tg.createLexicalComposerContext,Yt=Tg.useLexicalComposerContext;var w_={};de(w_,{$addUpdateTag:()=>Es,$applyNodeReplacement:()=>Gi,$assumeActiveEditor:()=>d1,$caretFromPoint:()=>$o,$caretRangeFromSelection:()=>xd,$cloneWithProperties:()=>S_,$cloneWithPropertiesEphemeral:()=>lP,$comparePointCaretNext:()=>Xl,$copyNode:()=>y_,$create:()=>sT,$createChildrenArray:()=>Yl,$createLineBreakNode:()=>Pd,$createNodeSelection:()=>n_,$createParagraphNode:()=>qt,$createPoint:()=>no,$createRangeSelection:()=>iN,$createRangeSelectionFromDom:()=>a1,$createTabNode:()=>GE,$createTextNode:()=>rn,$exportNodeJSON:()=>Vb,$extendCaretToRange:()=>E_,$findMatchingParent:()=>cr,$flushSyncAfterUpdate:()=>p1,$formatText:()=>JE,$fullReconcile:()=>uN,$generateNodesFromRawText:()=>o_,$getAdjacentChildCaret:()=>Vi,$getAdjacentNode:()=>PN,$getAdjacentSiblingOrParentSiblingCaret:()=>C1,$getCaretInDirection:()=>Wn,$getCaretRange:()=>br,$getCaretRangeInDirection:()=>Ld,$getCharacterOffsets:()=>vm,$getChildCaret:()=>zn,$getChildCaretAtIndex:()=>SN,$getChildCaretOrSelf:()=>hT,$getCollapsedCaretRange:()=>gT,$getCommonAncestor:()=>O_,$getCommonAncestorResultBranchOrder:()=>T_,$getDOMSlot:()=>Jt,$getDOMTextNode:()=>Po,$getDocument:()=>Xt,$getEditor:()=>vo,$getEditorDOMRenderConfig:()=>Kd,$getNearestNodeFromDOMNode:()=>u_,$getNearestRootOrShadowRoot:()=>m_,$getNodeByKey:()=>Ee,$getNodeByKeyOrThrow:()=>zN,$getNodeFromDOMNode:()=>c_,$getPreviousSelection:()=>Ts,$getRoot:()=>Lt,$getSelection:()=>ce,$getSelectionSlotFrame:()=>cT,$getSiblingCaret:()=>Xe,$getSlot:()=>Ns,$getSlotFrame:()=>Gl,$getSlotHost:()=>gn,$getSlotNameWithinHost:()=>lT,$getSlotNames:()=>yo,$getState:()=>rd,$getStateChange:()=>cR,$getTextContent:()=>c1,$getTextNodeOffset:()=>to,$getTextPointCaret:()=>Cr,$getTextPointCaretSlice:()=>wm,$getWritableNodeState:()=>Wm,$hasAncestor:()=>Vl,$hasUpdateTag:()=>X1,$insertNodeToNearestRootAtCaret:()=>bN,$insertNodes:()=>l1,$isBlockElementNode:()=>rN,$isBlockFullySelected:()=>s_,$isChildCaret:()=>Bn,$isCompactExport:()=>Hb,$isDecoratorNode:()=>he,$isEditorState:()=>v1,$isElementDOMSlot:()=>JN,$isElementNode:()=>k,$isExtendableTextPointCaret:()=>vN,$isInlineElementOrDecoratorNode:()=>BN,$isInlineFormattable:()=>dd,$isLeafNode:()=>U1,$isLexicalNode:()=>Zm,$isLineBreakNode:()=>pn,$isNodeCaret:()=>TP,$isNodeSelection:()=>ji,$isParagraphNode:()=>EN,$isRangeSelection:()=>K,$isRootNode:()=>qe,$isRootOrShadowRoot:()=>We,$isSelectionCapturedInDecoratorInput:()=>Bd,$isShadowRootNode:()=>__,$isSiblingCaret:()=>Sr,$isSlotChild:()=>vr,$isSlotHost:()=>mr,$isTabNode:()=>t_,$isTextNode:()=>R,$isTextPointCaret:()=>eo,$isTextPointCaretSlice:()=>MP,$isTokenOrSegmented:()=>Fn,$isTokenOrTab:()=>Ul,$markSlotEditable:()=>nT,$needsBlockCursorBeside:()=>Cd,$nodesOfType:()=>G1,$normalizeCaret:()=>hn,$normalizeSelection__EXPERIMENTAL:()=>Km,$onUpdate:()=>FN,$parseSerializedNode:()=>f1,$removeFromParent:()=>Zn,$removeSlot:()=>bP,$removeTextFromCaretRange:()=>xN,$rewindSiblingCaret:()=>Os,$selectAll:()=>Y1,$setCompositionKey:()=>ft,$setDirectionFromDOM:()=>ZN,$setFormatFromDOM:()=>eT,$setPointFromCaret:()=>bs,$setSelection:()=>Pt,$setSelectionFromCaretRange:()=>yN,$setSlot:()=>fT,$setState:()=>nE,$setTextFormat:()=>r1,$splitAtPointCaretNext:()=>CN,$splitNode:()=>Z1,$updateDOMSelection:()=>aN,$updateRangeSelectionFromCaretRange:()=>Nl,$withCompactExport:()=>Ub,ArtificialNode__DO_NOT_USE:()=>_d,BEFORE_INPUT_COMMAND:()=>Um,BLUR_COMMAND:()=>ME,CAN_REDO_COMMAND:()=>bR,CAN_UNDO_COMMAND:()=>ER,CAN_USE_BEFORE_INPUT:()=>Tl,CAN_USE_DOM:()=>Er,CLEAR_EDITOR_COMMAND:()=>SR,CLEAR_HISTORY_COMMAND:()=>CR,CLICK_COMMAND:()=>hE,COLLABORATION_TAG:()=>zE,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>P1,COMMAND_PRIORITY_BEFORE_EDITOR:()=>A1,COMMAND_PRIORITY_BEFORE_HIGH:()=>R1,COMMAND_PRIORITY_BEFORE_LOW:()=>I1,COMMAND_PRIORITY_BEFORE_NORMAL:()=>$1,COMMAND_PRIORITY_CRITICAL:()=>k1,COMMAND_PRIORITY_EDITOR:()=>O1,COMMAND_PRIORITY_HIGH:()=>M1,COMMAND_PRIORITY_LOW:()=>D1,COMMAND_PRIORITY_NORMAL:()=>w1,COMPOSITION_END_COMMAND:()=>jm,COMPOSITION_END_TAG:()=>ud,COMPOSITION_START_COMMAND:()=>Vm,COMPOSITION_START_TAG:()=>UE,CONTROLLED_TEXT_INSERTION_COMMAND:()=>Ti,CONTROL_OR_ALT:()=>pm,CONTROL_OR_META:()=>lr,CONTROL_OR_OTHER_KEY:()=>Rm,COPY_COMMAND:()=>Xm,CUT_COMMAND:()=>Jm,CUT_TAG:()=>WR,DEFAULT_EDITOR_DOM_CONFIG:()=>Kl,DELETE_CHARACTER_COMMAND:()=>Rl,DELETE_LINE_COMMAND:()=>Oi,DELETE_WORD_COMMAND:()=>Pl,DRAGEND_COMMAND:()=>OE,DRAGOVER_COMMAND:()=>TE,DRAGSTART_COMMAND:()=>NE,DROP_COMMAND:()=>EE,DecoratorNode:()=>zl,ElementNode:()=>oo,FOCUS_COMMAND:()=>wE,FORMAT_ELEMENT_COMMAND:()=>vR,FORMAT_TEXT_COMMAND:()=>fr,HISTORIC_TAG:()=>FR,HISTORY_MERGE_TAG:()=>qu,HISTORY_PUSH_TAG:()=>BR,INDENT_CONTENT_COMMAND:()=>yR,INPUT_COMMAND:()=>Hm,INSERT_LINE_BREAK_COMMAND:()=>bl,INSERT_PARAGRAPH_COMMAND:()=>um,INSERT_TAB_COMMAND:()=>_R,INTERNAL_$expandSelectionToWholeDocument:()=>Xu,INTERNAL_$isBlock:()=>Rt,IS_ALL_FORMATTING:()=>Ib,IS_ANDROID:()=>Am,IS_ANDROID_CHROME:()=>Ol,IS_APPLE:()=>Lo,IS_APPLE_WEBKIT:()=>Zl,IS_BOLD:()=>P$,IS_CHROME:()=>Od,IS_CODE:()=>z$,IS_FIREFOX:()=>xo,IS_HIGHLIGHT:()=>U$,IS_IOS:()=>ro,IS_ITALIC:()=>L$,IS_SAFARI:()=>Ql,IS_STRIKETHROUGH:()=>F$,IS_SUBSCRIPT:()=>W$,IS_SUPERSCRIPT:()=>K$,IS_UNDERLINE:()=>B$,KEY_ARROW_DOWN_COMMAND:()=>yE,KEY_ARROW_LEFT_COMMAND:()=>mE,KEY_ARROW_RIGHT_COMMAND:()=>gE,KEY_ARROW_UP_COMMAND:()=>_E,KEY_BACKSPACE_COMMAND:()=>vE,KEY_DELETE_COMMAND:()=>CE,KEY_DOWN_COMMAND:()=>Gm,KEY_ENTER_COMMAND:()=>qm,KEY_ESCAPE_COMMAND:()=>SE,KEY_MODIFIER_COMMAND:()=>kE,KEY_SPACE_COMMAND:()=>xE,KEY_TAB_COMMAND:()=>bE,LineBreakNode:()=>Fi,MOVE_TO_END:()=>dm,MOVE_TO_START:()=>fm,NODE_STATE_DIRECT:()=>Zg,NODE_STATE_KEY:()=>Dd,NODE_STATE_LATEST:()=>em,OUTDENT_CONTENT_COMMAND:()=>xR,PASTE_COMMAND:()=>Ym,PASTE_TAG:()=>zR,ParagraphNode:()=>Bi,REDO_COMMAND:()=>Ll,REMOVE_TEXT_COMMAND:()=>Vu,RootNode:()=>Li,SELECTION_CHANGE_COMMAND:()=>Rd,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>gR,SELECT_ALL_COMMAND:()=>DE,SET_TEXT_FORMAT_COMMAND:()=>mR,SKIP_COLLAB_TAG:()=>KR,SKIP_DOM_SELECTION_TAG:()=>KE,SKIP_SCROLL_INTO_VIEW_TAG:()=>WE,SKIP_SELECTION_FOCUS_TAG:()=>cd,TEXT_TYPE_TO_FORMAT:()=>xt,TabNode:()=>Ri,TextNode:()=>_r,UNDO_COMMAND:()=>id,addClassNamesToElement:()=>PP,aliasTableOf:()=>od,aliasedValue:()=>Qg,arrayValue:()=>iR,booleanValue:()=>eR,buildImportMap:()=>LR,compileKeyboardShortcuts:()=>IE,configExtension:()=>AP,createCommand:()=>j,createEditor:()=>L1,createRefCountedRegistry:()=>$E,createSharedNodeState:()=>oE,createState:()=>lR,declarePeerDependency:()=>IP,declaredAccepts:()=>Bm,defineExtension:()=>kP,enumValue:()=>kl,findAllLexicalElementsDeep:()=>UN,flipDirection:()=>Wo,getActiveElement:()=>Ed,getActiveElementDeep:()=>zi,getComposedEventTarget:()=>x_,getComposedSchemaFields:()=>dP,getComposedStaticRange:()=>qi,getDOMOwnerDocument:()=>Wd,getDOMSelection:()=>Un,getDOMSelectionFromTarget:()=>WN,getDOMSelectionPoints:()=>sn,getDOMSelectionRange:()=>VN,getDOMSelectionRangeAndPoints:()=>Q1,getDOMShadowRoots:()=>KN,getDOMTextNode:()=>DN,getDeclaredSlots:()=>uT,getEditorPropertyFromDOMNode:()=>nc,getNearestEditorFromDOMNode:()=>gr,getParentElement:()=>Ro,getRegisteredNode:()=>Fd,getRegisteredNodeOrThrow:()=>l_,getRegisteredSubtypeMap:()=>vP,getRootOwnerDocument:()=>HN,getStaticNodeConfig:()=>oc,getStyleObjectFromCSS:()=>_m,getTextDirection:()=>K1,getTransformSetFromKlass:()=>TN,getterTableOf:()=>ec,isBlockDomNode:()=>v_,isCurrentlyReadOnlyMode:()=>yr,isDOMCapturingSelection:()=>jl,isDOMDocumentNode:()=>Yi,isDOMNode:()=>Xi,isDOMShadowRoot:()=>Bo,isDOMTextNode:()=>_n,isDOMUnmanaged:()=>C_,isDocumentFragment:()=>qN,isExactShortcutMatch:()=>j1,isHTMLAnchorElement:()=>eP,isHTMLElement:()=>we,isHTMLTableCellElement:()=>nP,isHTMLTableRowElement:()=>tP,isInlineDomNode:()=>XN,isLastChildInBlockNode:()=>_N,isLexicalEditor:()=>zd,isModifierMatch:()=>RN,isOnlyChildInBlockNode:()=>mN,isSchemaField:()=>Fo,isSelectionCapturedInDecoratorInput:()=>W1,isSelectionWithinEditor:()=>tc,iterStaticNodeConfigChain:()=>zo,keyboardEventMaskForPlatform:()=>V1,makeStepwiseIterator:()=>N_,mergeRegister:()=>D_,mountSlotContainer:()=>sP,nodeSchema:()=>Id,normalizeClassNames:()=>rc,nullable:()=>tR,numberValue:()=>Ii,objectValue:()=>aR,optional:()=>nR,rawValue:()=>sR,registerEventListener:()=>Qm,registerEventListeners:()=>FP,removeClassNamesFromElement:()=>LP,removeFromParent:()=>H1,resetRandomKey:()=>B1,safeCast:()=>$P,setDOMStyleFromCSS:()=>ym,setDOMStyleObject:()=>XR,setDOMUnmanaged:()=>tT,setNodeIndentFromDOM:()=>QN,setterDefaultOf:()=>kd,setterTableOf:()=>Md,shallowMergeConfig:()=>RP,stopLexicalPropagation:()=>gm,stringValue:()=>Ml,toggleTextFormatType:()=>xr,tokenizeRawText:()=>lN,transformValue:()=>rR,unionValue:()=>oR,unmountSlotContainer:()=>iP,withAccessors:()=>Ni,withField:()=>Io});function Gg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);return n.search=o.toString(),new 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 M(e,...t){throw Gg(e,...t)}function km(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);n.search=o.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 M$(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}var Er=M$();function k$(){return Er&&"documentMode"in document?document.documentMode:null}var A$=k$();function I$(e){return Er&&e.test(navigator.platform)}function Jl(e){return Er&&e.test(navigator.userAgent)}var Lo=I$(/Mac|iPod|iPhone|iPad/),xo=Jl(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function $$(){return!(!Er||!("InputEvent"in window)||A$)&&"getTargetRanges"in new window.InputEvent("input")}var Tl=$$();function R$(){return Er&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var ro=R$(),Am=Jl(/Android/),Ql=Jl(/Version\/[\d.]+.*Safari/)&&!Am,Od=Jl(/^(?=.*Chrome).*/i),Ol=Er&&Am&&Od,Zl=Jl(/AppleWebKit\/[\d.]+/)&&Lo&&!Od,P$=1,L$=2,F$=4,B$=8,z$=16,W$=32,K$=64,U$=128;function H$(){return 2047}var Ib=H$(),Dl=Ql||ro||Zl?"\xA0":"\u200B",_s=`
67
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function SI(e,t="hidden"){return ie(()=>{let{element:n,manager:o}=e;if(!n||!o)return;let r=CI(n,o.registry.droppables),s=[],i=LS(n),{remove:a}=i;return bI(r,i,s),EI(i,t),i.remove=()=>{s.forEach(l=>l()),a.call(i)},i})}function CI(e,t){let n=new Map;for(let o of t)if(o.element&&(e===o.element||e.contains(o.element))){let r=`${al}${_u("dom-id")}`;o.element.setAttribute(r,""),n.set(o,r)}return n}function bI(e,t,n){for(let[o,r]of e){if(!o.element)continue;let s=`[${r}]`,i=t.matches(s)?t:t.querySelector(s);if(o.element.removeAttribute(r),!i)continue;let a=o.element;o.proxy=i,i.removeAttribute(r),Ga.set(a,i),n.push(()=>{Ga.delete(a),o.proxy=void 0})}}function EI(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(bu,t)}function x0(e,t){return e===t?!0:Zr(e)===Zr(t)}function e0(e){let{target:t}=e;"newState"in e&&e.newState==="closed"&&er(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>ns(t))}function Ph(e){return e.tagName==="TR"}function NI(e,t,n){let o=new MutationObserver(r=>{let s=!1;for(let i of r){if(i.target!==e){s=!0;continue}if(i.type!=="attributes")continue;let a=i.attributeName;if(a.startsWith("aria-")||yI.includes(a))continue;let l=e.getAttribute(a);if(a==="style"){if(ii(e)&&ii(t)){let c=e.style;for(let u of Array.from(t.style))c.getPropertyValue(u)===""&&t.style.removeProperty(u);for(let u of Array.from(c)){if(xI.includes(u)||u.startsWith(bt))continue;let d=c.getPropertyValue(u);t.style.setProperty(u,d)}}}else l!==null?t.setAttribute(a,l):t.removeAttribute(a)}s&&n&&t.replaceChildren(...e.cloneNode(!0).childNodes)});return o.observe(e,{attributes:!0,subtree:!0,childList:!0}),o}function TI(e,t,n){let o=new MutationObserver(r=>{for(let s of r)if(s.addedNodes.length!==0)for(let i of Array.from(s.addedNodes)){if(i.contains(e)&&e.nextElementSibling!==t){e.insertAdjacentElement("afterend",t),ns(n);return}if(i.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement("beforebegin",e),ns(n);return}}e.isConnected&&t.isConnected&&e.nextElementSibling!==t&&(e.insertAdjacentElement("afterend",t),ns(n))});return o.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),o}function OI(e){return new ResizeObserver(()=>{var t,n,o;let r=new In(e.placeholder,{frameTransform:e.frameTransform,ignoreTransforms:!0}),s=(t=e.transformOrigin)!=null?t:{x:1,y:1},i=(e.width-r.width)*s.x+e.delta.x,a=(e.height-r.height)*s.y+e.delta.y,l=Nh();if(e.styles.set({width:r.width-e.widthOffset,height:r.height-e.heightOffset,top:e.top+a+l.y,left:e.left+i+l.x},bt),(n=e.getElementMutationObserver())==null||n.takeRecords(),Ph(e.element)&&Ph(e.placeholder)){let g=Array.from(e.element.cells),y=Array.from(e.placeholder.cells);e.getSavedCellWidths()||e.setSavedCellWidths(g.map(m=>m.style.width));for(let[m,_]of g.entries()){let x=y[m];_.style.width=`${x.getBoundingClientRect().width}px`}}let c=(o=e.getTranslate())!=null?o:{x:0,y:0},u=e.left+i+l.x+c.x,d=e.top+a+l.y+c.y,f=r.width-e.widthOffset,p=r.height-e.heightOffset,h=e.frameTransform;e.dragOperation.shape=new tn(u*h.scaleX+h.x,d*h.scaleY+h.y,f*h.scaleX,p*h.scaleY)})}var DI=250,wI="ease";function MI(e){var t,n,o,r;let{animation:s}=e;if(typeof s=="function"){let _=s({source:e.source,element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});Promise.resolve(_).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)});return}let{duration:i=DI,easing:a=wI}=s??{};ns(e.feedbackElement);let[,l]=(t=bh(e.feedbackElement,_=>"translate"in _))!=null?t:[];l?.pause();let c=(n=e.placeholder)!=null?n:e.element,u={frameTransform:x0(e.feedbackElement,c)?null:void 0},d=new In(e.feedbackElement,u),f=(o=li(An(e.feedbackElement).translate))!=null?o:e.translate,p=new In(c,u),h=tn.delta(d,p,e.alignment),g={x:f.x-h.x,y:f.y-h.y},y=Math.round(d.intrinsicHeight)!==Math.round(p.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${p.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${p.intrinsicHeight}px`]}:{},m=Math.round(d.intrinsicWidth)!==Math.round(p.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${p.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${p.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},bt),e.feedbackElement.setAttribute(Rh,""),(r=e.getElementMutationObserver())==null||r.takeRecords(),mu({element:e.feedbackElement,keyframes:Vh(ol(ol({},y),m),{translate:[`${f.x}px ${f.y}px 0`,`${g.x}px ${g.y}px 0`]}),options:{duration:Ya(Ht(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?i:0,easing:a}}).then(()=>{e.feedbackElement.removeAttribute(Rh),l?.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}var v0,Lh,rl,Gh,vu,S0,C0,gi=class extends(Lh=mt,v0=[fe],Lh){constructor(t,n){super(t,n),nt(this,vu),nt(this,Gh,ut(rl,8,this)),ut(rl,11,this),this.state={initial:{},current:{}};let o=t.registry.plugins.get(Tu),r=o?.register(vI);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}this.registerEffect(as(this,vu,S0).bind(this,o)),this.registerEffect(as(this,vu,C0))}};rl=_i(Lh);Gh=new WeakMap;vu=new WeakSet;S0=function(e){let{overlay:t}=this;if(!t||!e)return;let n=ja(t);if(n)return e.addRoot(n)};C0=function(){var e,t,n,o,r,s,i;let{state:a,manager:l,options:c}=this,{dragOperation:u}=l,{position:d,source:f,status:p}=u;if(p.idle){a.current={},a.initial={};return}if(!f)return;let{element:h}=f,g=f.pluginConfig(gi),y=(t=(e=g?.feedback)!=null?e:c?.feedback)!=null?t:"default",m=typeof y=="function"?y(f,l):y;if(!h||m==="none"||!p.initialized||p.initializing)return;let{initial:_}=a,x=(n=this.overlay)!=null?n:h,v=os(x),S=os(h),b=!x0(h,x),N=new In(h,{frameTransform:b?S:null,ignoreTransforms:!b}),D={x:S.scaleX/v.scaleX,y:S.scaleY/v.scaleY},{width:O,height:T,top:A,left:$}=N;b&&(O=O/D.x,T=T/D.y);let I=new GS(x),L=An(h),{transition:P,translate:Y,boxSizing:Q,paddingBlockStart:ee,paddingBlockEnd:Z,paddingInlineStart:ne,paddingInlineEnd:ae,borderInlineStartWidth:xe,borderInlineEndWidth:ue,borderBlockStartWidth:q,borderBlockEndWidth:le}=L,Fe=P.split(",").filter(Ce=>!/^\s*(transform|translate|scale)\b/.test(Ce)).join(","),Te=Xa(L),Ot=L.transform,Dt=m==="clone",Ze=Q==="content-box",Hs=Ze?parseInt(ne)+parseInt(ae)+parseInt(xe)+parseInt(ue):0,bo=Ze?parseInt(ee)+parseInt(Z)+parseInt(q)+parseInt(le):0,lt=m!=="move"&&!this.overlay?SI(f,Dt?"clone":"hidden"):null,Go=ie(()=>rs(l.dragOperation.activatorEvent));if(!_.translate){if(this.overlay&&Te)_.translate={x:Te.x,y:Te.y};else if(Y!=="none"){let Ce=li(Y);Ce&&(_.translate=Ce)}}if(!_.transformOrigin){let Ce=ie(()=>d.current),rt=$+((o=Te?.x)!=null?o:0),cn=A+((r=Te?.y)!=null?r:0);_.transformOrigin={x:(Ce.x-rt*v.scaleX-v.x)/(O*v.scaleX),y:(Ce.y-cn*v.scaleY-v.y)/(T*v.scaleY)}}let{transformOrigin:_e}=_,Be=A*v.scaleY+v.y,pt=$*v.scaleX+v.x;if(!_.coordinates&&(_.coordinates={x:pt,y:Be},D.x!==1||D.y!==1)){let{scaleX:Ce,scaleY:rt}=S,{x:cn,y:qo}=_e;_.coordinates.x+=(O*Ce-O)*cn,_.coordinates.y+=(T*rt-T)*qo}_.dimensions||(_.dimensions={width:O,height:T}),_.frameTransform||(_.frameTransform=v);let en={x:_.coordinates.x-pt,y:_.coordinates.y-Be},Gn={width:(_.dimensions.width*_.frameTransform.scaleX-O*v.scaleX)*_e.x,height:(_.dimensions.height*_.frameTransform.scaleY-T*v.scaleY)*_e.y},Wt={x:en.x/v.scaleX+Gn.width,y:en.y/v.scaleY+Gn.height},Ke={left:$+Wt.x,top:A+Wt.y};x.setAttribute(go,"true");let wt=ie(()=>u.transform),Ic=(s=_.translate)!=null?s:{x:0,y:0},mp=wt.x*v.scaleX+Ic.x,_p=wt.y*v.scaleY+Ic.y,Tn=Nh();I.set({width:O-Hs,height:T-bo,top:Ke.top+Tn.y,left:Ke.left+Tn.x,translate:`${mp}px ${_p}px 0`,transform:this.overlay?"none":Ot,transition:Fe?`${Fe}, translate 0ms linear`:"translate 0ms linear",scale:b?`${D.x} ${D.y}`:"","transform-origin":`${_e.x*100}% ${_e.y*100}%`},bt),lt&&(h.insertAdjacentElement("afterend",lt),c?.rootElement&&(typeof c.rootElement=="function"?c.rootElement(f):c.rootElement).appendChild(h)),pu(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),ns(x),x.addEventListener("beforetoggle",e0));let On,ba,Br,ln=OI({placeholder:lt,element:h,feedbackElement:x,frameTransform:v,transformOrigin:_e,width:O,height:T,top:A,left:$,widthOffset:Hs,heightOffset:bo,delta:Wt,styles:I,dragOperation:u,getTranslate:()=>a.current.translate,getElementMutationObserver:()=>On,getSavedCellWidths:()=>Br,setSavedCellWidths:Ce=>{Br=Ce}}),$c=new In(x);ie(()=>u.shape=$c);let Ea=Ht(x),B=Ce=>{this.manager.actions.stop({event:Ce})},X=Ya(Ea);Go&&Ea.addEventListener("resize",B),ie(()=>f.status)==="idle"&&requestAnimationFrame(()=>f.status="dragging"),lt&&(ln.observe(lt),On=NI(h,lt,Dt),ba=TI(h,lt,x));let V=(i=l.dragOperation.source)==null?void 0:i.id,ye=()=>{var Ce;if(!Go||V==null)return;let rt=l.registry.draggables.get(V),cn=(Ce=rt?.handle)!=null?Ce:rt?.element;Oo(cn)&&cn.focus()},Mt=()=>{On?.disconnect(),ba?.disconnect(),ln.disconnect(),Ea.removeEventListener("resize",B),pu(x)&&(x.removeEventListener("beforetoggle",e0),x.removeAttribute("popover")),x.removeAttribute(go),I.reset();let Ce=()=>{var rt;if(Br&&Ph(h)){let yp=Array.from(h.cells);for(let[Rc,js]of yp.entries())js.style.width=(rt=Br[Rc])!=null?rt:""}f.status="idle";let cn=a.current.translate!=null,qo=u.status.dragging;lt&&(!qo&&cn||lt.parentElement!==x.parentElement)&&x.isConnected&&lt.replaceWith(x),lt?.remove()};x===this.overlay?setTimeout(Ce,0):Ce()},He=c?.dropAnimation,ht=this,Vs=Hr(()=>{var Ce,rt,cn;let{transform:qo,status:yp}=u;if(!(!qo.x&&!qo.y&&!a.current.translate)&&yp.dragging){let Rc=(Ce=_.translate)!=null?Ce:{x:0,y:0},js={x:qo.x/v.scaleX+Rc.x,y:qo.y/v.scaleY+Rc.y},jx=a.current.translate,kk=ie(()=>u.modifiers),xp=ie(()=>{var Ta;return(Ta=u.shape)==null?void 0:Ta.current}),Na=c?.keyboardTransition,Yx=Go&&!X&&Na!==null?`${(rt=Na?.duration)!=null?rt:250}ms ${(cn=Na?.easing)!=null?cn:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(I.set({transition:Fe?`${Fe}, translate ${Yx}`:`translate ${Yx}`,translate:`${js.x}px ${js.y}px 0`},bt),On?.takeRecords(),xp&&xp!==$c&&jx&&!kk.length){let Ta=It.delta(js,jx);u.shape=tn.from(xp.boundingRectangle).translate(Ta.x*v.scaleX,Ta.y*v.scaleY)}else u.shape=new In(x);a.current.translate=js}},function(){if(u.status.dropped){this.dispose(),f.status="dropping";let Ce=g?.dropAnimation!==void 0?g.dropAnimation:ht.dropAnimation!==void 0?ht.dropAnimation:He,rt=a.current.translate,cn=rt!=null;if(!rt&&h!==x&&(rt={x:0,y:0}),!rt||Ce===null){Mt();return}l.renderer.rendering.then(()=>{MI({source:f,element:h,feedbackElement:x,placeholder:lt,translate:rt,moved:cn,transition:P,alignment:f.alignment,styles:I,animation:Ce??void 0,getElementMutationObserver:()=>On,cleanup:Mt,restoreFocus:ye})})}});return()=>{Mt(),Vs()}};$n(rl,4,"overlay",v0,gi,Gh);ls(rl,gi);gi.configure=ri(gi);var qh=gi,Ja=!0,kI=!1,b0,E0,N0,T0,nr,Xh,Jh;T0=(N0=[fe],fn.Forward),E0=(b0=[fe],fn.Reverse);var sl=class{constructor(){nt(this,Xh,ut(nr,8,this,Ja)),ut(nr,11,this),nt(this,Jh,ut(nr,12,this,Ja)),ut(nr,15,this)}isLocked(e){return e===fn.Idle?!1:e==null?this[fn.Forward]===Ja&&this[fn.Reverse]===Ja:this[e]===Ja}unlock(e){e!==fn.Idle&&(this[e]=kI)}};nr=_i(null);Xh=new WeakMap;Jh=new WeakMap;$n(nr,4,T0,N0,sl,Xh);$n(nr,4,E0,b0,sl,Jh);ls(nr,sl);var AI=[fn.Forward,fn.Reverse],t0=class{constructor(){this.x=new sl,this.y=new sl}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},II=class extends mt{constructor(e){super(e);let t=wn(new t0),n=null;this.signal=t,gt(()=>{let{status:o}=e.dragOperation;if(!o.initialized){n=null,t.value=new t0;return}let{delta:r}=e.dragOperation.position;if(n){let s={x:n0(r.x,n.x),y:n0(r.y,n.y)},i=t.peek();Oe(()=>{for(let a of Vp)for(let l of AI)s[a]===l&&i[a].unlock(l);t.value=i})}n=r})}get current(){return this.signal.peek()}};function n0(e,t){return Math.sign(e-t)}var O0,Fh,il,Qh,tr,Bh,yi=class extends(Fh=si,O0=[fe],Fh){constructor(e){super(e),nt(this,Qh,ut(il,8,this,!1)),ut(il,11,this),nt(this,tr),nt(this,Bh,()=>{if(!$e(this,tr))return;let{element:s,by:i}=$e(this,tr);i.y&&(s.scrollTop+=i.y),i.x&&(s.scrollLeft+=i.x)}),this.scroll=(s,i)=>{var a;if(this.disabled)return!1;let l=this.getScrollableElements();if(!l)return Vt(this,tr,void 0),!1;let{position:c}=this.manager.dragOperation,u=c?.current;if(u){let{by:d}=s??{},f=d?{x:o0(d.x),y:o0(d.y)}:void 0,p=f?void 0:this.scrollIntentTracker.current;if(p?.isLocked())return!1;for(let h of l){let g=jS(h,d);if(g.x||g.y){let{speed:y,direction:m}=YS(h,u,f,i?.acceleration,i?.threshold);if(p)for(let _ of Vp)p[_].isLocked(m[_])&&(y[_]=0,m[_]=0);if(m.x||m.y){let{x:_,y:x}=d??m,v=_*y.x,S=x*y.y;if(v||S){let b=(a=$e(this,tr))==null?void 0:a.by;if(this.autoScrolling&&b&&(b.x&&!v||b.y&&!S))continue;return Vt(this,tr,{element:h,by:{x:v,y:S}}),qa.schedule($e(this,Bh)),!0}}}}}return Vt(this,tr,void 0),!1};let t=null,n=null,o=Kc(()=>{let{position:s,source:i}=e.dragOperation;if(!s)return null;let a=Th(ja(i?.element),s.current);return a&&(t=a),a??t}),r=Kc(()=>{let s=o.value,{documentElement:i}=es(s);if(!s||s===i){let{target:a}=e.dragOperation,l=a?.element;if(l){let c=hu(l,{excludeElement:!1});return n=c,c}}if(s){let a=hu(s,{excludeElement:!1});return this.autoScrolling&&n&&a.size<n?.size?n:(n=a,a)}return n=null,null},Wc);this.getScrollableElements=()=>r.value,this.scrollIntentTracker=new II(e),this.destroy=e.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!rs(e.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};il=_i(Fh);Qh=new WeakMap;tr=new WeakMap;Bh=new WeakMap;$n(il,4,"autoScrolling",O0,yi,Qh);ls(il,yi);function o0(e){return e>0?fn.Forward:e<0?fn.Reverse:fn.Idle}var $I=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let o of t)o();for(let o of n)o()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},RI=new $I(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),PI=10,zh=class extends mt{constructor(t,n){super(t,n);let o=t.registry.plugins.get(yi);if(!o)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=gt(()=>{var r,s,i;if(this.disabled)return;let{position:a,status:l}=t.dragOperation;if(l.dragging){let c={acceleration:(r=this.options)==null?void 0:r.acceleration,threshold:typeof((s=this.options)==null?void 0:s.threshold)=="number"?{x:this.options.threshold,y:this.options.threshold}:(i=this.options)==null?void 0:i.threshold};if(o.scroll(void 0,c)){o.autoScrolling=!0;let d=setInterval(()=>RI.schedule(()=>o.scroll(void 0,c)),PI);return()=>{clearInterval(d)}}else o.autoScrolling=!1}})}};zh.configure=ri(zh);var D0=zh,r0={capture:!0,passive:!0},Za,LI=class extends si{constructor(e){super(e),nt(this,Za),this.handleScroll=()=>{$e(this,Za)==null&&Vt(this,Za,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Vt(this,Za,void 0)},50))};let{dragOperation:t}=this.manager;this.destroy=gt(()=>{var n,o,r;if(t.status.dragging){let i=(r=(o=(n=t.source)==null?void 0:n.element)==null?void 0:o.ownerDocument)!=null?r:document;return i.addEventListener("scroll",this.handleScroll,r0),()=>{i.removeEventListener("scroll",this.handleScroll,r0)}}})}};Za=new WeakMap;var FI="* { user-select: none !important; -webkit-user-select: none !important; }",BI=class extends mt{constructor(e){super(e),this.manager=e;let t=e.registry.plugins.get(Tu),n=t?.register(FI);if(this.destroy=gt(()=>{let{dragOperation:o}=this.manager;if(o.status.initialized)return Mh(),document.addEventListener("selectionchange",Mh,{capture:!0}),()=>{document.removeEventListener("selectionchange",Mh,{capture:!0})}}),n){let o=this.destroy.bind(this);this.destroy=()=>{n(),o()}}}};function Mh(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var el=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;let o=(n=t.handle)!=null?n:t.element;return e.target!==o}}),ui,Eu=class extends Yr{constructor(t,n){super(t),this.manager=t,this.options=n,nt(this,ui,[]),this.listeners=new Oh,this.handleSourceKeyDown=(o,r,s)=>{if(this.disabled||o.defaultPrevented||!er(o.target)||r.disabled)return;let{keyboardCodes:i=el.keyboardCodes,preventActivation:a=el.preventActivation}=s??{};i.start.includes(o.code)&&this.manager.dragOperation.status.idle&&(a?.(o,r)||this.handleStart(o,r,s))}}bind(t,n=this.options){return gt(()=>{var r;let s=(r=t.handle)!=null?r:t.element,i=a=>{rs(a)&&this.handleSourceKeyDown(a,t,n)};if(s)return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}})}handleStart(t,n,o){let{element:r}=n;if(!r)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),gu(r);let{center:s}=new In(r);if(this.manager.actions.start({event:t,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();let a=es(r),l=[this.listeners.bind(a,[{type:"keydown",listener:c=>this.handleKeyDown(c,n,o),options:{capture:!0}}])];$e(this,ui).push(...l)}handleKeyDown(t,n,o){let{keyboardCodes:r=el.keyboardCodes}=o??{};if(ci(t,[...r.end,...r.cancel])){t.preventDefault();let s=ci(t,r.cancel);this.handleEnd(t,s);return}ci(t,r.up)?this.handleMove("up",t):ci(t,r.down)&&this.handleMove("down",t),ci(t,r.left)?this.handleMove("left",t):ci(t,r.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var o,r;let{shape:s}=this.manager.dragOperation,i=n.shiftKey?5:1,a={x:0,y:0},l=(r=(o=this.options)==null?void 0:o.offset)!=null?r:el.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!s){switch(t){case"up":a={x:0,y:-l.y*i};break;case"down":a={x:0,y:l.y*i};break;case"left":a={x:-l.x*i,y:0};break;case"right":a={x:l.x*i,y:0};break}(a.x||a.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:a}))}}sideEffects(){let t=this.manager.registry.plugins.get(D0);t?.disabled===!1&&(t.disable(),$e(this,ui).push(()=>{t.enable()}))}cleanup(){$e(this,ui).forEach(t=>t()),Vt(this,ui,[])}destroy(){this.cleanup(),this.listeners.clear()}};ui=new WeakMap;Eu.configure=ri(Eu);Eu.defaults=el;var Zh=Eu;function ci(e,t){return t.includes(e.code)}var ss,zI=class extends hh{constructor(){super(...arguments),nt(this,ss)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,ss,ts(e));break;case"pointermove":if(!$e(this,ss))return;let{x:t,y:n}=ts(e),o={x:t-$e(this,ss).x,y:n-$e(this,ss).y},{tolerance:r}=this.options;if(r&&Vc(o,r)){this.abort();return}Vc(o,this.options.value)&&this.activate(e);break;case"pointerup":this.abort();break}}abort(){Vt(this,ss,void 0)}};ss=new WeakMap;var di,is,WI=class extends hh{constructor(){super(...arguments),nt(this,di),nt(this,is)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,is,ts(e)),Vt(this,di,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!$e(this,is))return;let{x:t,y:n}=ts(e),o={x:t-$e(this,is).x,y:n-$e(this,is).y};Vc(o,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){$e(this,di)&&(clearTimeout($e(this,di)),Vt(this,is,void 0),Vt(this,di,void 0))}};di=new WeakMap;is=new WeakMap;var pi=class{};pi.Delay=WI;pi.Distance=zI;var Wh=Object.freeze({activationConstraints(e,t){var n;let{pointerType:o,target:r}=e;if(!(o==="mouse"&&er(r)&&(t.handle===r||(n=t.handle)!=null&&n.contains(r))))return o==="touch"?[new pi.Delay({value:250,tolerance:5})]:XS(r)&&!e.defaultPrevented?[new pi.Delay({value:200,tolerance:0})]:[new pi.Delay({value:200,tolerance:10}),new pi.Distance({value:5})]},preventActivation(e,t){var n;let{target:o}=e;if(o===t.element||o===t.handle||!er(o)||(n=t.handle)!=null&&n.contains(o))return!1;let r=FS(o);return r===t.element?!1:!!r}}),fi,Nu=class extends Yr{constructor(t,n){super(t),this.manager=t,this.options=n,nt(this,fi,new Set),this.listeners=new Oh,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{let{event:o,coordinates:r}=this.latest;!o||!r||this.manager.actions.move({event:o,to:r})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n,o=this.options){let{activationConstraints:r=Wh.activationConstraints}=o??{};return typeof r=="function"?r(t,n):r}bind(t,n=this.options){return gt(()=>{var r;let s=new AbortController,{signal:i}=s,a=c=>{qS(c)&&this.handlePointerDown(c,t,n)},l=[(r=t.handle)!=null?r:t.element];n?.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(let c of l)c&&(HI(c.ownerDocument.defaultView),c.addEventListener("pointerdown",a,{signal:i}));return()=>s.abort()})}handlePointerDown(t,n,o){if(this.disabled||!t.isPrimary||t.button!==0||!er(t.target)||n.disabled||KI(t)||!this.manager.dragOperation.status.idle)return;let{preventActivation:r=Wh.preventActivation}=o??{};if(r?.(t,n))return;let{target:s}=t,i=Oo(s)&&s.draggable&&s.getAttribute("draggable")==="true",a=os(n.element),{x:l,y:c}=ts(t);this.initialCoordinates={x:l*a.scaleX+a.x,y:c*a.scaleY+a.y};let u=this.activationConstraints(t,n,o);t.sensor=this;let d=new mS(u,g=>this.handleStart(n,g));d.signal.onabort=()=>this.handleCancel(t),d.onEvent(t),this.controller=d;let f=ru(),p=this.listeners.bind(f,[{type:"pointermove",listener:g=>this.handlePointerMove(g,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:i?this.handleCancel:xu,options:{capture:!0}}]),h=()=>{p(),this.initialCoordinates=void 0};$e(this,fi).add(h)}handlePointerMove(t,n){var o,r;if(((o=this.controller)==null?void 0:o.activated)===!1){(r=this.controller)==null||r.onEvent(t);return}if(this.manager.dragOperation.status.dragging){let s=ts(t),i=os(n.element);s.x=s.x*i.scaleX+i.x,s.y=s.y*i.scaleY+i.y,t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=s,qa.schedule(this.handleMove)}}handlePointerUp(t){let{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();let o=!n.initialized;this.manager.actions.stop({event:t,canceled:o})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){let{manager:o,initialCoordinates:r}=this;if(!r||!o.dragOperation.status.idle||n.defaultPrevented)return;if(o.actions.start({coordinates:r,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();let a=es(n.target).body;try{a.setPointerCapture(n.pointerId)}catch{this.handleCancel(n);return}let l=er(n.target)?[n.target,a]:a,c=this.listeners.bind(l,[{type:"touchmove",listener:xu,options:{passive:!1}},{type:"click",listener:xu},{type:"contextmenu",listener:xu},{type:"keydown",listener:this.handleKeyDown}]);$e(this,fi).add(c)}handleCancel(t){let{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){let{controller:t}=this;this.controller=void 0,t&&!t.signal.aborted&&t.abort(),this.latest={event:void 0,coordinates:void 0},$e(this,fi).forEach(n=>n()),$e(this,fi).clear()}destroy(){this.cleanup(),this.listeners.clear()}};fi=new WeakMap;Nu.configure=ri(Nu);Nu.defaults=Wh;var eg=Nu;function KI(e){return"sensor"in e}function xu(e){e.preventDefault()}function UI(){}var s0=new WeakSet;function HI(e){!e||s0.has(e)||(e.addEventListener("touchmove",UI,{capture:!1,passive:!1}),s0.add(e))}var kh={modifiers:[],plugins:[gI,D0,_I,qh,BI],sensors:[eg,Zh]},w0=class extends TS{constructor(e={}){let t=ho(e.plugins,kh.plugins),n=ho(e.sensors,kh.sensors),o=ho(e.modifiers,kh.modifiers);super(Vh(ol({},e),{plugins:[LI,yi,Tu,...t],sensors:n,modifiers:o}))}},M0,k0,Kh,or,tg,ng,cs=class extends(Kh=Xn,k0=[fe],M0=[fe],Kh){constructor(e,t){var n=e,{element:o,effects:r=()=>[],handle:s}=n,i=c0(n,["element","effects","handle"]);super(ol({effects:()=>[...r(),()=>{var a,l;let{manager:c}=this;if(!c)return;let d=((l=(a=this.sensors)==null?void 0:a.map(ti))!=null?l:[...c.sensors]).map(f=>{let p=f instanceof Yr?f:c.registry.register(f.plugin),h=f instanceof Yr?void 0:f.options;return p.bind(this,h)});return function(){d.forEach(p=>p())}}]},i),t),nt(this,tg,ut(or,8,this)),ut(or,11,this),nt(this,ng,ut(or,12,this)),ut(or,15,this),this.element=o,this.handle=s}};or=_i(Kh);tg=new WeakMap;ng=new WeakMap;$n(or,4,"handle",k0,cs,tg);$n(or,4,"element",M0,cs,ng);ls(or,cs);var A0,I0,Uh,rr,og,Ah,$0,R0,nl,rg,xi=class extends(Uh=Jn,I0=[fe],A0=[fe],Uh){constructor(e,t){var n=e,{element:o,effects:r=()=>[]}=n,s=c0(n,["element","effects"]);let{collisionDetector:i=yu}=s,a=c=>{let{manager:u,element:d}=this;if(!d||c===null){this.shape=void 0;return}if(!u)return;let f=new In(d),p=ie(()=>this.shape);return f&&p?.equals(f)?p:(this.shape=f,f)},l=wn(!1);super(Vh(ol({},s),{collisionDetector:i,effects:()=>[...r(),()=>{let{element:c,manager:u}=this;if(!u)return;let{dragOperation:d}=u,{source:f}=d;l.value=!!(f&&d.status.initialized&&c&&!this.disabled&&this.accepts(f))},()=>{let{element:c}=this;if(l.value&&c){let u=new HS(c,a);return()=>{u.disconnect(),this.shape=void 0}}},()=>{var c;if((c=this.manager)!=null&&c.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),nt(this,nl),nt(this,og,ut(rr,8,this)),ut(rr,11,this),nt(this,rg,ut(rr,12,this)),ut(rr,15,this),this.element=o,this.refreshShape=()=>a()}set element(e){Vt(this,nl,e,R0)}get element(){var e;return(e=this.proxy)!=null?e:$e(this,nl,$0)}};rr=_i(Uh);og=new WeakMap;nl=new WeakSet;rg=new WeakMap;Ah=$n(rr,20,"#element",I0,nl,og),$0=Ah.get,R0=Ah.set;$n(rr,4,"proxy",A0,xi,rg);ls(rr,xi);var VI=Object.create,H0=Object.defineProperty,jI=Object.defineProperties,YI=Object.getOwnPropertyDescriptor,GI=Object.getOwnPropertyDescriptors,Au=Object.getOwnPropertySymbols,V0=Object.prototype.hasOwnProperty,j0=Object.prototype.propertyIsEnumerable,qI=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),pl=e=>{throw TypeError(e)},lg=(e,t,n)=>t in e?H0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sg=(e,t)=>{for(var n in t||(t={}))V0.call(t,n)&&lg(e,n,t[n]);if(Au)for(var n of Au(t))j0.call(t,n)&&lg(e,n,t[n]);return e},ig=(e,t)=>jI(e,GI(t)),XI=(e,t)=>{var n={};for(var o in e)V0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Au)for(var o of Au(e))t.indexOf(o)<0&&j0.call(e,o)&&(n[o]=e[o]);return n},JI=e=>{var t;return[,,,VI((t=void 0)!=null?t:null)]},Y0=["class","method","getter","setter","accessor","field","value","get","set"],cl=e=>e!==void 0&&typeof e!="function"?pl("Function expected"):e,QI=(e,t,n,o,r)=>({kind:Y0[e],name:t,metadata:o,addInitializer:s=>n._?pl("Already initialized"):r.push(cl(s||null))}),ZI=(e,t)=>lg(t,qI("metadata"),e[3]),Ou=(e,t,n,o)=>{for(var r=0,s=e[t>>1],i=s&&s.length;r<i;r++)t&1?s[r].call(n):o=s[r].call(n,o);return o},G0=(e,t,n,o,r,s)=>{for(var i,a,l,c,u,d=t&7,f=!1,p=!1,h=e.length+1,g=Y0[d+5],y=e[h-1]=[],m=e[h]||(e[h]=[]),_=(r=r.prototype,YI({get[n](){return ul(this,s)},set[n](v){return us(this,s,v)}},n)),x=o.length-1;x>=0;x--)c=QI(d,n,l={},e[3],m),c.static=f,c.private=p,u=c.access={has:v=>n in v},u.get=v=>v[n],u.set=(v,S)=>v[n]=S,a=(0,o[x])({get:_.get,set:_.set},c),l._=1,a===void 0?cl(a)&&(_[g]=a):typeof a!="object"||a===null?pl("Object expected"):(cl(i=a.get)&&(_.get=i),cl(i=a.set)&&(_.set=i),cl(i=a.init)&&y.unshift(i));return _&&H0(r,n,_),r},q0=(e,t,n)=>t.has(e)||pl("Cannot "+n),ul=(e,t,n)=>(q0(e,t,"read from private field"),t.get(e)),ll=(e,t,n)=>t.has(e)?pl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),us=(e,t,n,o)=>(q0(e,t,"write to private field"),t.set(e,n),n);function ds(e){return e instanceof dg||e instanceof Q0}var Du=10,e$=class extends mt{constructor(e){super(e);let t=gt(()=>{let{dragOperation:o}=e;if(rs(o.activatorEvent)&&ds(o.source)&&o.status.initialized){let r=e.registry.plugins.get(yi);if(r)return r.disable(),()=>r.enable()}}),n=e.monitor.addEventListener("dragmove",(o,r)=>{queueMicrotask(()=>{if(this.disabled||o.defaultPrevented||!o.nativeEvent)return;let{dragOperation:s}=r;if(!rs(o.nativeEvent)||!ds(s.source)||!s.shape)return;let{actions:i,collisionObserver:a,registry:l}=r,{by:c}=o;if(!c)return;let u=t$(c),{source:d,target:f}=s,{center:p}=s.shape.current,h=[],g=[];Oe(()=>{for(let S of l.droppables){let{id:b}=S;if(!S.accepts(d)||b===f?.id&&ds(S)||!S.element)continue;let N=S.shape,D=new In(S.element,{getBoundingClientRect:O=>ai(O,void 0,.2)});!D.height||!D.width||(u=="down"&&p.y+Du<D.center.y||u=="up"&&p.y-Du>D.center.y||u=="left"&&p.x-Du>D.center.x||u=="right"&&p.x+Du<D.center.x)&&(h.push(S),S.shape=D,g.push(()=>S.shape=N))}}),o.preventDefault(),a.disable();let y=a.computeCollisions(h,JS);Oe(()=>g.forEach(S=>S()));let[m]=y;if(!m)return;let{id:_}=m,{index:x,group:v}=d.sortable;i.setDropTarget(_).then(()=>{let{source:S,target:b,shape:N}=s;if(!S||!ds(S)||!N)return;let{index:D,group:O,target:T}=S.sortable,A=x!==D||v!==O,$=A?T:b?.element;if(!$)return;gu($);let I=new In($);if(!I)return;let L=tn.delta(I,tn.from(N.current.boundingRectangle),S.alignment);i.move({by:L}),A?i.setDropTarget(S.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function t$(e){let{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var n$=Object.defineProperty,o$=Object.defineProperties,r$=Object.getOwnPropertyDescriptors,P0=Object.getOwnPropertySymbols,s$=Object.prototype.hasOwnProperty,i$=Object.prototype.propertyIsEnumerable,L0=(e,t,n)=>t in e?n$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t)=>{for(var n in t||(t={}))s$.call(t,n)&&L0(e,n,t[n]);if(P0)for(var n of P0(t))i$.call(t,n)&&L0(e,n,t[n]);return e},Si=(e,t)=>o$(e,r$(t));function a$(e,t,n){if(t===n)return e;let o=e.slice();return o.splice(n,0,o.splice(t,1)[0]),o}function wu(e,t){let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?n:void 0}function ag(e){return"initialIndex"in e&&typeof e.initialIndex=="number"&&"index"in e&&typeof e.index=="number"}function l$(e,t,n){var o,r;let{source:s,target:i,canceled:a}=t.operation;if(!s||!i||a)return"preventDefault"in t&&t.preventDefault(),e;let l=(x,v)=>x===v||x!==null&&typeof x=="object"&&"id"in x&&x.id===v;if(Array.isArray(e)){let x=e.findIndex(S=>l(S,s.id)),v=e.findIndex(S=>l(S,i.id));if(x===-1||v===-1){if(ag(s)){let S=s.initialIndex,b=s.index;return S===b||S<0||S>=e.length?("preventDefault"in t&&t.preventDefault(),e):n(e,S,b)}return e}if(!a&&"index"in s&&typeof s.index=="number"){let S=s.index;if(S!==x)return n(e,x,S)}return n(e,x,v)}let c=Object.entries(e),u=-1,d,f=-1,p;for(let[x,v]of c)if(u===-1&&(u=v.findIndex(S=>l(S,s.id)),u!==-1&&(d=x)),f===-1&&(f=v.findIndex(S=>l(S,i.id)),f!==-1&&(p=x)),u!==-1&&f!==-1)break;if(u===-1&&ag(s)){let x=s.initialGroup==null?void 0:wu(e,s.initialGroup),v=s.initialIndex,S=s.group==null?void 0:wu(e,s.group),b=s.index;if(x==null||S==null||x===S&&v===b)return"preventDefault"in t&&t.preventDefault(),e;if(x===S)return Si(vi({},e),{[x]:n(e[x],v,b)});let N=e[x][v];return Si(vi({},e),{[x]:[...e[x].slice(0,v),...e[x].slice(v+1)],[S]:[...e[S].slice(0,b),N,...e[S].slice(b)]})}if(!s.manager)return e;let{dragOperation:h}=s.manager,g=(r=(o=h.shape)==null?void 0:o.current.center)!=null?r:h.position.current;if(p==null){let x=wu(e,i.id);if(x!=null){let v=i.shape&&g.y>i.shape.center.y?e[x].length:0;p=x,f=v}}if(d==null||p==null||d===p&&u===f){if(d!=null&&d===p&&u===f&&ag(s)){let x=s.group==null?void 0:wu(e,s.group),v=s.group!=null&&x!==d,S=s.index!==u;if(v||S){let b=s.group==null?d:x;if(b!=null){if(d===b)return Si(vi({},e),{[d]:n(e[d],u,s.index)});let N=e[d][u];return Si(vi({},e),{[d]:[...e[d].slice(0,u),...e[d].slice(u+1)],[b]:[...e[b].slice(0,s.index),N,...e[b].slice(s.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return Si(vi({},e),{[d]:n(e[d],u,f)});let m=i.shape&&Math.round(g.y)>Math.round(i.shape.center.y)?1:0,_=e[d][u];return Si(vi({},e),{[d]:[...e[d].slice(0,u),...e[d].slice(u+1)],[p]:[...e[p].slice(0,f+m),_,...e[p].slice(f+m)]})}function c$(e,t){return l$(e,t,a$)}function F0(e){let t=new Map;for(let[,n]of e)for(let o of n)t.set(o.id,o.index);return t}function B0(e,t,n){var o;for(let[r,s]of t)for(let i of s){let a=e.get(i.id);if(i.index!==a||i.group!==r||!((o=n.get(r))!=null&&o.has(i)))return!0}return!1}var z0="__default__",u$=class extends mt{constructor(e){super(e);let t=()=>{let o=new Map;for(let r of e.registry.droppables)if(r instanceof dg){let{sortable:s}=r,{group:i}=s,a=o.get(i);a||(a=new Set,o.set(i,a)),a.add(s)}return o},n=[e.monitor.addEventListener("dragover",(o,r)=>{if(this.disabled)return;let{dragOperation:s}=r,{source:i,target:a}=s;if(!ds(i)||!ds(a)||i.sortable===a.sortable)return;let l=t(),c=F0(l),u=i.sortable.group===a.sortable.group,d=l.get(i.sortable.group),f=u?d:l.get(a.sortable.group);!d||!f||queueMicrotask(()=>{o.defaultPrevented||r.renderer.rendering.then(()=>{var p,h;let g=t();if(B0(c,l,g))return;let y=i.sortable.element,m=a.sortable.element;if(!m||!y||!u&&a.id===i.sortable.group)return;let _=Mu(d),x=u?_:Mu(f),v=(p=i.sortable.group)!=null?p:z0,S=(h=a.sortable.group)!=null?h:z0,b={[v]:_,[S]:x},N=c$(b,o);if(b===N)return;let D=N[S].indexOf(i.sortable),O=N[S].indexOf(a.sortable);r.collisionObserver.disable(),W0(y,D,m,O),Oe(()=>{for(let[T,A]of N[v].entries())A.index=T;if(!u)for(let[T,A]of N[S].entries())A.group=a.sortable.group,A.index=T}),r.actions.setDropTarget(i.id).then(()=>r.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(o,r)=>{if(!o.canceled)return;let{dragOperation:s}=r,{source:i}=s;ds(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{let a=t(),l=F0(a),c=a.get(i.sortable.initialGroup);c&&r.renderer.rendering.then(()=>{let u=t();if(B0(l,a,u))return;let d=Mu(c),f=Mu(c,f$),p=i.sortable.element,h=f.indexOf(i.sortable),g=d[h],y=g?.element;!g||!y||!p||(W0(p,g.index,y,i.index),Oe(()=>{for(let m of a.values()){let _=Array.from(m).values();for(let x of _)x.index=x.initialIndex,x.group=x.initialGroup}}))})}))})];this.destroy=()=>{for(let o of n)o()}}};function W0(e,t,n,o){let r=o<t?"afterend":"beforebegin";n.insertAdjacentElement(r,e)}function d$(e,t){return e.index-t.index}function f$(e,t){return e.initialIndex-t.initialIndex}function Mu(e,t=d$){return Array.from(e).sort(t)}var K0=[e$,u$],p$={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1};function U0(e){var t,n;return typeof e=="boolean"?{draggable:e,droppable:e}:{draggable:(t=e?.draggable)!=null?t:!1,droppable:(n=e?.droppable)!=null?n:!1}}var ku=new Nv,X0,J0,ir,cg,dl,fl,ug,Ci;J0=[fe],X0=[fe];var bi=class{constructor(e,t){ll(this,cg,Ou(ir,8,this)),Ou(ir,11,this),ll(this,dl),ll(this,fl),ll(this,ug,Ou(ir,12,this)),Ou(ir,15,this),ll(this,Ci),this.register=()=>(Oe(()=>{var h,g;(h=this.manager)==null||h.registry.register(this.droppable),(g=this.manager)==null||g.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{Oe(()=>{var h,g;(h=this.manager)==null||h.registry.unregister(this.droppable),(g=this.manager)==null||g.registry.unregister(this.draggable)})},this.destroy=()=>{Oe(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:o=()=>[],disabled:r,group:s,index:i,sensors:a,type:l,transition:c=p$,plugins:u}=n,d=XI(n,["effects","disabled","group","index","sensors","type","transition","plugins"]);let f=ho(u,K0),p=U0(r);this.droppable=new dg(ig(sg({},d),{disabled:p.droppable}),t,this),this.draggable=new Q0(ig(sg({},d),{disabled:p.draggable,plugins:f,effects:()=>[()=>{var h,g,y;let m=(h=this.manager)==null?void 0:h.dragOperation.status;m?.initializing&&this.id===((y=(g=this.manager)==null?void 0:g.dragOperation.source)==null?void 0:y.id)&&ku.clear(this.manager),m?.dragging&&ku.set(this.manager,this.id,ie(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:h,group:g,manager:y}=this,m=ul(this,fl),_=ul(this,dl);(h!==m||g!==_)&&(us(this,fl,h),us(this,dl,g),this.animate())},()=>{var h,g;let{target:y}=this,{isDragSource:m}=this.draggable;((g=(h=this.draggable.pluginConfig(qh))==null?void 0:h.feedback)!=null?g:"default")==="move"&&m&&(this.droppable.disabled=!y)},...o()],type:l,sensors:a}),t,this),us(this,Ci,d.element),this.manager=t,this.index=i,us(this,fl,i),this.group=s,us(this,dl,s),this.type=l,this.transition=c}get initialIndex(){var e,t;return(t=(e=ku.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=ku.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){ie(()=>{let{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;let{idle:o}=e.dragOperation.status;!n||!t||o&&!t.idle||e.renderer.rendering.then(()=>{let{element:r}=this;if(!r)return;for(let u of r.getAnimations())"transitionProperty"in u&&(u.transitionProperty==="transform"||u.transitionProperty==="translate"||u.transitionProperty==="scale")&&u.cancel();let s=this.refreshShape();if(!s)return;let i={x:n.boundingRectangle.left-s.boundingRectangle.left,y:n.boundingRectangle.top-s.boundingRectangle.top},{translate:a}=An(r),l=wh(r,a,!1),c=wh(r,a);if(i.x||i.y){let u=Ya(Ht(r))?ig(sg({},t),{duration:0}):t;mu({element:r,keyframes:{translate:[`${l.x+i.x}px ${l.y+i.y}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:u}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){Oe(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){Oe(()=>{let t=ul(this,Ci),n=this.droppable.element,o=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!o||o===t)&&(this.draggable.element=e),us(this,Ci,e)})}get element(){var e,t;let n=ul(this,Ci);if(n)return(t=(e=Ga.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){let{disabled:e}=this.draggable,{disabled:t}=this.droppable;return e===t?e:{draggable:e,droppable:t}}set plugins(e){this.draggable.plugins=ho(e,K0)}set disabled(e){let t=U0(e);Oe(()=>{this.droppable.disabled=t.droppable,this.draggable.disabled=t.draggable})}set data(e){Oe(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){this.droppable.id=e,this.draggable.id=e}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??yu}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Oe(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};ir=JI();cg=new WeakMap;dl=new WeakMap;fl=new WeakMap;ug=new WeakMap;Ci=new WeakMap;G0(ir,4,"index",J0,bi,cg);G0(ir,4,"group",X0,bi,ug);ZI(ir,bi);var Q0=class extends cs{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},dg=class extends xi{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}};var Rn=(...e)=>e.filter(Boolean).join(" ");var h$={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},g$={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},m$=({variant:e="primary",size:t="md",className:n,children:o,...r})=>{let s=r.href?"a":"button";return E.createElement(s,{...r,className:Rn("ks-button",h$[e],g$[t],n)},o)},Re=m$;var jt=(e,t,n,o={})=>fetch(e,{method:n,headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-Token":t},body:JSON.stringify(o)}).then(r=>r.json().then(s=>r.ok?s:Promise.reject(s))),Z0=(e,t,n,o)=>jt(e,t,"POST",{key:n,column_id:o}),eC=(e,t,n)=>jt(e,t,"POST",{title:n}),tC=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{field:o,value:r}),nC=(e,t)=>jt(e,t,"POST",{}),oC=(e,t,n)=>jt(e,t,"POST",{row_id:n}),rC=(e,t,n)=>jt(e,t,"POST",{section_id:n}),fg=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{setting:o,value:r}),Iu=(e,t,n)=>jt(`${e}/${n}`,t,"DELETE"),pg=(e,t,n,o,r)=>jt(`${e}/${n}/move`,t,"POST",{into:o,position:r}),sC=(e,t,n)=>jt(`${e}/${n}/duplicate`,t,"POST"),iC=(e,t,n,o,r,s)=>jt(`${e}/${n}/bind`,t,"POST",{field:o,name:r,fallback:s}),aC=(e,t,n)=>jt(e,t,"POST",{choice:n}),lC=(e,t,n)=>jt(e,t,"POST",{access_exception:n}),cC=(e,t,n,o,r)=>jt(`${e}/${n}/condition`,t,"POST",{name:o,equals:r}),hg=(e,t)=>jt(e,t,"POST");var _$=({as:e="input",disabled:t,className:n,...o})=>E.createElement(e,{...o,disabled:t,className:Rn("ks-input",t&&"ks-input-disabled",n)}),_t=_$;var y$=e=>E.createElement(_t,{...e,as:"select"}),yt=y$;var x$=({type:e="info",title:t,message:n,onDismiss:o,className:r})=>E.createElement("div",{className:Rn("ks-alert",`ks-alert-${e}`,r),role:"alert"},E.createElement("div",{className:"ks-alert-body"},E.createElement("div",{className:"ks-alert-content"},t&&E.createElement("p",{className:"ks-alert-title"},t),E.createElement("p",{className:t?"ks-alert-message-titled":"ks-alert-message"},n)),o&&E.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:o},"\xD7"))),hl=x$;var $u=(e,t)=>({className:n,children:o,...r})=>E.createElement(e,{...r,className:Rn(t,n)},o),on=$u("label","ks-label"),U2=$u("p","ks-hint"),H2=$u("p","ks-error"),V2=$u("span","ks-required");var v$={section:{spacing:"Section spacing",background:"Section background",width:"Section width"},row:{gap:"Row gap"},column:{wide:"Width on wide screens",narrow:"Width on narrow screens",align:"Vertical alignment"}};function gg({node:e,values:t,arrangements:n,refusal:o,onAddColumn:r,onAddRow:s,onArrange:i,onSelect:a,onRemove:l}){let c=v$[e.kind],u=Object.keys(n[e.kind]).filter(d=>c[d]);return E.createElement("aside",{"data-layout-panel":!0,className:"flex flex-col gap-3"},o&&E.createElement("div",{"data-layout-refusal":!0},E.createElement(hl,{type:"error",message:o})),u.map(d=>E.createElement("div",{key:`${e.id}-${d}`,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-${d}`},c[d]),E.createElement(yt,{id:`ks-pages-${d}`,defaultValue:t[d]??"",onChange:f=>i(e.id,d,f.target.value)},n[e.kind][d].map(f=>E.createElement("option",{key:f,value:f},f))))),e.kind==="column"&&E.createElement(E.Fragment,null,E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>r(e.rowId)},"Add column"),E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>s(e.sectionId)},"Add row"),E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>a({kind:"row",id:e.rowId,sectionId:e.sectionId})},"Select row")),e.kind==="row"&&E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>a({kind:"section",id:e.sectionId})},"Select section"),E.createElement(Re,{type:"button",variant:"danger",onClick:()=>l(e.id)},"Remove ",e.kind))}var gl=[{key:"phone",label:"Phone",width:"390px"},{key:"tablet",label:"Tablet",width:"768px"},{key:"desktop",label:"Desktop",width:"100%"},{key:"print",label:"Print",width:"794px",theme:"light"}];function mg({chosen:e,onChoose:t}){return E.createElement("div",{"data-device-width":!0,role:"group","aria-label":"Preview width",className:"flex rounded-md border border-(--ks-color-border) dark:border-(--ks-color-border-dark) p-0.5"},gl.map(n=>E.createElement("button",{key:n.key,type:"button","aria-pressed":e===n.key,onClick:()=>t(n.key),className:"rounded px-3 py-1 text-sm aria-pressed:bg-(--ks-color-accent) aria-pressed:text-white"},n.label)))}var S$=zr(function({place:t,onDuplicate:n,onRemove:o},r){return E.createElement("div",{"data-selection-toolbar":!0,hidden:!t,style:t??{},className:"absolute z-20 flex -translate-y-full overflow-hidden rounded-t-md bg-(--ks-color-accent) text-xs text-white shadow"},E.createElement("button",{ref:r,type:"button","data-move-handle":!0,className:"cursor-grab px-2 py-1 hover:bg-black/20"},"Move"),E.createElement("button",{type:"button",onClick:n,className:"px-2 py-1 hover:bg-black/20"},"Duplicate"),E.createElement("button",{type:"button",onClick:o,className:"px-2 py-1 hover:bg-black/20"},"Remove"))}),uC=S$;var dC={cursor:"M5 3l14 8-6 2-2 6z",tag:"M3 7v6l8 8 8-8-8-8H5a2 2 0 0 0-2 2zM7.5 7.5h.01",copy:"M8 8h11v11H8zM5 16V5h11",heading:"M6 4v16M18 4v16M6 12h12",text:"M4 6h16M4 12h16M4 18h10",list:"M4 6h4M12 6h8M4 12h4M12 12h8M4 18h4M12 18h8",info:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 16v-4M12 8h.01",code:"M8 6l-6 6 6 6M16 6l6 6-6 6",alert:"M12 3l10 18H2zM12 10v4M12 17h.01",card:"M3 5h18v14H3zM3 10h18",megaphone:"M3 11v2l13 5V6zM16 9a3 3 0 0 1 0 6M6 14l1 5h3l-1-4",chart:"M4 20V10M10 20V4M16 20v-7M22 20H2",bars:"M3 21h18M6 17v-6h3v6M11 17V7h3v10M16 17v-4h3v4",number:"M10 3L8 21M16 3l-2 18M4 9h17M3 15h17",progress:"M3 12h18M3 12h10",box:"M3 3h18v18H3z"},C$=e=>{let t=new Map;return e.forEach(n=>{let o=n.group??"Other";t.set(o,[...t.get(o)??[],n])}),[...t]},b$=({element:e,shown:t})=>E.createElement("button",{type:"button","data-element-key":e.key,hidden:!t,className:"flex cursor-grab items-center gap-3 rounded-md border border-(--ks-color-border) bg-(--ks-color-surface) px-3 py-2 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark) text-left text-sm hover:border-(--ks-color-accent) dark:bg-transparent"},E.createElement("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"size-5 shrink-0 fill-none stroke-current stroke-2 text-(--ks-color-icon)",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("path",{d:dC[e.icon]??dC.box})),E.createElement("span",null,e.name)),E$=zr(function({elements:t,children:n},o){let[r,s]=Ie(""),i=a=>a.name.toLowerCase().includes(r.trim().toLowerCase());return E.createElement("aside",{ref:o,"data-element-palette":!0,className:"flex w-64 shrink-0 flex-col gap-5 overflow-y-auto border-r border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement(_t,{type:"search","aria-label":"Search elements",placeholder:"Search elements",value:r,onChange:a=>s(a.target.value)}),C$(t).map(([a,l])=>E.createElement("section",{key:a,"data-element-group":a,hidden:!l.some(i),className:"flex flex-col gap-2"},E.createElement("h2",{className:"text-xs font-semibold uppercase tracking-wide text-(--ks-color-icon)"},a),l.map(c=>E.createElement(b$,{key:c.key,element:c,shown:i(c)})))),n)}),fC=E$;var N$=({variant:e="neutral",className:t,children:n,...o})=>E.createElement("span",{...o,className:Rn("ks-badge",`ks-badge-${e}`,t)},n),pC=N$;function Ru({sequence:e}){return E.createElement("aside",{"data-sequence-pages":!0,className:"flex w-56 shrink-0 flex-col gap-3 overflow-y-auto border-r border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement("h2",{className:"text-sm font-semibold"},e.title),e.screen_url&&E.createElement("a",{href:e.screen_url,className:"text-xs text-(--ks-color-accent) hover:underline"},"Flow"),e.notice&&E.createElement(hl,{type:"success",message:e.notice}),e.refusal&&E.createElement(hl,{type:"error",message:e.refusal}),E.createElement("ol",{className:"flex flex-col gap-1"},e.pages.map((t,n)=>E.createElement("li",{key:t.id,"data-sequence-page":!0,"aria-current":t.current?"page":void 0,className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm aria-[current=page]:bg-(--ks-color-accent)/10 aria-[current=page]:font-semibold"},E.createElement("span",{className:"text-(--ks-color-icon)"},n+1)," ",E.createElement("a",{href:t.url,className:"truncate hover:underline"},t.name),E.createElement(pC,{"data-page-state":!0,variant:t.state==="Published"?"success":"neutral"},t.state),t.remove_url&&E.createElement("a",{href:t.remove_url,"aria-label":`Remove ${t.name}`,className:"ml-auto text-xs text-(--ks-color-icon) hover:underline"},"Remove")))),E.createElement(Re,{href:e.add_page_url,size:"sm",variant:"secondary"},"Add page"),e.publish_url&&E.createElement("form",{method:"post",action:e.publish_url,className:"flex flex-col"},E.createElement("input",{type:"hidden",name:"authenticity_token",value:e.token}),E.createElement(Re,{type:"submit",size:"sm"},"Publish")))}function _g({path:e,onChoose:t}){return e.length===0?null:E.createElement("nav",{"data-selection-path":!0,"aria-label":"Selection",className:"mb-4 flex flex-wrap items-center gap-1 text-xs"},e.map((n,o)=>E.createElement(E.Fragment,{key:n.id},o>0&&E.createElement("span",{"aria-hidden":"true",className:"text-(--ks-color-icon)"},"\u203A"),E.createElement("button",{type:"button","aria-current":o===e.length-1?"true":void 0,onClick:()=>t(n),className:"rounded px-1.5 py-0.5 hover:bg-(--ks-color-fill-muted) aria-[current=true]:font-semibold"},n.label))))}function yg({samples:e,chosen:t,onChoose:n}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",{className:"whitespace-nowrap"},"Preview with"),E.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},e.map(([o,r])=>E.createElement("option",{key:r,value:r},o))))}function xg({title:e,onChange:t}){let n=e??"";return E.createElement("div",{className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:"ks-pages-page-title"},"Page title"),E.createElement(_t,{id:"ks-pages-page-title",type:"text",defaultValue:n,onBlur:o=>o.target.value!==n&&t(o.target.value)}),E.createElement("p",{className:"ks-hint"},"Shown in the browser tab once the page is published"))}function vg({exceptions:e,chosen:t,onChoose:n}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",{className:"whitespace-nowrap"},"Access exception"),E.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},E.createElement("option",{value:""},"None"),e.map(([o,r])=>E.createElement("option",{key:r,value:r},o))))}function Sg({condition:e,valueNames:t,onChange:n}){let[o,r]=Ie(e?.value??""),[s,i]=Ie(e?.equals??""),a=Object.entries(t??{});if(a.length===0)return null;let l=c=>{r(c),(c===""||s!=="")&&n(c,s)};return E.createElement("div",{"data-show-when":!0,className:"mt-4 flex flex-col gap-2 border-t border-(--ks-color-border) pt-4 dark:border-(--ks-color-border-dark)"},E.createElement(on,{htmlFor:"ks-pages-show-when-value"},"Show only when"),E.createElement(yt,{id:"ks-pages-show-when-value",value:o,onChange:c=>l(c.target.value)},E.createElement("option",{value:""},"Always shown"),a.map(([c,u])=>E.createElement("option",{key:c,value:c},u))),o!==""&&E.createElement(E.Fragment,null,E.createElement(on,{htmlFor:"ks-pages-show-when-equals"},"equals"),E.createElement(_t,{id:"ks-pages-show-when-equals",type:"text",defaultValue:s,onBlur:c=>{i(c.target.value),c.target.value!==e?.equals&&n(o,c.target.value)}})))}var hC=[["light","Light"],["dark","Dark"],["system","System"]],T$=e=>{e==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e};function Cg(){let e=document.documentElement.dataset.theme??"system",t=e==="custom"?[...hC,["custom","Custom"]]:hC;return E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",null,"Mode"),E.createElement(yt,{"data-theme-mode":!0,defaultValue:e,onChange:n=>T$(n.target.value),className:"py-1"},t.map(([n,o])=>E.createElement("option",{key:n,value:n},o))))}var O$=e=>e.replace(/_/g," ").replace(/^./,t=>t.toUpperCase());function bg({looks:e}){return e.length===0?null:E.createElement("label",{className:"flex items-center gap-2 text-sm"},E.createElement("span",null,"Look"),E.createElement(yt,{"data-look-choice":!0,defaultValue:document.documentElement.dataset.look,onChange:t=>{document.documentElement.dataset.look=t.target.value},className:"py-1"},e.map(t=>E.createElement("option",{key:t,value:t},O$(t)))))}var D$=e=>E.createElement(_t,{...e,as:"textarea"}),gC=D$;var w$=({className:e,...t})=>E.createElement("input",{type:"checkbox",...t,className:Rn("ks-checkbox",e)}),Pu=w$;var mC=(e,t,n)=>{let o=[...e];return[o[t],o[n]]=[o[n],o[t]],o};function Eg({field:e,entries:t,onChange:n}){let o=(e.entry??[]).filter(s=>!s.hidden),r=s=>n(e.key,s);return E.createElement("div",{"data-list-field":e.key,className:"flex flex-col gap-2"},t.map((s,i)=>E.createElement("fieldset",{key:`${i}-${JSON.stringify(s)}`,"data-list-entry":!0,className:"flex flex-col gap-2 rounded-md border border-(--ks-color-border) dark:border-(--ks-color-border-dark) p-2"},o.map(a=>E.createElement("div",{key:a.key,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-${e.key}-${i}-${a.key}`},a.label),a.kind==="one_of"&&E.createElement(yt,{id:`ks-pages-${e.key}-${i}-${a.key}`,defaultValue:s[a.key]??a.default??"",onChange:l=>r(t.map((c,u)=>u===i?{...c,[a.key]:l.target.value}:c))},E.createElement("option",{value:""}),a.options.map(l=>E.createElement("option",{key:l,value:l},l))),a.kind!=="one_of"&&(a.kind==="yes_or_no"?E.createElement(Pu,{id:`ks-pages-${e.key}-${i}-${a.key}`,className:"self-start",defaultChecked:s[a.key]==="true",onChange:l=>r(t.map((c,u)=>u===i?{...c,[a.key]:String(l.target.checked)}:c))}):E.createElement(_t,{id:`ks-pages-${e.key}-${i}-${a.key}`,type:"text",defaultValue:s[a.key]??a.default??"",onBlur:l=>l.target.value!==(s[a.key]??a.default??"")&&r(t.map((c,u)=>u===i?{...c,[a.key]:l.target.value}:c))})))),E.createElement("div",{className:"flex flex-wrap gap-2"},E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:i===0,onClick:()=>r(mC(t,i,i-1))},"Move up"),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:i===t.length-1,onClick:()=>r(mC(t,i,i+1))},"Move down"),E.createElement(Re,{type:"button",size:"sm",variant:"danger",onClick:()=>r(t.filter((a,l)=>l!==i))},"Remove item")))),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",onClick:()=>r([...t,{}])},"Add item"))}var Ng={};de(Ng,{LexicalComposerContext:()=>_C,createLexicalComposerContext:()=>M$,useLexicalComposerContext:()=>k$});var _C=ev(null);function M$(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n!=null?n.getTheme():null)}}}function k$(){let e=nv(_C);return e==null&&(function(t,...n){throw(function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let a of r)i.append("v",a);return s.search=i.toString(),new Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(t,...n)})(8),e}var Tg=Ng,yC=Tg.LexicalComposerContext,xC=Tg.createLexicalComposerContext,Yt=Tg.useLexicalComposerContext;var w_={};de(w_,{$addUpdateTag:()=>Es,$applyNodeReplacement:()=>Gi,$assumeActiveEditor:()=>p1,$caretFromPoint:()=>$o,$caretRangeFromSelection:()=>xd,$cloneWithProperties:()=>S_,$cloneWithPropertiesEphemeral:()=>uP,$comparePointCaretNext:()=>Xl,$copyNode:()=>y_,$create:()=>iT,$createChildrenArray:()=>Yl,$createLineBreakNode:()=>Pd,$createNodeSelection:()=>n_,$createParagraphNode:()=>qt,$createPoint:()=>oo,$createRangeSelection:()=>aN,$createRangeSelectionFromDom:()=>c1,$createTabNode:()=>qE,$createTextNode:()=>rn,$exportNodeJSON:()=>jb,$extendCaretToRange:()=>E_,$findMatchingParent:()=>cr,$flushSyncAfterUpdate:()=>g1,$formatText:()=>QE,$fullReconcile:()=>dN,$generateNodesFromRawText:()=>o_,$getAdjacentChildCaret:()=>Vi,$getAdjacentNode:()=>LN,$getAdjacentSiblingOrParentSiblingCaret:()=>E1,$getCaretInDirection:()=>Kn,$getCaretRange:()=>br,$getCaretRangeInDirection:()=>Ld,$getCharacterOffsets:()=>vm,$getChildCaret:()=>Wn,$getChildCaretAtIndex:()=>CN,$getChildCaretOrSelf:()=>gT,$getCollapsedCaretRange:()=>mT,$getCommonAncestor:()=>O_,$getCommonAncestorResultBranchOrder:()=>T_,$getDOMSlot:()=>Jt,$getDOMTextNode:()=>Po,$getDocument:()=>Xt,$getEditor:()=>vo,$getEditorDOMRenderConfig:()=>Kd,$getNearestNodeFromDOMNode:()=>u_,$getNearestRootOrShadowRoot:()=>m_,$getNodeByKey:()=>Ee,$getNodeByKeyOrThrow:()=>WN,$getNodeFromDOMNode:()=>c_,$getPreviousSelection:()=>Ts,$getRoot:()=>Lt,$getSelection:()=>ce,$getSelectionSlotFrame:()=>uT,$getSiblingCaret:()=>Xe,$getSlot:()=>Ns,$getSlotFrame:()=>Gl,$getSlotHost:()=>gn,$getSlotNameWithinHost:()=>cT,$getSlotNames:()=>yo,$getState:()=>rd,$getStateChange:()=>dR,$getTextContent:()=>d1,$getTextNodeOffset:()=>no,$getTextPointCaret:()=>Cr,$getTextPointCaretSlice:()=>wm,$getWritableNodeState:()=>Wm,$hasAncestor:()=>Vl,$hasUpdateTag:()=>Q1,$insertNodeToNearestRootAtCaret:()=>EN,$insertNodes:()=>u1,$isBlockElementNode:()=>sN,$isBlockFullySelected:()=>s_,$isChildCaret:()=>zn,$isCompactExport:()=>Vb,$isDecoratorNode:()=>he,$isEditorState:()=>C1,$isElementDOMSlot:()=>QN,$isElementNode:()=>k,$isExtendableTextPointCaret:()=>SN,$isInlineElementOrDecoratorNode:()=>zN,$isInlineFormattable:()=>dd,$isLeafNode:()=>V1,$isLexicalNode:()=>Zm,$isLineBreakNode:()=>pn,$isNodeCaret:()=>DP,$isNodeSelection:()=>ji,$isParagraphNode:()=>NN,$isRangeSelection:()=>K,$isRootNode:()=>qe,$isRootOrShadowRoot:()=>We,$isSelectionCapturedInDecoratorInput:()=>Bd,$isShadowRootNode:()=>__,$isSiblingCaret:()=>Sr,$isSlotChild:()=>vr,$isSlotHost:()=>mr,$isTabNode:()=>t_,$isTextNode:()=>R,$isTextPointCaret:()=>to,$isTextPointCaretSlice:()=>AP,$isTokenOrSegmented:()=>Bn,$isTokenOrTab:()=>Ul,$markSlotEditable:()=>oT,$needsBlockCursorBeside:()=>Cd,$nodesOfType:()=>X1,$normalizeCaret:()=>hn,$normalizeSelection__EXPERIMENTAL:()=>Km,$onUpdate:()=>BN,$parseSerializedNode:()=>h1,$removeFromParent:()=>eo,$removeSlot:()=>NP,$removeTextFromCaretRange:()=>vN,$rewindSiblingCaret:()=>Os,$selectAll:()=>q1,$setCompositionKey:()=>ft,$setDirectionFromDOM:()=>eT,$setFormatFromDOM:()=>tT,$setPointFromCaret:()=>bs,$setSelection:()=>Pt,$setSelectionFromCaretRange:()=>xN,$setSlot:()=>pT,$setState:()=>oE,$setTextFormat:()=>i1,$splitAtPointCaretNext:()=>bN,$splitNode:()=>tP,$updateDOMSelection:()=>lN,$updateRangeSelectionFromCaretRange:()=>Nl,$withCompactExport:()=>Hb,ArtificialNode__DO_NOT_USE:()=>_d,BEFORE_INPUT_COMMAND:()=>Um,BLUR_COMMAND:()=>kE,CAN_REDO_COMMAND:()=>NR,CAN_UNDO_COMMAND:()=>TR,CAN_USE_BEFORE_INPUT:()=>Tl,CAN_USE_DOM:()=>Er,CLEAR_EDITOR_COMMAND:()=>bR,CLEAR_HISTORY_COMMAND:()=>ER,CLICK_COMMAND:()=>gE,COLLABORATION_TAG:()=>WE,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>F1,COMMAND_PRIORITY_BEFORE_EDITOR:()=>$1,COMMAND_PRIORITY_BEFORE_HIGH:()=>L1,COMMAND_PRIORITY_BEFORE_LOW:()=>R1,COMMAND_PRIORITY_BEFORE_NORMAL:()=>P1,COMMAND_PRIORITY_CRITICAL:()=>I1,COMMAND_PRIORITY_EDITOR:()=>w1,COMMAND_PRIORITY_HIGH:()=>A1,COMMAND_PRIORITY_LOW:()=>M1,COMMAND_PRIORITY_NORMAL:()=>k1,COMPOSITION_END_COMMAND:()=>jm,COMPOSITION_END_TAG:()=>ud,COMPOSITION_START_COMMAND:()=>Vm,COMPOSITION_START_TAG:()=>HE,CONTROLLED_TEXT_INSERTION_COMMAND:()=>Ti,CONTROL_OR_ALT:()=>pm,CONTROL_OR_META:()=>lr,CONTROL_OR_OTHER_KEY:()=>Rm,COPY_COMMAND:()=>Xm,CUT_COMMAND:()=>Jm,CUT_TAG:()=>UR,DEFAULT_EDITOR_DOM_CONFIG:()=>Kl,DELETE_CHARACTER_COMMAND:()=>Rl,DELETE_LINE_COMMAND:()=>Oi,DELETE_WORD_COMMAND:()=>Pl,DRAGEND_COMMAND:()=>DE,DRAGOVER_COMMAND:()=>OE,DRAGSTART_COMMAND:()=>TE,DROP_COMMAND:()=>NE,DecoratorNode:()=>zl,ElementNode:()=>ro,FOCUS_COMMAND:()=>ME,FORMAT_ELEMENT_COMMAND:()=>CR,FORMAT_TEXT_COMMAND:()=>fr,HISTORIC_TAG:()=>zR,HISTORY_MERGE_TAG:()=>qu,HISTORY_PUSH_TAG:()=>WR,INDENT_CONTENT_COMMAND:()=>vR,INPUT_COMMAND:()=>Hm,INSERT_LINE_BREAK_COMMAND:()=>bl,INSERT_PARAGRAPH_COMMAND:()=>um,INSERT_TAB_COMMAND:()=>xR,INTERNAL_$expandSelectionToWholeDocument:()=>Xu,INTERNAL_$isBlock:()=>Rt,IS_ALL_FORMATTING:()=>$b,IS_ANDROID:()=>Am,IS_ANDROID_CHROME:()=>Ol,IS_APPLE:()=>Lo,IS_APPLE_WEBKIT:()=>Zl,IS_BOLD:()=>F$,IS_CHROME:()=>Od,IS_CODE:()=>K$,IS_FIREFOX:()=>xo,IS_HIGHLIGHT:()=>V$,IS_IOS:()=>so,IS_ITALIC:()=>B$,IS_SAFARI:()=>Ql,IS_STRIKETHROUGH:()=>z$,IS_SUBSCRIPT:()=>U$,IS_SUPERSCRIPT:()=>H$,IS_UNDERLINE:()=>W$,KEY_ARROW_DOWN_COMMAND:()=>xE,KEY_ARROW_LEFT_COMMAND:()=>_E,KEY_ARROW_RIGHT_COMMAND:()=>mE,KEY_ARROW_UP_COMMAND:()=>yE,KEY_BACKSPACE_COMMAND:()=>SE,KEY_DELETE_COMMAND:()=>bE,KEY_DOWN_COMMAND:()=>Gm,KEY_ENTER_COMMAND:()=>qm,KEY_ESCAPE_COMMAND:()=>CE,KEY_MODIFIER_COMMAND:()=>AE,KEY_SPACE_COMMAND:()=>vE,KEY_TAB_COMMAND:()=>EE,LineBreakNode:()=>Fi,MOVE_TO_END:()=>dm,MOVE_TO_START:()=>fm,NODE_STATE_DIRECT:()=>Zg,NODE_STATE_KEY:()=>Dd,NODE_STATE_LATEST:()=>em,OUTDENT_CONTENT_COMMAND:()=>SR,PASTE_COMMAND:()=>Ym,PASTE_TAG:()=>KR,ParagraphNode:()=>Bi,REDO_COMMAND:()=>Ll,REMOVE_TEXT_COMMAND:()=>Vu,RootNode:()=>Li,SELECTION_CHANGE_COMMAND:()=>Rd,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>_R,SELECT_ALL_COMMAND:()=>wE,SET_TEXT_FORMAT_COMMAND:()=>yR,SKIP_COLLAB_TAG:()=>HR,SKIP_DOM_SELECTION_TAG:()=>UE,SKIP_SCROLL_INTO_VIEW_TAG:()=>KE,SKIP_SELECTION_FOCUS_TAG:()=>cd,TEXT_TYPE_TO_FORMAT:()=>xt,TabNode:()=>Ri,TextNode:()=>_r,UNDO_COMMAND:()=>id,addClassNamesToElement:()=>FP,aliasTableOf:()=>od,aliasedValue:()=>Qg,arrayValue:()=>lR,booleanValue:()=>nR,buildImportMap:()=>BR,compileKeyboardShortcuts:()=>$E,configExtension:()=>$P,createCommand:()=>j,createEditor:()=>B1,createRefCountedRegistry:()=>RE,createSharedNodeState:()=>rE,createState:()=>uR,declarePeerDependency:()=>RP,declaredAccepts:()=>Bm,defineExtension:()=>IP,enumValue:()=>kl,findAllLexicalElementsDeep:()=>HN,flipDirection:()=>Wo,getActiveElement:()=>Ed,getActiveElementDeep:()=>zi,getComposedEventTarget:()=>x_,getComposedSchemaFields:()=>pP,getComposedStaticRange:()=>qi,getDOMOwnerDocument:()=>Wd,getDOMSelection:()=>Hn,getDOMSelectionFromTarget:()=>KN,getDOMSelectionPoints:()=>sn,getDOMSelectionRange:()=>jN,getDOMSelectionRangeAndPoints:()=>eP,getDOMShadowRoots:()=>UN,getDOMTextNode:()=>wN,getDeclaredSlots:()=>dT,getEditorPropertyFromDOMNode:()=>nc,getNearestEditorFromDOMNode:()=>gr,getParentElement:()=>Ro,getRegisteredNode:()=>Fd,getRegisteredNodeOrThrow:()=>l_,getRegisteredSubtypeMap:()=>CP,getRootOwnerDocument:()=>VN,getStaticNodeConfig:()=>oc,getStyleObjectFromCSS:()=>_m,getTextDirection:()=>H1,getTransformSetFromKlass:()=>ON,getterTableOf:()=>ec,isBlockDomNode:()=>v_,isCurrentlyReadOnlyMode:()=>yr,isDOMCapturingSelection:()=>jl,isDOMDocumentNode:()=>Yi,isDOMNode:()=>Xi,isDOMShadowRoot:()=>Bo,isDOMTextNode:()=>_n,isDOMUnmanaged:()=>C_,isDocumentFragment:()=>XN,isExactShortcutMatch:()=>G1,isHTMLAnchorElement:()=>nP,isHTMLElement:()=>we,isHTMLTableCellElement:()=>rP,isHTMLTableRowElement:()=>oP,isInlineDomNode:()=>JN,isLastChildInBlockNode:()=>yN,isLexicalEditor:()=>zd,isModifierMatch:()=>PN,isOnlyChildInBlockNode:()=>_N,isSchemaField:()=>Fo,isSelectionCapturedInDecoratorInput:()=>U1,isSelectionWithinEditor:()=>tc,iterStaticNodeConfigChain:()=>zo,keyboardEventMaskForPlatform:()=>Y1,makeStepwiseIterator:()=>N_,mergeRegister:()=>D_,mountSlotContainer:()=>aP,nodeSchema:()=>Id,normalizeClassNames:()=>rc,nullable:()=>oR,numberValue:()=>Ii,objectValue:()=>cR,optional:()=>rR,rawValue:()=>aR,registerEventListener:()=>Qm,registerEventListeners:()=>zP,removeClassNamesFromElement:()=>BP,removeFromParent:()=>j1,resetRandomKey:()=>W1,safeCast:()=>PP,setDOMStyleFromCSS:()=>ym,setDOMStyleObject:()=>QR,setDOMUnmanaged:()=>nT,setNodeIndentFromDOM:()=>ZN,setterDefaultOf:()=>kd,setterTableOf:()=>Md,shallowMergeConfig:()=>LP,stopLexicalPropagation:()=>gm,stringValue:()=>Ml,toggleTextFormatType:()=>xr,tokenizeRawText:()=>cN,transformValue:()=>iR,unionValue:()=>sR,unmountSlotContainer:()=>lP,withAccessors:()=>Ni,withField:()=>Io});function Gg(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);return n.search=o.toString(),new 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 M(e,...t){throw Gg(e,...t)}function km(e,...t){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(let r of t)o.append("v",r);n.search=o.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 A$(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}var Er=A$();function I$(){return Er&&"documentMode"in document?document.documentMode:null}var $$=I$();function R$(e){return Er&&e.test(navigator.platform)}function Jl(e){return Er&&e.test(navigator.userAgent)}var Lo=R$(/Mac|iPod|iPhone|iPad/),xo=Jl(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function P$(){return!(!Er||!("InputEvent"in window)||$$)&&"getTargetRanges"in new window.InputEvent("input")}var Tl=P$();function L$(){return Er&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var so=L$(),Am=Jl(/Android/),Ql=Jl(/Version\/[\d.]+.*Safari/)&&!Am,Od=Jl(/^(?=.*Chrome).*/i),Ol=Er&&Am&&Od,Zl=Jl(/AppleWebKit\/[\d.]+/)&&Lo&&!Od,F$=1,B$=2,z$=4,W$=8,K$=16,U$=32,H$=64,V$=128;function j$(){return 2047}var $b=j$(),Dl=Ql||so||Zl?"\xA0":"\u200B",_s=`
68
68
 
69
- `,Im=xo?"\xA0":Dl,$b="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Rb="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF";function Pb(e,t){return new RegExp("^[^"+e+"]*["+t+"]")}var V$=Pb(Rb,$b),j$=Pb($b,Rb),xt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Lb={directionless:1,unmergeable:2},Ai={center:2,end:6,justify:4,left:1,right:3,start:5};function Fb(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Bb=Fb(Ai),$m={normal:0,segmented:2,token:1},zb=Fb($m),Dd="$",Rm=Symbol.for("@lexical/ctrlOrOtherKey"),Og="$config";function Dg(){return vo()._blockCursorElement}function wg(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}var Y$=Zl||ro||Ql;function xC(){let e=Xt().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 Zu(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-decorator-boundary")}var ed=class e{constructor(t,n,o){w(this,"element");w(this,"before");w(this,"after");this.element=t,this.before=n||null,this.after=o||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(t){let n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&M(357),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&M(358),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&M(359),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,n,o){if(this.element===t)return n===t&&o===0?"before":"after";let r=vC(t,this.element);if(r===null)return"after";let s=Array.prototype.indexOf.call(t.childNodes,r);if(s<0)return"after";if(n===t)return o<=s?"before":"after";let i=vC(t,n);if(i===null)return"after";let a=Array.prototype.indexOf.call(t.childNodes,i);return a>=0&&a<=s?"before":"after"}getInsertionAnchor(){return this.before}};function vC(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var td=class e extends ed{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 t=super.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;for(;wg(n);)t=n,n=n.nextSibling;Zu(n)&&(t=n,n=n.nextSibling);let o=t?t.nextSibling:this.element.firstChild;return o!==null&&o===Dg()?o:t}getDecoratorBoundaryAnchor(t){let n;if(t==="leading"){let o=super.getFirstChildAnchor();for(n=o?o.nextSibling:this.element.firstChild;wg(n);)n=n.nextSibling}else n=this.before?this.before.previousSibling:this.element.lastChild,n!==null&&n===Dg()&&(n=n.previousSibling);return Zu(n)?n:null}setDecoratorBoundaryAnchor(t,n){let o=this.getDecoratorBoundaryAnchor(t);if(n!==(o!==null))if(o!==null)this.element.removeChild(o);else if(t==="leading"){let r=this.getFirstChildAnchor();this.element.insertBefore(xC(),r?r.nextSibling:this.element.firstChild)}else this.element.insertBefore(xC(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){let n=this.element,o=this.after===null?n.firstChild:this.after.nextSibling,r=t==="empty"&&wg(o)?null:t;if(n.__lexicalLastChildKind!==r)if(n.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let s=r==="decorator"&&Y$;this.insertManagedLineBreak(s)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before||this.getDecoratorBoundaryAnchor("trailing"),s=Xt().createElement("br");if(s.setAttribute("data-lexical-managed-linebreak","true"),o.insertBefore(s,r),t){let i=Xt().createElement("img");i.setAttribute("data-lexical-managed-linebreak","true"),i.style.setProperty("display","inline","important"),i.style.setProperty("border","0px","important"),i.style.setProperty("margin","0px","important"),i.alt="",o.insertBefore(i,s),o.__lexicalLineBreak=i}else o.__lexicalLineBreak=s}getFirstChildOffset(){let t=this.getFirstChild(),n=this.getInsertionAnchor(),o=0;for(let r=this.element.firstChild;r!==null&&r!==t&&r!==n;r=r.nextSibling)o++;return o}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset(),c=Dg(),u=this.element.childNodes,d=Math.min(r,u.length),f=0;for(let p=l;p<d;p++)u[p]!==c&&f++;return[t,Math.min(f,t.getChildrenSize())]}let s=SC(n,o);s.push(r);let i=SC(n,this.element),a=t.getIndexWithinParent();for(let l=0;l<i.length;l++){let c=s[l],u=i[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}};function SC(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;n.push(r)}return o!==e&&M(225),n.reverse()}function G$(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var Wb=G$(),hs=class{constructor(){w(this,"_front",new Set);w(this,"_back",new Set);w(this,"_cache")}get size(){return this._front.size+this._back.size}addBack(t){return delete this._cache,this._front.has(t)||this._back.add(t),this}addFront(t){return delete this._cache,this._back.has(t)||this._front.add(t),this}delete(t){return delete this._cache,this._front.delete(t)||this._back.delete(t)}toArray(){let t=Array.from(this._front).reverse();for(let n of this._back)t.push(n);return t}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},fs=null;function Kb(e,t=1e3){return e instanceof wl?e.clone():e.size<t?new Map(e):new wl().init(new Map(e),void 0,e.size)}var wl=class e{constructor(){w(this,"_mutable",!1);w(this,"_old");w(this,"_nursery");w(this,"_size",0)}clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(t,n,o){return this._old=t,this._nursery=n,this._size=o,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){let n=this._nursery&&this._nursery.get(t);return n!==void 0?n:this._old&&this._old.get(t)}get(t){let n=this.getWithTombstone(t);return n===fs?void 0:n}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(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){let n=new Map(this._old);for(let[o,r]of this._nursery)r!==fs?n.set(o,r):n.delete(o);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(t,n){let o=this.getWithTombstone(t);if(o===n)return this;let r=this.getNursery();return o!==fs&&o!==void 0||(this._size++,o===fs&&r.delete(t)),r.set(t,n),this}delete(t){let n=this.has(t);return n&&(this.getNursery().set(t,fs),this._size--),n}getOrInsert(t,n){let o=this.get(t);return o!==void 0?o:(this.set(t,n),n)}getOrInsertComputed(t,n){let o=this.get(t);if(o!==void 0)return o;let r=n(t);return this.set(t,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let t of this.entries())yield t[0]}*values(){for(let t of this.entries())yield t[1]}*entries(){let t=this._nursery,n=this._old;if(t){if(n)for(let o of n){let r=o[0],s=t.get(r);s!==fs&&(s!==void 0&&(o[1]=s),yield o)}for(let o of t)o[1]===fs||n&&n.has(o[0])||(yield o)}else n&&(yield*n)}forEach(t,n){n!==void 0&&(t=t.bind(n));for(let[o,r]of this.entries())t(r,o,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}},vl=!1;function Ub(e,t,...n){let o=vl,r;try{vl=e,r=t()}finally{vl=o}var s;return(s=r)===null||typeof s!="object"&&typeof s!="function"||typeof s.then!="function"||M(421),r}function Hb(){return vl}function Vb(e){let t=e.exportJSON(vl),n=e.constructor;return t.type!==n.getType()&&M(130,n.name),k(e)&&!Array.isArray(t.children)&&M(59,n.name),t}function nd(e,t,n,o,r,s){if(k(e)){let i=e.getFirstChild();for(;i!==null;){let a=i.__key;i.__parent===t&&((k(i)||mr(i)&&i.__slots!==null)&&nd(i,a,n,o,r,s),n.has(a)||s.delete(a),r.push(a)),i=i.getNextSibling()}}for(let i of mr(e)&&e.__slots!==null?e.__slots.values():[]){let a=o.get(i);a!==void 0&&vr(a)&&a.__slotHost===t&&((k(a)||mr(a)&&a.__slots!==null)&&nd(a,i,n,o,r,s),n.has(i)||s.delete(i),r.push(i))}}var qg=!1,Pm=0;function q$(e){Pm=e.timeStamp}function Mg(e,t,n){let o=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||o&&e.previousSibling===r)||o&&Ds(e,n)!==void 0}function X$(e,t,n){let o=Un(an(n)),r=o&&sn(o,n._rootElement),s=null,i=null;r!==null&&r.anchorNode===e&&(s=r.anchorOffset,i=r.focusOffset);let a=e.nodeValue;a!==null&&p_(t,a,s,i,!1)}function J$(e,t,n){if(K(e)){let o=e.anchor.getNode();if(o.is(n)&&e.format!==o.getFormat())return!1}return _n(t)&&n.isAttached()}function Q$(e,t,n){for(let o=e;o&&!C_(o);o=Ro(o)){let r=Ds(o,t);if(r!==void 0){let s=Ee(r,n);if(s)return he(s)||!we(o)?void 0:[o,s]}}}function jb(e,t,n){qg=!0;let o=performance.now()-Pm>100;try{mn(e,()=>{let r=ce()||(function(d){return d.read("latest",()=>{let f=ce();return f!==null?f.clone():null})})(e),s=new Map,i=e._editorState,a=e._blockCursorElement,l=!1,c="";for(let d=0;d<t.length;d++){let f=t[d],p=f.type,h=f.target,g=Q$(h,e,i);if(!g)continue;let[y,m]=g;if(p==="characterData")o&&R(m)&&_n(h)&&J$(r,h,m)&&X$(h,m,e);else if(p==="childList"){l=!0;let _=f.addedNodes;for(let S=0;S<_.length;S++){let b=_[S],N=c_(b),D=b.parentNode;if(!(D==null||b===a||N!==null||Mg(b,D,e)||Zu(b)||e._slotsUsed&&we(b)&&b.hasAttribute("data-lexical-slot")||C_(b))){if(xo){let O=(we(b)?b.innerText:null)||b.nodeValue;O&&(c+=O)}D.removeChild(b)}}let x=f.removedNodes,v=x.length;if(v>0){let S=0;for(let b=0;b<v;b++){let N=x[b];Mg(N,h,e)||a===N?(h.appendChild(N),S++):Zu(N)&&S++}v!==S&&s.set(y,m)}}}if(s.size>0)for(let[d,f]of s)f.reconcileObservedMutation(d,e);let u=n.takeRecords();if(u.length>0){for(let d=0;d<u.length;d++){let f=u[d],p=f.addedNodes,h=f.target;for(let g=0;g<p.length;g++){let y=p[g],m=y.parentNode;m==null||y.nodeName!=="BR"||Mg(y,h,e)||m.removeChild(y)}}n.takeRecords()}r!==null&&(l&&Pt(r),xo&&LN(e)&&r.insertRawText(c))})}finally{qg=!1}}function Yb(e){let t=e._observer;t!==null&&jb(e,t.takeRecords(),t)}function Gb(e){(function(t){Pm===0&&an(t).addEventListener("textInput",q$,!0)})(e),e._observer=new MutationObserver((t,n)=>{jb(e,t,n)})}function wd(e,t,n){let{isEqual:o}=e;return t===n||o!==void 0&&o(t,n)}function Lm(e,t){return wd(e,t,e.defaultValue)}function Fo(e){return typeof e=="object"&&e!==null}function ec(e,t){let n=Ad(e,t).getter;return Fo(n)&&n.getterTable!==void 0||M(405,t),Fm(n.getterTable)}function Md(e,t){let n=Ad(e,t).setter;return Fo(n)&&n.setterTable!==void 0||M(406,t),Fm(n.setterTable)}function od(e,t,n){let{meta:o}=Ad(e,t);for(let r=0;;)if(o.kind==="aliased"){if(r===n)return Fm(o.aliases);r++,o=o.inner.meta}else o.kind==="nullable"||o.kind==="optional"?o=o.inner.meta:o.kind==="array"?o=o.item.meta:M(407,t,String(n))}function kd(e,t){let n=Ad(e,t),{setter:o}=n;Fo(o)&&o.setterTable!==void 0||M(408,t);let r=String(n.defaultValue);return Ln(o.setterTable,r)||M(409,t,r),o.setterTable[r]}function Fm(e){return Object.assign(Object.create(null),e)}function Ad(e,t){let n=e.get(t);return n===void 0&&M(410,t),n}function Kn(e,t,n,o,r){r!==void 0&&qb.add(r);let s=n===void 0,i=s?e(void 0):n;return s&&Jb(i),Object.assign(e,{accepts:r,defaultValue:i,isEqual:o,meta:t})}var qb=new WeakSet;function Bm(e){let{accepts:t}=e;return t===void 0||qb.has(t)?void 0:t}var Xb=new WeakSet;function zm(e){return e!==null&&typeof e=="object"&&Xb.add(e),e}function Jb(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)&&!Xb.has(e)){Object.freeze(e);for(let t of Object.values(e))Jb(t)}}function Qb(e){let{isEqual:t}=e;return t===void 0?void 0:(n,o)=>n==null||o==null?n===o:t(n,o)}function Zb(e,t){return n=>t(n)||xs(e,n)}function xs(e,t){let{accepts:n}=e;return n!==void 0?n.call(e,t):(function(o,r){let{accepts:s}=o;if(s!==void 0)return xs(o,r)?{parsed:o(r)}:void 0;let i=o(r);return Lm(o,i)&&r!==o.defaultValue?void 0:{parsed:i}})(e,t)!==void 0}var CC=new WeakMap;function Xg(e){let t=CC.get(e);if(t!==void 0)return t;let n=(function(o){let r=o.meta;if(r==null||Bm(o)!==void 0)return!1;switch(r.kind){case"raw":return!0;case"union":return r.members!=null&&r.members.length>0&&r.members.every(s=>Xg(s));case"nullable":case"optional":case"transform":case"aliased":return r.inner!=null&&Xg(r.inner);default:return!1}})(e);return CC.set(e,n),n}function Ku(e,t){let n=e.meta;if(n==null)return xs(e,t)?1:4;let o=Bm(e),r=o!==void 0;if(r&&!o.call(e,t))return 4;let s=(function(i,a,l,c){switch(a.kind){case"raw":return c?1:2;case"array":{if(!Array.isArray(l))return 4;if(a.item==null)return 1;let u=1;for(let d=0;d<l.length;d++)if(l[d]!==void 0){let f=Ku(a.item,l[d]);f>u&&(u=f)}return u>=3?3:u}case"object":{let u=a.fields;if(!Ei(l))return 4;if(u==null)return 1;if(!c&&Uu(l,u))return 4;let d=1;for(let f of Object.keys(l))if(Ln(u,f)){let p=Ku(u[f],l[f]);p>d&&(d=p)}return d>=3?3:d}case"union":return a.members==null?1:eE(a.members,l).fit;case"aliased":case"nullable":case"optional":case"transform":return(a.kind==="aliased"?typeof l=="string"&&a.aliases!=null&&Ln(a.aliases,l):a.kind==="nullable"?l==null:a.kind==="optional"&&l===void 0)||a.inner==null?1:Ku(a.inner,l);default:return c||xs(i,l)?1:4}})(e,n,t,r);return r&&s===4?3:s}function eE(e,t){let n,o=4,r=4;for(let s=0;s<e.length;s++){let i=e[s],a=Ku(i,t),l=a<3&&Xg(i)?3:a;if(l<o&&(n=i,o=l,r=a,l===1))break}return{fit:r,member:n}}function Ln(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ei(e){if(!(function(n){return(function(o){return typeof o=="object"&&o!==null})(n)&&!Array.isArray(n)})(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Uu(e,t){for(let n of Object.keys(e))if(!Ln(t,n))return!0;return!1}function Ml(e=""){return Kn(t=>typeof t=="string"?t:e,{kind:"string"},void 0,void 0,t=>typeof t=="string")}var Z$=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ii(e=0,t={}){let{integer:n,clamp:o}=t,r=n&&t.min!==void 0?Math.ceil(t.min):t.min,s=n&&t.max!==void 0?Math.floor(t.max):t.max,i=c=>typeof c=="string"&&Z$.test(c)?Number(c):c,a=c=>typeof c=="number"&&Number.isFinite(c)&&(!n||Number.isInteger(c)),l=c=>a(c)&&(r===void 0||c>=r)&&(s===void 0||c<=s);return Kn(c=>{let u=i(c);return o&&a(u)?r!==void 0&&u<r?r:s!==void 0&&u>s?s:u:l(u)?u:e},{clamp:o,integer:n,kind:"number",max:s,min:r},void 0,void 0,c=>o?a(i(c)):l(i(c)))}function eR(e=!1){return Kn(t=>typeof t=="boolean"?t:e,{kind:"boolean"},void 0,void 0,t=>typeof t=="boolean")}function kl(e,...t){let n=zm(t.length!==0?t[0]:e[0]),o=new Set(e);return Kn(r=>r!==void 0&&o.has(r)?r:n,{kind:"enum",values:e},n,void 0,r=>o.has(r)&&(r!==void 0||n===void 0))}function tR(e,t={}){let{defaultAsNull:n}=t;return Kn(o=>{if(o==null)return null;let r=e(o);return n&&Lm(e,r)?null:r},{defaultAsNull:n,inner:e,kind:"nullable"},void 0,Qb(e),Zb(e,o=>o==null))}function nR(e,t={}){let{omitDefault:n}=t;return Kn(o=>{if(o===void 0)return;let r=e(o);return n&&Lm(e,r)?void 0:r},{inner:e,kind:"optional",omitDefault:n},void 0,Qb(e),Zb(e,o=>o===void 0))}function Jg(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Jg(e[o],t[o]))return!1;return!0}if(!Ei(e)||!Ei(t))return!1;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(o=>Ln(t,o)&&Jg(e[o],t[o]))}function oR(e,...t){let n=t.length!==0?zm(t[0]):e[0].defaultValue;return Kn(o=>{if(o===void 0)return n;let r=(s=>{let i=(function(a,l){return eE(a,l).member})(e,s);return i===void 0?void 0:{member:i,parsed:i(s)}})(o);return r===void 0?n:r.parsed},{kind:"union",members:e},n,Jg,o=>(o!==void 0||n===void 0)&&e.some(r=>xs(r,o)))}function Id(){return e=>(function(t){return{meta:{fields:t,kind:"node"}}})(e)}function Qg(e,t){let n=o=>typeof o=="string"&&Ln(t,o);return Kn(o=>n(o)?t[o]:e(o),{aliases:t,inner:e,kind:"aliased"},e.defaultValue,e.isEqual,o=>n(o)||xs(e,o))}function rR(e,t,n={}){return Kn(o=>t(e(o)),{inner:e,kind:"transform"},zm(t(e.defaultValue)),n.isEqual,o=>xs(e,o))}function sR(){return Kn(e=>e===void 0?void 0:e,{kind:"raw"},void 0,void 0,()=>!0)}function iR(e){return Kn(t=>{if(!Array.isArray(t))return[];let n=new Array(t.length);for(let o=0;o<t.length;o++)n[o]=e(t[o]);return n},{item:e,kind:"array"},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!wd(e,t[o],n[o]))return!1;return!0},t=>Array.isArray(t))}function aR(e){return(function(n,o){let r=Object.entries(o);return Kn(s=>{let i=s!==null&&typeof s=="object"?s:{},a={};for(let l=0;l<r.length;l++){let[c,u]=r[l];a[c]=u(i[c])}return a},{fields:o,kind:"object"},void 0,(s,i)=>Ei(s)&&Ei(i)&&!Uu(s,o)&&!Uu(i,o)&&r.every(([a,l])=>wd(l,s[a],i[a])),s=>Ei(s)&&!Uu(s,o))})(0,e)}function Io(e,t){return tE(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}})}function Ni(e,t){return tE(0,e,t)}function tE(e,t,n){return Object.assign(o=>t(o),{accepts:t.accepts,defaultValue:t.defaultValue,getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Zg="direct",em="latest",tm=class{constructor(t,n){w(this,"key");w(this,"parse");w(this,"unparse");w(this,"isEqual");w(this,"defaultValue");w(this,"resetOnCopyNode");w(this,"schema");this.key=t;let o="meta"in(r=n.parse)&&typeof r.meta=="object"&&r.meta!==null&&"kind"in r.meta&&typeof r.meta.kind=="string"&&"defaultValue"in r?n.parse:void 0;var r;this.schema=o,this.parse=n.parse.bind(n),this.unparse=(n.unparse||uR).bind(n),this.isEqual=n.isEqual?n.isEqual.bind(n):o!==void 0&&o.isEqual!==void 0?(s,i)=>wd(o,s,i):Object.is,this.defaultValue=o!==void 0?o.defaultValue:this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function lR(e,t){return new tm(e,t)}function rd(e,t,n=em){let o=(n===em?e.getLatest():e).__state;return o?o.getValue(t):t.defaultValue}function cR(e,t,n){let o=rd(e,n,Zg),r=rd(t,n,Zg);return n.isEqual(o,r)?null:[o,r]}function nE(e,t,n){let o;if(dt(),typeof n=="function"){let s=e.getLatest(),i=rd(s,t);if(o=n(i),t.isEqual(i,o))return s}else o=n;let r=e.getWritable();return Wm(r).updateFromKnown(t,o),r}function oE(e){let t=new Map,n=new Set;for(let{ownNodeConfig:o}of zo(typeof e=="function"?e:e.replace))if(o&&o.stateConfigs)for(let r of o.stateConfigs){let s;"stateConfig"in r?(s=r.stateConfig,r.flat&&n.add(s.key)):s=r,t.set(s.key,s)}return{flatKeys:n,sharedConfigMap:t}}var bC=new Set(["__proto__","constructor","prototype"]),nm=class e{constructor(t,n,o=void 0,r=new Map,s=void 0){w(this,"node");w(this,"knownState");w(this,"unknownState");w(this,"sharedNodeState");w(this,"size");this.node=t,this.sharedNodeState=n,this.unknownState=o,this.knownState=r;let{sharedConfigMap:i}=this.sharedNodeState,a=s!==void 0?s:(function(l,c,u){let d=u.size;if(c)for(let f in c){let p=l.get(f);p&&u.has(p)||d++}return d})(i,o,r);this.size=a}getValue(t){let n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let o=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){let r=this.unknownState[t.key];r!==void 0&&(o=t.parse(r)),this.updateFromKnown(t,o)}return o}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let t={...this.unknownState},n={};for(let[o,r]of this.knownState)o.isEqual(r,o.defaultValue)?delete t[o.key]:t[o.key]=o.unparse(r);for(let o of this.sharedNodeState.flatKeys)o in t&&(n[o]=t[o],delete t[o]);return EC(t)&&(n[Dd]=t),n}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:o}=this,r=new Map(this.knownState);return new e(t,n,(function(s,i,a){let l;if(a)for(let[c,u]of Object.entries(a)){if(bC.has(c))continue;let d=s.get(c);d?i.has(d)||i.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,r,o),r,this.size)}resetOnCopyNode(){for(let t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,n){let o=t.key;this.sharedNodeState.sharedConfigMap.set(o,t);let{knownState:r,unknownState:s}=this;r.has(t)||s&&o in s||(s&&(delete s[o],this.unknownState=EC(s)),this.size++),r.set(t,n)}updateFromUnknown(t,n){if(bC.has(t))return;let o=this.sharedNodeState.sharedConfigMap.get(t);o?this.updateFromKnown(o,o.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){let{knownState:n}=this;for(let o of n.keys())n.set(o,o.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(let[o,r]of Object.entries(t))this.updateFromUnknown(o,r)}};function Wm(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new nm(t,(function(o){return o.__state?o.__state.sharedNodeState:l_(vo(),o.getType()).sharedNodeState})(t));return t.__state=n,n}function rE(e,t){let n=e.getWritable(),o=t[Dd];return(n.__state||o)&&Wm(e).updateFromJSON(o),n}function EC(e){if(e)for(let t in e)return e}function uR(e){return e}function NC(e,t,n){for(let[o,r]of t.knownState){if(e.has(o.key))continue;e.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function TC(e,t,n){let{unknownState:o}=t,r=n?n.unknownState:void 0;if(o){for(let[s,i]of Object.entries(o))if(!e.has(s)&&(e.add(s),i!==(r?r[s]:void 0)))return!0}return!1}function OC(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function DC(e,t){let n=e.__mode,o=e.__format,r=e.__style,s=t.__mode,i=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===a)&&(e.__state===null||l===c||(function(u,d){if(u===d)return!0;let f=new Set;return!(u&&NC(f,u,d)||d&&NC(f,d,u)||u&&TC(f,u,d)||d&&TC(f,d,u))})(l,c))}function wC(e,t){let n=e.mergeWithSibling(t),o=ge()._normalizedNodes;return o.add(e.__key),o.add(t.__key),n}function MC(e){let t,n,o=e;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(t=o.getPreviousSibling())!==null&&R(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(DC(t,o)){o=wC(t,o);break}break}t.remove()}for(;(n=o.getNextSibling())!==null&&R(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(DC(o,n)){o=wC(o,n);break}break}n.remove()}}else o.remove()}function Km(e){return kC(e.anchor),kC(e.focus),e}function kC(e){for(;e.type==="element";){let t=e.getNode(),n=e.offset,o,r;if(n===t.getChildrenSize()?(o=t.getChildAtIndex(n-1),r=!0):(o=t.getChildAtIndex(n),r=!1),R(o)){e.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!k(o))break;e.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var sd=Symbol.for("@lexical/CachedTextSize");function AC(e,t){return om.read(()=>{let n=0,o=e;for(let r=0;r<t&&o!==null;r++){let s=Qn.get(o);if(s===void 0&&M(345,o),k(s)){let i=Pe.get(o);if(i!==void 0&&k(i)&&i.__parent!==s.__parent)n+=s.getTextContentSize();else{let a=vs.get(o),l=a&&a.__lexicalTextContent;typeof l!="string"&&M(346,s.getType()),n+=l.length}r<t-1&&!s.isInline()&&(n+=2)}else{let i=s[sd];i===void 0&&M(347,s.getType(),o),n+=i}o=s.__next}return n},{editor:pe})}function sE(e){k(e)||e[sd]===void 0&&(e[sd]=R(e)?e.__text.length:e.getTextContentSize())}var dR=4,Al,pe,Il,se="",Ye=null,$t=null,Et=null;function mo(){return{firstTextKey:Et,format:Ye,style:$t}}function Pn(e){e.firstTextKey!==null&&(Ye=e.format,$t=e.style,Et=e.firstTextKey)}function kg(e){if(Et!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&M(348),t===null)return;let n=Pe.get(t);R(n)&&(Ye=n.getFormat(),$t=n.getStyle(),Et=t)}var $d,Sl,Cl,Qn,om,Pe,vs,rm,$l,Ss,ko=!1,Hu=!1;function ur(e,t){let n=Qn.get(e),o=Pe.has(e);if(t!==null){let r=cm(e);r.parentNode===t&&t.removeChild(r)}if(!o){if(pe._keyToDOMMap.delete(e),k(n)){let r=Yl(n,Qn);sm(r,0,r.length-1,null)}if(n!==void 0){for(let r of Rn(n).values()){let s=am(r);ur(r,null),s!==null&&s.remove()}h_($l,Il,$d,n,"destroyed")}}}function sm(e,t,n,o){for(let r=t;r<=n;++r){let s=e[r];s!==void 0&&ur(s,o)}}function ps(e,t){e.setProperty("text-align",t)}var fR="40px";function iE(e,t){let n=Al.theme.indent;if(typeof n=="string"){let o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${fR}))`),Hl(e,"class"),Hl(e,"style")}function aE(e,t){let n=e.style;t===0?ps(n,""):t===1?ps(n,"left"):t===2?ps(n,"center"):t===3?ps(n,"right"):t===4?ps(n,"justify"):t===5?ps(n,"start"):t===6&&ps(n,"end"),Hl(e,"style")}function im(e,t){let n=(function(o){let r=o.__dir;if(r!==null)return r;if(qe(o))return null;let s=o.getParent();return s===null||We(s)&&s.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function lE(e){let t=Xt().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function cE(e,t,n){t||e.contentEditable==="false"?nT(n,pe):n.removeAttribute("contenteditable")}function IC(e,t,n){let o=se,r=mo();se="";let s="",i=he(e);for(let[a,l]of n){let c=lE(a);cE(t,i,c),t.appendChild(c),se="";let u=mo();dr(l,Jt(e,c,pe)),Pn(u),uE(e,a,t,c),s+=se}return Pn(r),se=o,s}function Rn(e){return mr(e)&&e.__slots!==null?e.__slots:aT}function uE(e,t,n,o){let r=Ss.$getSlotTargetElement(e,t,n,pe);r!==null&&(o.parentElement!==r&&r.appendChild(o),o.style.display="")}function am(e){let t=vs.get(e);return t!==void 0?t.parentElement:null}function $C(e,t,n){let o=Rn(e),r=Rn(t);for(let[u,d]of o)if(!r.has(u)){let f=am(d);ur(d,null),f!==null&&f.remove()}let s=se,i=mo(),a="",l=null,c=he(t);for(let[u,d]of r){let f=o.get(u),p=f!==void 0?am(f):null;se="";let h=mo();if(p===null){p=lE(u);let g=null;for(let y of n.children)if(!y.hasAttribute("data-lexical-slot")){g=y;break}n.insertBefore(p,g),dr(d,Jt(t,p,pe))}else f===d?Ao(d,p):(f!==void 0&&ur(f,p),dr(d,Jt(t,p,pe)));if(Pn(h),cE(n,c,p),uE(t,u,n,p),a+=se,p.parentElement===n){let g=l===null?n.firstChild:l.nextSibling;g!==p&&n.insertBefore(p,g),l=p}}return Pn(i),se=s,a}function dr(e,t){let n=Pe.get(e);if(n===void 0&&M(60),t!==null){let r=Qn.get(e);if(r!==void 0){let s=vs.get(e);if(s!==void 0){let i=vr(r)?r.__slotHost:null,a=vr(n)?n.__slotHost:null,l=r.__parent!==n.__parent||i!==a,c=a!==null&&s.parentElement!==t.element;if(l||c)return t.insertChild(s),Ao(e,t.element)}}}let o=Ss.$createDOM(n,pe);if((function(r,s,i){let a=i._keyToDOMMap;MN(s,i,r),a.set(r,s)})(e,o,pe),R(n)?o.setAttribute("data-lexical-text","true"):he(n)&&(o.setAttribute("data-lexical-decorator","true"),tT(o,{captureSelection:!0})),k(n)){let r=n.__indent,s=n.__size;im(o,n),r!==0&&iE(o,r);let i=Rn(n),a=i.size>0?IC(n,o,i):"";if(s===0)o.__lexicalTextContent=a,o.__lexicalFirstTextKey=null,se+=a,i.size>0&&(o.__lexicalSlotTextLength=a.length);else{let c=se,u=s-1;if(lm(Yl(n,Pe),n,0,u,Jt(n,o,pe)),a!==""){let d=o.__lexicalTextContent||"";o.__lexicalTextContent=a+d,se=c+a+d}i.size>0&&(o.__lexicalSlotTextLength=a.length)}let l=n.__format;l!==0&&aE(o,l),n.isInline()||(fE(0,n,o),dE(n,o))}else{let r=n.getTextContent();if(he(n)){let s=n.decorate(pe,Al);s!==null&&pE(e,s),o.contentEditable="false";let i=Rn(n);i.size>0&&IC(n,o,i)}se+=r}return t!==null&&t.insertChild(o),Ss.$decorateDOM(n,null,o,pe),sE(n),h_($l,Il,$d,n,"created"),o}function lm(e,t,n,o,r){let s=se,i=mo();se="",Ye=null,$t=null,Et=null;let a=n;for(;a<=o;++a){let c=mo();dr(e[a],r);let u=Pe.get(e[a]);u!==null&&R(u)?Ye===null&&(Ye=u.getFormat(),$t=u.getStyle(),Et=u.__key):k(u)&&a<o&&!u.isInline()&&(se+=_s),Pn(c)}let l=pe._keyToDOMMap.get(t.__key);l===void 0&&M(349,t.__key),l.__lexicalTextContent=se,l.__lexicalFirstTextKey=Et,se=s+se,Pn(i)}function RC(e,t){if(!e)return!1;let n=t.get(e);return he(n)&&!n.isInline()}function dE(e,t){let n=Jt(e,t,pe);n.setDecoratorBoundaryAnchor("leading",RC(e.__first,Pe)),n.setDecoratorBoundaryAnchor("trailing",RC(e.__last,Pe))}function fE(e,t,n){let o=Jt(t,n,pe),r=(function(s,i){if(s){let a=s.__last;if(a){let l=i.get(a);if(l)return pn(l)?"line-break":he(l)&&l.isInline()?"decorator":null}return"empty"}return null})(t,Pe);o.setManagedLineBreak(r)}function PC(e,t,n){let o=t.__lexicalFirstTextKey;if(o!=null){let r=e.__key,s=o;for(;s!==null;){let i=Pe.get(s);if(i===void 0){s=null;break}if(i.__parent===r)break;s=i.__parent}if(s!==null&&!n.has(s)){let i=Pe.get(o);if(R(i))return Ye=i.getFormat(),void($t=i.getStyle())}}t.__lexicalFirstTextKey=Et}function Ao(e,t){let n=Qn.get(e),o=Pe.get(e);n!==void 0&&o!==void 0||M(61);let r=ko||Cl.has(e)||Sl.has(e),s=Mi(pe,e);if(n===o&&!r){let i;if(k(n)){let a=s.__lexicalTextContent;typeof a!="string"&&M(355,n.getType()),i=a,kg(s)}else i=n.getTextContent();return se+=i,s}if(n!==o&&r&&h_($l,Il,$d,o,"updated"),Ss.$updateDOM(o,n,s,pe)){let i=dr(e,null);return t===null&&M(62),t.replaceChild(i,s),ur(e,null),i}if(k(n)){k(o)||M(334,e);let i=o.__indent;(ko||i!==n.__indent)&&iE(s,i);let a=o.__format;(ko||a!==n.__format)&&aE(s,a);let l=r&&(Rn(o).size>0||Rn(n).size>0)?$C(n,o,s):"";if(r){let c=se;if((function(u,d,f){var p;Ye=null,$t=null,Et=null,(function(h,g,y){let m=se,_=h.__size,x=g.__size;se="";let v=y.element,S=pe._keyToDOMMap.get(g.__key);S===void 0&&M(351,g.__key);let b=x-_;if(!ko&&Math.abs(b)<=1&&_>=dR&&h.__first===g.__first&&(b!==0||!pe._cloneNotNeeded.has(h.__key))){let N=S.__lexicalTextContent,D=rm.get(h.__key);if(!ko&&typeof N=="string"&&D!==void 0){let O=(function(T,A){let $=A.size;if($===0||$>=T.__size)return null;let I=T.__last,L=null,P=0;for(;I!==null&&P<$;){if(!A.has(I))return null;L=I;let Y=Pe.get(I);if(Y===void 0)return null;I=Y.__prev,P++}return P!==$||I!==null&&A.has(I)?null:L})(g,D);if(O!==null){let T=D.size;if(b===0){let A=AC(O,T),$=O,I=0;for(;$!==null&&I<T;){let ee=Pe.get($);if(ee===void 0)break;let Z=mo();Ao($,v),R(ee)&&Ye===null&&(Ye=ee.getFormat(),$t=ee.getStyle(),Et=ee.__key),Pn(Z),$=ee.__next,I++}let L="";for($=O,I=0;$!==null&&I<T;){let ee=Pe.get($);if(ee===void 0)break;let Z;if(k(ee)){let ne=pe._keyToDOMMap.get($),ae=ne&&ne.__lexicalTextContent;typeof ae!="string"&&M(352,ee.getType()),Z=ae}else Z=ee.getTextContent();L+=Z,I<T-1&&k(ee)&&!ee.isInline()&&(L+=_s),$=ee.__next,I++}let P=S.__lexicalSlotTextLength||0,Y=P>0?N.slice(P):N,Q=Y.slice(0,Y.length-A)+L;return S.__lexicalTextContent=Q,se=m+Q,void PC(g,S,D)}if((function(A,$,I,L,P,Y,Q,ee){if(ee!==1&&ee!==-1||Q!==(ee===1?2:1))return!1;let Z=Q-ee,ne=A.__last;for(let _e=0;_e<Z-1;_e++){if(ne===null)return!1;let Be=Qn.get(ne);if(Be===void 0)return!1;ne=Be.__prev}if(ne===null)return!1;let ae=Pe.get(Y),xe=Qn.get(ne);if(ae===void 0||xe===void 0||ae.__prev!==xe.__prev)return!1;let ue=[],q=Y;for(let _e=0;_e<Q;_e++){if(q===null)return!1;ue.push(q);let Be=Pe.get(q);q=Be?Be.__next:null}let le=[];q=ne;for(let _e=0;_e<Z;_e++){if(q===null)return!1;le.push(q);let Be=Qn.get(q);q=Be?Be.__next:null}let Fe=new Set(le),Te=new Set(ue),Ot=[],Dt=0,Ze=0;for(;Dt<Z&&Ze<Q;)if(ue[Ze]===le[Dt])Ot.push({key:ue[Ze],kind:"reconcile"}),Dt++,Ze++;else if(Te.has(le[Dt])){if(Fe.has(ue[Ze]))return!1;Ot.push({key:ue[Ze],kind:"create",nextIndex:Ze}),Ze++}else Ot.push({key:le[Dt],kind:"destroy"}),Dt++;for(;Dt<Z;)Ot.push({key:le[Dt++],kind:"destroy"});for(;Ze<Q;)Ot.push({key:ue[Ze],kind:"create",nextIndex:Ze}),Ze++;let Hs=AC(ne,Z);for(let _e of Ot){let Be=mo();if(_e.kind==="reconcile")Ao(_e.key,I.element);else if(_e.kind==="destroy")ur(_e.key,I.element);else{let pt=null;for(let en=_e.nextIndex+1;en<Q;en++){let Yn=pe._keyToDOMMap.get(ue[en]);if(Yn!==void 0){pt=Yn;break}}dr(_e.key,I.withBefore(pt??I.before))}if(_e.kind!=="destroy"){let pt=Pe.get(_e.key);pt&&R(pt)&&Ye===null&&(Ye=pt.getFormat(),$t=pt.getStyle(),Et=pt.__key)}Pn(Be)}let bo="";for(let _e=0;_e<Q;_e++){let Be=Pe.get(ue[_e]);if(Be===void 0)return!1;let pt;if(k(Be)){let en=pe._keyToDOMMap.get(ue[_e]),Yn=en&&en.__lexicalTextContent;typeof Yn!="string"&&M(350,Be.getType()),pt=Yn}else pt=Be.getTextContent();bo+=pt,_e<Q-1&&k(Be)&&!Be.isInline()&&(bo+=_s)}let lt=L.__lexicalSlotTextLength||0,Go=lt>0?P.slice(lt):P;return L.__lexicalTextContent=Go.slice(0,Go.length-Hs)+bo,!0})(h,0,y,S,N,O,T,b)){let A=S.__lexicalTextContent;return typeof A!="string"&&M(353),se=m+A,void PC(g,S,D)}}}if(b===0){let O=h.__first,T=0;for(;O!==null;){let A=Pe.get(O);if(A===void 0)break;let $=ko||Cl.has(O)||Sl.has(O),I=mo();if($)Ao(O,v);else{let L,P;if(k(A)){P=vs.get(O);let Y=P&&P.__lexicalTextContent;typeof Y!="string"&&M(354,A.getType()),L=Y}else L=A.getTextContent();se+=L,P!==void 0&&kg(P)}R(A)?Ye===null&&(Ye=A.getFormat(),$t=A.getStyle(),Et=A.__key):k(A)&&T<x-1&&!A.isInline()&&(se+=_s),Pn(I),O=A.__next,T++}return S.__lexicalTextContent=se,S.__lexicalFirstTextKey=Et,void(se=m+se)}}if(_===1&&x===1){let N=h.__first,D=g.__first;if(N===D)Ao(N,v);else{let T=cm(N),A=dr(D,null);try{T.parentNode===v?v.replaceChild(A,T):y.insertChild(A)}catch($){if(typeof $=="object"&&$!=null){let I=`${$.toString()} Parent: ${v.tagName}, new child: {tag: ${A.tagName} key: ${D}}, old child: {tag: ${T.tagName}, key: ${N}}.`;throw new Error(I)}throw $}ur(N,null)}let O=Pe.get(D);R(O)&&Ye===null&&(Ye=O.getFormat(),$t=O.getStyle(),Et=O.__key)}else{let N=Yl(h,Qn),D=Yl(g,Pe);if(N.length!==_&&M(227),D.length!==x&&M(228),_===0)x!==0&&lm(D,g,0,x-1,y);else if(x===0){if(_!==0){let O=y.after==null&&y.before==null&&Rn(g).size===0&&y.element.__lexicalLineBreak==null;sm(N,0,_-1,O?null:v),O&&(v.textContent="")}}else(function(O,T,A,$,I,L){let P=$-1,Y=I-1,Q,ee,Z=L.getFirstChild(),ne=0,ae=0;for(;ne<=P&&ae<=Y;){let q=T[ne],le=A[ae],Fe=mo();if(q===le)Z=Ag(Ao(le,L.element)),ne++,ae++;else{if(ee===void 0&&(ee=LC(A,ae)),Q===void 0)Q=LC(T,ne);else if(!Q.has(q)){ne++,Pn(Fe);continue}if(!ee.has(q)){Z=Ag(cm(q)),ur(q,L.element),ne++,Q.delete(q),Pn(Fe);continue}if(Q.has(le)){let Ot=Mi(pe,le);Ot!==Z&&L.withBefore(Z??L.before).insertChild(Ot),Z=Ag(Ao(le,L.element)),ne++,ae++}else dr(le,L.withBefore(Z??L.before)),ae++}let Te=Pe.get(le);Te!==null&&R(Te)?Ye===null&&(Ye=Te.getFormat(),$t=Te.getStyle(),Et=Te.__key):k(Te)&&ae<=Y&&!Te.isInline()&&(se+=_s),Pn(Fe)}let xe=ne>P,ue=ae>Y;if(xe&&!ue){let q=A[Y+1],le=q===void 0?null:pe.getElementByKey(q);lm(A,O,ae,Y,L.withBefore(le??L.before))}else ue&&!xe&&sm(T,ne,P,L.element)})(g,N,D,_,x,y)}S.__lexicalTextContent=se,S.__lexicalFirstTextKey=Et,se=m+se})(u,d,Jt(d,f,pe)),We(d)||(p=d,Ye==null||Ye===p.__textFormat||Hu||p.setTextFormat(Ye),(function(h){$t==null||$t===h.__textStyle||Hu||h.setTextStyle($t)})(d))})(n,o,s),o.isInline()||(qe(o)||fE(0,o,s),dE(o,s)),l!==""){let u=s.__lexicalTextContent||"";s.__lexicalTextContent=l+u,se=c+l+u,s.__lexicalSlotTextLength=l.length}else(Rn(o).size>0||Rn(n).size>0)&&(s.__lexicalSlotTextLength=0)}else{let c=s.__lexicalTextContent;typeof c!="string"&&M(356,n.getType()),se+=c,kg(s)}if((ko||o.__dir!==n.__dir||o.__parent!==n.__parent)&&(im(s,o),qe(o)&&!ko))for(let c of o.getChildren())k(c)&&im(Mi(pe,c.getKey()),c)}else{let i=o.getTextContent();if(he(o)){let a=o.decorate(pe,Al);a!==null&&pE(e,a),r&&(Rn(o).size>0||Rn(n).size>0)&&$C(n,o,s)}se+=i}if(!Hu&&qe(o)){let i=o.getLatest();if(i.__cachedText!==se){let a=i.getWritable();a.__cachedText=se,o=a}}return Ss.$decorateDOM(o,n,s,pe),sE(o),s}function pE(e,t){let n=pe._pendingDecorators,o=pe._decorators;if(n===null){if(o[e]===t)return;n=kN(pe)}n[e]=t}function Ag(e){let t=e.nextSibling;return t!==null&&t===pe._blockCursorElement&&(t=t.nextSibling),t}function LC(e,t){let n=new Set;for(let o=t;o<e.length;o++)n.add(e[o]);return n}function pR(e,t,n,o,r,s){se="",Ye=null,$t=null,Et=null,ko=o===2,pe=n,Al=n._config,Ss=n._config.dom||Kl,Il=n._nodes,$d=pe._listeners.mutation,Sl=r,Cl=s,Qn=e._nodeMap,om=e,Pe=t._nodeMap,Hu=t._readOnly,vs=Kb(n._keyToDOMMap),rm=(function(){let a=new Map,l=c=>{for(let u of c){let d=Pe.get(u);if(d===void 0)continue;let f=d.__parent;if(f===null)continue;let p=a.get(f);p===void 0&&(p=new Set,a.set(f,p)),p.add(u)}};return l(Sl.keys()),l(Cl),a})();let i=new Map;return $l=i,Ao("root",null),pe=void 0,Il=void 0,Sl=void 0,Cl=void 0,Qn=void 0,om=void 0,Pe=void 0,Al=void 0,vs=void 0,rm=void 0,$l=void 0,Ss=Kl,i}function cm(e){let t=vs.get(e);return t===void 0&&M(75,e),t}function hR(e){return()=>{}}function j(e){return{type:e}}var Rd=j("SELECTION_CHANGE_COMMAND"),gR=j("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),hE=j("CLICK_COMMAND"),Um=j("BEFORE_INPUT_COMMAND"),Hm=j("INPUT_COMMAND"),Vm=j("COMPOSITION_START_COMMAND"),jm=j("COMPOSITION_END_COMMAND"),Rl=j("DELETE_CHARACTER_COMMAND"),bl=j("INSERT_LINE_BREAK_COMMAND"),um=j("INSERT_PARAGRAPH_COMMAND"),Ti=j("CONTROLLED_TEXT_INSERTION_COMMAND"),Ym=j("PASTE_COMMAND"),Vu=j("REMOVE_TEXT_COMMAND"),Pl=j("DELETE_WORD_COMMAND"),Oi=j("DELETE_LINE_COMMAND"),fr=j("FORMAT_TEXT_COMMAND"),mR=j("SET_TEXT_FORMAT_COMMAND"),id=j("UNDO_COMMAND"),Ll=j("REDO_COMMAND"),Gm=j("KEYDOWN_COMMAND"),gE=j("KEY_ARROW_RIGHT_COMMAND"),dm=j("MOVE_TO_END"),mE=j("KEY_ARROW_LEFT_COMMAND"),fm=j("MOVE_TO_START"),_E=j("KEY_ARROW_UP_COMMAND"),yE=j("KEY_ARROW_DOWN_COMMAND"),qm=j("KEY_ENTER_COMMAND"),xE=j("KEY_SPACE_COMMAND"),vE=j("KEY_BACKSPACE_COMMAND"),SE=j("KEY_ESCAPE_COMMAND"),CE=j("KEY_DELETE_COMMAND"),bE=j("KEY_TAB_COMMAND"),_R=j("INSERT_TAB_COMMAND"),yR=j("INDENT_CONTENT_COMMAND"),xR=j("OUTDENT_CONTENT_COMMAND"),EE=j("DROP_COMMAND"),vR=j("FORMAT_ELEMENT_COMMAND"),NE=j("DRAGSTART_COMMAND"),TE=j("DRAGOVER_COMMAND"),OE=j("DRAGEND_COMMAND"),Xm=j("COPY_COMMAND"),Jm=j("CUT_COMMAND"),DE=j("SELECT_ALL_COMMAND"),SR=j("CLEAR_EDITOR_COMMAND"),CR=j("CLEAR_HISTORY_COMMAND"),bR=j("CAN_REDO_COMMAND"),ER=j("CAN_UNDO_COMMAND"),wE=j("FOCUS_COMMAND"),ME=j("BLUR_COMMAND"),kE=j("KEY_MODIFIER_COMMAND");function AE(e,t){return{...t,[Rm]:e}}var lr=AE("metaKey",{ctrlKey:!Lo,metaKey:Lo}),pm=AE("altKey",{altKey:Lo,ctrlKey:!Lo}),FC=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function Ig(e,t,n){let o=e.get(t);o?o.push(n):e.set(t,[n])}var hm=class{constructor(){w(this,"byKey",new Map);w(this,"byCode",new Map)}add(t){let{key:n,modifiers:o={}}=t;n.length>0||M(399);let r=n.toLowerCase();for(let s of(function(i){let a=[0];for(let[l,c]of FC){let u=i[l]||!1;u==="any"?a=a.concat(a.map(d=>d|c)):u&&(a=a.map(d=>d|c))}return a})(o))Ig(this.byKey,`${s}:${r}`,t),n.length===1&&(/[0-9]/.test(n)?Ig(this.byCode,`${s}:Digit${n}`,t):/[a-z]/.test(r)&&Ig(this.byCode,`${s}:Key${r.toUpperCase()}`,t));return this}matches(t){let n=t.key;if(!n)return[];let o=(function(i){let a=0;for(let[l,c]of FC)i[l]&&(a|=c);return a})(t),r=this.byKey.get(`${o}:${n.toLowerCase()}`),s=r?r.slice():[];if(this.byCode.size>0&&!(n.length===1&&n.charCodeAt(0)<=127)){let i=this.byCode.get(`${o}:${t.code}`);i&&s.push(...i)}return s}match(t){return this.matches(t)[0]}};function IE(e){let t=new hm;for(let n of e)t.add(n);return t}function $E(e){let t=new Map;return{dispose(){for(let n of t.values())n.dispose();t.clear()},register(n,o){let r=t.get(n);r===void 0&&(r={dispose:e(n,o),holders:new Set},t.set(n,r));let s=()=>{let i=t.get(n);i&&i.holders.delete(s)&&i.holders.size===0&&(t.delete(n),i.dispose())};return r.holders.add(s),s}}}function Qm(e,t,n,o){return e.addEventListener(t,n,o),e.removeEventListener.bind(e,t,n,o)}var wo=Object.freeze({}),$g,Rg=new WeakMap,ju=new WeakMap,NR=$E(e=>(e.addEventListener("selectionchange",jC),()=>e.removeEventListener("selectionchange",jC)));function RE(e,t,n,o,r,s){let i=e.anchor,a=e.focus,l=i.getNode(),c=ge(),u;if(s!==void 0)u=s;else{let g=Un(an(c));u=g!==null?sn(g,c._rootElement):null}let d=u!==null?u.anchorNode:null,f=i.key,p=c.getElementByKey(f),h=n.length;return f!==a.key||!R(l)||(!r&&(!Tl||c._inputState.lastBeforeInputInsertTextTimeStamp<o+50)||l.isDirty()&&h<2||AN(n))&&i.offset!==a.offset&&!l.isComposing()||Fn(l)||l.isDirty()&&h>1||(r||!Tl)&&p!==null&&!l.isComposing()&&d!==Po(l,p,c)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||(function(g,y){if(y.isSegmented())return!0;if(!g.isCollapsed())return!1;let m=g.anchor.offset,_=y.getParentOrThrow(),x=Ul(y);return m===0?!y.canInsertTextBefore()||!_.canInsertTextBefore()&&!y.isComposing()||x||(function(v){let S=v.getPreviousSibling();return(R(S)||k(S)&&S.isInline())&&!S.canInsertTextAfter()})(y):m===y.getTextContentSize()&&(!y.canInsertTextAfter()||!_.canInsertTextAfter()&&!y.isComposing()||x)})(e,l)}function BC(e,t){return _n(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function zC(e,t,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=sn(e,t._rootElement),a=t._inputState;if(a.isSelectionChangeFromDOMUpdate){a.isSelectionChangeFromDOMUpdate=!1;let l=a.selectionChangeFromDOMUpdatePoints;if(a.selectionChangeFromDOMUpdatePoints=null,BC(o,r)&&BC(s,i)&&!a.postDeleteSelectionToRestore&&(l===null||l.anchorNode===o&&l.anchorOffset===r&&l.focusNode===s&&l.focusOffset===i))return}mn(t,()=>{if(!n)return void Pt(null);if(!tc(t,o,s))return;let l=ce();if(a.postDeleteSelectionToRestore&&K(l)&&l.isCollapsed()){let c=l.anchor,u=a.postDeleteSelectionToRestore.anchor;(c.key===u.key&&c.offset===u.offset+1||c.offset===1&&u.getNode().is(c.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),Pt(l))}if(a.postDeleteSelectionToRestore=null,K(l)){let c=l.anchor,u=c.getNode();if(l.isCollapsed()){e.type==="Range"&&o===s&&(l.dirty=!0);let d=an(t).event,f=d?d.timeStamp:performance.now(),{format:p,style:h,offset:g,key:y,timeStamp:m}=a.collapsedSelectionFormat,_=Lt(),x=t.isComposing()===!1&&_.getTextContent()==="";if(f<m+200&&c.offset===g&&c.key===y)Yu(l,p,h);else if(c.type==="text")R(u)||M(141),PE(l,u);else if(c.type==="element"&&!x){k(u)||M(259);let v=c.getNode();v.isEmpty()?(function(S,b){Yu(S,b.getTextFormat(),b.getTextStyle())})(l,v):Yu(l,l.format,"")}}else{let d=c.key,f=l.focus.key,p=l.getNodes(),h=p.length,g=l.isBackward(),y=g?i:r,m=g?r:i,_=g?f:d,x=g?d:f,v=Ib,S=!1;for(let b=0;b<h;b++){let N=p[b],D=N.getTextContentSize();if(R(N)&&D!==0&&!(b===0&&N.__key===_&&y===D||b===h-1&&N.__key===x&&m===0)&&(S=!0,v&=N.getFormat(),v===0))break}l.format=S?v:0}}(function(c,u,d=!1){(d||hN(c,u))&&c.dispatchCommand(Rd)})(t,l,l!==null&&(l.dirty||!K(l)))})}function Yu(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function PE(e,t){Yu(e,t.getFormat(),t.getStyle())}function TR(e,t){mn(t,()=>{let n=ce(),o=Un(an(t)),r=Ts();if(o){if(K(n)){let s=n.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&n.isCollapsed()&&!qe(i)&&Lt().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r)&&(o.removeAllRanges(),n.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let s=sn(o,t._rootElement).anchorNode;(we(s)||_n(s))&&Pt(Bl(r,o,t,e))}}if(xo&&o!==null&&o.rangeCount===0){let s=t._rootElement;if(s!==null&&e.target===s){let i=e.clientY,a=s.childNodes.length;for(let c=0;c<s.childNodes.length;c++){let u=s.childNodes[c];if(we(u)){let d=u.getBoundingClientRect();if(i<=(d.top+d.bottom)/2){a=c;break}}}o.setBaseAndExtent(s,a,s,a);let l=Bl(r,o,t,e);l!==null?Pt(l):o.removeAllRanges()}}G(t,hE,e)})}function OR(e,t){let n=x_(e),o=e.pointerType;Xi(n)&&o!=="touch"&&o!=="pen"&&e.button===0&&mn(t,()=>{jl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function LE(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function WC(e){let{lastKeyCode:t}=ge()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t==="Enter"?`
69
+ `,Im=xo?"\xA0":Dl,Rb="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Pb="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF";function Lb(e,t){return new RegExp("^[^"+e+"]*["+t+"]")}var Y$=Lb(Pb,Rb),G$=Lb(Rb,Pb),xt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Fb={directionless:1,unmergeable:2},Ai={center:2,end:6,justify:4,left:1,right:3,start:5};function Bb(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var zb=Bb(Ai),$m={normal:0,segmented:2,token:1},Wb=Bb($m),Dd="$",Rm=Symbol.for("@lexical/ctrlOrOtherKey"),Og="$config";function Dg(){return vo()._blockCursorElement}function wg(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}var q$=Zl||so||Ql;function vC(){let e=Xt().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 Zu(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-decorator-boundary")}var ed=class e{constructor(t,n,o){w(this,"element");w(this,"before");w(this,"after");this.element=t,this.before=n||null,this.after=o||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(t){let n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&M(357),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&M(358),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&M(359),this.element.replaceChild(t,n),this}getFirstChild(){let t=this.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,n,o){if(this.element===t)return n===t&&o===0?"before":"after";let r=SC(t,this.element);if(r===null)return"after";let s=Array.prototype.indexOf.call(t.childNodes,r);if(s<0)return"after";if(n===t)return o<=s?"before":"after";let i=SC(t,n);if(i===null)return"after";let a=Array.prototype.indexOf.call(t.childNodes,i);return a>=0&&a<=s?"before":"after"}getInsertionAnchor(){return this.before}};function SC(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var td=class e extends ed{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 t=super.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;for(;wg(n);)t=n,n=n.nextSibling;Zu(n)&&(t=n,n=n.nextSibling);let o=t?t.nextSibling:this.element.firstChild;return o!==null&&o===Dg()?o:t}getDecoratorBoundaryAnchor(t){let n;if(t==="leading"){let o=super.getFirstChildAnchor();for(n=o?o.nextSibling:this.element.firstChild;wg(n);)n=n.nextSibling}else n=this.before?this.before.previousSibling:this.element.lastChild,n!==null&&n===Dg()&&(n=n.previousSibling);return Zu(n)?n:null}setDecoratorBoundaryAnchor(t,n){let o=this.getDecoratorBoundaryAnchor(t);if(n!==(o!==null))if(o!==null)this.element.removeChild(o);else if(t==="leading"){let r=this.getFirstChildAnchor();this.element.insertBefore(vC(),r?r.nextSibling:this.element.firstChild)}else this.element.insertBefore(vC(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){let n=this.element,o=this.after===null?n.firstChild:this.after.nextSibling,r=t==="empty"&&wg(o)?null:t;if(n.__lexicalLastChildKind!==r)if(n.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let s=r==="decorator"&&q$;this.insertManagedLineBreak(s)}}removeManagedLineBreak(){let t=this.getManagedLineBreak();if(t){let n=this.element,o=t.nodeName==="IMG"?t.nextSibling:null;o&&n.removeChild(o),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){let n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before||this.getDecoratorBoundaryAnchor("trailing"),s=Xt().createElement("br");if(s.setAttribute("data-lexical-managed-linebreak","true"),o.insertBefore(s,r),t){let i=Xt().createElement("img");i.setAttribute("data-lexical-managed-linebreak","true"),i.style.setProperty("display","inline","important"),i.style.setProperty("border","0px","important"),i.style.setProperty("margin","0px","important"),i.alt="",o.insertBefore(i,s),o.__lexicalLineBreak=i}else o.__lexicalLineBreak=s}getFirstChildOffset(){let t=this.getFirstChild(),n=this.getInsertionAnchor(),o=0;for(let r=this.element.firstChild;r!==null&&r!==t&&r!==n;r=r.nextSibling)o++;return o}resolveChildIndex(t,n,o,r){if(o===this.element){let l=this.getFirstChildOffset(),c=Dg(),u=this.element.childNodes,d=Math.min(r,u.length),f=0;for(let p=l;p<d;p++)u[p]!==c&&f++;return[t,Math.min(f,t.getChildrenSize())]}let s=CC(n,o);s.push(r);let i=CC(n,this.element),a=t.getIndexWithinParent();for(let l=0;l<i.length;l++){let c=s[l],u=i[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}};function CC(e,t){let n=[],o=t;for(;o!==e&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;n.push(r)}return o!==e&&M(225),n.reverse()}function X$(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var Kb=X$(),hs=class{constructor(){w(this,"_front",new Set);w(this,"_back",new Set);w(this,"_cache")}get size(){return this._front.size+this._back.size}addBack(t){return delete this._cache,this._front.has(t)||this._back.add(t),this}addFront(t){return delete this._cache,this._back.has(t)||this._front.add(t),this}delete(t){return delete this._cache,this._front.delete(t)||this._back.delete(t)}toArray(){let t=Array.from(this._front).reverse();for(let n of this._back)t.push(n);return t}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},fs=null;function Ub(e,t=1e3){return e instanceof wl?e.clone():e.size<t?new Map(e):new wl().init(new Map(e),void 0,e.size)}var wl=class e{constructor(){w(this,"_mutable",!1);w(this,"_old");w(this,"_nursery");w(this,"_size",0)}clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(t,n,o){return this._old=t,this._nursery=n,this._size=o,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){let n=this._nursery&&this._nursery.get(t);return n!==void 0?n:this._old&&this._old.get(t)}get(t){let n=this.getWithTombstone(t);return n===fs?void 0:n}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(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){let n=new Map(this._old);for(let[o,r]of this._nursery)r!==fs?n.set(o,r):n.delete(o);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(t,n){let o=this.getWithTombstone(t);if(o===n)return this;let r=this.getNursery();return o!==fs&&o!==void 0||(this._size++,o===fs&&r.delete(t)),r.set(t,n),this}delete(t){let n=this.has(t);return n&&(this.getNursery().set(t,fs),this._size--),n}getOrInsert(t,n){let o=this.get(t);return o!==void 0?o:(this.set(t,n),n)}getOrInsertComputed(t,n){let o=this.get(t);if(o!==void 0)return o;let r=n(t);return this.set(t,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let t of this.entries())yield t[0]}*values(){for(let t of this.entries())yield t[1]}*entries(){let t=this._nursery,n=this._old;if(t){if(n)for(let o of n){let r=o[0],s=t.get(r);s!==fs&&(s!==void 0&&(o[1]=s),yield o)}for(let o of t)o[1]===fs||n&&n.has(o[0])||(yield o)}else n&&(yield*n)}forEach(t,n){n!==void 0&&(t=t.bind(n));for(let[o,r]of this.entries())t(r,o,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}},vl=!1;function Hb(e,t,...n){let o=vl,r;try{vl=e,r=t()}finally{vl=o}var s;return(s=r)===null||typeof s!="object"&&typeof s!="function"||typeof s.then!="function"||M(421),r}function Vb(){return vl}function jb(e){let t=e.exportJSON(vl),n=e.constructor;return t.type!==n.getType()&&M(130,n.name),k(e)&&!Array.isArray(t.children)&&M(59,n.name),t}function nd(e,t,n,o,r,s){if(k(e)){let i=e.getFirstChild();for(;i!==null;){let a=i.__key;i.__parent===t&&((k(i)||mr(i)&&i.__slots!==null)&&nd(i,a,n,o,r,s),n.has(a)||s.delete(a),r.push(a)),i=i.getNextSibling()}}for(let i of mr(e)&&e.__slots!==null?e.__slots.values():[]){let a=o.get(i);a!==void 0&&vr(a)&&a.__slotHost===t&&((k(a)||mr(a)&&a.__slots!==null)&&nd(a,i,n,o,r,s),n.has(i)||s.delete(i),r.push(i))}}var qg=!1,Pm=0;function J$(e){Pm=e.timeStamp}function Mg(e,t,n){let o=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||o&&e.previousSibling===r)||o&&Ds(e,n)!==void 0}function Q$(e,t,n){let o=Hn(an(n)),r=o&&sn(o,n._rootElement),s=null,i=null;r!==null&&r.anchorNode===e&&(s=r.anchorOffset,i=r.focusOffset);let a=e.nodeValue;a!==null&&p_(t,a,s,i,!1)}function Z$(e,t,n){if(K(e)){let o=e.anchor.getNode();if(o.is(n)&&e.format!==o.getFormat())return!1}return _n(t)&&n.isAttached()}function eR(e,t,n){for(let o=e;o&&!C_(o);o=Ro(o)){let r=Ds(o,t);if(r!==void 0){let s=Ee(r,n);if(s)return he(s)||!we(o)?void 0:[o,s]}}}function Yb(e,t,n){qg=!0;let o=performance.now()-Pm>100;try{mn(e,()=>{let r=ce()||(function(d){return d.read("latest",()=>{let f=ce();return f!==null?f.clone():null})})(e),s=new Map,i=e._editorState,a=e._blockCursorElement,l=!1,c="";for(let d=0;d<t.length;d++){let f=t[d],p=f.type,h=f.target,g=eR(h,e,i);if(!g)continue;let[y,m]=g;if(p==="characterData")o&&R(m)&&_n(h)&&Z$(r,h,m)&&Q$(h,m,e);else if(p==="childList"){l=!0;let _=f.addedNodes;for(let S=0;S<_.length;S++){let b=_[S],N=c_(b),D=b.parentNode;if(!(D==null||b===a||N!==null||Mg(b,D,e)||Zu(b)||e._slotsUsed&&we(b)&&b.hasAttribute("data-lexical-slot")||C_(b))){if(xo){let O=(we(b)?b.innerText:null)||b.nodeValue;O&&(c+=O)}D.removeChild(b)}}let x=f.removedNodes,v=x.length;if(v>0){let S=0;for(let b=0;b<v;b++){let N=x[b];Mg(N,h,e)||a===N?(h.appendChild(N),S++):Zu(N)&&S++}v!==S&&s.set(y,m)}}}if(s.size>0)for(let[d,f]of s)f.reconcileObservedMutation(d,e);let u=n.takeRecords();if(u.length>0){for(let d=0;d<u.length;d++){let f=u[d],p=f.addedNodes,h=f.target;for(let g=0;g<p.length;g++){let y=p[g],m=y.parentNode;m==null||y.nodeName!=="BR"||Mg(y,h,e)||m.removeChild(y)}}n.takeRecords()}r!==null&&(l&&Pt(r),xo&&FN(e)&&r.insertRawText(c))})}finally{qg=!1}}function Gb(e){let t=e._observer;t!==null&&Yb(e,t.takeRecords(),t)}function qb(e){(function(t){Pm===0&&an(t).addEventListener("textInput",J$,!0)})(e),e._observer=new MutationObserver((t,n)=>{Yb(e,t,n)})}function wd(e,t,n){let{isEqual:o}=e;return t===n||o!==void 0&&o(t,n)}function Lm(e,t){return wd(e,t,e.defaultValue)}function Fo(e){return typeof e=="object"&&e!==null}function ec(e,t){let n=Ad(e,t).getter;return Fo(n)&&n.getterTable!==void 0||M(405,t),Fm(n.getterTable)}function Md(e,t){let n=Ad(e,t).setter;return Fo(n)&&n.setterTable!==void 0||M(406,t),Fm(n.setterTable)}function od(e,t,n){let{meta:o}=Ad(e,t);for(let r=0;;)if(o.kind==="aliased"){if(r===n)return Fm(o.aliases);r++,o=o.inner.meta}else o.kind==="nullable"||o.kind==="optional"?o=o.inner.meta:o.kind==="array"?o=o.item.meta:M(407,t,String(n))}function kd(e,t){let n=Ad(e,t),{setter:o}=n;Fo(o)&&o.setterTable!==void 0||M(408,t);let r=String(n.defaultValue);return Fn(o.setterTable,r)||M(409,t,r),o.setterTable[r]}function Fm(e){return Object.assign(Object.create(null),e)}function Ad(e,t){let n=e.get(t);return n===void 0&&M(410,t),n}function Un(e,t,n,o,r){r!==void 0&&Xb.add(r);let s=n===void 0,i=s?e(void 0):n;return s&&Qb(i),Object.assign(e,{accepts:r,defaultValue:i,isEqual:o,meta:t})}var Xb=new WeakSet;function Bm(e){let{accepts:t}=e;return t===void 0||Xb.has(t)?void 0:t}var Jb=new WeakSet;function zm(e){return e!==null&&typeof e=="object"&&Jb.add(e),e}function Qb(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)&&!Jb.has(e)){Object.freeze(e);for(let t of Object.values(e))Qb(t)}}function Zb(e){let{isEqual:t}=e;return t===void 0?void 0:(n,o)=>n==null||o==null?n===o:t(n,o)}function eE(e,t){return n=>t(n)||xs(e,n)}function xs(e,t){let{accepts:n}=e;return n!==void 0?n.call(e,t):(function(o,r){let{accepts:s}=o;if(s!==void 0)return xs(o,r)?{parsed:o(r)}:void 0;let i=o(r);return Lm(o,i)&&r!==o.defaultValue?void 0:{parsed:i}})(e,t)!==void 0}var bC=new WeakMap;function Xg(e){let t=bC.get(e);if(t!==void 0)return t;let n=(function(o){let r=o.meta;if(r==null||Bm(o)!==void 0)return!1;switch(r.kind){case"raw":return!0;case"union":return r.members!=null&&r.members.length>0&&r.members.every(s=>Xg(s));case"nullable":case"optional":case"transform":case"aliased":return r.inner!=null&&Xg(r.inner);default:return!1}})(e);return bC.set(e,n),n}function Ku(e,t){let n=e.meta;if(n==null)return xs(e,t)?1:4;let o=Bm(e),r=o!==void 0;if(r&&!o.call(e,t))return 4;let s=(function(i,a,l,c){switch(a.kind){case"raw":return c?1:2;case"array":{if(!Array.isArray(l))return 4;if(a.item==null)return 1;let u=1;for(let d=0;d<l.length;d++)if(l[d]!==void 0){let f=Ku(a.item,l[d]);f>u&&(u=f)}return u>=3?3:u}case"object":{let u=a.fields;if(!Ei(l))return 4;if(u==null)return 1;if(!c&&Uu(l,u))return 4;let d=1;for(let f of Object.keys(l))if(Fn(u,f)){let p=Ku(u[f],l[f]);p>d&&(d=p)}return d>=3?3:d}case"union":return a.members==null?1:tE(a.members,l).fit;case"aliased":case"nullable":case"optional":case"transform":return(a.kind==="aliased"?typeof l=="string"&&a.aliases!=null&&Fn(a.aliases,l):a.kind==="nullable"?l==null:a.kind==="optional"&&l===void 0)||a.inner==null?1:Ku(a.inner,l);default:return c||xs(i,l)?1:4}})(e,n,t,r);return r&&s===4?3:s}function tE(e,t){let n,o=4,r=4;for(let s=0;s<e.length;s++){let i=e[s],a=Ku(i,t),l=a<3&&Xg(i)?3:a;if(l<o&&(n=i,o=l,r=a,l===1))break}return{fit:r,member:n}}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ei(e){if(!(function(n){return(function(o){return typeof o=="object"&&o!==null})(n)&&!Array.isArray(n)})(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Uu(e,t){for(let n of Object.keys(e))if(!Fn(t,n))return!0;return!1}function Ml(e=""){return Un(t=>typeof t=="string"?t:e,{kind:"string"},void 0,void 0,t=>typeof t=="string")}var tR=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ii(e=0,t={}){let{integer:n,clamp:o}=t,r=n&&t.min!==void 0?Math.ceil(t.min):t.min,s=n&&t.max!==void 0?Math.floor(t.max):t.max,i=c=>typeof c=="string"&&tR.test(c)?Number(c):c,a=c=>typeof c=="number"&&Number.isFinite(c)&&(!n||Number.isInteger(c)),l=c=>a(c)&&(r===void 0||c>=r)&&(s===void 0||c<=s);return Un(c=>{let u=i(c);return o&&a(u)?r!==void 0&&u<r?r:s!==void 0&&u>s?s:u:l(u)?u:e},{clamp:o,integer:n,kind:"number",max:s,min:r},void 0,void 0,c=>o?a(i(c)):l(i(c)))}function nR(e=!1){return Un(t=>typeof t=="boolean"?t:e,{kind:"boolean"},void 0,void 0,t=>typeof t=="boolean")}function kl(e,...t){let n=zm(t.length!==0?t[0]:e[0]),o=new Set(e);return Un(r=>r!==void 0&&o.has(r)?r:n,{kind:"enum",values:e},n,void 0,r=>o.has(r)&&(r!==void 0||n===void 0))}function oR(e,t={}){let{defaultAsNull:n}=t;return Un(o=>{if(o==null)return null;let r=e(o);return n&&Lm(e,r)?null:r},{defaultAsNull:n,inner:e,kind:"nullable"},void 0,Zb(e),eE(e,o=>o==null))}function rR(e,t={}){let{omitDefault:n}=t;return Un(o=>{if(o===void 0)return;let r=e(o);return n&&Lm(e,r)?void 0:r},{inner:e,kind:"optional",omitDefault:n},void 0,Zb(e),eE(e,o=>o===void 0))}function Jg(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!Jg(e[o],t[o]))return!1;return!0}if(!Ei(e)||!Ei(t))return!1;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(o=>Fn(t,o)&&Jg(e[o],t[o]))}function sR(e,...t){let n=t.length!==0?zm(t[0]):e[0].defaultValue;return Un(o=>{if(o===void 0)return n;let r=(s=>{let i=(function(a,l){return tE(a,l).member})(e,s);return i===void 0?void 0:{member:i,parsed:i(s)}})(o);return r===void 0?n:r.parsed},{kind:"union",members:e},n,Jg,o=>(o!==void 0||n===void 0)&&e.some(r=>xs(r,o)))}function Id(){return e=>(function(t){return{meta:{fields:t,kind:"node"}}})(e)}function Qg(e,t){let n=o=>typeof o=="string"&&Fn(t,o);return Un(o=>n(o)?t[o]:e(o),{aliases:t,inner:e,kind:"aliased"},e.defaultValue,e.isEqual,o=>n(o)||xs(e,o))}function iR(e,t,n={}){return Un(o=>t(e(o)),{inner:e,kind:"transform"},zm(t(e.defaultValue)),n.isEqual,o=>xs(e,o))}function aR(){return Un(e=>e===void 0?void 0:e,{kind:"raw"},void 0,void 0,()=>!0)}function lR(e){return Un(t=>{if(!Array.isArray(t))return[];let n=new Array(t.length);for(let o=0;o<t.length;o++)n[o]=e(t[o]);return n},{item:e,kind:"array"},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!wd(e,t[o],n[o]))return!1;return!0},t=>Array.isArray(t))}function cR(e){return(function(n,o){let r=Object.entries(o);return Un(s=>{let i=s!==null&&typeof s=="object"?s:{},a={};for(let l=0;l<r.length;l++){let[c,u]=r[l];a[c]=u(i[c])}return a},{fields:o,kind:"object"},void 0,(s,i)=>Ei(s)&&Ei(i)&&!Uu(s,o)&&!Uu(i,o)&&r.every(([a,l])=>wd(l,s[a],i[a])),s=>Ei(s)&&!Uu(s,o))})(0,e)}function Io(e,t){return nE(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}})}function Ni(e,t){return nE(0,e,t)}function nE(e,t,n){return Object.assign(o=>t(o),{accepts:t.accepts,defaultValue:t.defaultValue,getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Zg="direct",em="latest",tm=class{constructor(t,n){w(this,"key");w(this,"parse");w(this,"unparse");w(this,"isEqual");w(this,"defaultValue");w(this,"resetOnCopyNode");w(this,"schema");this.key=t;let o="meta"in(r=n.parse)&&typeof r.meta=="object"&&r.meta!==null&&"kind"in r.meta&&typeof r.meta.kind=="string"&&"defaultValue"in r?n.parse:void 0;var r;this.schema=o,this.parse=n.parse.bind(n),this.unparse=(n.unparse||fR).bind(n),this.isEqual=n.isEqual?n.isEqual.bind(n):o!==void 0&&o.isEqual!==void 0?(s,i)=>wd(o,s,i):Object.is,this.defaultValue=o!==void 0?o.defaultValue:this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function uR(e,t){return new tm(e,t)}function rd(e,t,n=em){let o=(n===em?e.getLatest():e).__state;return o?o.getValue(t):t.defaultValue}function dR(e,t,n){let o=rd(e,n,Zg),r=rd(t,n,Zg);return n.isEqual(o,r)?null:[o,r]}function oE(e,t,n){let o;if(dt(),typeof n=="function"){let s=e.getLatest(),i=rd(s,t);if(o=n(i),t.isEqual(i,o))return s}else o=n;let r=e.getWritable();return Wm(r).updateFromKnown(t,o),r}function rE(e){let t=new Map,n=new Set;for(let{ownNodeConfig:o}of zo(typeof e=="function"?e:e.replace))if(o&&o.stateConfigs)for(let r of o.stateConfigs){let s;"stateConfig"in r?(s=r.stateConfig,r.flat&&n.add(s.key)):s=r,t.set(s.key,s)}return{flatKeys:n,sharedConfigMap:t}}var EC=new Set(["__proto__","constructor","prototype"]),nm=class e{constructor(t,n,o=void 0,r=new Map,s=void 0){w(this,"node");w(this,"knownState");w(this,"unknownState");w(this,"sharedNodeState");w(this,"size");this.node=t,this.sharedNodeState=n,this.unknownState=o,this.knownState=r;let{sharedConfigMap:i}=this.sharedNodeState,a=s!==void 0?s:(function(l,c,u){let d=u.size;if(c)for(let f in c){let p=l.get(f);p&&u.has(p)||d++}return d})(i,o,r);this.size=a}getValue(t){let n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let o=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){let r=this.unknownState[t.key];r!==void 0&&(o=t.parse(r)),this.updateFromKnown(t,o)}return o}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let t={...this.unknownState},n={};for(let[o,r]of this.knownState)o.isEqual(r,o.defaultValue)?delete t[o.key]:t[o.key]=o.unparse(r);for(let o of this.sharedNodeState.flatKeys)o in t&&(n[o]=t[o],delete t[o]);return NC(t)&&(n[Dd]=t),n}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:o}=this,r=new Map(this.knownState);return new e(t,n,(function(s,i,a){let l;if(a)for(let[c,u]of Object.entries(a)){if(EC.has(c))continue;let d=s.get(c);d?i.has(d)||i.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,r,o),r,this.size)}resetOnCopyNode(){for(let t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,n){let o=t.key;this.sharedNodeState.sharedConfigMap.set(o,t);let{knownState:r,unknownState:s}=this;r.has(t)||s&&o in s||(s&&(delete s[o],this.unknownState=NC(s)),this.size++),r.set(t,n)}updateFromUnknown(t,n){if(EC.has(t))return;let o=this.sharedNodeState.sharedConfigMap.get(t);o?this.updateFromKnown(o,o.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){let{knownState:n}=this;for(let o of n.keys())n.set(o,o.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(let[o,r]of Object.entries(t))this.updateFromUnknown(o,r)}};function Wm(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new nm(t,(function(o){return o.__state?o.__state.sharedNodeState:l_(vo(),o.getType()).sharedNodeState})(t));return t.__state=n,n}function sE(e,t){let n=e.getWritable(),o=t[Dd];return(n.__state||o)&&Wm(e).updateFromJSON(o),n}function NC(e){if(e)for(let t in e)return e}function fR(e){return e}function TC(e,t,n){for(let[o,r]of t.knownState){if(e.has(o.key))continue;e.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function OC(e,t,n){let{unknownState:o}=t,r=n?n.unknownState:void 0;if(o){for(let[s,i]of Object.entries(o))if(!e.has(s)&&(e.add(s),i!==(r?r[s]:void 0)))return!0}return!1}function DC(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function wC(e,t){let n=e.__mode,o=e.__format,r=e.__style,s=t.__mode,i=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===a)&&(e.__state===null||l===c||(function(u,d){if(u===d)return!0;let f=new Set;return!(u&&TC(f,u,d)||d&&TC(f,d,u)||u&&OC(f,u,d)||d&&OC(f,d,u))})(l,c))}function MC(e,t){let n=e.mergeWithSibling(t),o=ge()._normalizedNodes;return o.add(e.__key),o.add(t.__key),n}function kC(e){let t,n,o=e;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(t=o.getPreviousSibling())!==null&&R(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(wC(t,o)){o=MC(t,o);break}break}t.remove()}for(;(n=o.getNextSibling())!==null&&R(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(wC(o,n)){o=MC(o,n);break}break}n.remove()}}else o.remove()}function Km(e){return AC(e.anchor),AC(e.focus),e}function AC(e){for(;e.type==="element";){let t=e.getNode(),n=e.offset,o,r;if(n===t.getChildrenSize()?(o=t.getChildAtIndex(n-1),r=!0):(o=t.getChildAtIndex(n),r=!1),R(o)){e.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!k(o))break;e.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var sd=Symbol.for("@lexical/CachedTextSize");function IC(e,t){return om.read(()=>{let n=0,o=e;for(let r=0;r<t&&o!==null;r++){let s=Zn.get(o);if(s===void 0&&M(345,o),k(s)){let i=Pe.get(o);if(i!==void 0&&k(i)&&i.__parent!==s.__parent)n+=s.getTextContentSize();else{let a=vs.get(o),l=a&&a.__lexicalTextContent;typeof l!="string"&&M(346,s.getType()),n+=l.length}r<t-1&&!s.isInline()&&(n+=2)}else{let i=s[sd];i===void 0&&M(347,s.getType(),o),n+=i}o=s.__next}return n},{editor:pe})}function iE(e){k(e)||e[sd]===void 0&&(e[sd]=R(e)?e.__text.length:e.getTextContentSize())}var pR=4,Al,pe,Il,se="",Ye=null,$t=null,Et=null;function mo(){return{firstTextKey:Et,format:Ye,style:$t}}function Ln(e){e.firstTextKey!==null&&(Ye=e.format,$t=e.style,Et=e.firstTextKey)}function kg(e){if(Et!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&M(348),t===null)return;let n=Pe.get(t);R(n)&&(Ye=n.getFormat(),$t=n.getStyle(),Et=t)}var $d,Sl,Cl,Zn,om,Pe,vs,rm,$l,Ss,ko=!1,Hu=!1;function ur(e,t){let n=Zn.get(e),o=Pe.has(e);if(t!==null){let r=cm(e);r.parentNode===t&&t.removeChild(r)}if(!o){if(pe._keyToDOMMap.delete(e),k(n)){let r=Yl(n,Zn);sm(r,0,r.length-1,null)}if(n!==void 0){for(let r of Pn(n).values()){let s=am(r);ur(r,null),s!==null&&s.remove()}h_($l,Il,$d,n,"destroyed")}}}function sm(e,t,n,o){for(let r=t;r<=n;++r){let s=e[r];s!==void 0&&ur(s,o)}}function ps(e,t){e.setProperty("text-align",t)}var hR="40px";function aE(e,t){let n=Al.theme.indent;if(typeof n=="string"){let o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${hR}))`),Hl(e,"class"),Hl(e,"style")}function lE(e,t){let n=e.style;t===0?ps(n,""):t===1?ps(n,"left"):t===2?ps(n,"center"):t===3?ps(n,"right"):t===4?ps(n,"justify"):t===5?ps(n,"start"):t===6&&ps(n,"end"),Hl(e,"style")}function im(e,t){let n=(function(o){let r=o.__dir;if(r!==null)return r;if(qe(o))return null;let s=o.getParent();return s===null||We(s)&&s.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function cE(e){let t=Xt().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function uE(e,t,n){t||e.contentEditable==="false"?oT(n,pe):n.removeAttribute("contenteditable")}function $C(e,t,n){let o=se,r=mo();se="";let s="",i=he(e);for(let[a,l]of n){let c=cE(a);uE(t,i,c),t.appendChild(c),se="";let u=mo();dr(l,Jt(e,c,pe)),Ln(u),dE(e,a,t,c),s+=se}return Ln(r),se=o,s}function Pn(e){return mr(e)&&e.__slots!==null?e.__slots:lT}function dE(e,t,n,o){let r=Ss.$getSlotTargetElement(e,t,n,pe);r!==null&&(o.parentElement!==r&&r.appendChild(o),o.style.display="")}function am(e){let t=vs.get(e);return t!==void 0?t.parentElement:null}function RC(e,t,n){let o=Pn(e),r=Pn(t);for(let[u,d]of o)if(!r.has(u)){let f=am(d);ur(d,null),f!==null&&f.remove()}let s=se,i=mo(),a="",l=null,c=he(t);for(let[u,d]of r){let f=o.get(u),p=f!==void 0?am(f):null;se="";let h=mo();if(p===null){p=cE(u);let g=null;for(let y of n.children)if(!y.hasAttribute("data-lexical-slot")){g=y;break}n.insertBefore(p,g),dr(d,Jt(t,p,pe))}else f===d?Ao(d,p):(f!==void 0&&ur(f,p),dr(d,Jt(t,p,pe)));if(Ln(h),uE(n,c,p),dE(t,u,n,p),a+=se,p.parentElement===n){let g=l===null?n.firstChild:l.nextSibling;g!==p&&n.insertBefore(p,g),l=p}}return Ln(i),se=s,a}function dr(e,t){let n=Pe.get(e);if(n===void 0&&M(60),t!==null){let r=Zn.get(e);if(r!==void 0){let s=vs.get(e);if(s!==void 0){let i=vr(r)?r.__slotHost:null,a=vr(n)?n.__slotHost:null,l=r.__parent!==n.__parent||i!==a,c=a!==null&&s.parentElement!==t.element;if(l||c)return t.insertChild(s),Ao(e,t.element)}}}let o=Ss.$createDOM(n,pe);if((function(r,s,i){let a=i._keyToDOMMap;kN(s,i,r),a.set(r,s)})(e,o,pe),R(n)?o.setAttribute("data-lexical-text","true"):he(n)&&(o.setAttribute("data-lexical-decorator","true"),nT(o,{captureSelection:!0})),k(n)){let r=n.__indent,s=n.__size;im(o,n),r!==0&&aE(o,r);let i=Pn(n),a=i.size>0?$C(n,o,i):"";if(s===0)o.__lexicalTextContent=a,o.__lexicalFirstTextKey=null,se+=a,i.size>0&&(o.__lexicalSlotTextLength=a.length);else{let c=se,u=s-1;if(lm(Yl(n,Pe),n,0,u,Jt(n,o,pe)),a!==""){let d=o.__lexicalTextContent||"";o.__lexicalTextContent=a+d,se=c+a+d}i.size>0&&(o.__lexicalSlotTextLength=a.length)}let l=n.__format;l!==0&&lE(o,l),n.isInline()||(pE(0,n,o),fE(n,o))}else{let r=n.getTextContent();if(he(n)){let s=n.decorate(pe,Al);s!==null&&hE(e,s),o.contentEditable="false";let i=Pn(n);i.size>0&&$C(n,o,i)}se+=r}return t!==null&&t.insertChild(o),Ss.$decorateDOM(n,null,o,pe),iE(n),h_($l,Il,$d,n,"created"),o}function lm(e,t,n,o,r){let s=se,i=mo();se="",Ye=null,$t=null,Et=null;let a=n;for(;a<=o;++a){let c=mo();dr(e[a],r);let u=Pe.get(e[a]);u!==null&&R(u)?Ye===null&&(Ye=u.getFormat(),$t=u.getStyle(),Et=u.__key):k(u)&&a<o&&!u.isInline()&&(se+=_s),Ln(c)}let l=pe._keyToDOMMap.get(t.__key);l===void 0&&M(349,t.__key),l.__lexicalTextContent=se,l.__lexicalFirstTextKey=Et,se=s+se,Ln(i)}function PC(e,t){if(!e)return!1;let n=t.get(e);return he(n)&&!n.isInline()}function fE(e,t){let n=Jt(e,t,pe);n.setDecoratorBoundaryAnchor("leading",PC(e.__first,Pe)),n.setDecoratorBoundaryAnchor("trailing",PC(e.__last,Pe))}function pE(e,t,n){let o=Jt(t,n,pe),r=(function(s,i){if(s){let a=s.__last;if(a){let l=i.get(a);if(l)return pn(l)?"line-break":he(l)&&l.isInline()?"decorator":null}return"empty"}return null})(t,Pe);o.setManagedLineBreak(r)}function LC(e,t,n){let o=t.__lexicalFirstTextKey;if(o!=null){let r=e.__key,s=o;for(;s!==null;){let i=Pe.get(s);if(i===void 0){s=null;break}if(i.__parent===r)break;s=i.__parent}if(s!==null&&!n.has(s)){let i=Pe.get(o);if(R(i))return Ye=i.getFormat(),void($t=i.getStyle())}}t.__lexicalFirstTextKey=Et}function Ao(e,t){let n=Zn.get(e),o=Pe.get(e);n!==void 0&&o!==void 0||M(61);let r=ko||Cl.has(e)||Sl.has(e),s=Mi(pe,e);if(n===o&&!r){let i;if(k(n)){let a=s.__lexicalTextContent;typeof a!="string"&&M(355,n.getType()),i=a,kg(s)}else i=n.getTextContent();return se+=i,s}if(n!==o&&r&&h_($l,Il,$d,o,"updated"),Ss.$updateDOM(o,n,s,pe)){let i=dr(e,null);return t===null&&M(62),t.replaceChild(i,s),ur(e,null),i}if(k(n)){k(o)||M(334,e);let i=o.__indent;(ko||i!==n.__indent)&&aE(s,i);let a=o.__format;(ko||a!==n.__format)&&lE(s,a);let l=r&&(Pn(o).size>0||Pn(n).size>0)?RC(n,o,s):"";if(r){let c=se;if((function(u,d,f){var p;Ye=null,$t=null,Et=null,(function(h,g,y){let m=se,_=h.__size,x=g.__size;se="";let v=y.element,S=pe._keyToDOMMap.get(g.__key);S===void 0&&M(351,g.__key);let b=x-_;if(!ko&&Math.abs(b)<=1&&_>=pR&&h.__first===g.__first&&(b!==0||!pe._cloneNotNeeded.has(h.__key))){let N=S.__lexicalTextContent,D=rm.get(h.__key);if(!ko&&typeof N=="string"&&D!==void 0){let O=(function(T,A){let $=A.size;if($===0||$>=T.__size)return null;let I=T.__last,L=null,P=0;for(;I!==null&&P<$;){if(!A.has(I))return null;L=I;let Y=Pe.get(I);if(Y===void 0)return null;I=Y.__prev,P++}return P!==$||I!==null&&A.has(I)?null:L})(g,D);if(O!==null){let T=D.size;if(b===0){let A=IC(O,T),$=O,I=0;for(;$!==null&&I<T;){let ee=Pe.get($);if(ee===void 0)break;let Z=mo();Ao($,v),R(ee)&&Ye===null&&(Ye=ee.getFormat(),$t=ee.getStyle(),Et=ee.__key),Ln(Z),$=ee.__next,I++}let L="";for($=O,I=0;$!==null&&I<T;){let ee=Pe.get($);if(ee===void 0)break;let Z;if(k(ee)){let ne=pe._keyToDOMMap.get($),ae=ne&&ne.__lexicalTextContent;typeof ae!="string"&&M(352,ee.getType()),Z=ae}else Z=ee.getTextContent();L+=Z,I<T-1&&k(ee)&&!ee.isInline()&&(L+=_s),$=ee.__next,I++}let P=S.__lexicalSlotTextLength||0,Y=P>0?N.slice(P):N,Q=Y.slice(0,Y.length-A)+L;return S.__lexicalTextContent=Q,se=m+Q,void LC(g,S,D)}if((function(A,$,I,L,P,Y,Q,ee){if(ee!==1&&ee!==-1||Q!==(ee===1?2:1))return!1;let Z=Q-ee,ne=A.__last;for(let _e=0;_e<Z-1;_e++){if(ne===null)return!1;let Be=Zn.get(ne);if(Be===void 0)return!1;ne=Be.__prev}if(ne===null)return!1;let ae=Pe.get(Y),xe=Zn.get(ne);if(ae===void 0||xe===void 0||ae.__prev!==xe.__prev)return!1;let ue=[],q=Y;for(let _e=0;_e<Q;_e++){if(q===null)return!1;ue.push(q);let Be=Pe.get(q);q=Be?Be.__next:null}let le=[];q=ne;for(let _e=0;_e<Z;_e++){if(q===null)return!1;le.push(q);let Be=Zn.get(q);q=Be?Be.__next:null}let Fe=new Set(le),Te=new Set(ue),Ot=[],Dt=0,Ze=0;for(;Dt<Z&&Ze<Q;)if(ue[Ze]===le[Dt])Ot.push({key:ue[Ze],kind:"reconcile"}),Dt++,Ze++;else if(Te.has(le[Dt])){if(Fe.has(ue[Ze]))return!1;Ot.push({key:ue[Ze],kind:"create",nextIndex:Ze}),Ze++}else Ot.push({key:le[Dt],kind:"destroy"}),Dt++;for(;Dt<Z;)Ot.push({key:le[Dt++],kind:"destroy"});for(;Ze<Q;)Ot.push({key:ue[Ze],kind:"create",nextIndex:Ze}),Ze++;let Hs=IC(ne,Z);for(let _e of Ot){let Be=mo();if(_e.kind==="reconcile")Ao(_e.key,I.element);else if(_e.kind==="destroy")ur(_e.key,I.element);else{let pt=null;for(let en=_e.nextIndex+1;en<Q;en++){let Gn=pe._keyToDOMMap.get(ue[en]);if(Gn!==void 0){pt=Gn;break}}dr(_e.key,I.withBefore(pt??I.before))}if(_e.kind!=="destroy"){let pt=Pe.get(_e.key);pt&&R(pt)&&Ye===null&&(Ye=pt.getFormat(),$t=pt.getStyle(),Et=pt.__key)}Ln(Be)}let bo="";for(let _e=0;_e<Q;_e++){let Be=Pe.get(ue[_e]);if(Be===void 0)return!1;let pt;if(k(Be)){let en=pe._keyToDOMMap.get(ue[_e]),Gn=en&&en.__lexicalTextContent;typeof Gn!="string"&&M(350,Be.getType()),pt=Gn}else pt=Be.getTextContent();bo+=pt,_e<Q-1&&k(Be)&&!Be.isInline()&&(bo+=_s)}let lt=L.__lexicalSlotTextLength||0,Go=lt>0?P.slice(lt):P;return L.__lexicalTextContent=Go.slice(0,Go.length-Hs)+bo,!0})(h,0,y,S,N,O,T,b)){let A=S.__lexicalTextContent;return typeof A!="string"&&M(353),se=m+A,void LC(g,S,D)}}}if(b===0){let O=h.__first,T=0;for(;O!==null;){let A=Pe.get(O);if(A===void 0)break;let $=ko||Cl.has(O)||Sl.has(O),I=mo();if($)Ao(O,v);else{let L,P;if(k(A)){P=vs.get(O);let Y=P&&P.__lexicalTextContent;typeof Y!="string"&&M(354,A.getType()),L=Y}else L=A.getTextContent();se+=L,P!==void 0&&kg(P)}R(A)?Ye===null&&(Ye=A.getFormat(),$t=A.getStyle(),Et=A.__key):k(A)&&T<x-1&&!A.isInline()&&(se+=_s),Ln(I),O=A.__next,T++}return S.__lexicalTextContent=se,S.__lexicalFirstTextKey=Et,void(se=m+se)}}if(_===1&&x===1){let N=h.__first,D=g.__first;if(N===D)Ao(N,v);else{let T=cm(N),A=dr(D,null);try{T.parentNode===v?v.replaceChild(A,T):y.insertChild(A)}catch($){if(typeof $=="object"&&$!=null){let I=`${$.toString()} Parent: ${v.tagName}, new child: {tag: ${A.tagName} key: ${D}}, old child: {tag: ${T.tagName}, key: ${N}}.`;throw new Error(I)}throw $}ur(N,null)}let O=Pe.get(D);R(O)&&Ye===null&&(Ye=O.getFormat(),$t=O.getStyle(),Et=O.__key)}else{let N=Yl(h,Zn),D=Yl(g,Pe);if(N.length!==_&&M(227),D.length!==x&&M(228),_===0)x!==0&&lm(D,g,0,x-1,y);else if(x===0){if(_!==0){let O=y.after==null&&y.before==null&&Pn(g).size===0&&y.element.__lexicalLineBreak==null;sm(N,0,_-1,O?null:v),O&&(v.textContent="")}}else(function(O,T,A,$,I,L){let P=$-1,Y=I-1,Q,ee,Z=L.getFirstChild(),ne=0,ae=0;for(;ne<=P&&ae<=Y;){let q=T[ne],le=A[ae],Fe=mo();if(q===le)Z=Ag(Ao(le,L.element)),ne++,ae++;else{if(ee===void 0&&(ee=FC(A,ae)),Q===void 0)Q=FC(T,ne);else if(!Q.has(q)){ne++,Ln(Fe);continue}if(!ee.has(q)){Z=Ag(cm(q)),ur(q,L.element),ne++,Q.delete(q),Ln(Fe);continue}if(Q.has(le)){let Ot=Mi(pe,le);Ot!==Z&&L.withBefore(Z??L.before).insertChild(Ot),Z=Ag(Ao(le,L.element)),ne++,ae++}else dr(le,L.withBefore(Z??L.before)),ae++}let Te=Pe.get(le);Te!==null&&R(Te)?Ye===null&&(Ye=Te.getFormat(),$t=Te.getStyle(),Et=Te.__key):k(Te)&&ae<=Y&&!Te.isInline()&&(se+=_s),Ln(Fe)}let xe=ne>P,ue=ae>Y;if(xe&&!ue){let q=A[Y+1],le=q===void 0?null:pe.getElementByKey(q);lm(A,O,ae,Y,L.withBefore(le??L.before))}else ue&&!xe&&sm(T,ne,P,L.element)})(g,N,D,_,x,y)}S.__lexicalTextContent=se,S.__lexicalFirstTextKey=Et,se=m+se})(u,d,Jt(d,f,pe)),We(d)||(p=d,Ye==null||Ye===p.__textFormat||Hu||p.setTextFormat(Ye),(function(h){$t==null||$t===h.__textStyle||Hu||h.setTextStyle($t)})(d))})(n,o,s),o.isInline()||(qe(o)||pE(0,o,s),fE(o,s)),l!==""){let u=s.__lexicalTextContent||"";s.__lexicalTextContent=l+u,se=c+l+u,s.__lexicalSlotTextLength=l.length}else(Pn(o).size>0||Pn(n).size>0)&&(s.__lexicalSlotTextLength=0)}else{let c=s.__lexicalTextContent;typeof c!="string"&&M(356,n.getType()),se+=c,kg(s)}if((ko||o.__dir!==n.__dir||o.__parent!==n.__parent)&&(im(s,o),qe(o)&&!ko))for(let c of o.getChildren())k(c)&&im(Mi(pe,c.getKey()),c)}else{let i=o.getTextContent();if(he(o)){let a=o.decorate(pe,Al);a!==null&&hE(e,a),r&&(Pn(o).size>0||Pn(n).size>0)&&RC(n,o,s)}se+=i}if(!Hu&&qe(o)){let i=o.getLatest();if(i.__cachedText!==se){let a=i.getWritable();a.__cachedText=se,o=a}}return Ss.$decorateDOM(o,n,s,pe),iE(o),s}function hE(e,t){let n=pe._pendingDecorators,o=pe._decorators;if(n===null){if(o[e]===t)return;n=AN(pe)}n[e]=t}function Ag(e){let t=e.nextSibling;return t!==null&&t===pe._blockCursorElement&&(t=t.nextSibling),t}function FC(e,t){let n=new Set;for(let o=t;o<e.length;o++)n.add(e[o]);return n}function gR(e,t,n,o,r,s){se="",Ye=null,$t=null,Et=null,ko=o===2,pe=n,Al=n._config,Ss=n._config.dom||Kl,Il=n._nodes,$d=pe._listeners.mutation,Sl=r,Cl=s,Zn=e._nodeMap,om=e,Pe=t._nodeMap,Hu=t._readOnly,vs=Ub(n._keyToDOMMap),rm=(function(){let a=new Map,l=c=>{for(let u of c){let d=Pe.get(u);if(d===void 0)continue;let f=d.__parent;if(f===null)continue;let p=a.get(f);p===void 0&&(p=new Set,a.set(f,p)),p.add(u)}};return l(Sl.keys()),l(Cl),a})();let i=new Map;return $l=i,Ao("root",null),pe=void 0,Il=void 0,Sl=void 0,Cl=void 0,Zn=void 0,om=void 0,Pe=void 0,Al=void 0,vs=void 0,rm=void 0,$l=void 0,Ss=Kl,i}function cm(e){let t=vs.get(e);return t===void 0&&M(75,e),t}function mR(e){return()=>{}}function j(e){return{type:e}}var Rd=j("SELECTION_CHANGE_COMMAND"),_R=j("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),gE=j("CLICK_COMMAND"),Um=j("BEFORE_INPUT_COMMAND"),Hm=j("INPUT_COMMAND"),Vm=j("COMPOSITION_START_COMMAND"),jm=j("COMPOSITION_END_COMMAND"),Rl=j("DELETE_CHARACTER_COMMAND"),bl=j("INSERT_LINE_BREAK_COMMAND"),um=j("INSERT_PARAGRAPH_COMMAND"),Ti=j("CONTROLLED_TEXT_INSERTION_COMMAND"),Ym=j("PASTE_COMMAND"),Vu=j("REMOVE_TEXT_COMMAND"),Pl=j("DELETE_WORD_COMMAND"),Oi=j("DELETE_LINE_COMMAND"),fr=j("FORMAT_TEXT_COMMAND"),yR=j("SET_TEXT_FORMAT_COMMAND"),id=j("UNDO_COMMAND"),Ll=j("REDO_COMMAND"),Gm=j("KEYDOWN_COMMAND"),mE=j("KEY_ARROW_RIGHT_COMMAND"),dm=j("MOVE_TO_END"),_E=j("KEY_ARROW_LEFT_COMMAND"),fm=j("MOVE_TO_START"),yE=j("KEY_ARROW_UP_COMMAND"),xE=j("KEY_ARROW_DOWN_COMMAND"),qm=j("KEY_ENTER_COMMAND"),vE=j("KEY_SPACE_COMMAND"),SE=j("KEY_BACKSPACE_COMMAND"),CE=j("KEY_ESCAPE_COMMAND"),bE=j("KEY_DELETE_COMMAND"),EE=j("KEY_TAB_COMMAND"),xR=j("INSERT_TAB_COMMAND"),vR=j("INDENT_CONTENT_COMMAND"),SR=j("OUTDENT_CONTENT_COMMAND"),NE=j("DROP_COMMAND"),CR=j("FORMAT_ELEMENT_COMMAND"),TE=j("DRAGSTART_COMMAND"),OE=j("DRAGOVER_COMMAND"),DE=j("DRAGEND_COMMAND"),Xm=j("COPY_COMMAND"),Jm=j("CUT_COMMAND"),wE=j("SELECT_ALL_COMMAND"),bR=j("CLEAR_EDITOR_COMMAND"),ER=j("CLEAR_HISTORY_COMMAND"),NR=j("CAN_REDO_COMMAND"),TR=j("CAN_UNDO_COMMAND"),ME=j("FOCUS_COMMAND"),kE=j("BLUR_COMMAND"),AE=j("KEY_MODIFIER_COMMAND");function IE(e,t){return{...t,[Rm]:e}}var lr=IE("metaKey",{ctrlKey:!Lo,metaKey:Lo}),pm=IE("altKey",{altKey:Lo,ctrlKey:!Lo}),BC=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function Ig(e,t,n){let o=e.get(t);o?o.push(n):e.set(t,[n])}var hm=class{constructor(){w(this,"byKey",new Map);w(this,"byCode",new Map)}add(t){let{key:n,modifiers:o={}}=t;n.length>0||M(399);let r=n.toLowerCase();for(let s of(function(i){let a=[0];for(let[l,c]of BC){let u=i[l]||!1;u==="any"?a=a.concat(a.map(d=>d|c)):u&&(a=a.map(d=>d|c))}return a})(o))Ig(this.byKey,`${s}:${r}`,t),n.length===1&&(/[0-9]/.test(n)?Ig(this.byCode,`${s}:Digit${n}`,t):/[a-z]/.test(r)&&Ig(this.byCode,`${s}:Key${r.toUpperCase()}`,t));return this}matches(t){let n=t.key;if(!n)return[];let o=(function(i){let a=0;for(let[l,c]of BC)i[l]&&(a|=c);return a})(t),r=this.byKey.get(`${o}:${n.toLowerCase()}`),s=r?r.slice():[];if(this.byCode.size>0&&!(n.length===1&&n.charCodeAt(0)<=127)){let i=this.byCode.get(`${o}:${t.code}`);i&&s.push(...i)}return s}match(t){return this.matches(t)[0]}};function $E(e){let t=new hm;for(let n of e)t.add(n);return t}function RE(e){let t=new Map;return{dispose(){for(let n of t.values())n.dispose();t.clear()},register(n,o){let r=t.get(n);r===void 0&&(r={dispose:e(n,o),holders:new Set},t.set(n,r));let s=()=>{let i=t.get(n);i&&i.holders.delete(s)&&i.holders.size===0&&(t.delete(n),i.dispose())};return r.holders.add(s),s}}}function Qm(e,t,n,o){return e.addEventListener(t,n,o),e.removeEventListener.bind(e,t,n,o)}var wo=Object.freeze({}),$g,Rg=new WeakMap,ju=new WeakMap,OR=RE(e=>(e.addEventListener("selectionchange",YC),()=>e.removeEventListener("selectionchange",YC)));function PE(e,t,n,o,r,s){let i=e.anchor,a=e.focus,l=i.getNode(),c=ge(),u;if(s!==void 0)u=s;else{let g=Hn(an(c));u=g!==null?sn(g,c._rootElement):null}let d=u!==null?u.anchorNode:null,f=i.key,p=c.getElementByKey(f),h=n.length;return f!==a.key||!R(l)||(!r&&(!Tl||c._inputState.lastBeforeInputInsertTextTimeStamp<o+50)||l.isDirty()&&h<2||IN(n))&&i.offset!==a.offset&&!l.isComposing()||Bn(l)||l.isDirty()&&h>1||(r||!Tl)&&p!==null&&!l.isComposing()&&d!==Po(l,p,c)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||(function(g,y){if(y.isSegmented())return!0;if(!g.isCollapsed())return!1;let m=g.anchor.offset,_=y.getParentOrThrow(),x=Ul(y);return m===0?!y.canInsertTextBefore()||!_.canInsertTextBefore()&&!y.isComposing()||x||(function(v){let S=v.getPreviousSibling();return(R(S)||k(S)&&S.isInline())&&!S.canInsertTextAfter()})(y):m===y.getTextContentSize()&&(!y.canInsertTextAfter()||!_.canInsertTextAfter()&&!y.isComposing()||x)})(e,l)}function zC(e,t){return _n(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function WC(e,t,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=sn(e,t._rootElement),a=t._inputState;if(a.isSelectionChangeFromDOMUpdate){a.isSelectionChangeFromDOMUpdate=!1;let l=a.selectionChangeFromDOMUpdatePoints;if(a.selectionChangeFromDOMUpdatePoints=null,zC(o,r)&&zC(s,i)&&!a.postDeleteSelectionToRestore&&(l===null||l.anchorNode===o&&l.anchorOffset===r&&l.focusNode===s&&l.focusOffset===i))return}mn(t,()=>{if(!n)return void Pt(null);if(!tc(t,o,s))return;let l=ce();if(a.postDeleteSelectionToRestore&&K(l)&&l.isCollapsed()){let c=l.anchor,u=a.postDeleteSelectionToRestore.anchor;(c.key===u.key&&c.offset===u.offset+1||c.offset===1&&u.getNode().is(c.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),Pt(l))}if(a.postDeleteSelectionToRestore=null,K(l)){let c=l.anchor,u=c.getNode();if(l.isCollapsed()){e.type==="Range"&&o===s&&(l.dirty=!0);let d=an(t).event,f=d?d.timeStamp:performance.now(),{format:p,style:h,offset:g,key:y,timeStamp:m}=a.collapsedSelectionFormat,_=Lt(),x=t.isComposing()===!1&&_.getTextContent()==="";if(f<m+200&&c.offset===g&&c.key===y)Yu(l,p,h);else if(c.type==="text")R(u)||M(141),LE(l,u);else if(c.type==="element"&&!x){k(u)||M(259);let v=c.getNode();v.isEmpty()?(function(S,b){Yu(S,b.getTextFormat(),b.getTextStyle())})(l,v):Yu(l,l.format,"")}}else{let d=c.key,f=l.focus.key,p=l.getNodes(),h=p.length,g=l.isBackward(),y=g?i:r,m=g?r:i,_=g?f:d,x=g?d:f,v=$b,S=!1;for(let b=0;b<h;b++){let N=p[b],D=N.getTextContentSize();if(R(N)&&D!==0&&!(b===0&&N.__key===_&&y===D||b===h-1&&N.__key===x&&m===0)&&(S=!0,v&=N.getFormat(),v===0))break}l.format=S?v:0}}(function(c,u,d=!1){(d||gN(c,u))&&c.dispatchCommand(Rd)})(t,l,l!==null&&(l.dirty||!K(l)))})}function Yu(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function LE(e,t){Yu(e,t.getFormat(),t.getStyle())}function DR(e,t){mn(t,()=>{let n=ce(),o=Hn(an(t)),r=Ts();if(o){if(K(n)){let s=n.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&n.isCollapsed()&&!qe(i)&&Lt().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r)&&(o.removeAllRanges(),n.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){let s=sn(o,t._rootElement).anchorNode;(we(s)||_n(s))&&Pt(Bl(r,o,t,e))}}if(xo&&o!==null&&o.rangeCount===0){let s=t._rootElement;if(s!==null&&e.target===s){let i=e.clientY,a=s.childNodes.length;for(let c=0;c<s.childNodes.length;c++){let u=s.childNodes[c];if(we(u)){let d=u.getBoundingClientRect();if(i<=(d.top+d.bottom)/2){a=c;break}}}o.setBaseAndExtent(s,a,s,a);let l=Bl(r,o,t,e);l!==null?Pt(l):o.removeAllRanges()}}G(t,gE,e)})}function wR(e,t){let n=x_(e),o=e.pointerType;Xi(n)&&o!=="touch"&&o!=="pen"&&e.button===0&&mn(t,()=>{jl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function FE(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function KC(e){let{lastKeyCode:t}=ge()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t==="Enter"?`
70
70
  `:t==="Tab"?" ":null;if(!n)return;let o=ce();if(!K(o)||!o.isCollapsed())return;let r=o.anchor.getNode();if(!R(r))return;let{offset:s}=o.anchor;if(r.getTextContentSize()===s){let i=r.getNextSibling();if(n===`
71
- `){if(ro)return;if(pn(i))i.selectEnd();else if(!i){let a=cr(r,rN),l=a&&a.getNextSibling();k(l)&&l.selectStart()}}else n===" "?t_(i)&&i.selectEnd():R(i)&&i.getTextContent()[0]===n&&i.select(1,1)}else r.getTextContent()[s]===n&&r.select(s+1,s+1)}function Fl(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function KC(e){Lo&&!ro&&Od&&(Fl(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Fl(e),0))}function FE(e,t){let n=x_(e);if(we(n)&&jl(n,t))return!0;let o=t.getRootElement();if(o===null)return!1;let r=zi(o.ownerDocument);return r!==null&&o.contains(r)&&jl(r,t)}function DR(e){let t=e.inputType,n=LE(e),o=ge(),r=o._inputState,s=ce();if(t==="insertText"&&e.data&&r.isInsertTextAfterHandledSelectionCommand){if(Fl(r),e.preventDefault(),K(s)&&!s.isCollapsed()){let d=s.isBackward()?s.anchor:s.focus;s.anchor.set(d.key,d.offset,d.type),s.focus.set(d.key,d.offset,d.type)}return!0}if(t==="deleteContentBackward"){if(s===null){let d=Ts();if(!K(d))return!0;Pt(d.clone())}if(K(s)){let d=s.anchor.key===s.focus.key;if((function(f,p){return f.lastKeyCode==="MediaLast"&&p<f.lastKeyDownTimeStamp+30})(r,e.timeStamp)&&o.isComposing()&&d){if(ft(null),r.lastKeyDownTimeStamp=0,setTimeout(()=>{mn(o,()=>{ft(null)})},30),K(s)){let f=s.anchor.getNode();f.markDirty(),R(f)||M(142),PE(s,f)}}else{if(ft(null),ro&&n!==null&&!n.collapsed&&(s.applyDOMRange(n),!s.isCollapsed()))return e.preventDefault(),s.removeText(),!0;e.preventDefault();let f=s.anchor.getNode(),p=f.getTextContent(),h=f.canInsertTextAfter(),g=s.anchor.offset===0&&s.focus.offset===p.length,y=Ol&&d&&!g&&h;if(y&&s.isCollapsed()&&(y=!he(PN(s.anchor,!0))),!y){G(o,Rl,!0);let m=ce();Ol&&K(m)&&m.isCollapsed()&&(r.postDeleteSelectionToRestore=m,setTimeout(()=>r.postDeleteSelectionToRestore=null))}}return!0}}if(!K(s))return t!=="historyUndo"&&t!=="historyRedo"||(e.preventDefault(),G(o,t==="historyUndo"?id:Ll)),!0;let i=e.data;r.unprocessedBeforeInputData!==null&&f_(!1,o,r.unprocessedBeforeInputData),s.dirty&&r.unprocessedBeforeInputData===null||!s.isCollapsed()||qe(s.anchor.getNode())||n===null||s.applyDOMRange(n),r.unprocessedBeforeInputData=null;let a=s.anchor,l=s.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(i===`
72
- `)e.preventDefault(),G(o,bl,!1);else if(i===_s)e.preventDefault(),G(o,um);else if(i==null&&e.dataTransfer){let d=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(d)}else i!=null&&RE(s,n,i,e.timeStamp,!0)?(e.preventDefault(),G(o,Ti,i),WC(i)):r.unprocessedBeforeInputData=i;return r.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":G(o,Ti,e),WC((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let d=r.hadOrphanedCompositionEvents;r.hadOrphanedCompositionEvents=!1;let f=o._compositionKey;ft(null),d||G(o,Ti,e),Gu(f);break}case"insertLineBreak":ft(null),r.isInsertLineBreak=!1,G(o,bl,!1);break;case"insertParagraph":ft(null),r.isInsertLineBreak?(r.isInsertLineBreak=!1,G(o,bl,!1)):G(o,um);break;case"insertFromPaste":case"insertFromPasteAsQuotation":G(o,Ym,e);break;case"deleteByComposition":(function(d,f){return d!==f||k(d)||k(f)||!Ul(d)||!Ul(f)})(c,u)&&G(o,Vu,e);break;case"deleteByDrag":Es(cd),G(o,Vu,e);break;case"deleteByCut":G(o,Vu,e);break;case"deleteContent":G(o,Rl,!1);break;case"deleteWordBackward":G(o,Pl,!0);break;case"deleteWordForward":G(o,Pl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":G(o,Oi,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":G(o,Oi,!1);break;case"formatStrikeThrough":G(o,fr,"strikethrough");break;case"formatBold":G(o,fr,"bold");break;case"formatItalic":G(o,fr,"italic");break;case"formatUnderline":G(o,fr,"underline");break;case"historyUndo":G(o,id);break;case"historyRedo":G(o,Ll)}return!0}function wR(e,t){e.stopPropagation();let n=t._inputState;Fl(n),mn(t,()=>{FE(e,t)||t.dispatchCommand(Hm,e)},{event:e}),n.unprocessedBeforeInputData=null}function MR(e){let t=ge(),n=t._inputState,o=ce(),r=e.data,s=LE(e),i=!1;if(r!=null&&K(o)){let a=Un(an(t)),l=a!==null?sn(a,t._rootElement):null,c=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!t.isComposing();c&&(n.hadOrphanedCompositionEvents=!0);let u=o.anchor.getNode(),d=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&t.isComposing()&&R(u)&&Fn(u);if(!c&&!d&&RE(o,s,r,e.timeStamp,!1,l)){if(i=!0,n.compositionPhase==="ending-firefox"){let m=ad(t,r);if(n.compositionPhase="idle",m)return Es(ud),xb(),!0}let f=o.anchor.getNode();if(a===null||l===null)return!0;let p=o.isBackward(),h=p?o.anchor.offset:o.focus.offset,g=p?o.focus.offset:o.anchor.offset;Tl&&!o.isCollapsed()&&R(f)&&l.anchorNode!==null&&f.getTextContent().slice(0,h)+r+f.getTextContent().slice(h+g)===$N(l.anchorNode)||G(t,Ti,r);let y=r.length;xo&&y>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(o.anchor.offset-=y,o._cachedNodes=null,o._cachedIsBackward=null),Ol&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,ft(null))}}return i||(f_(!1,t,r!==null?r:void 0),n.compositionPhase==="ending-firefox"&&(ad(t,r||void 0),Es(ud),n.compositionPhase="idle")),xb(),!0}function kR(e,t){G(t,Vm,e)}function AR(e){let t=ge(),n=t._inputState,o=ce();if(K(o)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let r=o.anchor,s=o.anchor.getNode();if(ft(r.key),Es(UE),e.timeStamp<n.lastKeyDownTimeStamp+30||r.type==="element"||!o.isCollapsed()||!Ol&&(s.getFormat()!==o.format||R(s)&&s.getStyle()!==o.style)||R(s)&&(Fn(s)||r.offset===0&&!s.canInsertTextBefore()||r.offset===s.getTextContentSize()&&!s.canInsertTextAfter())){G(t,Ti,Im);let i=ce();K(i)&&ft(i.anchor.key)}}return!0}function IR(e){let t=ge();return t._inputState.compositionPhase="idle",ad(t,e.data),Es(ud),!0}function Gu(e){if(e===null)return;let t=Ee(e);if(!R(t)||t.getType()==="text"||Fn(t)||!t.isAttached())return;let n=ce(),o=K(n)&&n.anchor.key===e?n.anchor.offset:null,r=rn(t.getTextContent());if(r.setFormat(t.getFormat()),r.setStyle(t.getStyle()),t.replace(r),o!==null){let s=Math.min(o,r.getTextContentSize());r.select(s,s)}}function ad(e,t){let n=e._compositionKey;if(ft(null),n!==null&&t!=null){if(t===""){let r=Ee(n),s=e.getElementByKey(n),i=s!==null&&R(r)?Po(r,s,e):null;if(i!==null&&i.nodeValue!==null&&R(r)){let a=Un(an(e)),l=a&&sn(a,e._rootElement),c=null,u=null;l!==null&&l.anchorNode===i&&(c=l.anchorOffset,u=l.focusOffset),p_(r,i.nodeValue,c,u,!0)}return Gu(n),!1}if(t[t.length-1]===`
73
- `){let r=ce();if(K(r)||ji(r)){if(K(r)){let s=r.focus;r.anchor.set(s.key,s.offset,s.type)}return G(e,qm,null),Gu(n),!1}}let o=Ee(n);if(o!==null&&R(o)&&Fn(o)){o.markDirty();let r=ce(),s=o.getTextContentSize(),i=K(r)&&r.anchor.key===n?r.anchor.offset:s;return o.select(i,i).insertText(t),!0}}return f_(!0,e,t),Gu(n),!1}function $R(e,t){let n=t._inputState;xo?n.compositionPhase="ending-firefox":ro||!Ql&&!Zl?G(t,jm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}function RR(e,t){let n=t._inputState;ro&&(n.isShiftKeyDown=e.key==="Shift"||n.isShiftKeyDown&&e.shiftKey&&e.key!=="CapsLock"),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Fl(n),t.isComposing()||G(t,Gm,e)}var Lu={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},ml={ctrlKey:!0},UC={metaKey:!0},ar={shiftKey:"any"},HC={altKey:"any",shiftKey:"any"};function PR(e){let t=ge(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase==="ending-safari"){let s=(function(i){return i.key==="Backspace"})(e);if(s&&mn(t,()=>{ad(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",s)return!0}let o=t._keyDownShortcuts;o===null&&(o=IE((function(){let s=(c,u,d)=>({key:c,modifiers:u,onMatch:(f,p)=>{G(p,d,f)}}),i=(c,u,d,f)=>({key:c,modifiers:u,onMatch:(p,h)=>{p.preventDefault(),G(h,d,f)}}),a=(c,u)=>({key:"Enter",modifiers:c,onMatch:(d,f)=>{let p=f._inputState;p.isInsertLineBreak=u&&(!ro||p.isShiftKeyDown),G(f,qm,d),d.defaultPrevented&&(p.isInsertLineBreak=!1)}}),l=(c,u)=>({key:c,modifiers:lr,onMatch:(d,f)=>{let p=f._editorState._selection;p===null||K(p)||(d.preventDefault(),G(f,u,d))}});return[s("ArrowRight",ar,gE),s("ArrowLeft",ar,mE),s("ArrowUp",HC,_E),s("ArrowDown",HC,yE),a({...Lu,shiftKey:!0},!0),a({...Lu,shiftKey:!1},!1),s(" ",Lu,xE),{key:"Backspace",modifiers:ar,onMatch:(c,u)=>{G(u,vE,c)&&KC(u._inputState)}},s("Escape",Lu,SE),s("Delete",{},CE),i("Backspace",pm,Pl,!0),i("Delete",pm,Pl,!1),i("b",lr,fr,"bold"),i("u",lr,fr,"underline"),i("i",lr,fr,"italic"),s("Tab",ar,bE),i("z",lr,id,void 0),i("z",{...lr,shiftKey:!0},Ll,void 0),...Lo?[{key:"o",modifiers:ml,onMatch:(c,u)=>{c.preventDefault(),G(u,bl,!0)}},s("ArrowLeft",{metaKey:!0,...ar},fm),s("ArrowRight",{metaKey:!0,...ar},dm),i("h",ml,Rl,!0),i("d",ml,Rl,!1),i("Backspace",UC,Oi,!0),i("Delete",UC,Oi,!1),i("k",ml,Oi,!1)]:[s("Home",ar,fm),s("End",ar,dm),i("y",ml,Ll,void 0)],{key:"a",modifiers:lr,onMatch:(c,u)=>{c.preventDefault(),G(u,DE,c)&&KC(u._inputState)}},l("c",Xm),l("x",Jm)]})()),t._keyDownShortcuts=o);let r=o.match(e);return r&&r.onMatch(e,t),(function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey})(e)&&t.dispatchCommand(kE,e),!0}function VC(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Di=new Map;function jC(e){let t=WN(e.target);if(t===null)return;let n=Wd(e.target),o=null,r=null,s=n!==null?ju.get(n):void 0;if(n!==null){if(s!==void 0){let d=s.editors,f=s.hasShadowEditor;if(f===void 0){f=!1;for(let p of d)if(p._rootElement!==null&&Bo(p._rootElement.getRootNode())){f=!0;break}s.hasShadowEditor=f}if(f){let p=null,h=null;for(let g of d){let y=g._rootElement;if(y===null)continue;let m=sn(t,y).anchorNode;if(m!==null&&gr(m)===g){if(Bo(y.getRootNode())){o=g,r=m;break}p===null&&(p=g,h=m)}}o===null&&p!==null&&(o=p,r=h)}else{let p=t.anchorNode;p===null||we(p)&&p.shadowRoot!==null||(o=gr(p),o!==null&&(r=p))}}if(o===null){let d=zi(n);o=d!==null?gr(d):null}}if(o===null)return;if(o._inputState.isSelectionChangeFromMouseDown){if(s!==void 0)for(let d of s.editors)d._inputState.isSelectionChangeFromMouseDown=!1;mn(o,()=>{let d=Ts(),f=r??sn(t,o._rootElement).anchorNode;(we(f)||_n(f))&&Pt(Bl(d,t,o,e))})}let i=d_(o),a=i[i.length-1],l=a._key,c=Di.get(l),u=c||a;u!==o&&zC(t,u,!1),zC(t,o,!0),o!==a?Di.set(l,o):c&&Di.delete(l)}function gm(e){e._lexicalHandled=!0}function YC(e){return e._lexicalHandled===!0}var GC=hR();function mm(e,t,n){dt();let o=e.__key,r=e.getParent();if(r===null)return void(Nt(e)!==null&&M(367,o,String(Nt(e))));let s=(function(a){let l=ce();if(!K(l)||!k(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return Vl(d,a)&&c.set(a.__key,0,"element"),Vl(f,a)&&u.set(a.__key,0,"element"),l})(e),i=!1;if(K(s)&&t){let a=s.anchor,l=s.focus;a.key===o&&(pd(a,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0),l.key===o&&(pd(l,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else ji(s)&&t&&e.isSelected()&&e.selectPrevious();if(K(s)&&t&&!i&&gs(s,r)){let a=e.getIndexWithinParent();Zn(e),ms(s,r,a,-1)}else Zn(e);n||We(r)||r.canBeEmpty()||!r.isEmpty()||mm(r,t),t&&s&&qe(r)&&r.isEmpty()&&r.selectEnd()}function LR(e){return e}var BE=Symbol.for("ephemeral");function ld(e){return e[BE]||!1}var qC={configurable:!0,enumerable:!1,value:void 0,writable:!0},st=class{constructor(t){w(this,"__type");w(this,"__key");w(this,"__parent");w(this,"__prev");w(this,"__next");w(this,"__state");this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",qC),Object.defineProperty(this,sd,qC),wN(this,t)}static getType(){let{ownNodeType:t}=oc(this);return t===void 0&&M(64,this.name),t}static clone(t){M(65,this.name)}$config(){return{}}config(t,n){let o=n.extends||iT(this.constructor);return Object.assign(n,{extends:o}),typeof t=="string"&&Object.assign(n,{type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}resetOnCopyNodeFrom(t){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}getType(){return this.__type}isInline(){M(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;let n=Ee(t);if(n===null)break;t=n.__parent!==null?n.__parent:Nt(n)}return!1}isSelected(t){let n=t||ce();if(n==null)return!1;let o=n.getNodes().some(r=>r.__key===this.__key);if(R(this))return o;if(K(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let r=this.getParent();if(he(this)&&this.isInline()&&r){let s=n.isBackward()?n.focus:n.anchor;if(r.is(s.getNode())&&s.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return o}getKey(){return this.__key}getIndexWithinParent(){let t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),o=0;for(;n!==null;){if(this.is(n))return o;o++,n=n.getNextSibling()}return-1}getParent(){let t=this.getLatest().__parent;return t===null?null:Ee(t)}getParentOrThrow(){let t=this.getParent();return t===null&&M(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){let n=t.getParent();if(We(n)||Nt(t)!==null)return k(t)||t===this&&he(t)||M(194),t;t=n}return null}getTopLevelElementOrThrow(){let t=this.getTopLevelElement();return t===null&&M(67,this.__key),t}getParents(){let t=[],n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){let t=[],n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){let t=this.getLatest().__prev;return t===null?null:Ee(t)}getPreviousSiblings(){let t=[],n=this.getParent();if(n===null)return t;let o=n.getFirstChild();for(;o!==null&&!o.is(this);)t.push(o),o=o.getNextSibling();return t}getNextSibling(){let t=this.getLatest().__next;return t===null?null:Ee(t)}getNextSiblings(){let t=[],n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}is(t){return t!=null&&this.__key===t.__key}isBefore(t){let n=O_(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?T_(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&M(279),!1)))}isParentOf(t){return Vl(t,this)}getNodesBetween(t){let n=this.isBefore(t),o=[],r=new Set,s=this;for(;s!==null;){let i=s.__key;if(r.has(i)||(r.add(i),o.push(s)),s===t)break;let a=k(s)?n?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}let l=n?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}let c=s.getParentOrThrow();if(r.has(c.__key)||o.push(c),c===t)break;let u=null,d=c;do{if(d===null&&M(68),u=n?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||r.has(d.__key)||o.push(d)}while(u===null);s=u}return n||o.reverse(),o}isDirty(){let t=ge()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(ld(this))return this;let t=Ee(this.__key);return t===null&&M(113),t}getWritable(){if(ld(this))return this;dt();let t=yn(),n=ge(),o=this.__key,r=n._cloneNotNeeded,s=r.get(o),i=t._selection;if(i!==null&&i.setCachedNodes(null),s!==void 0)return vd(s),s;let a=t._nodeMap,l=a.get(o);l===void 0&&M(113);let c=S_(l);return r.set(o,c),a.set(o,c),vd(c),c}getTextContent(){return dT(this)}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){M(70)}updateDOM(t,n,o){M(71)}getDOMSlot(t){return new ed(t)}exportDOM(t){return{element:Kd(t).$createDOM(this,t)}}exportJSON(t=!1){let n=(function(r,s){let i=Nd(Wi(r.constructor)),{generated:a,isCompactDefault:l}=i,c=a===null?void 0:s?a.exportCompactJSON:a.exportJSON;return c===void 0?(function(u,d,f){let p=f?{type:u.__type}:{};return k(u)&&(p.children=[]),(function(h,g,y,m){for(let _=0;_<g.length;_++){let x=g[_];if(m&&x.derived)continue;let v;if(x.kind==="ownField"){let S=h[x.field];v=x.getterTable===void 0?S:Ln(x.getterTable,S)?x.getterTable[S]:void 0}else v=x.getter.call(h);x.kind==="ownField"&&x.when!==void 0&&(!Om(x,v)&&x.when.call(h)||(v=void 0)),m&&Om(x,v)||(y[x.key]=v)}})(u,d,p,f),f||(p.type=u.__type,p.version=1),p})(r,i.getters,s):s?c(r,l):c(r)})(this,t),o=this.__state?this.__state.toJSON():void 0;return o!==void 0&&Object.assign(n,o),n}static importJSON(t){M(18,this.name)}updateFromJSON(t){return rT(rE(this,t),t)}static transform(){return null}remove(t){mm(this,!0,t)}replace(t,n){dt();let o=ce();o!==null&&(o=o.clone()),jg(this,t);let r=this.getLatest(),s=this.__key,i=gn(r);i!==null&&M(400,s,r.getType(),i.getKey(),i.getType());let a=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),u=c.__size,d=l.getParent(),f=d!==null&&K(o)&&gs(o,d),p=f?l.getIndexWithinParent():-1;Zn(l),f&&d!==null&&K(o)&&ms(o,d,p,-1);let h=r.getPreviousSibling(),g=r.getNextSibling(),y=r.__prev,m=r.__next,_=r.__parent;mm(r,!1,!0),h===null?c.__first=a:h.getWritable().__next=a,l.__prev=y,g===null?c.__last=a:g.getWritable().__prev=a,l.__next=m,l.__parent=_,c.__size=d!==null&&d.is(c)?u-1:u;let x=0;if(n&&(k(this)&&k(l)||M(139),x=l.getChildrenSize(),l.splice(x,0,this.getChildren())),K(o)){Pt(o);let v=o.anchor,S=o.focus;v.key===s&&(n&&v.type==="element"?v.set(l.__key,x+v.offset,"element"):ZC(v,l)),S.key===s&&(n&&S.type==="element"?S.set(l.__key,x+S.offset,"element"):ZC(S,l))}return _o()===s&&ft(a),l}insertAfter(t,n=!0){dt(),jg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.getParent(),i=ce(),a=!1,l=!1,c=-1;if(s!==null&&n&&K(i)&&gs(i,s)){let h=s.__key,g=i.anchor,y=i.focus;c=t.getIndexWithinParent(),a=g.type==="element"&&g.key===h&&g.offset===c+1,l=y.type==="element"&&y.key===h&&y.offset===c+1}Zn(r),c!==-1&&s!==null&&K(i)&&ms(i,s,c,-1);let u=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=r.__key,p=o.__next;if(u===null?d.__last=f:u.getWritable().__prev=f,d.__size++,o.__next=f,r.__next=p,r.__prev=o.__key,r.__parent=o.__parent,n&&K(i)){let h=d.__key;if(a||l||gs(i,d)){let g=this.getIndexWithinParent();ms(i,d,g+1),a&&i.anchor.set(h,g+2,"element"),l&&i.focus.set(h,g+2,"element")}}return t}insertBefore(t,n=!0){dt(),jg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.__key,i=ce(),a=r.getParent(),l=a!==null&&n&&K(i)&&gs(i,a),c=l?r.getIndexWithinParent():-1;Zn(r),l&&a!==null&&K(i)&&ms(i,a,c,-1);let u=this.getPreviousSibling(),d=this.getParentOrThrow().getWritable(),f=o.__prev,p=n&&K(i)&&gs(i,d),h=p?this.getIndexWithinParent():-1;return u===null?d.__first=s:u.getWritable().__next=s,d.__size++,o.__prev=s,r.__prev=f,r.__next=o.__key,r.__parent=o.__parent,p&&K(i)&&ms(i,d,h),t}isParentRequired(){return!1}createParentElementNode(){return qt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){dt();let o=gn(this);if(o!==null)return o.selectPrevious(t,n);let r=this.getPreviousSibling(),s=this.getParentOrThrow();if(r===null)return s.select(0,0);if(k(r))return r.select();if(!R(r)){let i=r.getIndexWithinParent()+1;return s.select(i,i)}return r.select(t,n)}selectNext(t,n){dt();let o=gn(this);if(o!==null)return o.selectNext(t,n);let r=this.getNextSibling(),s=this.getParentOrThrow();if(r===null)return s.select();if(k(r))return r.select(0,0);if(!R(r)){let i=r.getIndexWithinParent();return s.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}};w(st,"importDOM");function Zm(e){return e instanceof st}var FR="historic",BR="history-push",qu="history-merge",zR="paste",WR="cut",zE="collaboration",KR="skip-collab",WE="skip-scroll-into-view",KE="skip-dom-selection",cd="skip-selection-focus",UE="composition-start",ud="composition-end",UR=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function $i(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!UR.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function HE(e,t,n,o,r){let s=$i(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}var HR=e=>{let t=ec(e,"format"),n=Md(e,"format"),o=kd(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=HE(s.indent,0,0,1/0),r.__textFormat=$i(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}};function VR(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var jR=e=>{let t=ec(e,"mode"),n=od(e,"detail",0),o=od(e,"format",0),r=Md(e,"mode"),s=kd(e,"mode");return{exportJSON:function(i){return{detail:i.__detail,format:i.__format,mode:t[i.__mode],style:i.__style,text:i.__text,type:i.__type,version:1}},exportCompactJSON:function(i){let a={type:i.__type},l=i.__detail;l!==void 0&&l!==0&&(a.detail=l);let c=i.__format;c!==void 0&&c!==0&&(a.format=c);let u=t[i.__mode];u!==void 0&&u!=="normal"&&(a.mode=u);let d=i.__style;d!==void 0&&d!==""&&(a.style=d);let f=i.__text;return f!==void 0&&f!==""&&(a.text=f),a},updateFromJSON:function(i,a){let l=a.detail;i.__detail=typeof l=="string"&&l in n?n[l]:$i(l,0);let c=a.format;i.__format=typeof c=="string"&&c in o?o[c]:$i(c,0);let u=a.mode;i.__mode=typeof u=="string"&&u in r?r[u]:s;let d=a.style;i.__style=typeof d=="string"?d:"";let f=a.text;return i.__text=typeof f=="string"?f:"",i},afterCloneFrom:VR}},YR=e=>{let t=ec(e,"format"),n=Md(e,"format"),o=kd(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=HE(s.indent,0,0,1/0),r.__textFormat=$i(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}},GR=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),qR=e=>{let t=ec(e,"mode"),n=od(e,"format",0);return{exportJSON:function(o){return{detail:o.__detail,mode:t[o.__mode],text:o.__text,format:o.__format,style:o.__style,type:o.__type,version:1}},exportCompactJSON:function(o){let r={type:o.__type},s=o.__format;s!==void 0&&s!==0&&(r.format=s);let i=o.__style;return i!==void 0&&i!==""&&(r.style=i),r},updateFromJSON:function(o,r){let s=r.format;o.__format=typeof s=="string"&&s in n?n[s]:$i(s,0);let i=r.style;return o.__style=typeof i=="string"?i:"",o}}};function _m(e){let t={};if(!e)return t;let n="",o="",r=null,s=!1,i=!1,a=!1,l=0,c=e.length,u=-1;for(let p=0;p<c;p++){let h=e[p];if(s)h==="*"&&e[p+1]==="/"&&(s=!1,p++);else if(i)u===-1&&(u=p),i=!1;else if(r===null)if(h!=="/"||e[p+1]!=="*")if(h!=='"'&&h!=="'")if(h!=="(")if(h!==")")if(a||h!==":"||l!==0){if(h===";"&&l===0){u!==-1&&(a?o+=e.slice(u,p):n+=e.slice(u,p),u=-1);let g=n.trim(),y=o.trim();g!==""&&y!==""&&(t[g]=y),n="",o="",a=!1;continue}u===-1&&(u=p)}else u!==-1&&(n+=e.slice(u,p),u=-1),a=!0;else u===-1&&(u=p),l=Math.max(0,l-1);else u===-1&&(u=p),l++;else u===-1&&(u=p),r=h;else u!==-1&&(a?o+=e.slice(u,p):n+=e.slice(u,p),u=-1),s=!0,p++;else u===-1&&(u=p),h==="\\"?i=!0:h===r&&(r=null)}u!==-1&&(a?o+=e.slice(u,c):n+=e.slice(u,c));let d=n.trim(),f=o.trim();return d!==""&&f!==""&&(t[d]=f),t}function VE(e,t,n){let o=n.trimEnd(),r=o.length-10;r>=0&&o.slice(r).toLowerCase()==="!important"?e.setProperty(t,o.slice(0,r).trim(),"important"):e.setProperty(t,n,"")}function XR(e,t){for(let n in t){let o=t[n];o==null?e.removeProperty(n):VE(e,n,o)}}function ym(e,t,n=""){if(t===n)return;let o=_m(n),r=_m(t);for(let s in r)delete o[s],VE(e,s,r[s]);for(let s in o)e.removeProperty(s)}var JR=Id()({detail:Io(Qg(Ii(),Lb),{field:"__detail"}),format:Io(Qg(Ii(),xt),{field:"__format"}),mode:Io(kl(["normal","token","segmented"]),{field:"__mode",getterTable:zb,setterTable:$m}),style:Io(Ml(),{field:"__style"}),text:Io(Ml(),{field:"__text",getter:"getTextContent",setter:"setTextContent"})});function Pg(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Lg(e,t){return 1&t?"strong":2&t?"em":"span"}function jE(e,t,n,o,r){let s=o.classList,i=wi(r,"base");i!==void 0&&s.add(...i),i=wi(r,"underlineStrikethrough");let a=!1,l=8&t&&4&t;i!==void 0&&(8&n&&4&n?(a=!0,l||s.add(...i)):l&&s.remove(...i));for(let c in xt){let u=xt[c];if(i=wi(r,c),i!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&s.remove(...i);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&s.add(...i)}else t&u&&s.remove(...i)}Hl(o,"class")}function YE(e,t,n){let o=n.isComposing(),r=e+(o?Dl:""),s=vo(),i=Kd(s).$getDOMSlot(n,t,s),a=i.getFirstChild();if(a===null||a.nodeType!==Node.TEXT_NODE)return void i.insertChild(Xt().createTextNode(r));let l=a,c=l.nodeValue;if(c!==r)if(o||xo){let[u,d,f]=(function(p,h){let g=p.length,y=h.length,m=0,_=0;for(;m<g&&m<y&&p[m]===h[m];)m++;for(;_+m<g&&_+m<y&&p[g-_-1]===h[y-_-1];)_++;return[m,g-m-_,h.slice(m,y-_)]})(c,r);d!==0&&l.deleteData(u,d),l.insertData(u,f)}else l.nodeValue=r}function XC(e,t,n,o,r,s){YE(r,e,t);let i=s.theme.text;i!==void 0&&jE(0,0,o,e,i)}function Fu(e,t){let n=Xt().createElement(t);return n.appendChild(e),n}function dd(e){return e!=null&&e.__isInlineFormattable===!0}var _r=class extends st{constructor(n="",o){super(o);w(this,"__text");w(this,"__format");w(this,"__style");w(this,"__mode");w(this,"__detail");this.__text=n,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}get __isInlineFormattable(){return!0}$config(){return this.config("text",{extends:st,generated:jR,importDOM:{"#text":()=>({conversion:t1,priority:0}),b:()=>({conversion:ZR,priority:0}),code:()=>({conversion:Mo,priority:0}),em:()=>({conversion:Mo,priority:0}),i:()=>({conversion:Mo,priority:0}),mark:()=>({conversion:Mo,priority:0}),s:()=>({conversion:Mo,priority:0}),span:()=>({conversion:QR,priority:0}),strong:()=>({conversion:Mo,priority:0}),sub:()=>({conversion:Mo,priority:0}),sup:()=>({conversion:Mo,priority:0}),u:()=>({conversion:Mo,priority:0})},json:JR})}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let n=this.getLatest();return zb[n.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===_o()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(n){let o=xt[n];return(this.getFormat()&o)!==0}isSimpleText(){let n=this.getLatest();return n.__type==="text"&&n.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(n,o){return xr(this.getLatest().__format,n,o)}canHaveFormat(){return!0}isInline(){return!0}createDOM(n,o){let r=this.__format,s=Pg(0,r),i=Lg(0,r),a=s===null?i:s,l=Xt().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Xt().createElement(i),l.appendChild(c)),XC(c,this,0,r,this.__text,n);let u=this.__style;return u!==""&&ym(l.style,u),l}updateDOM(n,o,r){let s=this.__text,i=n.__format,a=this.__format,l=Pg(0,i),c=Pg(0,a),u=Lg(0,i),d=Lg(0,a);if((l===null?u:l)!==(c===null?d:c))return!0;if(l===c&&u!==d){let y=o.firstChild;y==null&&M(48);let m=Xt().createElement(d);return XC(m,this,0,a,s,r),o.replaceChild(m,y),!1}let f=o;c!==null&&l!==null&&(f=o.firstChild,f==null&&M(49)),YE(s,f,this);let p=r.theme.text;p!==void 0&&i!==a&&jE(0,i,a,f,p);let h=n.__style,g=this.__style;return h!==g&&(ym(o.style,g,h),Hl(o,"style")),!1}exportDOM(n){let{element:o}=super.exportDOM(n);return we(o)||M(132),o.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?o.style.textTransform="lowercase":this.hasFormat("uppercase")?o.style.textTransform="uppercase":this.hasFormat("capitalize")&&(o.style.textTransform="capitalize"),this.hasFormat("bold")&&(o=Fu(o,"b")),this.hasFormat("italic")&&(o=Fu(o,"i")),this.hasFormat("strikethrough")&&(o=Fu(o,"s")),this.hasFormat("underline")&&(o=Fu(o,"u")),{element:o}}selectionTransform(n,o){}setFormat(n){let o=this.getWritable();return o.__format=typeof n=="string"?xt[n]:n,o}setDetail(n){let o=this.getWritable();return o.__detail=typeof n=="string"?Lb[n]:n,o}setStyle(n){let o=this.getWritable();return o.__style=n,o}toggleFormat(n){let o=xr(this.getFormat(),n,null);return this.setFormat(o)}toggleDirectionless(){let n=this.getWritable();return n.__detail^=1,n}toggleUnmergeable(){let n=this.getWritable();return n.__detail^=2,n}setMode(n){let o=$m[n];if(this.getLatest().__mode===o)return this;let r=this.getWritable();return r.__mode=o,r}setTextContent(n){if(this.getLatest().__text===n)return this;let o=this.getWritable();return o.__text=n,o}select(n,o){dt();let r=n,s=o,i=ce(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!K(i))return sN(l,r,l,s,"text","text");{let c=_o();c!==i.anchor.key&&c!==i.focus.key||ft(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let n=this.getTextContentSize();return this.select(n,n)}spliceText(n,o,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=n;c<0&&(c=l+c,c<0&&(c=0));let u=ce();if(s&&K(u)){let f=n+l;u.setTextNodeRange(i,f,i,f)}let d=a.slice(0,c)+r+a.slice(c+o);return i.__text=d,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...n){dt();let o=this.getLatest(),r=o.getTextContent();if(r==="")return[];let s=o.__key,i=_o(),a=r.length;n.sort((O,T)=>O-T),n.push(a);let l=[],c=n.length;for(let O=0,T=0;O<a&&T<=c;T++){let A=n[T];A>O&&(l.push(r.slice(O,A)),O=A)}let u=l.length;if(u===1)return[o];let d=l[0],f=o.getParent(),p,h=o.getFormat(),g=o.getStyle(),y=o.__detail,m=!1,_=null,x=null,v=ce();if(K(v)){let[O,T]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];O.type==="text"&&O.key===s&&(_=O),T.type==="text"&&T.key===s&&(x=T)}o.isSegmented()?(p=rn(d),p.__format=h,p.__style=g,p.__detail=y,p.__state=OC(o,p),m=!0):p=o.setTextContent(d);let S=[p];for(let O=1;O<u;O++){let T=rn(l[O]);T.__format=h,T.__style=g,T.__detail=y,T.__state=OC(o,T);let A=T.__key;i===s&&ft(A),S.push(T)}let b=_?_.offset:null,N=x?x.offset:null,D=0;for(let O of S){if(!_&&!x)break;let T=D+O.getTextContentSize();if(_!==null&&b!==null&&b<=T&&b>=D&&(_.set(O.getKey(),b-D,"text"),b<T&&(_=null)),x!==null&&N!==null&&N<=T&&N>=D){x.set(O.getKey(),N-D,"text");break}D=T}if(f!==null){(function(A){let $=A.getPreviousSibling(),I=A.getNextSibling();$!==null&&vd($),I!==null&&vd(I)})(this);let O=f.getWritable(),T=this.getIndexWithinParent();m?(O.splice(T,0,S),this.remove()):O.splice(T,1,S),K(v)&&ms(v,f,T,u-1)}return S}mergeWithSibling(n){let o=n===this.getPreviousSibling();o||n===this.getNextSibling()||M(50);let r=this.__key,s=n.__key,i=this.__text,a=i.length;_o()===s&&ft(r);let l=ce();if(K(l)){let f=l.anchor,p=l.focus;f!==null&&f.key===s&&ab(f,o,r,n,a),p!==null&&p.key===s&&ab(p,o,r,n,a)}let c=n.__text,u=o?c+i:i+c;this.setTextContent(u);let d=this.getWritable();return n.remove(),d}isTextEntity(){return!1}};function QR(e){return{forChild:e_(e.style),node:null}}function ZR(e){let t=e,n=t.style.fontWeight==="normal";return{forChild:e_(t.style,n?void 0:"bold"),node:null}}var JC=new WeakMap;function e1(e){if(!we(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function t1(e){let t=e;e.parentElement===null&&M(129);let n=t.textContent||"";if((function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=JC.get(s))===void 0&&!e1(s);)i.push(s),s=s.parentNode;let a=r===void 0?s:r;for(let l=0;l<i.length;l++)JC.set(i[l],a);return a})(t)!==null)return{node:o_(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=QC(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=QC(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:rn(n)}}function QC(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let s=n.parentElement;if(s===null)return null;n=s}if(n=o,we(n)){let s=n.style.display;if(s===""&&!XN(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(_n(n))return n;if(n.nodeName==="BR")return null}}var n1={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Mo(e){let t=n1[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:e_(e.style,t),node:null}}function rn(e=""){return Gi(new _r(e))}function R(e){return e instanceof _r}function e_(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",s=o.includes("line-through"),i=e.fontStyle==="italic",a=o.includes("underline"),l=e.verticalAlign,c=e.textTransform;return u=>((R(u)||dd(u))&&(r&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),l!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),l!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),c!=="lowercase"&&c!=="uppercase"&&c!=="capitalize"||u.hasFormat(c)||u.toggleFormat(c),t&&!u.hasFormat(t)&&u.toggleFormat(t)),u)}var o1=Id()({detail:Ni(Ii(2),{getter:{field:"__detail"},setter:null}),mode:Ni(kl(["normal"]),{getter:{field:"__mode",getterTable:{0:"normal"}},setter:null}),text:Ni(Ml(" "),{getter:{field:"__text",method:"getTextContent"},setter:null})}),Ri=class extends _r{$config(){return this.config("tab",{extends:_r,generated:qR,json:o1})}constructor(t=void 0){super(" ",t),this.__detail=2}createDOM(t){let n=super.createDOM(t),o=wi(t.theme,"tab");return o!==void 0&&n.classList.add(...o),n}setTextContent(t){return super.setTextContent(" ")}spliceText(t,n,o,r){return o===""&&n===0||o===" "&&n===1||M(286),this}setDetail(t){return t!==2&&M(127),this}setMode(t){return t!=="normal"&&M(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function GE(){return Gi(new Ri)}function t_(e){return e instanceof Ri}var xm=class{constructor(t,n,o){w(this,"key");w(this,"offset");w(this,"type");w(this,"_selection");this._selection=null,this.key=t,this.offset=n,this.type=o}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:Xl(hn($o(this,"next")),hn($o(t,"next")))<0}getNode(){let t=Ee(this.key);return t===null&&M(20),t}set(t,n,o,r){let s=this._selection,i=this.key;r&&this.key===t&&this.offset===n&&this.type===o||(this.key=t,this.offset=n,this.type=o,yr()||(_o()===i&&ft(t),s!==null&&(s.setCachedNodes(null),K(s)&&(s._cachedIsBackward=null),s.dirty=!0)))}};function no(e,t,n){return new xm(e,t,n)}function Fg(e,t){let n=t.__key,o=e.offset,r="element";if(R(t)){r="text";let s=t.getTextContentSize();o>s&&(o=s)}else if(!k(t)){let s=t.getNextSibling();if(R(s))n=s.__key,o=0,r="text";else{let i=t.getParent();i&&(n=i.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function ZC(e,t){if(k(t)){let n=t.getLastDescendant();k(n)||R(n)?Fg(e,n):Fg(e,t)}else Fg(e,t)}function eb(e,t,n,o){let r=e.getNode(),s=r.getChildAtIndex(e.offset),i=rn();if(i.setFormat(n),i.setStyle(o),EN(s))s.splice(0,0,[i]);else if(s!==null){let a=We(r)?qt().append(i):i;s.insertBefore(a)}else if(We(r)){let a=r.getLastChild();k(a)&&!a.isInline()&&a.isEmpty()?a.append(i):r.append(qt().append(i))}else r.append(i);e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}function tb(e,t,n,o){let r=e.anchor.getNode();R(r)||M(398);let s=e.anchor.offset,i=rn(t);i.setFormat(n),i.setStyle(o);let a=r.getParentOrThrow();if(s===0)a.isInline()&&!r.__prev?a.insertBefore(i):r.insertBefore(i,!1);else if(s===r.getTextContentSize())a.isInline()&&!r.__next?a.insertAfter(i):r.insertAfter(i,!1);else{let[l]=r.splitText(s);l.insertAfter(i,!1)}r.getTextContent()===""&&r.isAttached()&&r.remove(),i.selectEnd(),i.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var fd=class e{constructor(t){w(this,"_nodes");w(this,"_cachedNodes");w(this,"dirty");this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!ji(t))return!1;let n=this._nodes,o=t._nodes;return n.size===o.size&&Array.from(n).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let n=this.getNodes().filter(i=>Nt(i)===null),o=n.length;if(o===0)return;let r=n[o-1],s;if(R(r))s=r.select();else{let i=r.getIndexWithinParent()+1;s=r.getParentOrThrow().select(i,i)}s.insertNodes(t);for(let i=0;i<o;i++)n[i].remove()}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=this._nodes,o=[];for(let r of n){let s=Ee(r);s!==null&&o.push(s)}return yr()||(this._cachedNodes=o),o}getTextContent(){let t=this.getNodes(),n="";for(let o=0;o<t.length;o++)n+=t[o].getTextContent();return n}deleteNodes(){let t=this.getNodes().filter(n=>Nt(n)===null);if((ce()||Ts())===this&&t[0]){let n=Xe(t[0],"next");yN(br(n,n))}for(let n of t)n.remove();qE()}};function qE(){let e=Lt();if(e.getChildrenSize()===0&&cT(ce())===null){let t=qt();e.append(t),t.select()}}function K(e){return e instanceof Cs}var Cs=class e{constructor(t,n,o,r){w(this,"format");w(this,"style");w(this,"anchor");w(this,"focus");w(this,"_cachedNodes");w(this,"_cachedIsBackward");w(this,"dirty");this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!K(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=(function(o){let r=[],[s,i]=o.getTextSlices();s&&r.push(s.caret.origin);let a=new Set,l=new Set;for(let c of o)if(Bn(c)){let{origin:u}=c;r.length===0?a.add(u):(l.add(u),r.push(u))}else{let{origin:u}=c;k(u)&&l.has(u)||r.push(u)}if(i&&r.push(i.caret.origin),Sr(o.focus)&&k(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let c=zn(o.focus.origin,"previous");Bn(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(r[r.length-1]);c=Vi(c))a.delete(c.origin),r.pop();for(;r.length>1;){let c=r[r.length-1];if(!k(c)||l.has(c)||c.isEmpty()||a.has(c))break;r.pop()}if(r.length===0&&o.isCollapsed()){let c=hn(o.anchor),u=hn(o.anchor.getFlipped()),d=p=>eo(p)?p.origin:p.getNodeAtCaret(),f=d(c)||d(u)||(o.anchor.getNodeAtCaret()?c.origin:u.origin);r.push(f)}return r})(Ld(xd(this),"next"));return yr()||(this._cachedNodes=n),n}setTextNodeRange(t,n,o,r){return this.anchor.set(t.__key,n,"text"),this.focus.set(o.__key,r,"text"),this}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let n=t[0],o=t[t.length-1],r=this.anchor,s=this.focus,i=r.isBefore(s),[a,l]=vm(this),c="",u=!0;for(let d=0;d<t.length;d++){let f=t[d];if(k(f)&&!f.isInline()){u||(c+=`
74
- `);let p="";for(let h of yo(f)){let g=Ns(f,h);g!==null&&(p+=g.getTextContent())}p!==""?(c+=p,u=!1):u=!f.isEmpty()}else if(u=!1,R(f)){let p=f.getTextContent();f===n?f===o?r.type==="element"&&s.type==="element"&&s.offset!==r.offset||(p=a<l?p.slice(a,l):p.slice(l,a)):p=i?p.slice(a):p.slice(l):f===o&&(p=i?p.slice(0,l):p.slice(0,a)),c+=p}else!he(f)&&!pn(f)||f===o&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(t){let n=ge(),o=n.getEditorState()._selection,r=oN(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,o);if(r===null)return;let[s,i,a]=r;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(i.key,i.offset,i.type,!0),a&&(this.dirty=!0),Km(this)}clone(){let t=this.anchor,n=this.focus;return new e(no(t.key,t.offset,t.type),no(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=xr(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){let n=xt[t];return(this.format&n)!==0}insertRawText(t){this.insertNodes(o_(t))}insertText(t){let n=this.format,o=this.style;if(!this.isCollapsed()){let d=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(R(d)&&(n=d.getFormat(),o=d.getStyle()),this.removeText(),this.format=n,this.style=o,t==="")return;if(_o()===null)return this.anchor.type==="element"&&eb(this.anchor,this.focus,n,o),void tb(this,t,n,o)}this.anchor.type==="element"&&eb(this.anchor,this.focus,n,o);let r=this.anchor.getNode();R(r)||M(398);let s=this.anchor.offset,i=r.getParentOrThrow(),a=r.getTextContentSize();if(Fn(r)||s===0&&(!r.canInsertTextBefore()||!i.canInsertTextBefore()&&!r.__prev)||s===a&&(!r.canInsertTextAfter()||!i.canInsertTextAfter()&&!r.__next)){if(r.isSegmented()&&s!==0&&s!==a){if(_o()!==null)r.setMode("normal").setFormat(n).setStyle(o);else{let f=rn(r.getTextContent());f.setFormat(n),f.setStyle(o);let p=ce()===this;r.replace(f),this.setTextNodeRange(f,s,f,s),p&&ce()!==this&&Pt(this)}return void(t!==""&&this.insertText(t))}if(t==="")return;if(s===0){let f=r.getPreviousSibling();if(R(f)&&f.canInsertTextAfter()&&!Fn(f))f.select();else{let p=rn();p.setFormat(n),p.setStyle(o),i.canInsertTextBefore()?r.insertBefore(p):i.insertBefore(p),p.select()}return void this.insertText(t)}if(s===a){let f=r.getNextSibling();if(R(f)&&f.canInsertTextBefore()&&!Fn(f))f.select(0,0);else{let p=rn();p.setFormat(n),p.setStyle(o),i.canInsertTextAfter()?r.insertAfter(p):i.insertAfter(p),p.select(0,0)}return void this.insertText(t)}let d=rn(t);return d.setFormat(n),d.setStyle(o),r.replace(d),void d.select()}if(t==="")return;let l=i.isInline()&&s===0&&!r.__prev,c=i.isInline()&&s===a&&!r.__next,u=r.getFormat()!==n||r.getStyle()!==o;if(l||c||u){if(r.getTextContent()!==""||l||c)return void tb(this,t,n,o);r.setFormat(n),r.setStyle(o)}r.spliceText(s,0,t,!0),r.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-t.length,this.anchor.type)}removeText(){let t=ce()===this,n=this.anchor.key;Nl(this,xN(xd(this))),this.isCollapsed()&&(function(o,r){let s=o.anchor;if(s.key===r)return;let i=s.getNode(),a=0,l="";R(i)?(a=i.getFormat(),l=i.getStyle()):k(i)&&(a=i.getTextFormat(),l=i.getTextStyle()),o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)})(this,n),t&&ce()!==this&&Pt(this)}formatText(t,n=null){JE(this,t,n)}insertNodes(t){if(t.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&k(n)&&n.isShadowRoot()&&Nt(n)!==null){let x=n.getFirstChild()??n.append(qt()).getFirstChild();if(x!==null&&!k(x)){let v=qt();x.insertBefore(v),x=v}if(x!==null){x.selectStart();let v=ce();return K(v)||M(369),v.insertNodes(t)}}if(this.anchor.type==="element"&&We(n)){let x=zg(t),v=x.getLastDescendant();return n.splice(this.anchor.offset,0,x.getChildren()),void(v!==null&&v.selectEnd())}let o=this.isBackward()?this.focus:this.anchor,r=o.getNode(),s=cr(r,Rt),i=t[t.length-1];if(k(s)&&"__language"in s){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let[,x]=_l(this);s.splice(x,0,t),i.selectEnd()}return}if(!t.some(x=>(k(x)||he(x))&&!x.isInline())){k(s)||M(211,r.constructor.name,r.getType());let[x,v]=_l(this,!0);return(k(x)?x:s).splice(v,0,t),void i.selectEnd()}if(k(s)&&Nt(s)!==null){let[,x]=_l(this),v=Cm(t);s.splice(x,0,v);let S=v[v.length-1];return void(S!==void 0?S.selectEnd():s.select(x,x))}if(s===null){let x=zg(t),v=x.getLastDescendant(),S=$o(this.anchor,"next");for(let b of x.getChildren())S=bN(b,S);return void(v!==null&&v.selectEnd())}if(k(s)&&!s.isParentRequired()&&!We(s.getParentOrThrow())){let[,x]=_l(this),v=Cm(t);s.splice(x,0,v);let S=v[v.length-1];return void(S!==void 0?S.selectEnd():s.select(x,x))}let a=zg(t),l=a.getLastDescendant(),c=a.getChildren(),u=(function(x){let v=(function(S){let b=S.getNode();if(S.offset>0)return S.type==="element"&&k(b)?b.getChildAtIndex(S.offset-1):null;for(let N=b;N!==null&&!Rt(N)&&!We(N);N=N.getParent()){let D=N.getPreviousSibling();if(D!==null)return D}return null})(x);return pn(v)&&pn(v.getPreviousSibling())})(o),d=k(s)&&s.isEmpty()?null:this.insertParagraph();d&&!s.isAttached()&&(r=this.anchor.getNode(),s=cr(r,Rt));let f=c[c.length-1],p=c[0];var h;h=p,u||!k(h)||!Rt(h)||h.isEmpty()||!k(s)||s.isEmpty()&&!s.canMergeWhenEmpty()||(k(s)||M(211,r.constructor.name,r.getType()),s.append(...p.getChildren()),p=c[1]),p&&(s===null&&M(212,r.constructor.name,r.getType()),(function(x,v){let S=v.getParentOrThrow().getLastChild(),b=v,N=[v];for(;b!==S;)b.getNextSibling()||M(140),b=b.getNextSibling(),N.push(b);let D=x;for(let O of N)D=D.insertAfter(O)})(s,p));let g=cr(l,Rt),y=l.selectEnd();d&&(k(g)&&(d.canMergeWhenEmpty()||Rt(f))?(g.append(...d.getChildren()),d.remove()):d.isEmpty()&&d.remove()),k(s)&&s.isEmpty()&&s.remove();let m=k(s)?s.getLastChild():null;pn(m)&&g!==s&&m.remove();let _=hn($o(y.anchor,"next"));bs(y.anchor,_),bs(y.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type==="element"&&We(t)){let a=qt();return t.splice(this.anchor.offset,0,[a]),a.select(),a}let[,n]=_l(this),o=cr(this.anchor.getNode(),Rt);if(o!==null&&Nt(o)!==null)return null;k(o)||M(213);let r=o.getChildAtIndex(n),s=r?[r,...r.getNextSiblings()]:[],i=o.insertNewAfter(this,!1);return i?(i.append(...s),i.selectStart(),i):null}insertLineBreak(t){let n=Pd();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[s,i]=vm(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=a?[i,s]:[s,i];if(n===0)return[];if(n===1){if(R(o)&&!this.isCollapsed()){let f=o.splitText(u,d),p=u===0?f[0]:f[1];return p?(l.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[o]}if(R(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),R(r)){let f=r.getTextContent().length;d===0?t.pop():d!==f&&([r]=r.splitText(d),t[t.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(gd(this,t,n,o))return;let r=t==="move",s=ge(),i=Un(an(s));if(!i)return;let a=s._blockCursorElement,l=s._rootElement,c=this.focus.getNode();l===null||a===null||!k(c)||c.isInline()||c.canBeEmpty()||bd(a,s,l);let u=Mi(s,this.focus.key),d=u;if(this.focus.type==="text"&&(d=R(c)?Po(c,u,s):null),this.dirty){let f=Mi(s,this.anchor.key),p=f;if(this.anchor.type==="text"){let h=this.anchor.getNode();p=R(h)?Po(h,f,s):null}p&&d&&hd(i,p,this.anchor.offset,d,this.focus.offset)}if(o==="character"&&R(c)&&c.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let f=Xe(c,n?"previous":"next").getNodeAtCaret();if(R(f)){if(!r){let p=f.getTextContentSize();return n?this.focus.set(f.__key,p-1,"text"):this.focus.set(f.__key,1,"text"),void(this.dirty=!0)}{let p=s.getElementByKey(f.getKey()),h=p?Po(f,p,s):null;if(h){let g=n?h.length:0;hd(i,h,g,h,g)}}}}if(ZE(i,t,n?"backward":"forward",o,l),i.rangeCount>0){let f=qi(i,s._rootElement),p=f||i.getRangeAt(0),h=this.anchor.getNode(),g=qe(h)?h:m_(h);this.applyDOMRange(p),this.dirty=!0,r||(eN(this,n,g),(f?i.direction!=="backward":i.anchorNode===p.startContainer&&i.anchorOffset===p.startOffset)||QE(this))}o==="lineboundary"&&gd(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&k(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),s=n.getNextSibling()||(r===null?null:r.getNextSibling());if(k(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t)){let l=k(r)?r.getNextSibling():null;if(!(k(r)&&r.isEmpty()&&k(l)&&l.isShadowRoot()))return}let s=$o(o,t?"previous":"next"),i=E_(s);if(i.getTextSlices().every(l=>l===null||l.distance===0)){if(o.type==="element"){let c=s.getNodeAtCaret();if(k(c)&&Cd(c)){let u=c.getParent();c.remove();let d=Sd(u,c);return void(d!==null&&d.selectStart())}}let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(Bn(c)){if(!c.origin.isInline()){if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(k(i.anchor.origin)&&i.anchor.origin.isEmpty()){let u=hn(c);Nl(this,br(u,u)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Sr(c)){if(k(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(he(c.origin)){if(!c.origin.isIsolated())if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&k(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let u=n_();u.add(c.origin.getKey()),Pt(u)}else{let u=c.origin,d=u.getParent();u.remove();let f=Sd(d,u);f!==null&&f.selectStart()}return}if(pn(c.origin))return void c.origin.remove();break}}if(l.type==="merge-block"){let{caret:c,block:u}=l;return yo(u).length>0?void 0:c.origin.isEmpty()&&!u.isEmpty()&&c.origin.getParent()===u.getParent()?void c.origin.remove(!0):(Nl(this,br(!c.origin.isEmpty()&&u.isEmpty()?Os(Xe(u,c.direction)):i.anchor,c)),this.removeText())}for(let c=o.getNode();c!==null;){if(Nt(c)!==null)return;if(k(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(Bg(this,t,"character"),this.isCollapsed()){if(t&&o.offset===0&&(function(l,c){for(let u=c;u;u=u.getParent()){if(k(u)){if(u.collapseAtStart(l))return!0;if(We(u))break}if(u.getPreviousSibling())break}return!1})(this,o.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(r=o.type==="text"?o.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,u=l.getTextContentSize();if(l.is(r)||t&&c!==u||!t&&c!==0)return void ob(l,t,c)}else if(r!==null&&r.isSegmented()){let c=o.offset,u=r.getTextContentSize();if(r.is(l)||t&&c!==0||!t&&c!==u)return void ob(r,t,c)}(function(c,u){let d=c.anchor,f=c.focus,p=d.getNode();if(p===f.getNode()&&d.type==="text"&&f.type==="text"){let g=d.offset,y=f.offset,m=g<y,_=m?g:y,x=m?y:g,v=x-1;_!==v&&!AN(h=p.getTextContent().slice(_,x))&&!i1(h)&&(u?f.set(f.key,v,f.type):d.set(d.key,v,d.type))}var h})(this,t)}}n||Xu(this),this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&qE()}deleteLine(t){let n=this.isCollapsed(),o=Sm(this.anchor);if(o!==null&&he(gn(o)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(t);this.isCollapsed()&&Bg(this,t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):cr(this.anchor.getNode(),Rt)!==cr(this.focus.getNode(),Rt)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(t)):(n||Xu(this),this.removeText())}deleteWord(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;Bg(this,t,"word")}this.isCollapsed()?this.deleteCharacter(t):(n||Xu(this),this.removeText())}isBackward(){let t=this._cachedIsBackward;if(t!==null)return t;let n=this.focus.isBefore(this.anchor);return yr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}};function ji(e){return e instanceof fd}function XE(e,t){if(ji(e)){for(let m of e.getNodes())dd(m)&&m.setFormat(t(m.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void ft(null);let n=[];for(let m of e.getNodes())R(m)?n.push(m):k(m)?m.setTextFormat(t(m.getTextFormat())):dd(m)&&m.setFormat(t(m.getFormat()));let o=n.length;if(o===0)return e.setFormat(t(e.format)),void ft(null);let r=e.anchor,s=e.focus,i=e.isBackward(),a=i?s:r,l=i?r:s,c=0,u=n[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),u==null)return;let f=o-1,p=n[f],h=l.type==="text"?l.offset:p.getTextContentSize();if(u.is(p)){if(d===h)return;let m=t(u.getFormat());if(Fn(u)||d===0&&h===u.getTextContentSize())u.setFormat(m);else{let _=u.splitText(d,h),x=d===0?_[0]:_[1];x.setFormat(m),a.type==="text"&&a.set(x.__key,0,"text"),l.type==="text"&&l.set(x.__key,h-d,"text")}return void(e.format=m)}d===0||Fn(u)||([,u]=u.splitText(d),d=0);let g=t(u.getFormat());u.setFormat(g);let y=t(p.getFormat());h>0&&(h===p.getTextContentSize()||Fn(p)||([p]=p.splitText(h)),p.setFormat(y));for(let m=c+1;m<f;m++){let _=n[m];_.setFormat(t(_.getFormat()))}a.type==="text"&&a.set(u.__key,d,"text"),l.type==="text"&&l.set(p.__key,h,"text"),e.format=g|y}function r1(e,t){let n=[];for(let[o,r]of Object.entries(t))typeof r=="boolean"&&n.push([o,r]);n.length!==0&&XE(e,o=>{for(let[r,s]of n)o=xr(o,r,s?xt[r]:0);return o})}function JE(e,t,n=null){let o=n===null&&K(e)?xr(e.format,t,null):n;XE(e,r=>xr(r,t,o))}function nb(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function vm(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[nb(n),nb(o)]}function Xu(e){let t=Lt();!t.isEmpty()&&s_(t,e)&&(e.anchor.set(t.getKey(),0,"element"),e.focus.set(t.getKey(),t.getChildrenSize(),"element"))}function QE(e){let t=e.focus,n=e.anchor,o=n.key,r=n.offset,s=n.type;n.set(t.key,t.offset,t.type,!0),t.set(o,r,s,!0)}function ZE(e,t,n,o,r){let s=o==="character"?sn(e,r):null,i=s&&s.focusNode,a=s?s.focusOffset:0;if(e.modify(t,n,o),s===null||!(function(c,u,d){return c!==null&&c.nodeType===3&&(d==="backward"?u>0:d==="forward"&&u<c.length)})(i,a,n))return;let l=sn(e,r);l.focusNode===i&&l.focusOffset===a&&e.modify(t,n,o)}function eN(e,t,n){let o=e.getNodes(),r=o.filter(a=>Vl(a,n));if(r.length===0||r.length===o.length)return!1;let s=t?r[0]:r[r.length-1],i=k(s)?s:s.getParentOrThrow();return t?i.selectStart():i.selectEnd(),!0}function Bg(e,t,n){if(gd(e,"extend",t,n))return;let o=ge(),r=Un(an(o));if(!r||typeof r.modify!="function")return;let s=o._blockCursorElement,i=o._rootElement,a=e.anchor,l=e.focus.getNode();i===null||s===null||!k(l)||l.isInline()||l.canBeEmpty()||bd(s,o,i);let c=O=>{let T=O.getNode(),A=o.getElementByKey(O.key);return A!==null&&O.type==="text"&&R(T)?Po(T,A,o):A},u=a.getNode(),d=c(a);if(d===null)return;let f=a.offset,p=e.isCollapsed(),h=e.focus,g=p?d:c(h);if(g===null)return;let y=h.offset;if(hd(r,g,y,g,y),ZE(r,"move",t?"backward":"forward",n,i),r.rangeCount===0)return;let m=qi(r,i)||r.getRangeAt(0),_=m.startContainer,x=m.startOffset;if(n==="lineboundary"&&_n(_)&&gr(_)===o){let O=ys(_);if(he(O)&&O.isInline()&&!O.isIsolated()){let T=o.getElementByKey(O.getKey());T!==null&&T.contains(_)&&(_=T,x=t?0:T.childNodes.length)}}if(p&&n==="character"&&a.type==="text"&&R(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let O=Xe(u,t?"previous":"next").getNodeAtCaret();if(R(O)){let T=t?O.getTextContentSize()-1:1;return e.focus.set(O.__key,T,"text"),void(e.dirty=!0)}}if(p&&n==="character"&&a.type==="text"){let O=t?0:u.getTextContentSize(),T=_===d?x:f!==O?O:-1;if(T>=0)return void(T!==f&&(e.focus.set(a.key,T,"text"),e.dirty=!0))}let[v,S,b,N]=t?[_,x,d,f]:[d,f,_,x],D=qe(u)?u:m_(u);e.applyDOMRange({collapsed:!1,endContainer:b,endOffset:N,startContainer:v,startOffset:S}),e.dirty=!0,!eN(e,t,D)&&t&&QE(e),n==="lineboundary"&&gd(e,"extend",t,n,"decorators")}function s1(){try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1}var i1=s1();function ob(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,a=0;for(let c=0;c<s;c++){let u=c===s-1;if(a=i,i+=r[c].length,t&&i===n||i>n||u){r.splice(c,1),u&&(a=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(a,a))}function rb(e,t,n,o){let r,s=t,i=!1;if(we(e)){let a=!1,l=e.childNodes,c=l.length,u=o._blockCursorElement;s===c&&c>0&&(a=!0,s=c-1),Ds(e,o)!==void 0||jl(e,o)||(i=!0);let d=l[s],f=!1;if(d===u)d=l[s+1],f=!0;else if(u!==null){let p=u.parentNode;e===p&&t>Array.prototype.indexOf.call(p.children,u)&&s--}if(r=ys(d),R(r))s=to(r,a?"next":"previous");else{let p=ys(e);if(p===null)return null;if(k(p)){let h=o.getElementByKey(p.getKey());h===null&&M(214),[p,s]=Jt(p,h,o).resolveChildIndex(p,h,e,t),k(p)||M(215),a&&s>=p.getChildrenSize()&&(s=Math.max(0,p.getChildrenSize()-1));let y=p.getChildAtIndex(s);if(k(y)&&(function(m,_,x){let v=m.getParent();return x===null||v===null||!v.canBeEmpty()||v!==x.getNode()})(y,0,n)){let m=a?y.getLastDescendant():y.getFirstDescendant();m===null?p=y:(y=m,p=k(y)?y:y.getParentOrThrow()),s=0}R(y)?(r=y,p=null,s=to(y,a?"next":"previous")):y!==p&&a&&!f&&(k(p)||M(216),s=Math.min(p.getChildrenSize(),s+1))}else{let h=gn(p),g=h!==null?h:p,y=g.getIndexWithinParent(),m=o.getElementByKey(p.getKey()),_="after";if(m!==null&&ys(e)===p){let x=Jt(p,m,o);x.element!==m?_=x.resolveLeafPosition(m,e,t):t===0&&he(p)&&(_="before")}s=_==="before"?y:y+1,p=g.getParentOrThrow()}if(k(p))return[no(p.__key,s,"element"),i]}}else r=ys(e);return R(r)?[no(r.__key,to(r,s,"clamp"),"text"),i]:null}function sb(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(t){if((n||!t)&&s===null&&k(i)&&i.isInline()){let a=i.getPreviousSibling();R(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else k(s)&&!n&&s.isInline()?e.set(s.__key,s.getChildrenSize(),"element"):R(s)&&!r.isUnmergeable()&&e.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(t&&k(s)&&s.isInline())e.set(s.__key,0,"element");else if((n||t)&&s===null&&k(i)&&i.isInline()&&!i.canInsertTextAfter()&&i.getTextContentSize()>1){let a=i.getNextSibling();R(a)&&e.set(a.__key,0,"text")}}}function Sm(e){let t=Ee(e.key);return t===null?null:Gl(t)}function tN(e,t,n){let o=Sm(e),r=Sm(t);if(o===r||o!==null&&r!==null&&o.is(r))return!1;let s=n(o,r);if(o!==null)return k(o)?t.set(o.getKey(),s?o.getChildrenSize():0,"element"):t.set(o.getKey(),s?o.getTextContentSize():0,"text"),!0;let i=gn(r);if(i===null)return!1;let a=i.getParent();if(a===null)return!1;let l=i.getIndexWithinParent();return t.set(a.getKey(),s?l+1:l,"element"),!0}function nN(e){let t=tN(e.anchor,e.focus,(n,o)=>(function(r,s,i,a){if(i!==null&&a!==null){let u=gn(i),d=gn(a);if(u!==null&&u.is(d)){for(let f of Ud(u).values()){if(f===i.getKey())return!0;if(f===a.getKey())return!1}return!0}return u===null||d===null||u.isBefore(d)}if(i!==null){let u=gn(i),d=Ee(s.key);return u===null||d===null||!(!u.is(d)&&!u.isParentOf(d))||u.isBefore(d)}let l=gn(a),c=Ee(r.key);return l!==null&&c!==null&&!l.is(c)&&!l.isParentOf(c)&&c.isBefore(l)})(e.anchor,e.focus,n,o));return t&&(e.dirty=!0),t}function oN(e,t,n,o,r,s){if(e===null||n===null||!tc(r,e,n))return null;let i=rb(e,t,K(s)?s.anchor:null,r);if(i===null)return null;let a=rb(n,o,K(s)?s.focus:null,r);if(a===null)return null;let[l,c]=i,[u,d]=a;if(l.type==="element"&&u.type==="element"){let p=ys(e),h=ys(n);if(he(p)&&he(h))return null}let f=r._slotsUsed&&tN(l,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return(function(p,h){if(p.type==="text"&&h.type==="text"){let g=p.isBefore(h),y=p.is(h);sb(p,g,y),sb(h,!g,y),y&&h.set(p.key,p.offset,p.type)}})(l,u),[l,u,c||d||f]}function rN(e){return k(e)&&!e.isInline()}function sN(e,t,n,o,r,s){let i=yn(),a=new Cs(no(e,t,r),no(n,o,s),0,"");return a.dirty=!0,i._selection=a,a}function iN(){let e=no("root",0,"element"),t=no("root",0,"element");return new Cs(e,t,0,"")}function n_(){return new fd(new Set)}function a1(e,t){return Bl(null,e,t,null)}function Bl(e,t,n,o){let r=n._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,a=i==="selectionchange",l=!qg&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(K(e)&&!l)return e.clone();{if(t===null)return null;let v=sn(t,n._rootElement);if(c=v.anchorNode,u=v.focusNode,d=v.anchorOffset,f=v.focusOffset,(a||i===void 0)&&K(e)&&!tc(n,c,u))return e.clone()}let p=oN(c,d,u,f,n,e);if(p===null)return null;let[h,g,y]=p,m=0,_="";if(K(e)){let v=e.anchor;if(h.key===v.key)m=e.format,_=e.style;else{let S=h.getNode();R(S)?(m=S.getFormat(),_=S.getStyle()):k(S)&&(m=S.getTextFormat(),_=S.getTextStyle())}}let x=new Cs(h,g,m,_);return y&&(x.dirty=!0),x}function ce(){return yn()._selection}function Ts(){return ge()._editorState._selection}function gs(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function ms(e,t,n,o=1){if(!gs(e,t))return;let r=e.anchor,s=e.focus,i=t.__key;if(e.isCollapsed()){let a=r.offset;if(n<=a&&o>0||n<a&&o<0){let l=Math.max(0,a+o);r.set(i,l,"element"),s.set(i,l,"element"),ib(e)}}else{let a=e.isBackward(),l=a?s:r,c=l.getNode(),u=a?r:s,d=u.getNode();if(t.is(c)){let f=l.offset;(n<=f&&o>0||n<f&&o<0)&&l.set(i,Math.max(0,f+o),"element")}if(t.is(d)){let f=u.offset;(n<=f&&o>0||n<f&&o<0)&&u.set(i,Math.max(0,f+o),"element")}}ib(e)}function ib(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,s=t.getNode(),i=o.getNode();if(e.isCollapsed()){if(!k(s))return;let a=s.getChildrenSize(),l=n>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(n);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),o.set(c.__key,u,"text")}return}if(k(s)){let a=s.getChildrenSize(),l=n>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(n);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(k(i)){let a=i.getChildrenSize(),l=r>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(r);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function pd(e,t,n,o,r){let s=null,i=0,a=null;o!==null?(s=o.__key,R(o)?(i=o.getTextContentSize(),a="text"):k(o)&&(i=o.getChildrenSize(),a="element")):r!==null&&(s=r.__key,R(r)?a="text":k(r)&&(a="element")),s!==null&&a!==null?e.set(s,i,a):(i=t.getIndexWithinParent(),i===-1&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function ab(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function hd(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function lb(e,t,n){let o=Mi(e,t.getKey());if(k(t)){let r=Jt(t,o,e);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function aN(e,t,n,o,r,s){let i=s.getRootNode(),a=Yi(i)||Bo(i)?zi(i):null;if(r.has(zE)&&a!==s||a!==null&&Bd(a,a))return;let l=sn(o,s),c;if(!K(t))return void(e!==null&&tc(n,l.anchorNode,l.focusNode)&&o.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[h,g]=lb(n,f,u.offset),[y,m]=lb(n,p,d.offset),_=t.format,x=t.style,v=t.isCollapsed(),S=h,b=y,N=!1;if(u.type==="text"?(S=R(f)?Po(f,h,n):null,N=f.getFormat()!==_||f.getStyle()!==x):K(e)&&e.anchor.type==="text"&&(N=!0),d.type==="text"&&(b=R(p)?Po(p,y,n):null),S!==null&&b!==null){if(v&&(e===null||N||K(e)&&(e.format!==_||e.style!==x))&&(function(D,O,T,A,$,I){D._inputState.collapsedSelectionFormat={format:O,key:$,offset:A,style:T,timeStamp:I}})(n,_,x,g,u.key,performance.now()),(o.type!=="Range"||!v)&&l.anchorOffset===g&&l.focusOffset===m&&l.anchorNode===S&&l.focusNode===b){if(a===null||!s.contains(a)){let D=a!==null?gr(a):null;D!==null&&D!==n||r.has(cd)||s.focus({preventScroll:!0})}if(u.type!=="element")return}if(hd(o,S,g,b,m),xo&&t.isCollapsed()&&s!==null&&!r.has(cd)){let D=Ed(s);if(D===null||!s.contains(D)){let O=zi(s.ownerDocument),T=O!==null?gr(O):null;T!==null&&T!==n||s.focus({preventScroll:!0})}}if(!r.has(WE)&&t.isCollapsed()&&s!==null&&s===Ed(s)){let D=K(t)&&t.anchor.type==="element"?(function(O,T,A){let $=T.childNodes[A];if(!we($))return $||null;let I=Ds($,O),L=I!==void 0?Ee(I):null;return L===null||k(L)?$:Jt(L,$,O).element})(n,S,g):(c===void 0&&(c=VN(o,s)),c);if(D!==null){let O;if(_n(D)){let T=D.ownerDocument.createRange();T.selectNode(D),O=T.getBoundingClientRect()}else O=we(D)?D.getBoundingClientRect():(function(T){let A=T.getBoundingClientRect(),{startContainer:$,startOffset:I}=T;if(!T.collapsed||A.width!==0||A.height!==0||!_n($)||$.length===0)return A;let L=T.cloneRange();return I>0?L.setStart($,I-1):L.setEnd($,1),L.getBoundingClientRect()})(D);(function(T,A,$,I=null){let L=Wd($),P=g_(L);if(L===null||P===null)return;let Y=$.getBoundingClientRect();if(A.bottom<Y.top)return;if(I!==null&&A.height>0){let{left:xe,right:ue}=A,q=we(I)?I:Ro(I);for(;q!==null&&$.contains(q);){let le=q1(P,q,xe,ue);xe-=le,ue-=le,q=q===$?null:Ro(q)}}let{top:Q,bottom:ee}=A,Z=0,ne=0,ae=$;for(;ae!==null;){let xe=ae===L.body;if(xe){let q=P.visualViewport;if(q){let Ot=q.offsetTop;Z=Ot,ne=Ot+q.height}else Z=0,ne=an(T).innerHeight;let le=P.getComputedStyle(L.documentElement),Fe=parseFloat(le.scrollPaddingTop),Te=parseFloat(le.scrollPaddingBottom);isFinite(Fe)&&(Z+=Fe),isFinite(Te)&&(ne-=Te)}else{let q=ae===$?Y:ae.getBoundingClientRect();Z=q.top,ne=q.bottom}let ue=0;if(Q<Z?ue=-(Z-Q):ee>ne&&(ue=ee-ne),ue!==0)if(xe)P.scrollBy(0,ue);else{let q=ae.scrollTop;ae.scrollTop+=ue;let le=ae.scrollTop-q;Q-=le,ee-=le}if(xe)break;ae=Ro(ae)}})(n,O,s,S)}}(function(D,O,T,A,$){let I=D._inputState;I.isSelectionChangeFromDOMUpdate=!0,I.selectionChangeFromDOMUpdatePoints=O!==void 0&&T!==void 0&&A!==void 0&&$!==void 0?{anchorNode:O,anchorOffset:T,focusNode:A,focusOffset:$}:null})(n,S,g,b,m)}}function l1(e){let t=ce()||Ts();t===null&&(t=Lt().selectEnd()),t.insertNodes(e)}function lN(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
71
+ `){if(so)return;if(pn(i))i.selectEnd();else if(!i){let a=cr(r,sN),l=a&&a.getNextSibling();k(l)&&l.selectStart()}}else n===" "?t_(i)&&i.selectEnd():R(i)&&i.getTextContent()[0]===n&&i.select(1,1)}else r.getTextContent()[s]===n&&r.select(s+1,s+1)}function Fl(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function UC(e){Lo&&!so&&Od&&(Fl(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Fl(e),0))}function BE(e,t){let n=x_(e);if(we(n)&&jl(n,t))return!0;let o=t.getRootElement();if(o===null)return!1;let r=zi(o.ownerDocument);return r!==null&&o.contains(r)&&jl(r,t)}function MR(e){let t=e.inputType,n=FE(e),o=ge(),r=o._inputState,s=ce();if(t==="insertText"&&e.data&&r.isInsertTextAfterHandledSelectionCommand){if(Fl(r),e.preventDefault(),K(s)&&!s.isCollapsed()){let d=s.isBackward()?s.anchor:s.focus;s.anchor.set(d.key,d.offset,d.type),s.focus.set(d.key,d.offset,d.type)}return!0}if(t==="deleteContentBackward"){if(s===null){let d=Ts();if(!K(d))return!0;Pt(d.clone())}if(K(s)){let d=s.anchor.key===s.focus.key;if((function(f,p){return f.lastKeyCode==="MediaLast"&&p<f.lastKeyDownTimeStamp+30})(r,e.timeStamp)&&o.isComposing()&&d){if(ft(null),r.lastKeyDownTimeStamp=0,setTimeout(()=>{mn(o,()=>{ft(null)})},30),K(s)){let f=s.anchor.getNode();f.markDirty(),R(f)||M(142),LE(s,f)}}else{if(ft(null),so&&n!==null&&!n.collapsed&&(s.applyDOMRange(n),!s.isCollapsed()))return e.preventDefault(),s.removeText(),!0;e.preventDefault();let f=s.anchor.getNode(),p=f.getTextContent(),h=f.canInsertTextAfter(),g=s.anchor.offset===0&&s.focus.offset===p.length,y=Ol&&d&&!g&&h;if(y&&s.isCollapsed()&&(y=!he(LN(s.anchor,!0))),!y){G(o,Rl,!0);let m=ce();Ol&&K(m)&&m.isCollapsed()&&(r.postDeleteSelectionToRestore=m,setTimeout(()=>r.postDeleteSelectionToRestore=null))}}return!0}}if(!K(s))return t!=="historyUndo"&&t!=="historyRedo"||(e.preventDefault(),G(o,t==="historyUndo"?id:Ll)),!0;let i=e.data;r.unprocessedBeforeInputData!==null&&f_(!1,o,r.unprocessedBeforeInputData),s.dirty&&r.unprocessedBeforeInputData===null||!s.isCollapsed()||qe(s.anchor.getNode())||n===null||s.applyDOMRange(n),r.unprocessedBeforeInputData=null;let a=s.anchor,l=s.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(i===`
72
+ `)e.preventDefault(),G(o,bl,!1);else if(i===_s)e.preventDefault(),G(o,um);else if(i==null&&e.dataTransfer){let d=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(d)}else i!=null&&PE(s,n,i,e.timeStamp,!0)?(e.preventDefault(),G(o,Ti,i),KC(i)):r.unprocessedBeforeInputData=i;return r.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":G(o,Ti,e),KC((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let d=r.hadOrphanedCompositionEvents;r.hadOrphanedCompositionEvents=!1;let f=o._compositionKey;ft(null),d||G(o,Ti,e),Gu(f);break}case"insertLineBreak":ft(null),r.isInsertLineBreak=!1,G(o,bl,!1);break;case"insertParagraph":ft(null),r.isInsertLineBreak?(r.isInsertLineBreak=!1,G(o,bl,!1)):G(o,um);break;case"insertFromPaste":case"insertFromPasteAsQuotation":G(o,Ym,e);break;case"deleteByComposition":(function(d,f){return d!==f||k(d)||k(f)||!Ul(d)||!Ul(f)})(c,u)&&G(o,Vu,e);break;case"deleteByDrag":Es(cd),G(o,Vu,e);break;case"deleteByCut":G(o,Vu,e);break;case"deleteContent":G(o,Rl,!1);break;case"deleteWordBackward":G(o,Pl,!0);break;case"deleteWordForward":G(o,Pl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":G(o,Oi,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":G(o,Oi,!1);break;case"formatStrikeThrough":G(o,fr,"strikethrough");break;case"formatBold":G(o,fr,"bold");break;case"formatItalic":G(o,fr,"italic");break;case"formatUnderline":G(o,fr,"underline");break;case"historyUndo":G(o,id);break;case"historyRedo":G(o,Ll)}return!0}function kR(e,t){e.stopPropagation();let n=t._inputState;Fl(n),mn(t,()=>{BE(e,t)||t.dispatchCommand(Hm,e)},{event:e}),n.unprocessedBeforeInputData=null}function AR(e){let t=ge(),n=t._inputState,o=ce(),r=e.data,s=FE(e),i=!1;if(r!=null&&K(o)){let a=Hn(an(t)),l=a!==null?sn(a,t._rootElement):null,c=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!t.isComposing();c&&(n.hadOrphanedCompositionEvents=!0);let u=o.anchor.getNode(),d=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&t.isComposing()&&R(u)&&Bn(u);if(!c&&!d&&PE(o,s,r,e.timeStamp,!1,l)){if(i=!0,n.compositionPhase==="ending-firefox"){let m=ad(t,r);if(n.compositionPhase="idle",m)return Es(ud),vb(),!0}let f=o.anchor.getNode();if(a===null||l===null)return!0;let p=o.isBackward(),h=p?o.anchor.offset:o.focus.offset,g=p?o.focus.offset:o.anchor.offset;Tl&&!o.isCollapsed()&&R(f)&&l.anchorNode!==null&&f.getTextContent().slice(0,h)+r+f.getTextContent().slice(h+g)===RN(l.anchorNode)||G(t,Ti,r);let y=r.length;xo&&y>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(o.anchor.offset-=y,o._cachedNodes=null,o._cachedIsBackward=null),Ol&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,ft(null))}}return i||(f_(!1,t,r!==null?r:void 0),n.compositionPhase==="ending-firefox"&&(ad(t,r||void 0),Es(ud),n.compositionPhase="idle")),vb(),!0}function IR(e,t){G(t,Vm,e)}function $R(e){let t=ge(),n=t._inputState,o=ce();if(K(o)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let r=o.anchor,s=o.anchor.getNode();if(ft(r.key),Es(HE),e.timeStamp<n.lastKeyDownTimeStamp+30||r.type==="element"||!o.isCollapsed()||!Ol&&(s.getFormat()!==o.format||R(s)&&s.getStyle()!==o.style)||R(s)&&(Bn(s)||r.offset===0&&!s.canInsertTextBefore()||r.offset===s.getTextContentSize()&&!s.canInsertTextAfter())){G(t,Ti,Im);let i=ce();K(i)&&ft(i.anchor.key)}}return!0}function RR(e){let t=ge();return t._inputState.compositionPhase="idle",ad(t,e.data),Es(ud),!0}function Gu(e){if(e===null)return;let t=Ee(e);if(!R(t)||t.getType()==="text"||Bn(t)||!t.isAttached())return;let n=ce(),o=K(n)&&n.anchor.key===e?n.anchor.offset:null,r=rn(t.getTextContent());if(r.setFormat(t.getFormat()),r.setStyle(t.getStyle()),t.replace(r),o!==null){let s=Math.min(o,r.getTextContentSize());r.select(s,s)}}function ad(e,t){let n=e._compositionKey;if(ft(null),n!==null&&t!=null){if(t===""){let r=Ee(n),s=e.getElementByKey(n),i=s!==null&&R(r)?Po(r,s,e):null;if(i!==null&&i.nodeValue!==null&&R(r)){let a=Hn(an(e)),l=a&&sn(a,e._rootElement),c=null,u=null;l!==null&&l.anchorNode===i&&(c=l.anchorOffset,u=l.focusOffset),p_(r,i.nodeValue,c,u,!0)}return Gu(n),!1}if(t[t.length-1]===`
73
+ `){let r=ce();if(K(r)||ji(r)){if(K(r)){let s=r.focus;r.anchor.set(s.key,s.offset,s.type)}return G(e,qm,null),Gu(n),!1}}let o=Ee(n);if(o!==null&&R(o)&&Bn(o)){o.markDirty();let r=ce(),s=o.getTextContentSize(),i=K(r)&&r.anchor.key===n?r.anchor.offset:s;return o.select(i,i).insertText(t),!0}}return f_(!0,e,t),Gu(n),!1}function PR(e,t){let n=t._inputState;xo?n.compositionPhase="ending-firefox":so||!Ql&&!Zl?G(t,jm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}function LR(e,t){let n=t._inputState;so&&(n.isShiftKeyDown=e.key==="Shift"||n.isShiftKeyDown&&e.shiftKey&&e.key!=="CapsLock"),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Fl(n),t.isComposing()||G(t,Gm,e)}var Lu={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},ml={ctrlKey:!0},HC={metaKey:!0},ar={shiftKey:"any"},VC={altKey:"any",shiftKey:"any"};function FR(e){let t=ge(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase==="ending-safari"){let s=(function(i){return i.key==="Backspace"})(e);if(s&&mn(t,()=>{ad(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",s)return!0}let o=t._keyDownShortcuts;o===null&&(o=$E((function(){let s=(c,u,d)=>({key:c,modifiers:u,onMatch:(f,p)=>{G(p,d,f)}}),i=(c,u,d,f)=>({key:c,modifiers:u,onMatch:(p,h)=>{p.preventDefault(),G(h,d,f)}}),a=(c,u)=>({key:"Enter",modifiers:c,onMatch:(d,f)=>{let p=f._inputState;p.isInsertLineBreak=u&&(!so||p.isShiftKeyDown),G(f,qm,d),d.defaultPrevented&&(p.isInsertLineBreak=!1)}}),l=(c,u)=>({key:c,modifiers:lr,onMatch:(d,f)=>{let p=f._editorState._selection;p===null||K(p)||(d.preventDefault(),G(f,u,d))}});return[s("ArrowRight",ar,mE),s("ArrowLeft",ar,_E),s("ArrowUp",VC,yE),s("ArrowDown",VC,xE),a({...Lu,shiftKey:!0},!0),a({...Lu,shiftKey:!1},!1),s(" ",Lu,vE),{key:"Backspace",modifiers:ar,onMatch:(c,u)=>{G(u,SE,c)&&UC(u._inputState)}},s("Escape",Lu,CE),s("Delete",{},bE),i("Backspace",pm,Pl,!0),i("Delete",pm,Pl,!1),i("b",lr,fr,"bold"),i("u",lr,fr,"underline"),i("i",lr,fr,"italic"),s("Tab",ar,EE),i("z",lr,id,void 0),i("z",{...lr,shiftKey:!0},Ll,void 0),...Lo?[{key:"o",modifiers:ml,onMatch:(c,u)=>{c.preventDefault(),G(u,bl,!0)}},s("ArrowLeft",{metaKey:!0,...ar},fm),s("ArrowRight",{metaKey:!0,...ar},dm),i("h",ml,Rl,!0),i("d",ml,Rl,!1),i("Backspace",HC,Oi,!0),i("Delete",HC,Oi,!1),i("k",ml,Oi,!1)]:[s("Home",ar,fm),s("End",ar,dm),i("y",ml,Ll,void 0)],{key:"a",modifiers:lr,onMatch:(c,u)=>{c.preventDefault(),G(u,wE,c)&&UC(u._inputState)}},l("c",Xm),l("x",Jm)]})()),t._keyDownShortcuts=o);let r=o.match(e);return r&&r.onMatch(e,t),(function(s){return s.ctrlKey||s.shiftKey||s.altKey||s.metaKey})(e)&&t.dispatchCommand(AE,e),!0}function jC(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Di=new Map;function YC(e){let t=KN(e.target);if(t===null)return;let n=Wd(e.target),o=null,r=null,s=n!==null?ju.get(n):void 0;if(n!==null){if(s!==void 0){let d=s.editors,f=s.hasShadowEditor;if(f===void 0){f=!1;for(let p of d)if(p._rootElement!==null&&Bo(p._rootElement.getRootNode())){f=!0;break}s.hasShadowEditor=f}if(f){let p=null,h=null;for(let g of d){let y=g._rootElement;if(y===null)continue;let m=sn(t,y).anchorNode;if(m!==null&&gr(m)===g){if(Bo(y.getRootNode())){o=g,r=m;break}p===null&&(p=g,h=m)}}o===null&&p!==null&&(o=p,r=h)}else{let p=t.anchorNode;p===null||we(p)&&p.shadowRoot!==null||(o=gr(p),o!==null&&(r=p))}}if(o===null){let d=zi(n);o=d!==null?gr(d):null}}if(o===null)return;if(o._inputState.isSelectionChangeFromMouseDown){if(s!==void 0)for(let d of s.editors)d._inputState.isSelectionChangeFromMouseDown=!1;mn(o,()=>{let d=Ts(),f=r??sn(t,o._rootElement).anchorNode;(we(f)||_n(f))&&Pt(Bl(d,t,o,e))})}let i=d_(o),a=i[i.length-1],l=a._key,c=Di.get(l),u=c||a;u!==o&&WC(t,u,!1),WC(t,o,!0),o!==a?Di.set(l,o):c&&Di.delete(l)}function gm(e){e._lexicalHandled=!0}function GC(e){return e._lexicalHandled===!0}var qC=mR();function mm(e,t,n){dt();let o=e.__key,r=e.getParent();if(r===null)return void(Nt(e)!==null&&M(367,o,String(Nt(e))));let s=(function(a){let l=ce();if(!K(l)||!k(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return Vl(d,a)&&c.set(a.__key,0,"element"),Vl(f,a)&&u.set(a.__key,0,"element"),l})(e),i=!1;if(K(s)&&t){let a=s.anchor,l=s.focus;a.key===o&&(pd(a,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0),l.key===o&&(pd(l,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else ji(s)&&t&&e.isSelected()&&e.selectPrevious();if(K(s)&&t&&!i&&gs(s,r)){let a=e.getIndexWithinParent();eo(e),ms(s,r,a,-1)}else eo(e);n||We(r)||r.canBeEmpty()||!r.isEmpty()||mm(r,t),t&&s&&qe(r)&&r.isEmpty()&&r.selectEnd()}function BR(e){return e}var zE=Symbol.for("ephemeral");function ld(e){return e[zE]||!1}var XC={configurable:!0,enumerable:!1,value:void 0,writable:!0},st=class{constructor(t){w(this,"__type");w(this,"__key");w(this,"__parent");w(this,"__prev");w(this,"__next");w(this,"__state");this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",XC),Object.defineProperty(this,sd,XC),MN(this,t)}static getType(){let{ownNodeType:t}=oc(this);return t===void 0&&M(64,this.name),t}static clone(t){M(65,this.name)}$config(){return{}}config(t,n){let o=n.extends||aT(this.constructor);return Object.assign(n,{extends:o}),typeof t=="string"&&Object.assign(n,{type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}resetOnCopyNodeFrom(t){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}getType(){return this.__type}isInline(){M(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;let n=Ee(t);if(n===null)break;t=n.__parent!==null?n.__parent:Nt(n)}return!1}isSelected(t){let n=t||ce();if(n==null)return!1;let o=n.getNodes().some(r=>r.__key===this.__key);if(R(this))return o;if(K(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let r=this.getParent();if(he(this)&&this.isInline()&&r){let s=n.isBackward()?n.focus:n.anchor;if(r.is(s.getNode())&&s.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return o}getKey(){return this.__key}getIndexWithinParent(){let t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),o=0;for(;n!==null;){if(this.is(n))return o;o++,n=n.getNextSibling()}return-1}getParent(){let t=this.getLatest().__parent;return t===null?null:Ee(t)}getParentOrThrow(){let t=this.getParent();return t===null&&M(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){let n=t.getParent();if(We(n)||Nt(t)!==null)return k(t)||t===this&&he(t)||M(194),t;t=n}return null}getTopLevelElementOrThrow(){let t=this.getTopLevelElement();return t===null&&M(67,this.__key),t}getParents(){let t=[],n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){let t=[],n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){let t=this.getLatest().__prev;return t===null?null:Ee(t)}getPreviousSiblings(){let t=[],n=this.getParent();if(n===null)return t;let o=n.getFirstChild();for(;o!==null&&!o.is(this);)t.push(o),o=o.getNextSibling();return t}getNextSibling(){let t=this.getLatest().__next;return t===null?null:Ee(t)}getNextSiblings(){let t=[],n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}is(t){return t!=null&&this.__key===t.__key}isBefore(t){let n=O_(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?T_(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&M(279),!1)))}isParentOf(t){return Vl(t,this)}getNodesBetween(t){let n=this.isBefore(t),o=[],r=new Set,s=this;for(;s!==null;){let i=s.__key;if(r.has(i)||(r.add(i),o.push(s)),s===t)break;let a=k(s)?n?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}let l=n?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}let c=s.getParentOrThrow();if(r.has(c.__key)||o.push(c),c===t)break;let u=null,d=c;do{if(d===null&&M(68),u=n?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||r.has(d.__key)||o.push(d)}while(u===null);s=u}return n||o.reverse(),o}isDirty(){let t=ge()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(ld(this))return this;let t=Ee(this.__key);return t===null&&M(113),t}getWritable(){if(ld(this))return this;dt();let t=yn(),n=ge(),o=this.__key,r=n._cloneNotNeeded,s=r.get(o),i=t._selection;if(i!==null&&i.setCachedNodes(null),s!==void 0)return vd(s),s;let a=t._nodeMap,l=a.get(o);l===void 0&&M(113);let c=S_(l);return r.set(o,c),a.set(o,c),vd(c),c}getTextContent(){return fT(this)}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){M(70)}updateDOM(t,n,o){M(71)}getDOMSlot(t){return new ed(t)}exportDOM(t){return{element:Kd(t).$createDOM(this,t)}}exportJSON(t=!1){let n=(function(r,s){let i=Nd(Wi(r.constructor)),{generated:a,isCompactDefault:l}=i,c=a===null?void 0:s?a.exportCompactJSON:a.exportJSON;return c===void 0?(function(u,d,f){let p=f?{type:u.__type}:{};return k(u)&&(p.children=[]),(function(h,g,y,m){for(let _=0;_<g.length;_++){let x=g[_];if(m&&x.derived)continue;let v;if(x.kind==="ownField"){let S=h[x.field];v=x.getterTable===void 0?S:Fn(x.getterTable,S)?x.getterTable[S]:void 0}else v=x.getter.call(h);x.kind==="ownField"&&x.when!==void 0&&(!Om(x,v)&&x.when.call(h)||(v=void 0)),m&&Om(x,v)||(y[x.key]=v)}})(u,d,p,f),f||(p.type=u.__type,p.version=1),p})(r,i.getters,s):s?c(r,l):c(r)})(this,t),o=this.__state?this.__state.toJSON():void 0;return o!==void 0&&Object.assign(n,o),n}static importJSON(t){M(18,this.name)}updateFromJSON(t){return sT(sE(this,t),t)}static transform(){return null}remove(t){mm(this,!0,t)}replace(t,n){dt();let o=ce();o!==null&&(o=o.clone()),jg(this,t);let r=this.getLatest(),s=this.__key,i=gn(r);i!==null&&M(400,s,r.getType(),i.getKey(),i.getType());let a=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),u=c.__size,d=l.getParent(),f=d!==null&&K(o)&&gs(o,d),p=f?l.getIndexWithinParent():-1;eo(l),f&&d!==null&&K(o)&&ms(o,d,p,-1);let h=r.getPreviousSibling(),g=r.getNextSibling(),y=r.__prev,m=r.__next,_=r.__parent;mm(r,!1,!0),h===null?c.__first=a:h.getWritable().__next=a,l.__prev=y,g===null?c.__last=a:g.getWritable().__prev=a,l.__next=m,l.__parent=_,c.__size=d!==null&&d.is(c)?u-1:u;let x=0;if(n&&(k(this)&&k(l)||M(139),x=l.getChildrenSize(),l.splice(x,0,this.getChildren())),K(o)){Pt(o);let v=o.anchor,S=o.focus;v.key===s&&(n&&v.type==="element"?v.set(l.__key,x+v.offset,"element"):eb(v,l)),S.key===s&&(n&&S.type==="element"?S.set(l.__key,x+S.offset,"element"):eb(S,l))}return _o()===s&&ft(a),l}insertAfter(t,n=!0){dt(),jg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.getParent(),i=ce(),a=!1,l=!1,c=-1;if(s!==null&&n&&K(i)&&gs(i,s)){let h=s.__key,g=i.anchor,y=i.focus;c=t.getIndexWithinParent(),a=g.type==="element"&&g.key===h&&g.offset===c+1,l=y.type==="element"&&y.key===h&&y.offset===c+1}eo(r),c!==-1&&s!==null&&K(i)&&ms(i,s,c,-1);let u=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=r.__key,p=o.__next;if(u===null?d.__last=f:u.getWritable().__prev=f,d.__size++,o.__next=f,r.__next=p,r.__prev=o.__key,r.__parent=o.__parent,n&&K(i)){let h=d.__key;if(a||l||gs(i,d)){let g=this.getIndexWithinParent();ms(i,d,g+1),a&&i.anchor.set(h,g+2,"element"),l&&i.focus.set(h,g+2,"element")}}return t}insertBefore(t,n=!0){dt(),jg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.__key,i=ce(),a=r.getParent(),l=a!==null&&n&&K(i)&&gs(i,a),c=l?r.getIndexWithinParent():-1;eo(r),l&&a!==null&&K(i)&&ms(i,a,c,-1);let u=this.getPreviousSibling(),d=this.getParentOrThrow().getWritable(),f=o.__prev,p=n&&K(i)&&gs(i,d),h=p?this.getIndexWithinParent():-1;return u===null?d.__first=s:u.getWritable().__next=s,d.__size++,o.__prev=s,r.__prev=f,r.__next=o.__key,r.__parent=o.__parent,p&&K(i)&&ms(i,d,h),t}isParentRequired(){return!1}createParentElementNode(){return qt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){dt();let o=gn(this);if(o!==null)return o.selectPrevious(t,n);let r=this.getPreviousSibling(),s=this.getParentOrThrow();if(r===null)return s.select(0,0);if(k(r))return r.select();if(!R(r)){let i=r.getIndexWithinParent()+1;return s.select(i,i)}return r.select(t,n)}selectNext(t,n){dt();let o=gn(this);if(o!==null)return o.selectNext(t,n);let r=this.getNextSibling(),s=this.getParentOrThrow();if(r===null)return s.select();if(k(r))return r.select(0,0);if(!R(r)){let i=r.getIndexWithinParent();return s.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}};w(st,"importDOM");function Zm(e){return e instanceof st}var zR="historic",WR="history-push",qu="history-merge",KR="paste",UR="cut",WE="collaboration",HR="skip-collab",KE="skip-scroll-into-view",UE="skip-dom-selection",cd="skip-selection-focus",HE="composition-start",ud="composition-end",VR=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function $i(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!VR.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function VE(e,t,n,o,r){let s=$i(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}var jR=e=>{let t=ec(e,"format"),n=Md(e,"format"),o=kd(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=VE(s.indent,0,0,1/0),r.__textFormat=$i(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}};function YR(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var GR=e=>{let t=ec(e,"mode"),n=od(e,"detail",0),o=od(e,"format",0),r=Md(e,"mode"),s=kd(e,"mode");return{exportJSON:function(i){return{detail:i.__detail,format:i.__format,mode:t[i.__mode],style:i.__style,text:i.__text,type:i.__type,version:1}},exportCompactJSON:function(i){let a={type:i.__type},l=i.__detail;l!==void 0&&l!==0&&(a.detail=l);let c=i.__format;c!==void 0&&c!==0&&(a.format=c);let u=t[i.__mode];u!==void 0&&u!=="normal"&&(a.mode=u);let d=i.__style;d!==void 0&&d!==""&&(a.style=d);let f=i.__text;return f!==void 0&&f!==""&&(a.text=f),a},updateFromJSON:function(i,a){let l=a.detail;i.__detail=typeof l=="string"&&l in n?n[l]:$i(l,0);let c=a.format;i.__format=typeof c=="string"&&c in o?o[c]:$i(c,0);let u=a.mode;i.__mode=typeof u=="string"&&u in r?r[u]:s;let d=a.style;i.__style=typeof d=="string"?d:"";let f=a.text;return i.__text=typeof f=="string"?f:"",i},afterCloneFrom:YR}},qR=e=>{let t=ec(e,"format"),n=Md(e,"format"),o=kd(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=VE(s.indent,0,0,1/0),r.__textFormat=$i(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}},XR=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),JR=e=>{let t=ec(e,"mode"),n=od(e,"format",0);return{exportJSON:function(o){return{detail:o.__detail,mode:t[o.__mode],text:o.__text,format:o.__format,style:o.__style,type:o.__type,version:1}},exportCompactJSON:function(o){let r={type:o.__type},s=o.__format;s!==void 0&&s!==0&&(r.format=s);let i=o.__style;return i!==void 0&&i!==""&&(r.style=i),r},updateFromJSON:function(o,r){let s=r.format;o.__format=typeof s=="string"&&s in n?n[s]:$i(s,0);let i=r.style;return o.__style=typeof i=="string"?i:"",o}}};function _m(e){let t={};if(!e)return t;let n="",o="",r=null,s=!1,i=!1,a=!1,l=0,c=e.length,u=-1;for(let p=0;p<c;p++){let h=e[p];if(s)h==="*"&&e[p+1]==="/"&&(s=!1,p++);else if(i)u===-1&&(u=p),i=!1;else if(r===null)if(h!=="/"||e[p+1]!=="*")if(h!=='"'&&h!=="'")if(h!=="(")if(h!==")")if(a||h!==":"||l!==0){if(h===";"&&l===0){u!==-1&&(a?o+=e.slice(u,p):n+=e.slice(u,p),u=-1);let g=n.trim(),y=o.trim();g!==""&&y!==""&&(t[g]=y),n="",o="",a=!1;continue}u===-1&&(u=p)}else u!==-1&&(n+=e.slice(u,p),u=-1),a=!0;else u===-1&&(u=p),l=Math.max(0,l-1);else u===-1&&(u=p),l++;else u===-1&&(u=p),r=h;else u!==-1&&(a?o+=e.slice(u,p):n+=e.slice(u,p),u=-1),s=!0,p++;else u===-1&&(u=p),h==="\\"?i=!0:h===r&&(r=null)}u!==-1&&(a?o+=e.slice(u,c):n+=e.slice(u,c));let d=n.trim(),f=o.trim();return d!==""&&f!==""&&(t[d]=f),t}function jE(e,t,n){let o=n.trimEnd(),r=o.length-10;r>=0&&o.slice(r).toLowerCase()==="!important"?e.setProperty(t,o.slice(0,r).trim(),"important"):e.setProperty(t,n,"")}function QR(e,t){for(let n in t){let o=t[n];o==null?e.removeProperty(n):jE(e,n,o)}}function ym(e,t,n=""){if(t===n)return;let o=_m(n),r=_m(t);for(let s in r)delete o[s],jE(e,s,r[s]);for(let s in o)e.removeProperty(s)}var ZR=Id()({detail:Io(Qg(Ii(),Fb),{field:"__detail"}),format:Io(Qg(Ii(),xt),{field:"__format"}),mode:Io(kl(["normal","token","segmented"]),{field:"__mode",getterTable:Wb,setterTable:$m}),style:Io(Ml(),{field:"__style"}),text:Io(Ml(),{field:"__text",getter:"getTextContent",setter:"setTextContent"})});function Pg(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Lg(e,t){return 1&t?"strong":2&t?"em":"span"}function YE(e,t,n,o,r){let s=o.classList,i=wi(r,"base");i!==void 0&&s.add(...i),i=wi(r,"underlineStrikethrough");let a=!1,l=8&t&&4&t;i!==void 0&&(8&n&&4&n?(a=!0,l||s.add(...i)):l&&s.remove(...i));for(let c in xt){let u=xt[c];if(i=wi(r,c),i!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&s.remove(...i);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&s.add(...i)}else t&u&&s.remove(...i)}Hl(o,"class")}function GE(e,t,n){let o=n.isComposing(),r=e+(o?Dl:""),s=vo(),i=Kd(s).$getDOMSlot(n,t,s),a=i.getFirstChild();if(a===null||a.nodeType!==Node.TEXT_NODE)return void i.insertChild(Xt().createTextNode(r));let l=a,c=l.nodeValue;if(c!==r)if(o||xo){let[u,d,f]=(function(p,h){let g=p.length,y=h.length,m=0,_=0;for(;m<g&&m<y&&p[m]===h[m];)m++;for(;_+m<g&&_+m<y&&p[g-_-1]===h[y-_-1];)_++;return[m,g-m-_,h.slice(m,y-_)]})(c,r);d!==0&&l.deleteData(u,d),l.insertData(u,f)}else l.nodeValue=r}function JC(e,t,n,o,r,s){GE(r,e,t);let i=s.theme.text;i!==void 0&&YE(0,0,o,e,i)}function Fu(e,t){let n=Xt().createElement(t);return n.appendChild(e),n}function dd(e){return e!=null&&e.__isInlineFormattable===!0}var _r=class extends st{constructor(n="",o){super(o);w(this,"__text");w(this,"__format");w(this,"__style");w(this,"__mode");w(this,"__detail");this.__text=n,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}get __isInlineFormattable(){return!0}$config(){return this.config("text",{extends:st,generated:GR,importDOM:{"#text":()=>({conversion:o1,priority:0}),b:()=>({conversion:t1,priority:0}),code:()=>({conversion:Mo,priority:0}),em:()=>({conversion:Mo,priority:0}),i:()=>({conversion:Mo,priority:0}),mark:()=>({conversion:Mo,priority:0}),s:()=>({conversion:Mo,priority:0}),span:()=>({conversion:e1,priority:0}),strong:()=>({conversion:Mo,priority:0}),sub:()=>({conversion:Mo,priority:0}),sup:()=>({conversion:Mo,priority:0}),u:()=>({conversion:Mo,priority:0})},json:ZR})}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let n=this.getLatest();return Wb[n.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===_o()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(n){let o=xt[n];return(this.getFormat()&o)!==0}isSimpleText(){let n=this.getLatest();return n.__type==="text"&&n.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(n,o){return xr(this.getLatest().__format,n,o)}canHaveFormat(){return!0}isInline(){return!0}createDOM(n,o){let r=this.__format,s=Pg(0,r),i=Lg(0,r),a=s===null?i:s,l=Xt().createElement(a),c=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),s!==null&&(c=Xt().createElement(i),l.appendChild(c)),JC(c,this,0,r,this.__text,n);let u=this.__style;return u!==""&&ym(l.style,u),l}updateDOM(n,o,r){let s=this.__text,i=n.__format,a=this.__format,l=Pg(0,i),c=Pg(0,a),u=Lg(0,i),d=Lg(0,a);if((l===null?u:l)!==(c===null?d:c))return!0;if(l===c&&u!==d){let y=o.firstChild;y==null&&M(48);let m=Xt().createElement(d);return JC(m,this,0,a,s,r),o.replaceChild(m,y),!1}let f=o;c!==null&&l!==null&&(f=o.firstChild,f==null&&M(49)),GE(s,f,this);let p=r.theme.text;p!==void 0&&i!==a&&YE(0,i,a,f,p);let h=n.__style,g=this.__style;return h!==g&&(ym(o.style,g,h),Hl(o,"style")),!1}exportDOM(n){let{element:o}=super.exportDOM(n);return we(o)||M(132),o.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?o.style.textTransform="lowercase":this.hasFormat("uppercase")?o.style.textTransform="uppercase":this.hasFormat("capitalize")&&(o.style.textTransform="capitalize"),this.hasFormat("bold")&&(o=Fu(o,"b")),this.hasFormat("italic")&&(o=Fu(o,"i")),this.hasFormat("strikethrough")&&(o=Fu(o,"s")),this.hasFormat("underline")&&(o=Fu(o,"u")),{element:o}}selectionTransform(n,o){}setFormat(n){let o=this.getWritable();return o.__format=typeof n=="string"?xt[n]:n,o}setDetail(n){let o=this.getWritable();return o.__detail=typeof n=="string"?Fb[n]:n,o}setStyle(n){let o=this.getWritable();return o.__style=n,o}toggleFormat(n){let o=xr(this.getFormat(),n,null);return this.setFormat(o)}toggleDirectionless(){let n=this.getWritable();return n.__detail^=1,n}toggleUnmergeable(){let n=this.getWritable();return n.__detail^=2,n}setMode(n){let o=$m[n];if(this.getLatest().__mode===o)return this;let r=this.getWritable();return r.__mode=o,r}setTextContent(n){if(this.getLatest().__text===n)return this;let o=this.getWritable();return o.__text=n,o}select(n,o){dt();let r=n,s=o,i=ce(),a=this.getTextContent(),l=this.__key;if(typeof a=="string"){let c=a.length;r===void 0&&(r=c),s===void 0&&(s=c)}else r=0,s=0;if(!K(i))return iN(l,r,l,s,"text","text");{let c=_o();c!==i.anchor.key&&c!==i.focus.key||ft(l),i.setTextNodeRange(this,r,this,s)}return i}selectStart(){return this.select(0,0)}selectEnd(){let n=this.getTextContentSize();return this.select(n,n)}spliceText(n,o,r,s){let i=this.getWritable(),a=i.__text,l=r.length,c=n;c<0&&(c=l+c,c<0&&(c=0));let u=ce();if(s&&K(u)){let f=n+l;u.setTextNodeRange(i,f,i,f)}let d=a.slice(0,c)+r+a.slice(c+o);return i.__text=d,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...n){dt();let o=this.getLatest(),r=o.getTextContent();if(r==="")return[];let s=o.__key,i=_o(),a=r.length;n.sort((O,T)=>O-T),n.push(a);let l=[],c=n.length;for(let O=0,T=0;O<a&&T<=c;T++){let A=n[T];A>O&&(l.push(r.slice(O,A)),O=A)}let u=l.length;if(u===1)return[o];let d=l[0],f=o.getParent(),p,h=o.getFormat(),g=o.getStyle(),y=o.__detail,m=!1,_=null,x=null,v=ce();if(K(v)){let[O,T]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];O.type==="text"&&O.key===s&&(_=O),T.type==="text"&&T.key===s&&(x=T)}o.isSegmented()?(p=rn(d),p.__format=h,p.__style=g,p.__detail=y,p.__state=DC(o,p),m=!0):p=o.setTextContent(d);let S=[p];for(let O=1;O<u;O++){let T=rn(l[O]);T.__format=h,T.__style=g,T.__detail=y,T.__state=DC(o,T);let A=T.__key;i===s&&ft(A),S.push(T)}let b=_?_.offset:null,N=x?x.offset:null,D=0;for(let O of S){if(!_&&!x)break;let T=D+O.getTextContentSize();if(_!==null&&b!==null&&b<=T&&b>=D&&(_.set(O.getKey(),b-D,"text"),b<T&&(_=null)),x!==null&&N!==null&&N<=T&&N>=D){x.set(O.getKey(),N-D,"text");break}D=T}if(f!==null){(function(A){let $=A.getPreviousSibling(),I=A.getNextSibling();$!==null&&vd($),I!==null&&vd(I)})(this);let O=f.getWritable(),T=this.getIndexWithinParent();m?(O.splice(T,0,S),this.remove()):O.splice(T,1,S),K(v)&&ms(v,f,T,u-1)}return S}mergeWithSibling(n){let o=n===this.getPreviousSibling();o||n===this.getNextSibling()||M(50);let r=this.__key,s=n.__key,i=this.__text,a=i.length;_o()===s&&ft(r);let l=ce();if(K(l)){let f=l.anchor,p=l.focus;f!==null&&f.key===s&&lb(f,o,r,n,a),p!==null&&p.key===s&&lb(p,o,r,n,a)}let c=n.__text,u=o?c+i:i+c;this.setTextContent(u);let d=this.getWritable();return n.remove(),d}isTextEntity(){return!1}};function e1(e){return{forChild:e_(e.style),node:null}}function t1(e){let t=e,n=t.style.fontWeight==="normal";return{forChild:e_(t.style,n?void 0:"bold"),node:null}}var QC=new WeakMap;function n1(e){if(!we(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function o1(e){let t=e;e.parentElement===null&&M(129);let n=t.textContent||"";if((function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=QC.get(s))===void 0&&!n1(s);)i.push(s),s=s.parentNode;let a=r===void 0?s:r;for(let l=0;l<i.length;l++)QC.set(i[l],a);return a})(t)!==null)return{node:o_(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let o=t,r=!0;for(;o!==null&&(o=ZC(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let o=t,r=!0;for(;o!==null&&(o=ZC(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:rn(n)}}function ZC(e,t){let n=e;for(;;){let o;for(;(o=t?n.nextSibling:n.previousSibling)===null;){let s=n.parentElement;if(s===null)return null;n=s}if(n=o,we(n)){let s=n.style.display;if(s===""&&!JN(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(_n(n))return n;if(n.nodeName==="BR")return null}}var r1={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Mo(e){let t=r1[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:e_(e.style,t),node:null}}function rn(e=""){return Gi(new _r(e))}function R(e){return e instanceof _r}function e_(e,t){let n=e.fontWeight,o=e.textDecoration.split(" "),r=n==="700"||n==="bold",s=o.includes("line-through"),i=e.fontStyle==="italic",a=o.includes("underline"),l=e.verticalAlign,c=e.textTransform;return u=>((R(u)||dd(u))&&(r&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),l!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),l!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),c!=="lowercase"&&c!=="uppercase"&&c!=="capitalize"||u.hasFormat(c)||u.toggleFormat(c),t&&!u.hasFormat(t)&&u.toggleFormat(t)),u)}var s1=Id()({detail:Ni(Ii(2),{getter:{field:"__detail"},setter:null}),mode:Ni(kl(["normal"]),{getter:{field:"__mode",getterTable:{0:"normal"}},setter:null}),text:Ni(Ml(" "),{getter:{field:"__text",method:"getTextContent"},setter:null})}),Ri=class extends _r{$config(){return this.config("tab",{extends:_r,generated:JR,json:s1})}constructor(t=void 0){super(" ",t),this.__detail=2}createDOM(t){let n=super.createDOM(t),o=wi(t.theme,"tab");return o!==void 0&&n.classList.add(...o),n}setTextContent(t){return super.setTextContent(" ")}spliceText(t,n,o,r){return o===""&&n===0||o===" "&&n===1||M(286),this}setDetail(t){return t!==2&&M(127),this}setMode(t){return t!=="normal"&&M(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function qE(){return Gi(new Ri)}function t_(e){return e instanceof Ri}var xm=class{constructor(t,n,o){w(this,"key");w(this,"offset");w(this,"type");w(this,"_selection");this._selection=null,this.key=t,this.offset=n,this.type=o}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:Xl(hn($o(this,"next")),hn($o(t,"next")))<0}getNode(){let t=Ee(this.key);return t===null&&M(20),t}set(t,n,o,r){let s=this._selection,i=this.key;r&&this.key===t&&this.offset===n&&this.type===o||(this.key=t,this.offset=n,this.type=o,yr()||(_o()===i&&ft(t),s!==null&&(s.setCachedNodes(null),K(s)&&(s._cachedIsBackward=null),s.dirty=!0)))}};function oo(e,t,n){return new xm(e,t,n)}function Fg(e,t){let n=t.__key,o=e.offset,r="element";if(R(t)){r="text";let s=t.getTextContentSize();o>s&&(o=s)}else if(!k(t)){let s=t.getNextSibling();if(R(s))n=s.__key,o=0,r="text";else{let i=t.getParent();i&&(n=i.__key,o=t.getIndexWithinParent()+1)}}e.set(n,o,r)}function eb(e,t){if(k(t)){let n=t.getLastDescendant();k(n)||R(n)?Fg(e,n):Fg(e,t)}else Fg(e,t)}function tb(e,t,n,o){let r=e.getNode(),s=r.getChildAtIndex(e.offset),i=rn();if(i.setFormat(n),i.setStyle(o),NN(s))s.splice(0,0,[i]);else if(s!==null){let a=We(r)?qt().append(i):i;s.insertBefore(a)}else if(We(r)){let a=r.getLastChild();k(a)&&!a.isInline()&&a.isEmpty()?a.append(i):r.append(qt().append(i))}else r.append(i);e.is(t)&&t.set(i.__key,0,"text"),e.set(i.__key,0,"text")}function nb(e,t,n,o){let r=e.anchor.getNode();R(r)||M(398);let s=e.anchor.offset,i=rn(t);i.setFormat(n),i.setStyle(o);let a=r.getParentOrThrow();if(s===0)a.isInline()&&!r.__prev?a.insertBefore(i):r.insertBefore(i,!1);else if(s===r.getTextContentSize())a.isInline()&&!r.__next?a.insertAfter(i):r.insertAfter(i,!1);else{let[l]=r.splitText(s);l.insertAfter(i,!1)}r.getTextContent()===""&&r.isAttached()&&r.remove(),i.selectEnd(),i.isComposing()&&e.anchor.type==="text"&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var fd=class e{constructor(t){w(this,"_nodes");w(this,"_cachedNodes");w(this,"dirty");this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!ji(t))return!1;let n=this._nodes,o=t._nodes;return n.size===o.size&&Array.from(n).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){let n=this.getNodes().filter(i=>Nt(i)===null),o=n.length;if(o===0)return;let r=n[o-1],s;if(R(r))s=r.select();else{let i=r.getIndexWithinParent()+1;s=r.getParentOrThrow().select(i,i)}s.insertNodes(t);for(let i=0;i<o;i++)n[i].remove()}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=this._nodes,o=[];for(let r of n){let s=Ee(r);s!==null&&o.push(s)}return yr()||(this._cachedNodes=o),o}getTextContent(){let t=this.getNodes(),n="";for(let o=0;o<t.length;o++)n+=t[o].getTextContent();return n}deleteNodes(){let t=this.getNodes().filter(n=>Nt(n)===null);if((ce()||Ts())===this&&t[0]){let n=Xe(t[0],"next");xN(br(n,n))}for(let n of t)n.remove();XE()}};function XE(){let e=Lt();if(e.getChildrenSize()===0&&uT(ce())===null){let t=qt();e.append(t),t.select()}}function K(e){return e instanceof Cs}var Cs=class e{constructor(t,n,o,r){w(this,"format");w(this,"style");w(this,"anchor");w(this,"focus");w(this,"_cachedNodes");w(this,"_cachedIsBackward");w(this,"dirty");this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!K(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let t=this._cachedNodes;if(t!==null)return t;let n=(function(o){let r=[],[s,i]=o.getTextSlices();s&&r.push(s.caret.origin);let a=new Set,l=new Set;for(let c of o)if(zn(c)){let{origin:u}=c;r.length===0?a.add(u):(l.add(u),r.push(u))}else{let{origin:u}=c;k(u)&&l.has(u)||r.push(u)}if(i&&r.push(i.caret.origin),Sr(o.focus)&&k(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let c=Wn(o.focus.origin,"previous");zn(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(r[r.length-1]);c=Vi(c))a.delete(c.origin),r.pop();for(;r.length>1;){let c=r[r.length-1];if(!k(c)||l.has(c)||c.isEmpty()||a.has(c))break;r.pop()}if(r.length===0&&o.isCollapsed()){let c=hn(o.anchor),u=hn(o.anchor.getFlipped()),d=p=>to(p)?p.origin:p.getNodeAtCaret(),f=d(c)||d(u)||(o.anchor.getNodeAtCaret()?c.origin:u.origin);r.push(f)}return r})(Ld(xd(this),"next"));return yr()||(this._cachedNodes=n),n}setTextNodeRange(t,n,o,r){return this.anchor.set(t.__key,n,"text"),this.focus.set(o.__key,r,"text"),this}getTextContent(){let t=this.getNodes();if(t.length===0)return"";let n=t[0],o=t[t.length-1],r=this.anchor,s=this.focus,i=r.isBefore(s),[a,l]=vm(this),c="",u=!0;for(let d=0;d<t.length;d++){let f=t[d];if(k(f)&&!f.isInline()){u||(c+=`
74
+ `);let p="";for(let h of yo(f)){let g=Ns(f,h);g!==null&&(p+=g.getTextContent())}p!==""?(c+=p,u=!1):u=!f.isEmpty()}else if(u=!1,R(f)){let p=f.getTextContent();f===n?f===o?r.type==="element"&&s.type==="element"&&s.offset!==r.offset||(p=a<l?p.slice(a,l):p.slice(l,a)):p=i?p.slice(a):p.slice(l):f===o&&(p=i?p.slice(0,l):p.slice(0,a)),c+=p}else!he(f)&&!pn(f)||f===o&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(t){let n=ge(),o=n.getEditorState()._selection,r=rN(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,o);if(r===null)return;let[s,i,a]=r;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(i.key,i.offset,i.type,!0),a&&(this.dirty=!0),Km(this)}clone(){let t=this.anchor,n=this.focus;return new e(oo(t.key,t.offset,t.type),oo(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=xr(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){let n=xt[t];return(this.format&n)!==0}insertRawText(t){this.insertNodes(o_(t))}insertText(t){let n=this.format,o=this.style;if(!this.isCollapsed()){let d=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(R(d)&&(n=d.getFormat(),o=d.getStyle()),this.removeText(),this.format=n,this.style=o,t==="")return;if(_o()===null)return this.anchor.type==="element"&&tb(this.anchor,this.focus,n,o),void nb(this,t,n,o)}this.anchor.type==="element"&&tb(this.anchor,this.focus,n,o);let r=this.anchor.getNode();R(r)||M(398);let s=this.anchor.offset,i=r.getParentOrThrow(),a=r.getTextContentSize();if(Bn(r)||s===0&&(!r.canInsertTextBefore()||!i.canInsertTextBefore()&&!r.__prev)||s===a&&(!r.canInsertTextAfter()||!i.canInsertTextAfter()&&!r.__next)){if(r.isSegmented()&&s!==0&&s!==a){if(_o()!==null)r.setMode("normal").setFormat(n).setStyle(o);else{let f=rn(r.getTextContent());f.setFormat(n),f.setStyle(o);let p=ce()===this;r.replace(f),this.setTextNodeRange(f,s,f,s),p&&ce()!==this&&Pt(this)}return void(t!==""&&this.insertText(t))}if(t==="")return;if(s===0){let f=r.getPreviousSibling();if(R(f)&&f.canInsertTextAfter()&&!Bn(f))f.select();else{let p=rn();p.setFormat(n),p.setStyle(o),i.canInsertTextBefore()?r.insertBefore(p):i.insertBefore(p),p.select()}return void this.insertText(t)}if(s===a){let f=r.getNextSibling();if(R(f)&&f.canInsertTextBefore()&&!Bn(f))f.select(0,0);else{let p=rn();p.setFormat(n),p.setStyle(o),i.canInsertTextAfter()?r.insertAfter(p):i.insertAfter(p),p.select(0,0)}return void this.insertText(t)}let d=rn(t);return d.setFormat(n),d.setStyle(o),r.replace(d),void d.select()}if(t==="")return;let l=i.isInline()&&s===0&&!r.__prev,c=i.isInline()&&s===a&&!r.__next,u=r.getFormat()!==n||r.getStyle()!==o;if(l||c||u){if(r.getTextContent()!==""||l||c)return void nb(this,t,n,o);r.setFormat(n),r.setStyle(o)}r.spliceText(s,0,t,!0),r.isComposing()&&this.anchor.type==="text"&&this.anchor.set(this.anchor.key,this.anchor.offset-t.length,this.anchor.type)}removeText(){let t=ce()===this,n=this.anchor.key;Nl(this,vN(xd(this))),this.isCollapsed()&&(function(o,r){let s=o.anchor;if(s.key===r)return;let i=s.getNode(),a=0,l="";R(i)?(a=i.getFormat(),l=i.getStyle()):k(i)&&(a=i.getTextFormat(),l=i.getTextStyle()),o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)})(this,n),t&&ce()!==this&&Pt(this)}formatText(t,n=null){QE(this,t,n)}insertNodes(t){if(t.length===0)return;this.isCollapsed()||this.removeText();let n=this.anchor.getNode();if(this.anchor.type==="element"&&k(n)&&n.isShadowRoot()&&Nt(n)!==null){let x=n.getFirstChild()??n.append(qt()).getFirstChild();if(x!==null&&!k(x)){let v=qt();x.insertBefore(v),x=v}if(x!==null){x.selectStart();let v=ce();return K(v)||M(369),v.insertNodes(t)}}if(this.anchor.type==="element"&&We(n)){let x=zg(t),v=x.getLastDescendant();return n.splice(this.anchor.offset,0,x.getChildren()),void(v!==null&&v.selectEnd())}let o=this.isBackward()?this.focus:this.anchor,r=o.getNode(),s=cr(r,Rt),i=t[t.length-1];if(k(s)&&"__language"in s){if("__language"in t[0])this.insertText(t[0].getTextContent());else{let[,x]=_l(this);s.splice(x,0,t),i.selectEnd()}return}if(!t.some(x=>(k(x)||he(x))&&!x.isInline())){k(s)||M(211,r.constructor.name,r.getType());let[x,v]=_l(this,!0);return(k(x)?x:s).splice(v,0,t),void i.selectEnd()}if(k(s)&&Nt(s)!==null){let[,x]=_l(this),v=Cm(t);s.splice(x,0,v);let S=v[v.length-1];return void(S!==void 0?S.selectEnd():s.select(x,x))}if(s===null){let x=zg(t),v=x.getLastDescendant(),S=$o(this.anchor,"next");for(let b of x.getChildren())S=EN(b,S);return void(v!==null&&v.selectEnd())}if(k(s)&&!s.isParentRequired()&&!We(s.getParentOrThrow())){let[,x]=_l(this),v=Cm(t);s.splice(x,0,v);let S=v[v.length-1];return void(S!==void 0?S.selectEnd():s.select(x,x))}let a=zg(t),l=a.getLastDescendant(),c=a.getChildren(),u=(function(x){let v=(function(S){let b=S.getNode();if(S.offset>0)return S.type==="element"&&k(b)?b.getChildAtIndex(S.offset-1):null;for(let N=b;N!==null&&!Rt(N)&&!We(N);N=N.getParent()){let D=N.getPreviousSibling();if(D!==null)return D}return null})(x);return pn(v)&&pn(v.getPreviousSibling())})(o),d=k(s)&&s.isEmpty()?null:this.insertParagraph();d&&!s.isAttached()&&(r=this.anchor.getNode(),s=cr(r,Rt));let f=c[c.length-1],p=c[0];var h;h=p,u||!k(h)||!Rt(h)||h.isEmpty()||!k(s)||s.isEmpty()&&!s.canMergeWhenEmpty()||(k(s)||M(211,r.constructor.name,r.getType()),s.append(...p.getChildren()),p=c[1]),p&&(s===null&&M(212,r.constructor.name,r.getType()),(function(x,v){let S=v.getParentOrThrow().getLastChild(),b=v,N=[v];for(;b!==S;)b.getNextSibling()||M(140),b=b.getNextSibling(),N.push(b);let D=x;for(let O of N)D=D.insertAfter(O)})(s,p));let g=cr(l,Rt),y=l.selectEnd();d&&(k(g)&&(d.canMergeWhenEmpty()||Rt(f))?(g.append(...d.getChildren()),d.remove()):d.isEmpty()&&d.remove()),k(s)&&s.isEmpty()&&s.remove();let m=k(s)?s.getLastChild():null;pn(m)&&g!==s&&m.remove();let _=hn($o(y.anchor,"next"));bs(y.anchor,_),bs(y.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type==="element"&&We(t)){let a=qt();return t.splice(this.anchor.offset,0,[a]),a.select(),a}let[,n]=_l(this),o=cr(this.anchor.getNode(),Rt);if(o!==null&&Nt(o)!==null)return null;k(o)||M(213);let r=o.getChildAtIndex(n),s=r?[r,...r.getNextSiblings()]:[],i=o.insertNewAfter(this,!1);return i?(i.append(...s),i.selectStart(),i):null}insertLineBreak(t){let n=Pd();if(this.insertNodes([n]),t){let o=n.getParentOrThrow(),r=n.getIndexWithinParent();o.select(r,r)}}extract(){let t=[...this.getNodes()],n=t.length,o=t[0],r=t[n-1],[s,i]=vm(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=a?[i,s]:[s,i];if(n===0)return[];if(n===1){if(R(o)&&!this.isCollapsed()){let f=o.splitText(u,d),p=u===0?f[0]:f[1];return p?(l.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[o]}if(R(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),R(r)){let f=r.getTextContent().length;d===0?t.pop():d!==f&&([r]=r.splitText(d),t[t.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,o){if(gd(this,t,n,o))return;let r=t==="move",s=ge(),i=Hn(an(s));if(!i)return;let a=s._blockCursorElement,l=s._rootElement,c=this.focus.getNode();l===null||a===null||!k(c)||c.isInline()||c.canBeEmpty()||bd(a,s,l);let u=Mi(s,this.focus.key),d=u;if(this.focus.type==="text"&&(d=R(c)?Po(c,u,s):null),this.dirty){let f=Mi(s,this.anchor.key),p=f;if(this.anchor.type==="text"){let h=this.anchor.getNode();p=R(h)?Po(h,f,s):null}p&&d&&hd(i,p,this.anchor.offset,d,this.focus.offset)}if(o==="character"&&R(c)&&c.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let f=Xe(c,n?"previous":"next").getNodeAtCaret();if(R(f)){if(!r){let p=f.getTextContentSize();return n?this.focus.set(f.__key,p-1,"text"):this.focus.set(f.__key,1,"text"),void(this.dirty=!0)}{let p=s.getElementByKey(f.getKey()),h=p?Po(f,p,s):null;if(h){let g=n?h.length:0;hd(i,h,g,h,g)}}}}if(eN(i,t,n?"backward":"forward",o,l),i.rangeCount>0){let f=qi(i,s._rootElement),p=f||i.getRangeAt(0),h=this.anchor.getNode(),g=qe(h)?h:m_(h);this.applyDOMRange(p),this.dirty=!0,r||(tN(this,n,g),(f?i.direction!=="backward":i.anchorNode===p.startContainer&&i.anchorOffset===p.startOffset)||ZE(this))}o==="lineboundary"&&gd(this,t,n,o,"decorators")}forwardDeletion(t,n,o){if(!o&&(t.type==="element"&&k(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){let r=n.getParent(),s=n.getNextSibling()||(r===null?null:r.getNextSibling());if(k(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t)){let l=k(r)?r.getNextSibling():null;if(!(k(r)&&r.isEmpty()&&k(l)&&l.isShadowRoot()))return}let s=$o(o,t?"previous":"next"),i=E_(s);if(i.getTextSlices().every(l=>l===null||l.distance===0)){if(o.type==="element"){let c=s.getNodeAtCaret();if(k(c)&&Cd(c)){let u=c.getParent();c.remove();let d=Sd(u,c);return void(d!==null&&d.selectStart())}}let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(zn(c)){if(!c.origin.isInline()){if(c.origin.isShadowRoot()){if(l.type==="merge-block")break;if(k(i.anchor.origin)&&i.anchor.origin.isEmpty()){let u=hn(c);Nl(this,br(u,u)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:c,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Sr(c)){if(k(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else l={block:c.origin,type:"merge-next-block"};continue}if(he(c.origin)){if(!c.origin.isIsolated())if(l.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&k(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let u=n_();u.add(c.origin.getKey()),Pt(u)}else{let u=c.origin,d=u.getParent();u.remove();let f=Sd(d,u);f!==null&&f.selectStart()}return}if(pn(c.origin))return void c.origin.remove();break}}if(l.type==="merge-block"){let{caret:c,block:u}=l;return yo(u).length>0?void 0:c.origin.isEmpty()&&!u.isEmpty()&&c.origin.getParent()===u.getParent()?void c.origin.remove(!0):(Nl(this,br(!c.origin.isEmpty()&&u.isEmpty()?Os(Xe(u,c.direction)):i.anchor,c)),this.removeText())}for(let c=o.getNode();c!==null;){if(Nt(c)!==null)return;if(k(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(Bg(this,t,"character"),this.isCollapsed()){if(t&&o.offset===0&&(function(l,c){for(let u=c;u;u=u.getParent()){if(k(u)){if(u.collapseAtStart(l))return!0;if(We(u))break}if(u.getPreviousSibling())break}return!1})(this,o.getNode()))return}else{let l=a.type==="text"?a.getNode():null;if(r=o.type==="text"?o.getNode():null,l!==null&&l.isSegmented()){let c=a.offset,u=l.getTextContentSize();if(l.is(r)||t&&c!==u||!t&&c!==0)return void rb(l,t,c)}else if(r!==null&&r.isSegmented()){let c=o.offset,u=r.getTextContentSize();if(r.is(l)||t&&c!==0||!t&&c!==u)return void rb(r,t,c)}(function(c,u){let d=c.anchor,f=c.focus,p=d.getNode();if(p===f.getNode()&&d.type==="text"&&f.type==="text"){let g=d.offset,y=f.offset,m=g<y,_=m?g:y,x=m?y:g,v=x-1;_!==v&&!IN(h=p.getTextContent().slice(_,x))&&!l1(h)&&(u?f.set(f.key,v,f.type):d.set(d.key,v,d.type))}var h})(this,t)}}n||Xu(this),this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&XE()}deleteLine(t){let n=this.isCollapsed(),o=Sm(this.anchor);if(o!==null&&he(gn(o)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(t);this.isCollapsed()&&Bg(this,t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):cr(this.anchor.getNode(),Rt)!==cr(this.focus.getNode(),Rt)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(t)):(n||Xu(this),this.removeText())}deleteWord(t){let n=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,t))return;Bg(this,t,"word")}this.isCollapsed()?this.deleteCharacter(t):(n||Xu(this),this.removeText())}isBackward(){let t=this._cachedIsBackward;if(t!==null)return t;let n=this.focus.isBefore(this.anchor);return yr()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}};function ji(e){return e instanceof fd}function JE(e,t){if(ji(e)){for(let m of e.getNodes())dd(m)&&m.setFormat(t(m.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void ft(null);let n=[];for(let m of e.getNodes())R(m)?n.push(m):k(m)?m.setTextFormat(t(m.getTextFormat())):dd(m)&&m.setFormat(t(m.getFormat()));let o=n.length;if(o===0)return e.setFormat(t(e.format)),void ft(null);let r=e.anchor,s=e.focus,i=e.isBackward(),a=i?s:r,l=i?r:s,c=0,u=n[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),u==null)return;let f=o-1,p=n[f],h=l.type==="text"?l.offset:p.getTextContentSize();if(u.is(p)){if(d===h)return;let m=t(u.getFormat());if(Bn(u)||d===0&&h===u.getTextContentSize())u.setFormat(m);else{let _=u.splitText(d,h),x=d===0?_[0]:_[1];x.setFormat(m),a.type==="text"&&a.set(x.__key,0,"text"),l.type==="text"&&l.set(x.__key,h-d,"text")}return void(e.format=m)}d===0||Bn(u)||([,u]=u.splitText(d),d=0);let g=t(u.getFormat());u.setFormat(g);let y=t(p.getFormat());h>0&&(h===p.getTextContentSize()||Bn(p)||([p]=p.splitText(h)),p.setFormat(y));for(let m=c+1;m<f;m++){let _=n[m];_.setFormat(t(_.getFormat()))}a.type==="text"&&a.set(u.__key,d,"text"),l.type==="text"&&l.set(p.__key,h,"text"),e.format=g|y}function i1(e,t){let n=[];for(let[o,r]of Object.entries(t))typeof r=="boolean"&&n.push([o,r]);n.length!==0&&JE(e,o=>{for(let[r,s]of n)o=xr(o,r,s?xt[r]:0);return o})}function QE(e,t,n=null){let o=n===null&&K(e)?xr(e.format,t,null):n;JE(e,r=>xr(r,t,o))}function ob(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function vm(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,o]=t;return n.type==="element"&&o.type==="element"&&n.key===o.key&&n.offset===o.offset?[0,0]:[ob(n),ob(o)]}function Xu(e){let t=Lt();!t.isEmpty()&&s_(t,e)&&(e.anchor.set(t.getKey(),0,"element"),e.focus.set(t.getKey(),t.getChildrenSize(),"element"))}function ZE(e){let t=e.focus,n=e.anchor,o=n.key,r=n.offset,s=n.type;n.set(t.key,t.offset,t.type,!0),t.set(o,r,s,!0)}function eN(e,t,n,o,r){let s=o==="character"?sn(e,r):null,i=s&&s.focusNode,a=s?s.focusOffset:0;if(e.modify(t,n,o),s===null||!(function(c,u,d){return c!==null&&c.nodeType===3&&(d==="backward"?u>0:d==="forward"&&u<c.length)})(i,a,n))return;let l=sn(e,r);l.focusNode===i&&l.focusOffset===a&&e.modify(t,n,o)}function tN(e,t,n){let o=e.getNodes(),r=o.filter(a=>Vl(a,n));if(r.length===0||r.length===o.length)return!1;let s=t?r[0]:r[r.length-1],i=k(s)?s:s.getParentOrThrow();return t?i.selectStart():i.selectEnd(),!0}function Bg(e,t,n){if(gd(e,"extend",t,n))return;let o=ge(),r=Hn(an(o));if(!r||typeof r.modify!="function")return;let s=o._blockCursorElement,i=o._rootElement,a=e.anchor,l=e.focus.getNode();i===null||s===null||!k(l)||l.isInline()||l.canBeEmpty()||bd(s,o,i);let c=O=>{let T=O.getNode(),A=o.getElementByKey(O.key);return A!==null&&O.type==="text"&&R(T)?Po(T,A,o):A},u=a.getNode(),d=c(a);if(d===null)return;let f=a.offset,p=e.isCollapsed(),h=e.focus,g=p?d:c(h);if(g===null)return;let y=h.offset;if(hd(r,g,y,g,y),eN(r,"move",t?"backward":"forward",n,i),r.rangeCount===0)return;let m=qi(r,i)||r.getRangeAt(0),_=m.startContainer,x=m.startOffset;if(n==="lineboundary"&&_n(_)&&gr(_)===o){let O=ys(_);if(he(O)&&O.isInline()&&!O.isIsolated()){let T=o.getElementByKey(O.getKey());T!==null&&T.contains(_)&&(_=T,x=t?0:T.childNodes.length)}}if(p&&n==="character"&&a.type==="text"&&R(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let O=Xe(u,t?"previous":"next").getNodeAtCaret();if(R(O)){let T=t?O.getTextContentSize()-1:1;return e.focus.set(O.__key,T,"text"),void(e.dirty=!0)}}if(p&&n==="character"&&a.type==="text"){let O=t?0:u.getTextContentSize(),T=_===d?x:f!==O?O:-1;if(T>=0)return void(T!==f&&(e.focus.set(a.key,T,"text"),e.dirty=!0))}let[v,S,b,N]=t?[_,x,d,f]:[d,f,_,x],D=qe(u)?u:m_(u);e.applyDOMRange({collapsed:!1,endContainer:b,endOffset:N,startContainer:v,startOffset:S}),e.dirty=!0,!tN(e,t,D)&&t&&ZE(e),n==="lineboundary"&&gd(e,"extend",t,n,"decorators")}function a1(){try{let e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\uFE0F")&&t("#\uFE0F\u20E3")&&t("\u{1F44D}"))return t}catch{}return()=>!1}var l1=a1();function rb(e,t,n){let o=e,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,a=0;for(let c=0;c<s;c++){let u=c===s-1;if(a=i,i+=r[c].length,t&&i===n||i>n||u){r.splice(c,1),u&&(a=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(a,a))}function sb(e,t,n,o){let r,s=t,i=!1;if(we(e)){let a=!1,l=e.childNodes,c=l.length,u=o._blockCursorElement;s===c&&c>0&&(a=!0,s=c-1),Ds(e,o)!==void 0||jl(e,o)||(i=!0);let d=l[s],f=!1;if(d===u)d=l[s+1],f=!0;else if(u!==null){let p=u.parentNode;e===p&&t>Array.prototype.indexOf.call(p.children,u)&&s--}if(r=ys(d),R(r))s=no(r,a?"next":"previous");else{let p=ys(e);if(p===null)return null;if(k(p)){let h=o.getElementByKey(p.getKey());h===null&&M(214),[p,s]=Jt(p,h,o).resolveChildIndex(p,h,e,t),k(p)||M(215),a&&s>=p.getChildrenSize()&&(s=Math.max(0,p.getChildrenSize()-1));let y=p.getChildAtIndex(s);if(k(y)&&(function(m,_,x){let v=m.getParent();return x===null||v===null||!v.canBeEmpty()||v!==x.getNode()})(y,0,n)){let m=a?y.getLastDescendant():y.getFirstDescendant();m===null?p=y:(y=m,p=k(y)?y:y.getParentOrThrow()),s=0}R(y)?(r=y,p=null,s=no(y,a?"next":"previous")):y!==p&&a&&!f&&(k(p)||M(216),s=Math.min(p.getChildrenSize(),s+1))}else{let h=gn(p),g=h!==null?h:p,y=g.getIndexWithinParent(),m=o.getElementByKey(p.getKey()),_="after";if(m!==null&&ys(e)===p){let x=Jt(p,m,o);x.element!==m?_=x.resolveLeafPosition(m,e,t):t===0&&he(p)&&(_="before")}s=_==="before"?y:y+1,p=g.getParentOrThrow()}if(k(p))return[oo(p.__key,s,"element"),i]}}else r=ys(e);return R(r)?[oo(r.__key,no(r,s,"clamp"),"text"),i]:null}function ib(e,t,n){let o=e.offset,r=e.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(t){if((n||!t)&&s===null&&k(i)&&i.isInline()){let a=i.getPreviousSibling();R(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else k(s)&&!n&&s.isInline()?e.set(s.__key,s.getChildrenSize(),"element"):R(s)&&!r.isUnmergeable()&&e.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(t&&k(s)&&s.isInline())e.set(s.__key,0,"element");else if((n||t)&&s===null&&k(i)&&i.isInline()&&!i.canInsertTextAfter()&&i.getTextContentSize()>1){let a=i.getNextSibling();R(a)&&e.set(a.__key,0,"text")}}}function Sm(e){let t=Ee(e.key);return t===null?null:Gl(t)}function nN(e,t,n){let o=Sm(e),r=Sm(t);if(o===r||o!==null&&r!==null&&o.is(r))return!1;let s=n(o,r);if(o!==null)return k(o)?t.set(o.getKey(),s?o.getChildrenSize():0,"element"):t.set(o.getKey(),s?o.getTextContentSize():0,"text"),!0;let i=gn(r);if(i===null)return!1;let a=i.getParent();if(a===null)return!1;let l=i.getIndexWithinParent();return t.set(a.getKey(),s?l+1:l,"element"),!0}function oN(e){let t=nN(e.anchor,e.focus,(n,o)=>(function(r,s,i,a){if(i!==null&&a!==null){let u=gn(i),d=gn(a);if(u!==null&&u.is(d)){for(let f of Ud(u).values()){if(f===i.getKey())return!0;if(f===a.getKey())return!1}return!0}return u===null||d===null||u.isBefore(d)}if(i!==null){let u=gn(i),d=Ee(s.key);return u===null||d===null||!(!u.is(d)&&!u.isParentOf(d))||u.isBefore(d)}let l=gn(a),c=Ee(r.key);return l!==null&&c!==null&&!l.is(c)&&!l.isParentOf(c)&&c.isBefore(l)})(e.anchor,e.focus,n,o));return t&&(e.dirty=!0),t}function rN(e,t,n,o,r,s){if(e===null||n===null||!tc(r,e,n))return null;let i=sb(e,t,K(s)?s.anchor:null,r);if(i===null)return null;let a=sb(n,o,K(s)?s.focus:null,r);if(a===null)return null;let[l,c]=i,[u,d]=a;if(l.type==="element"&&u.type==="element"){let p=ys(e),h=ys(n);if(he(p)&&he(h))return null}let f=r._slotsUsed&&nN(l,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return(function(p,h){if(p.type==="text"&&h.type==="text"){let g=p.isBefore(h),y=p.is(h);ib(p,g,y),ib(h,!g,y),y&&h.set(p.key,p.offset,p.type)}})(l,u),[l,u,c||d||f]}function sN(e){return k(e)&&!e.isInline()}function iN(e,t,n,o,r,s){let i=yn(),a=new Cs(oo(e,t,r),oo(n,o,s),0,"");return a.dirty=!0,i._selection=a,a}function aN(){let e=oo("root",0,"element"),t=oo("root",0,"element");return new Cs(e,t,0,"")}function n_(){return new fd(new Set)}function c1(e,t){return Bl(null,e,t,null)}function Bl(e,t,n,o){let r=n._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,a=i==="selectionchange",l=!qg&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(K(e)&&!l)return e.clone();{if(t===null)return null;let v=sn(t,n._rootElement);if(c=v.anchorNode,u=v.focusNode,d=v.anchorOffset,f=v.focusOffset,(a||i===void 0)&&K(e)&&!tc(n,c,u))return e.clone()}let p=rN(c,d,u,f,n,e);if(p===null)return null;let[h,g,y]=p,m=0,_="";if(K(e)){let v=e.anchor;if(h.key===v.key)m=e.format,_=e.style;else{let S=h.getNode();R(S)?(m=S.getFormat(),_=S.getStyle()):k(S)&&(m=S.getTextFormat(),_=S.getTextStyle())}}let x=new Cs(h,g,m,_);return y&&(x.dirty=!0),x}function ce(){return yn()._selection}function Ts(){return ge()._editorState._selection}function gs(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function ms(e,t,n,o=1){if(!gs(e,t))return;let r=e.anchor,s=e.focus,i=t.__key;if(e.isCollapsed()){let a=r.offset;if(n<=a&&o>0||n<a&&o<0){let l=Math.max(0,a+o);r.set(i,l,"element"),s.set(i,l,"element"),ab(e)}}else{let a=e.isBackward(),l=a?s:r,c=l.getNode(),u=a?r:s,d=u.getNode();if(t.is(c)){let f=l.offset;(n<=f&&o>0||n<f&&o<0)&&l.set(i,Math.max(0,f+o),"element")}if(t.is(d)){let f=u.offset;(n<=f&&o>0||n<f&&o<0)&&u.set(i,Math.max(0,f+o),"element")}}ab(e)}function ab(e){let t=e.anchor,n=t.offset,o=e.focus,r=o.offset,s=t.getNode(),i=o.getNode();if(e.isCollapsed()){if(!k(s))return;let a=s.getChildrenSize(),l=n>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(n);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),o.set(c.__key,u,"text")}return}if(k(s)){let a=s.getChildrenSize(),l=n>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(n);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(k(i)){let a=i.getChildrenSize(),l=r>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(r);if(R(c)){let u=0;l&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function pd(e,t,n,o,r){let s=null,i=0,a=null;o!==null?(s=o.__key,R(o)?(i=o.getTextContentSize(),a="text"):k(o)&&(i=o.getChildrenSize(),a="element")):r!==null&&(s=r.__key,R(r)?a="text":k(r)&&(a="element")),s!==null&&a!==null?e.set(s,i,a):(i=t.getIndexWithinParent(),i===-1&&(i=n.getChildrenSize()),e.set(n.__key,i,"element"))}function lb(e,t,n,o,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>o.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function hd(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function cb(e,t,n){let o=Mi(e,t.getKey());if(k(t)){let r=Jt(t,o,e);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function lN(e,t,n,o,r,s){let i=s.getRootNode(),a=Yi(i)||Bo(i)?zi(i):null;if(r.has(WE)&&a!==s||a!==null&&Bd(a,a))return;let l=sn(o,s),c;if(!K(t))return void(e!==null&&tc(n,l.anchorNode,l.focusNode)&&o.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[h,g]=cb(n,f,u.offset),[y,m]=cb(n,p,d.offset),_=t.format,x=t.style,v=t.isCollapsed(),S=h,b=y,N=!1;if(u.type==="text"?(S=R(f)?Po(f,h,n):null,N=f.getFormat()!==_||f.getStyle()!==x):K(e)&&e.anchor.type==="text"&&(N=!0),d.type==="text"&&(b=R(p)?Po(p,y,n):null),S!==null&&b!==null){if(v&&(e===null||N||K(e)&&(e.format!==_||e.style!==x))&&(function(D,O,T,A,$,I){D._inputState.collapsedSelectionFormat={format:O,key:$,offset:A,style:T,timeStamp:I}})(n,_,x,g,u.key,performance.now()),(o.type!=="Range"||!v)&&l.anchorOffset===g&&l.focusOffset===m&&l.anchorNode===S&&l.focusNode===b){if(a===null||!s.contains(a)){let D=a!==null?gr(a):null;D!==null&&D!==n||r.has(cd)||s.focus({preventScroll:!0})}if(u.type!=="element")return}if(hd(o,S,g,b,m),xo&&t.isCollapsed()&&s!==null&&!r.has(cd)){let D=Ed(s);if(D===null||!s.contains(D)){let O=zi(s.ownerDocument),T=O!==null?gr(O):null;T!==null&&T!==n||s.focus({preventScroll:!0})}}if(!r.has(KE)&&t.isCollapsed()&&s!==null&&s===Ed(s)){let D=K(t)&&t.anchor.type==="element"?(function(O,T,A){let $=T.childNodes[A];if(!we($))return $||null;let I=Ds($,O),L=I!==void 0?Ee(I):null;return L===null||k(L)?$:Jt(L,$,O).element})(n,S,g):(c===void 0&&(c=jN(o,s)),c);if(D!==null){let O;if(_n(D)){let T=D.ownerDocument.createRange();T.selectNode(D),O=T.getBoundingClientRect()}else O=we(D)?D.getBoundingClientRect():(function(T){let A=T.getBoundingClientRect(),{startContainer:$,startOffset:I}=T;if(!T.collapsed||A.width!==0||A.height!==0||!_n($)||$.length===0)return A;let L=T.cloneRange();return I>0?L.setStart($,I-1):L.setEnd($,1),L.getBoundingClientRect()})(D);(function(T,A,$,I=null){let L=Wd($),P=g_(L);if(L===null||P===null)return;let Y=$.getBoundingClientRect();if(A.bottom<Y.top)return;if(I!==null&&A.height>0){let{left:xe,right:ue}=A,q=we(I)?I:Ro(I);for(;q!==null&&$.contains(q);){let le=J1(P,q,xe,ue);xe-=le,ue-=le,q=q===$?null:Ro(q)}}let{top:Q,bottom:ee}=A,Z=0,ne=0,ae=$;for(;ae!==null;){let xe=ae===L.body;if(xe){let q=P.visualViewport;if(q){let Ot=q.offsetTop;Z=Ot,ne=Ot+q.height}else Z=0,ne=an(T).innerHeight;let le=P.getComputedStyle(L.documentElement),Fe=parseFloat(le.scrollPaddingTop),Te=parseFloat(le.scrollPaddingBottom);isFinite(Fe)&&(Z+=Fe),isFinite(Te)&&(ne-=Te)}else{let q=ae===$?Y:ae.getBoundingClientRect();Z=q.top,ne=q.bottom}let ue=0;if(Q<Z?ue=-(Z-Q):ee>ne&&(ue=ee-ne),ue!==0)if(xe)P.scrollBy(0,ue);else{let q=ae.scrollTop;ae.scrollTop+=ue;let le=ae.scrollTop-q;Q-=le,ee-=le}if(xe)break;ae=Ro(ae)}})(n,O,s,S)}}(function(D,O,T,A,$){let I=D._inputState;I.isSelectionChangeFromDOMUpdate=!0,I.selectionChangeFromDOMUpdatePoints=O!==void 0&&T!==void 0&&A!==void 0&&$!==void 0?{anchorNode:O,anchorOffset:T,focusNode:A,focusOffset:$}:null})(n,S,g,b,m)}}function u1(e){let t=ce()||Ts();t===null&&(t=Lt().selectEnd()),t.insertNodes(e)}function cN(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
75
75
  `||n===`\r
76
- `?t.linebreak():n===" "?t.tab():n!==""&&t.text(n)}function o_(e){let t=[];return lN(e,{linebreak:()=>t.push(Pd()),tab:()=>t.push(GE()),text:n=>t.push(rn(n))}),t}function c1(){let e=ce();return e===null?"":e.getTextContent()}function Cm(e){let t=[];for(let n of e)pn(n)||(!k(n)&&!he(n)||n.isInline()?t.push(n):k(n)&&t.push(...Cm(n.getChildren())));return t}function _l(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let o=ce();K(o)&&(n=o),K(n)||M(161);let r=n.anchor,s=r.getNode(),i=r.offset;for(;!Rt(s)&&Nt(s)===null;){let a=s;if([s,i]=u1(s,i,t),a.is(s))break}return[s,i]}function u1(e,t,n=!1){let o=e.getParent();if(!o){let s=qt();return Lt().append(s),s.select(),[Lt(),0]}if(R(e)){let s=e.splitText(t);if(s.length===0)return[o,e.getIndexWithinParent()];let i=t===0?0:1;return[o,s[0].getIndexWithinParent()+i]}if(!k(e)||t===0)return[o,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let s=new Cs(no(e.__key,t,"element"),no(e.__key,t,"element"),0,""),i=e.insertNewAfter(s);if(i)i.append(r,...r.getNextSiblings());else if(n)return[e,t]}return[o,e.getIndexWithinParent()+1]}function cb(e){return pn(e)||BN(e)||R(e)||e.isParentRequired()}function zg(e){let t=qt(),n=null;for(let o=0;o<e.length;o++){let r=e[o];if(cb(r)){if(n===null){n=r.createParentElementNode(),t.append(n);let s=e[o+1];if(pn(r)&&(s===void 0||!cb(s)))continue}n.append(r)}else t.append(r),n=null}return t}function gd(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[d,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}let s=$o(e.focus,n?"previous":"next"),i=o==="lineboundary",a=t==="move",l=s,c=r==="decorators-and-blocks",u=!1;if(!vN(l)){for(let d of l){c=!1;let{origin:f}=d;if(he(f)){if(f.isIsolated()){u=!0;break}if(l=d,i&&f.isInline())continue}break}if(u)return!0;if(c)for(let d of E_(s).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Bn(d))d.origin.isInline()||(l=d);else{if(k(d.origin))continue;he(d.origin)&&!d.origin.isInline()&&(l=d)}break}}if(l===s)return!1;if(a&&!i&&he(l.origin)&&l.origin.isKeyboardSelectable()){let d=n_();return d.add(l.origin.getKey()),Pt(d),!0}return l=hn(l),a&&bs(e.anchor,l),bs(e.focus,l),c||!i}var vt=null,Ge=null,Gt=!1,Wg=!1,Ju=!1,Kg=new Set,Ug=new Set,Qu=0,ub={characterData:!0,childList:!0,subtree:!0};function yr(){return Gt||vt!==null&&vt._readOnly}function dt(){Gt&&M(13)}function cN(){Qu>99&&M(14)}function yn(){return vt===null&&M(195,dN()),vt}function d1(e){yn()!==null&&Ge===null&&(Ge=e),Ge!==e&&km(378)}function ge(){return Ge===null&&M(337,dN()),Ge}function uN(){ge()._dirtyType=2}function dN(){let e=0,t=new Set,n=hr.version;if(typeof window<"u")for(let r of UN(document)){let s=nc(r);if(zd(s))e++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===n&&(i+=" (separately built, likely a bundler configuration issue)"),t.add(i)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function fN(){return Ge}function db(e,t,n){let o=t.__type,r=l_(e,o),s=n.get(o);s===void 0&&(s=Array.from(r.transforms),n.set(o,s));let i=s.length;for(let a=0;a<i&&(s[a](t),t.isAttached());a++);}function fb(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function pN(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function f1(e){return md(e,ge()._nodes)}function md(e,t){let n=e.type,o=t.get(n);o===void 0&&M(17,n);let r=o.klass;e.type!==r.getType()&&M(18,r.name);let s=r.importJSON(e),i=e.children;if(k(s)&&Array.isArray(i))for(let l=0;l<i.length;l++){let c=md(i[l],t);s.append(c)}let a=e.$slots;if(a){mr(s)||M(379,r.name);for(let l in a)fT(s,l,md(a[l],t))}return s}function pb(e,t,n){let o=vt,r=Gt,s=Ge;vt=t,Gt=!0,Ge=e;try{return n()}finally{vt=o,Gt=r,Ge=s}}function pr(e,t){let n=Ju;Ju=!0;try{let o=(function(r){if(Ug.has(r))return!1;Ug.add(r);try{for(let s=0;r._pendingEditorState!==null;s++){let i=r._pendingEditorState._selection,a=r._rootElement;if(!hN(r,i))return!1;let l=(i===null||K(i))&&(r._headless||a===null||!a.isConnected);if(l||s===100)return r._lastNotifiedSelection=i===null?null:i.clone(),!l;Pi(r,()=>r.dispatchCommand(Rd),void 0,!0)}return!1}finally{Ug.delete(r)}})(e);(function(r,s){let i=r._pendingEditorState,a=r._rootElement,l=r._headless||a===null;if(i===null)return void(!r._updating&&r._deferred.length>0&&hb(r,r._deferred));let c=r._editorState,u=c._selection,d=i._selection,f=r._dirtyType!==0,p=vt,h=Gt,g=Ge,y=r._updating,m=r._observer,_=null;if(r._pendingEditorState=null,r._editorState=i,!l&&f&&m!==null){Ge=r,vt=i,Gt=!1,r._updating=!0;try{let T=r._dirtyType,A=r._dirtyElements,$=r._dirtyLeaves;m.disconnect(),_=pR(c,i,r,T,A,$)}catch(T){if(T instanceof Error&&r._onError(T),Wg)throw T;return NN(r,null,a,i),Gb(r),r._dirtyType=2,Wg=!0,pr(r,c),void(Wg=!1)}finally{m.observe(a,ub),r._updating=y,vt=p,Gt=h,Ge=g}}i._readOnly||(i._readOnly=!0);let x=r._dirtyLeaves,v=r._dirtyElements,S=r._normalizedNodes,b=r._updateTags;f&&(r._dirtyType=0,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set),r._updateTags=new Set;let N=r._deferred;y||(r._deferred=[]),(function(T,A){let $=T._decorators,I=T._pendingDecorators||$,L=A._nodeMap,P;for(P in I)L.has(P)||(I===$&&(I=kN(T)),delete I[P])})(r,i);let D=l?null:Un(an(r));if(r._editable&&D!==null&&(f||d===null||d.dirty||!d.is(u))&&a!==null&&!b.has(KE)){Ge=r,vt=i;try{if(m!==null&&m.disconnect(),f||d===null||d.dirty){let T=r._blockCursorElement;T!==null&&bd(T,r,a),aN(u,d,r,D,b,a)}(function(T,A,$){let I=T._blockCursorElement;if(K($)&&$.isCollapsed()&&$.anchor.type==="element"&&A.contains(Ed(A))){let L=$.anchor,P=L.getNode(),Y=L.offset,Q=!1,ee=null;if(Y===P.getChildrenSize())Cd(P.getChildAtIndex(Y-1))&&(Q=!0);else{let Z=P.getChildAtIndex(Y);Z!==null&&Cd(Z)&&(Q=!0,ee=T.getElementByKey(Z.__key))}if(Q){let Z=Jt(P,T.getElementByKey(P.__key),T).element;return I===null&&(T._blockCursorElement=I=(function(ne){let ae=ne.theme,xe=Xt().createElement("div");xe.contentEditable="false",xe.setAttribute("data-lexical-cursor","true");let ue=ae.blockCursor;if(ue!==void 0){if(typeof ue=="string"){let q=rc(ue);ue=ae.blockCursor=q}ue!==void 0&&xe.classList.add(...ue)}return xe})(T._config)),A.style.caretColor="transparent",void(ee===null?Z.appendChild(I):Z.insertBefore(I,ee))}}I!==null&&bd(I,T,A)})(r,a,d)}finally{m!==null&&m.observe(a,ub),Ge=g,vt=p}}_!==null&&(function(T,A,$,I,L){let P=Array.from(T._listeners.mutation),Y=P.length;for(let Q=0;Q<Y;Q++){let[ee,Z]=P[Q];for(let ne of Z){let ae=A.get(ne);ae!==void 0&&ee(ae,{dirtyLeaves:I,prevEditorState:L,updateTags:$})}}})(r,_,b,x,c);let O=r._pendingDecorators;O!==null&&(r._decorators=O,r._pendingDecorators=null,El("decorator",r,!0,O)),(function(T,A,$){let I=yb(A),L=yb($);I!==L&&El("textcontent",T,!0,L)})(r,s||c,i),El("update",r,!0,{dirtyElements:v,dirtyLeaves:x,editorState:i,mutatedNodes:_,normalizedNodes:S,prevEditorState:s||c,tags:b}),y||hb(r,N),(function(T){let A=T._updates;if(A.length===0)return void(T._cascadeCount=0);if((function(I){Kg.has(I)||(Kg.add(I),setTimeout(()=>{Kg.delete(I),I._cascadeCount=0},0))})(T),T._cascadeCount++>99)return T._updates=[],T._cascadeCount=0,void T._onWarn(Gg(437,T._config.namespace));let $=A.shift();if($){let[I,L]=$;Pi(T,I,L)}})(r)})(e,t),o&&e._onWarn(Gg(436))}finally{Ju=n}}function El(e,t,n,...o){let r=t._updating;t._updating=n;try{let s=t._listeners[e],i=Array.from(s);for(let[a,l]of i){l&&l();let c=a(...o),u=typeof c=="function"?c:void 0;s.has(a)?s.set(a,u):u&&u()}}finally{t._updating=r}}function hN(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function bm(e,t,n,o){let r=d_(e),s;if(!Ju)for(let i=0;i<r.length;i++)r[i]._updating||(r[i]._cascadeCount=0);if(t===Rd){if(Ge!==e||Gt){let a=!1;return mn(e,()=>{a=bm(e,t,n,o)}),a}let i=yn()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let l=r[a];if(a>0&&l._updating){s=l;break}let c=l._commands.get(t);if(c!==void 0){let u=c[i];if(u.size>0){let d=!1;if(mn(l,()=>{for(let f of u)if(f(n,o))return void(d=!0)}),d)return d}}}return s&&s.update(()=>{bm(s,t,n,o)}),!1}function hb(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let o=0;o<t.length;o++)t[o]()}finally{e._updating=n}}}function gb(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[s,i]=r,a=e._pendingEditorState,l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(a===null&&M(191),a._flushSync=!0),l&&e._deferred.push(l),pN(e,i.tag)),a==null?Pi(e,s,i):s()}}return o}function p1(){let e=yn();dt(),e._flushSync=!0}function Pi(e,t,n,o=!1){let r=e._updateTags,s,i=!1,a=!1;n!==void 0&&(s=n.onUpdate,pN(e,n.tag),i=n.skipTransforms||!1,a=n.discrete||!1),s&&e._deferred.push(s);let l=e._editorState,c=e._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=gN(c||l),u=!0),c._flushSync=a;let d=vt,f=Gt,p=Ge,h=e._updating;vt=c,Gt=!1,e._updating=!0,Ge=e;let g=e._headless||e.getRootElement()===null;i_(null);try{u&&(g?l._selection!==null&&(c._selection=l._selection.clone()):c._selection=(function(x,v){let S=x.getEditorState()._selection,b=Un(an(x));return K(S)||S==null?Bl(S,b,x,v):S.clone()})(e,n&&n.event||null));let m=e._compositionKey;t(),i=gb(e,i),(function(x,v){let S=v.getEditorState()._selection,b=x._selection;if(K(b)){let N=b.anchor,D=b.focus,O;if(N.type==="text"&&(O=N.getNode(),O.selectionTransform(S,b)),D.type==="text"){let T=D.getNode();O!==T&&T.selectionTransform(S,b)}}})(c,e),e._dirtyType!==0&&(i?(function(x,v){let S=v._dirtyLeaves,b=x._nodeMap;for(let N of S){let D=b.get(N);R(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&MC(D)}})(c,e):(function(x,v){let S=v._dirtyLeaves,b=v._dirtyElements,N=x._nodeMap,D=_o(),O=new Map,T=S,A=T.size,$=b,I=$.size;for(;A>0||I>0;){if(A>0){v._dirtyLeaves=new Set;for(let L of T){let P=N.get(L);R(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&MC(P),P!==void 0&&fb(P,D)&&db(v,P,O),S.add(L)}if(T=v._dirtyLeaves,A=T.size,A>0){Qu++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,$.delete("root")&&$.set("root",!0);for(let L of $){let P=L[0],Y=L[1];if(b.set(P,Y),!Y)continue;let Q=N.get(P);Q!==void 0&&fb(Q,D)&&db(v,Q,O)}T=v._dirtyLeaves,A=T.size,$=v._dirtyElements,I=$.size,Qu++}v._dirtyLeaves=S,v._dirtyElements=b})(c,e),gb(e),(function(x,v,S,b){let N=x._nodeMap,D=v._nodeMap,O=[];for(let[I]of b){let L=D.get(I);L!==void 0&&(L.isAttached()||(k(L)&&nd(L,I,N,D,O,b),N.has(I)||b.delete(I),O.push(I)))}for(let I of S){let L=D.get(I);L===void 0||L.isAttached()||(mr(L)&&L.__slots!==null&&nd(L,I,N,D,O,S),N.has(I)||S.delete(I),O.push(I))}let T=ge(),A=T._cloneNotNeeded;for(let I of O)D.delete(I),A.delete(I);let $=T._compositionKey;$===null||D.has($)||(T._compositionKey=null)})(l,c,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(c._flushSync=!0);let _=c._selection;if(K(_)){e._slotsUsed&&nN(_);let x=c._nodeMap,v=_.anchor.key,S=_.focus.key;x.get(v)!==void 0&&x.get(S)!==void 0||M(19)}else ji(_)&&_._nodes.size===0&&(c._selection=null)}catch(m){m instanceof Error&&e._onError(m),e._pendingEditorState=l;let _=l._selection;return e._lastNotifiedSelection=_===null?null:_.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void pr(e)}finally{vt=d,Gt=f,Ge=p,e._updating=h,Qu=0}if(o)return;e._dirtyType!==0||e._deferred.length>0||(function(m,_){let x=_.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(x))return!0}else if(x!==null)return!0;return!1})(c,e)?c._flushSync?(c._flushSync=!1,pr(e)):u&&z1(()=>{pr(e)}):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function mn(e,t,n){Ge===e&&n===void 0?yr()?Pi(e,t,n):t():Pi(e,t,n)}function h1(){return{...Bb,0:""}}function g1(){return{...Ai,"":0}}var m1=h1(),_1=g1(),y1=Id()({direction:Io(kl([null,"ltr","rtl"]),{field:"__dir"}),format:Io(kl(["","left","start","center","right","end","justify"]),{field:"__format",getter:"getFormatType",getterTable:m1,setter:"setFormat",setterTable:_1}),indent:Io(Ii(0,{integer:!0,min:0}),{field:"__indent"}),textFormat:Ni(Ii(),{getter:{field:"__textFormat",method:"getSerializedTextFormat",when:"shouldSerializeTextStyles"},setter:{field:"__textFormat"}}),textStyle:Ni(Ml(),{getter:{field:"__textStyle",method:"getSerializedTextStyle",when:"shouldSerializeTextStyles"},setter:{field:"__textStyle"}})});function x1(e){if(We(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var oo=class extends st{constructor(n){super(n);w(this,"__first");w(this,"__last");w(this,"__size");w(this,"__format");w(this,"__style");w(this,"__indent");w(this,"__dir");w(this,"__textFormat");w(this,"__textStyle");w(this,"__slotHost");w(this,"__slots");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}$config(){return this.config(Symbol.for("ElementNode"),{$transform:x1,extends:st,generated:HR,json:y1})}afterCloneFrom(n){super.afterCloneFrom(n),this.__key===n.__key&&(this.__first=n.__first,this.__last=n.__last,this.__size=n.__size,this.__slotHost=n.__slotHost,this.__slotHost!==null&&this.__parent!==null&&M(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=n.__slots),this.__style=n.__style,(function(o,r){o.__dir=r.__dir,o.__format=r.__format,o.__indent=r.__indent,o.__textFormat=r.__textFormat,o.__textStyle=r.__textStyle})(this,n)}getFormat(){return this.getLatest().__format}getFormatType(){let n=this.getFormat();return Bb[n]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let n=[],o=this.getFirstChild();for(;o!==null;)n.push(o),o=o.getNextSibling();return n}getChildrenKeys(){let n=[],o=this.getFirstChild();for(;o!==null;)n.push(o.__key),o=o.getNextSibling();return n}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&yo(this).length===0}isDirty(){let n=ge()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){let n=this.getLatest(),o=this.getParentOrThrow().getLastChild();return o!==null&&o.is(n)}getAllTextNodes(){let n=[];for(let r of yo(this)){let s=Ns(this,r);if(k(s))for(let i of s.getAllTextNodes())n.push(i)}let o=this.getFirstChild();for(;o!==null;){if(R(o)&&n.push(o),k(o))for(let r of o.getAllTextNodes())n.push(r);o=o.getNextSibling()}return n}getFirstDescendant(){let n=this.getFirstChild();for(;k(n);){let o=n.getFirstChild();if(o===null)break;n=o}return n}getLastDescendant(){let n=this.getLastChild();for(;k(n);){let o=n.getLastChild();if(o===null)break;n=o}return n}getDescendantByIndex(n){let o=this.getChildren(),r=o.length;if(n>=r){let i=o[r-1];return k(i)&&i.getLastDescendant()||i||null}let s=o[n];return k(s)&&s.getFirstDescendant()||s||null}getFirstChild(){let n=this.getLatest().__first;return n===null?null:Ee(n)}getFirstChildOrThrow(){let n=this.getFirstChild();return n===null&&M(45,this.__key),n}getLastChild(){let n=this.getLatest().__last;return n===null?null:Ee(n)}getLastChildOrThrow(){let n=this.getLastChild();return n===null&&M(96,this.__key),n}getChildAtIndex(n){let o=this.getChildrenSize(),r,s;if(n<o/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=n;){if(s===n)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=o-1;r!==null&&s>=n;){if(s===n)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let n=dT(this),o=this.getChildren(),r=o.length;for(let s=0;s<r;s++){let i=o[s];n+=i.getTextContent(),k(i)&&s!==r-1&&!i.isInline()&&(n+=_s)}return n}getTextContentSize(){let n=(function(s){let i=0;for(let a of yo(s)){let l=Ns(s,a);l!==null&&(i+=l.getTextContentSize())}return i})(this),o=this.getChildren(),r=o.length;for(let s=0;s<r;s++){let i=o[s];n+=i.getTextContentSize(),k(i)&&s!==r-1&&!i.isInline()&&(n+=2)}return n}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(n){if(n!==""){let o=Ai[n];return(this.getFormat()&o)!==0}return!1}hasTextFormat(n){let o=xt[n];return(this.getTextFormat()&o)!==0}getFormatFlags(n,o){return xr(this.getLatest().__textFormat,n,o)}getTextStyle(){return this.getLatest().__textStyle}select(n,o){dt();let r=ce(),s=n,i=o,a=this.getChildrenSize();if(!this.canBeEmpty()){if(n===0&&o===0){let c=this.getFirstChild();if(R(c)||k(c))return c.select(0,0)}else if(!(n!==void 0&&n!==a||o!==void 0&&o!==a)){let c=this.getLastChild();if(R(c)||k(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return K(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):sN(l,s,l,i,"element","element")}selectStart(){let n=this.getFirstDescendant();return n?n.selectStart():this.select()}selectEnd(){let n=this.getLastDescendant();return n?n.selectEnd():this.select()}clear(){let n=this.getWritable();return this.getChildren().forEach(o=>o.remove()),n}append(...n){return this.splice(this.getChildrenSize(),0,n)}setDirection(n){let o=this.getWritable();return o.__dir=n,o}setFormat(n){let o=this.getWritable();return o.__format=n!==""&&Ai[n]||0,o}setStyle(n){let o=this.getWritable();return o.__style=n||"",o}setTextFormat(n){let o=this.getWritable();return o.__textFormat=n,o}setTextStyle(n){let o=this.getWritable();return o.__textStyle=n,o}setIndent(n){let o=this.getWritable();return o.__indent=n,o}splice(n,o,r){ld(this)&&M(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();n+o<=s||M(226,String(n),String(o),String(s));for(let h of r);let a=i.__key,l=[],c=[],u=this.getChildAtIndex(n+o),d=null,f=s-o+r.length;if(n!==0)if(n===s)d=this.getLastChild();else{let h=this.getChildAtIndex(n);h!==null&&(d=h.getPreviousSibling())}if(o>0){let h=d===null?this.getFirstChild():d.getNextSibling();for(let g=0;g<o;g++){h===null&&M(100);let y=h.getNextSibling(),m=h.__key;Zn(h.getWritable()),c.push(m),h=y}}let p=d;for(let h of r){p!==null&&h.is(p)&&(d=p=p.getPreviousSibling()),u!==null&&h.is(u)&&(u=u.getNextSibling());let g=h.getWritable();g.__parent===a&&f--,Zn(g);let y=h.__key;if(p===null)i.__first=y,g.__prev=null;else{let m=p.getWritable();m.__next=y,g.__prev=m.__key}h.__key===a&&M(76),g.__parent=a,l.push(y),p=h}if(u===null)p!==null&&(p.getWritable().__next=null,i.__last=p.__key);else{let h=u.getWritable();if(p!==null){let g=p.getWritable();h.__prev=p.__key,g.__next=u.__key}else h.__prev=null}if(i.__size=f,c.length){let h=ce();if(K(h)){let g=new Set(c),y=new Set(l),{anchor:m,focus:_}=h;mb(m,g,y)&&pd(m,m.getNode(),this,d,u),mb(_,g,y)&&pd(_,_.getNode(),this,d,u),f!==0||this.canBeEmpty()||We(this)||this.remove()}}return i}getDOMSlot(n){return new td(n)}exportDOM(n){let{element:o}=super.exportDOM(n);if(we(o)){let r=this.getIndent();r>0&&(o.style.paddingInlineStart=40*r+"px",o.setAttribute("data-lexical-indent",String(r)));let s=this.getDirection();s&&(o.dir=s)}return{element:o}}shouldSerializeTextStyles(){if(We(this))return!1;for(let n=this.getFirstChild();n!==null;n=n.getNextSibling())if(R(n))return!1;return!0}getSerializedTextFormat(){let n=this.getTextFormat();return n!==0&&this.shouldSerializeTextStyles()?n:void 0}getSerializedTextStyle(){let n=this.getTextStyle();return n!==""&&this.shouldSerializeTextStyles()?n:void 0}insertNewAfter(n,o){return null}canIndent(){return!0}collapseAtStart(n){return!1}excludeFromCopy(n){return!1}canReplaceWith(n){return!0}canInsertAfter(n){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(n){return!1}extractWithChild(n,o,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(n,o){let r=Jt(this,n,o),s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let a=o.getElementByKey(i.getKey());a!==null&&(s==null?(r.insertChild(a),s=a):s!==a&&r.replaceChild(a,s),s=s.nextSibling)}}};function k(e){return e instanceof oo}function mb(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var zl=class extends st{constructor(n){super(n);w(this,"__slotHost");w(this,"__slots");this.__slotHost=null,this.__slots=null}afterCloneFrom(n){super.afterCloneFrom(n),this.__key===n.__key&&(this.__slotHost=n.__slotHost,this.__slotHost!==null&&this.__parent!==null&&M(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=n.__slots)}decorate(n,o){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function he(e){return e instanceof zl}var Li=class extends oo{constructor(){super("root");w(this,"__cachedText");this.__cachedText=null}$config(){return this.config("root",{extends:oo})}getTopLevelElementOrThrow(){M(51)}getTextContent(){let n=this.__cachedText;return n===null||!yr()&&ge()._dirtyType!==0?super.getTextContent():n}remove(){M(52)}replace(n){M(53)}insertBefore(n){M(54)}insertAfter(n){M(55)}updateDOM(n,o){return!1}splice(n,o,r){for(let s of r)k(s)||he(s)||M(282);return super.splice(n,o,r)}static importJSON(n){return Lt().updateFromJSON(n)}collapseAtStart(){return!0}};function qe(e){return e instanceof Li}function gN(e){return new Wl(Kb(e._nodeMap),null,e._slotsUsed)}function r_(){return new Wl(new Map([["root",new Li]]),null,!1)}function Em(e){let t=e.constructor,n=Vb(e);if(k(e)){let r=n.children,s=e.getChildren();for(let i=0;i<s.length;i++)r.push(Em(s[i]))}let o=yo(e);if(o.length>0){let r={};for(let s of o){let i=Ns(e,s);i===null&&M(366,t.name,s),r[s]=Em(i)}n.$slots=r}return n}function v1(e){return e instanceof Wl}var Wl=class e{constructor(t,n=null,o=!1){w(this,"_nodeMap");w(this,"_selection");w(this,"_flushSync");w(this,"_readOnly");w(this,"_parsed");w(this,"_slotsUsed");this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=o}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(t,n){return pb(n&&n.editor||null,this,t)}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(t){return Ub(typeof t=="boolean"&&t,()=>pb(null,this,()=>({root:Em(Lt())})))}},_d=class extends oo{$config(){return this.config("artificial",{extends:oo})}createDOM(t){return Xt().createElement("div")}},Fi=class extends st{$config(){return this.config("linebreak",{extends:st,generated:GR,importDOM:{br:t=>mN(t)||_N(t)?null:{conversion:S1,priority:0}}})}getTextContent(){return`
77
- `}createDOM(){return Xt().createElement("br")}updateDOM(){return!1}isInline(){return!0}};function S1(e){return{node:Pd()}}function Pd(){return Gi(new Fi)}function pn(e){return e instanceof Fi}function mN(e){let t=e.parentElement;if(t!==null&&v_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yd(n)){let o=t.lastChild;if(o===e||o.previousSibling===e&&yd(o))return!0}}return!1}function _N(e){let t=e.parentElement;if(t!==null&&v_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yd(n))return!1;let o=t.lastChild;if(o===e||o.previousSibling===e&&yd(o))return!0}return!1}function yd(e){return _n(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function $o(e,t){let{type:n,key:o,offset:r}=e,s=zN(e.key);return n==="text"?(R(s)||M(266,s.getType(),o),Cr(s,t,r)):(k(s)||M(267,s.getType(),o),SN(s,e.offset,t))}function bs(e,t){let{origin:n,direction:o}=t,r=o==="next";eo(t)?e.set(n.getKey(),t.offset,"text"):Sr(t)?R(n)?e.set(n.getKey(),to(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Bn(t)&&k(n)||M(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function yN(e){let t=ce(),n=K(t)?t:iN();return Nl(n,e),Pt(n),n}function Nl(e,t){bs(e.anchor,t.anchor),bs(e.focus,t.focus)}function xd(e){let{anchor:t,focus:n}=e,o=$o(t,"next"),r=$o(n,"next"),s=Xl(o,r)<=0?"next":"previous";return br(Wn(o,s),Wn(r,s))}function Os(e){let{direction:t,origin:n}=e,o=Xe(n,Wo(t)).getNodeAtCaret();return o?Xe(o,t):zn(n.getParentOrThrow(),t)}function _b(e,t="root"){let n=[e];for(let o=Bn(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Os(o));return n}function Hg(e){return!!e&&e.origin.isAttached()}function xN(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,s=Ld(e,o),i=s.anchor.origin;for(;i!==null&&!We(i);)i=i.getParent();let a=k(i)?i.getFirstChild():null,l=_b(s.anchor,n),c=_b(s.focus.getFlipped(),n),u=new Set,d=[];for(let m of s.iterNodeCarets(n))if(Bn(m))u.add(m.origin.getKey());else if(Sr(m)){let{origin:_}=m;k(_)&&!u.has(_.getKey())||d.push(_)}let f=new Set;for(let m of d){let _=m.getParent();_===null||u.has(_.getKey())||f.add(_),Zn(m)}for(let m of f)!m.canBeEmpty()&&!We(m)&&m.isEmpty()&&m.isAttached()&&m.remove();for(let m of s.getTextSlices()){if(!m)continue;let{origin:_}=m.caret,x=_.getTextContentSize(),v=Os(Xe(_,o)),S=_.getMode();if(Math.abs(m.distance)===x&&r==="removeEmptySlices"||S==="token"&&m.distance!==0)v.remove();else if(m.distance!==0){r="removeEmptySlices";let b=m.removeTextSlice(),N=m.caret.origin;if(S==="segmented"){let D=b.origin,O=rn(D.getTextContent()).setStyle(D.getStyle()).setFormat(D.getFormat());v.replaceOrInsert(O),b=Cr(O,o,b.offset)}N.is(l[0].origin)&&(l[0]=b),N.is(c[0].origin)&&(c[0]=b.getFlipped())}}let p,h;for(let m of l)if(Hg(m)){p=hn(m);break}for(let m of c)if(Hg(m)){h=hn(m);break}let g=(function(m,_,x){if(!m||!_)return null;let v=m.getParentAtCaret(),S=_.getParentAtCaret();if(!v||!S)return null;let b=v.getParents().reverse();b.push(v);let N=S.getParents().reverse();N.push(S);let D=Math.min(b.length,N.length),O;for(O=0;O<D&&b[O]===N[O];O++);let T=(I,L)=>{let P;for(let Y=O;Y<I.length;Y++){let Q=I[Y];if(We(Q))return;!P&&L(Q)&&(P=Q)}return P},A=T(b,Rt),$=A&&T(N,I=>x.has(I.getKey())&&Rt(I));return $&&yo($).length>0?null:A&&$?[A,$]:null})(p,h,u);if(g){let[m,_]=g;zn(m,"previous").splice(0,_.getChildren());let x=_.getParent();for(_.remove(!0);x&&x.isEmpty();){let v=x;x=x.getParent(),v.remove(!0)}}else if(h){let m=(function(v){if(Bn(v)){let S=v.origin;if(Rt(S))return S}else{let S=v.getParentAtCaret();if(S&&Rt(S))return S}return null})(h),_=m&&m.getParent(),x=m&&m.getParents().findLast(__);if(m&&_&&!qe(_)&&m.isEmpty()&&u.has(m.getKey())&&yo(m).length===0&&(!x||u.has(x.getKey()))){m.remove(!0);let v=_;for(;v&&!qe(v)&&v.isEmpty();){let S=v.getParent();if(S&&qe(S)&&S.getChildrenSize()<=1&&v.canBeEmpty())break;let b=v;v=S,b.remove(!0)}}}Sd(i,a)!==null||i===null||i.isAttached()||Sd(Lt(),null);let y=[p,h,...l,...c].find(Hg);if(y)return gT(Wn(hn(y),e.direction));M(269,JSON.stringify(l.map(m=>m.origin.__key)))}function hn(e){let t=(function(r){let s=r;for(;Bn(s);){let i=Vi(s);if(!Bn(i))break;s=i}return s})(e.getLatest()),{direction:n}=t;if(R(t.origin))return eo(t)?t:Cr(t.origin,n,n);let o=t.getAdjacentCaret();return Sr(o)&&R(o.origin)?Cr(o.origin,n,Wo(n)):t}function vN(e){return eo(e)&&e.offset!==to(e.origin,e.direction)}function Ld(e,t){return e.direction===t?e:br(Wn(e.focus,t),Wn(e.anchor,t))}function SN(e,t,n){let o=zn(e,"next");for(let r=0;r<t;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return Wn(o,n)}function C1(e,t="root"){let n=0,o=e,r=Vi(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Vi(o)}return r&&[r,n]}function b1(e){let{origin:t,offset:n,direction:o}=e;if(n===to(t,o))return e.getSiblingCaret();if(n===to(t,Wo(o)))return Os(e.getSiblingCaret());let[r]=t.splitText(n);return R(r)||M(281),Wn(Xe(r,"next"),o)}function E1(e,t){return!0}function CN(e,{$copyElementNode:t=y_,$splitTextPointCaretNext:n=b1,rootMode:o="shadowRoot",$shouldSplit:r=E1,removeEmptyDestination:s=!1}={}){if(eo(e))return n(e);let i=e.getParentCaret(o);if(i){let{origin:a}=i;if(Bn(e)){let c=Os(i);if(s&&a.isEmpty())return a.remove(),c;if(!a.canBeEmpty()||!r(a,"first"))return c}let l=(function(c){let u=[];for(let d=c.getAdjacentCaret();d;d=d.getAdjacentCaret())u.push(d.origin);return u})(e);(l.length>0||!s&&a.canBeEmpty()&&r(a,"last"))&&i.insert(t(a).splice(0,0,l))}return i}function bN(e,t,n){let o=Wn(t,"next");eo(o)&&(o.offset===0?o=Xe(o.origin,"previous").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=Xe(o.origin,"next"))),o.origin.is(e)&&(Sr(o)||M(342,e.getKey(),e.getType()),o=Os(o)),(e.is(o.getNodeAtCaret())||e.is(o.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let r=o;r;r=CN(r,n))o=r;return eo(o)&&M(283),o.insert(e.isInline()?qt().append(e):e),Wn(Xe(e.getLatest(),"next"),t.direction)}function s_(e,t){let n=Ld(K(t)?xd(t):t,"next"),o=Gl(n.anchor.origin),r=Gl(e.getLatest());if(o===null?r!==null:!o.is(r))return!1;let s=hn(zn(e,"next")),i=Wn(hn(zn(e,"previous")),"next");return Xl(n.anchor,s)<=0&&Xl(n.focus,i)>=0}var Bi=class extends oo{$config(){return this.config("paragraph",{extends:oo,generated:YR,importDOM:{p:()=>({conversion:N1,priority:0})}})}createDOM(t){let n=Xt().createElement("p"),o=wi(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}exportDOM(t){let{element:n}=super.exportDOM(t);if(we(n)){this.isEmpty()&&n.append(Xt().createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}exportJSON(t=!1){let n=super.exportJSON(t);if(n.textFormat===void 0||n.textStyle===void 0){let o=this.getChildren().find(R),r=o?o.getFormat():this.getTextFormat(),s=o?o.getStyle():this.getTextStyle();t&&r===0||(n.textFormat=r),t&&s===""||(n.textStyle=s)}return n}extractWithChild(t,n,o){if(!K(n)||this.getFormatType()===""&&this.getIndent()===0&&this.getStyle()==="")return!1;if(s_(this,n)){let r=this.getTextContent();return r!==""&&n.getTextContent()===r}return!1}insertNewAfter(t,n){let o=qt();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){if(this.getChildren().every(t=>R(t)&&!/\S/.test(t.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function N1(e){let t=qt();if(eT(t,e),QN(e,t),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in Ai&&t.setFormat(n)}return ZN(t,e),{node:t}}function qt(){return Gi(new Bi)}function EN(e){return e instanceof Bi}function T1(e){console.warn(e)}var O1=0,D1=1,w1=2,M1=3,k1=4,A1=-8,I1=-7,$1=-6,R1=-5,P1=-4;function NN(e,t,n,o,r){let s=e._keyToDOMMap;s.clear(),e._editorState=r_(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,r&&r.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent="",(function(a,l){delete a[`__lexicalKey_${l._key}`]})(t,e)),n!==null&&(n.textContent="",s.set("root",n),MN(n,e,"root"))}function TN(e){let t=new Set,n=new Set;for(let{klass:o,ownNodeConfig:r}of zo(e)){let s=o.transform;if(!n.has(s)){n.add(s);let i=o.transform();i&&t.add(i)}if(r){let i=r.$transform;i&&t.add(i)}}return t}var Kl={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,o)=>{},$exportDOM:(e,t)=>{let n=Fd(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,o,r)=>k(e)&&e.extractWithChild(t,n,o),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,o)=>null,$shouldExclude:(e,t,n)=>k(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,o)=>e.updateDOM(t,n,o._config)};function L1(e){let t=e||{},n=fN(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,s=t.disableEvents||!1,i=r_(),a=t.namespace||(r!==null?r._config.namespace:IN()),l=t.editorState,c=[Li,_r,Fi,Ri,Bi,_d,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let y=0;y<c.length;y++){let m=c[y],_=null,x=null;if(m&&typeof m=="object"){let b=m;m=b.replace,_=b.with,x=b.withKlass||null}if(typeof m!="function"||!m.prototype||!(m===st||m.prototype instanceof st)){let b="<unknown>";try{b=JSON.parse(Wb)}catch{}M(365,String(y-c.length+(t.nodes?t.nodes.length:0)),typeof m=="function"?`${m.name}${typeof m.getType=="function"?` (type ${String(m.getType())})`:""}`:String(m),String(b))}oc(m);let v=m.getType(),S=TN(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:x,sharedNodeState:oE(c[y]),transforms:S})}}let g=new hr(i,r,h,{disableEvents:s,dom:{...Kl,...e&&e.dom},namespace:a,theme:o},u||console.error,d||T1,(function(y,m){let _=new Map,x=new Set,v=S=>{Object.keys(S).forEach(b=>{let N=_.get(b);N===void 0&&(N=[],_.set(b,N)),N.push(S[b])})};return y.forEach(S=>{let b=S.klass.importDOM;if(b==null||x.has(b))return;x.add(b);let N=b.call(S.klass);N!==null&&v(N)}),m&&v(m),_})(h,f?f.import:void 0),p,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(y){y.registerCommand(Um,DR,0),y.registerCommand(Hm,MR,0),y.registerCommand(Vm,AR,0),y.registerCommand(jm,IR,0),y.registerCommand(Gm,PR,0)})(g),g}function F1(e,t){let n=e.get(t);e.delete(t),n&&n()}function yl(e,t,n){return e.set(t,n),F1.bind(null,e,t)}var hr=class{constructor(t,n,o,r,s,i,a,l,c){w(this,"_headless");w(this,"_parentEditor");w(this,"_rootElement");w(this,"_editorState");w(this,"_pendingEditorState");w(this,"_compositionKey");w(this,"_deferred");w(this,"_keyToDOMMap");w(this,"_updates");w(this,"_updating");w(this,"_cascadeCount");w(this,"_listeners");w(this,"_commands");w(this,"_nodes");w(this,"_decorators");w(this,"_pendingDecorators");w(this,"_config");w(this,"_dirtyType");w(this,"_cloneNotNeeded");w(this,"_dirtyLeaves");w(this,"_dirtyElements");w(this,"_normalizedNodes");w(this,"_updateTags");w(this,"_observer");w(this,"_key");w(this,"_onError");w(this,"_onWarn");w(this,"_htmlConversions");w(this,"_window");w(this,"_editable");w(this,"_blockCursorElement");w(this,"_slotsUsed");w(this,"_keyDownShortcuts");w(this,"_inputState");w(this,"_lastNotifiedSelection");w(this,"_createEditorArgs");this._createEditorArgs=c,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new wl,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=o,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=IN(),this._onError=s,this._onWarn=i,this._htmlConversions=a,this._editable=l,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){return yl(this._listeners.update,t)}registerEditableListener(t){return yl(this._listeners.editable,t)}registerDecoratorListener(t){return yl(this._listeners.decorator,t)}registerTextContentListener(t){return yl(this._listeners.textcontent,t)}registerRootListener(t){let n=this._listeners.root;return D_(yl(n,t,t(this._rootElement,null)||void 0),()=>(function(o,r,s){let i=o.get(r);i&&i(),o.set(r,r(...s)||void 0)})(n,t,[null,this._rootElement]))}registerCommand(t,n,o){o===void 0&&M(35);let r=this._commands;r.has(t)||r.set(t,[new hs,new hs,new hs,new hs,new hs]);let s=r.get(t);s===void 0&&M(36,String(t));let i=(function(l){return 7&l})(o),a=s[i];return i!==o?a.addFront(n):a.addBack(n),()=>{a.delete(n),s.every(l=>l.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,s=this._listeners.mutation,i=s.get(n);i===void 0&&(i=new Set,s.set(n,i)),i.add(r);let a=o&&o.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,r),()=>{i.delete(r),i.size===0&&s.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&M(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=Tm(o).get(n.getType());if(!r)return;let s=new Map;for(let i of r.keys())s.set(i,"created");s.size>0&&t(s,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],s=o.replaceWithKlass;if(s!=null){let i=this.registerNodeTransformToKlass(s,n);r.push(i)}return(function(i,a){let l=Tm(i.getEditorState()),c=[];for(let u of a){let d=l.get(u);d&&c.push(d)}c.length!==0&&i.update(()=>{for(let u of c)for(let d of u.keys()){let f=Ee(d);f&&f.markDirty()}},i._pendingEditorState===null?{tag:qu}:void 0)})(this,r.map(i=>i.klass.getType())),()=>{r.forEach(i=>i.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,...n){return G(this,t,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=wi(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,NN(this,n,t,r,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||(function(s){let i=Rg.get(s);if(i===void 0)return void GC();let a=ju.get(i);if(a===void 0)return void GC();Rg.delete(s);let l=nc(s);zd(l)?((function(u){if(u._parentEditor!==null){let d=d_(u),f=d[d.length-1]._key;Di.get(f)===u&&Di.delete(f)}else Di.delete(u._key)})(l),a.editors.delete(l),a.hasShadowEditor=void 0,s.__lexicalEditor=null):l&&M(198);let c=VC(s);for(let u=0;u<c.length;u++)c[u]();s.__lexicalEventHandles=[]})(n),o!=null&&n.classList.remove(...o)),t!==null){let s=g_(t),i=t.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Gb(this),this._updateTags.add(qu),pr(this),this._config.disableEvents||(function(a,l){let c=a.ownerDocument;Rg.set(a,c);let u=ju.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},ju.set(c,u)),u.editors.add(l),u.hasShadowEditor=void 0,a.__lexicalEditor=l;let d=VC(a);d.push(NR.register(c));let f=(function(){if($g!==void 0)return $g;let p=[["keydown",RR],["pointerdown",OR],["compositionstart",kR],["compositionend",$R],["input",wR],["click",TR],["cut",wo],["copy",wo],["dragstart",wo],["dragover",wo],["dragend",wo],["paste",wo],["focus",wo],["blur",wo],["drop",wo]];return Tl&&p.push(["beforeinput",(h,g)=>(function(y,m){let _=y.inputType;_==="deleteCompositionText"||xo&&LN(m)||_!=="insertCompositionText"&&mn(m,()=>{FE(y,m)||G(m,Um,y)},{event:y})})(h,g)]),ro&&p.push(["keyup",(h,g)=>(function(y,m){y.shiftKey&&y.key!=="CapsLock"||(m._inputState.isShiftKeyDown=!1)})(h,g)]),$g=p,p})();for(let p=0;p<f.length;p++){let[h,g]=f[p],y=typeof g=="function"?m=>{YC(m)||(gm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(YC(m))return;gm(m);let _=l.isEditable();switch(h){case"cut":return _&&G(l,Jm,m);case"copy":return G(l,Xm,m);case"paste":return _&&G(l,Ym,m);case"dragstart":return _&&G(l,NE,m);case"dragover":return _&&G(l,TE,m);case"dragend":return _&&G(l,OE,m);case"focus":return _&&G(l,wE,m);case"blur":return l._inputState.isShiftKeyDown=!1,l._inputState.isInsertLineBreak=!1,_&&G(l,ME,m);case"drop":return _&&G(l,EE,m)}};d.push(Qm(a,h,y))}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(qu),pr(this);El("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){let o=t.isEmpty(),r=t;r._readOnly&&(r=gN(t),r._selection=t._selection?t._selection.clone():null),Yb(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),pr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||t._slotsUsed,mn(this,()=>{if(i&&this._updateTags.add(i),o&&(km(38),Lt().append(qt())),t._parsed)for(let[a,l]of r._nodeMap.entries())k(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(t,n){return(function(o,r,s){let i=r_(),a=vt,l=Gt,c=Ge,u=r._dirtyElements,d=r._dirtyLeaves,f=r._cloneNotNeeded,p=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Map,r._dirtyType=0,vt=i,Gt=!1,Ge=r,i_(null);try{let h=r._nodes;md(o.root,h),s&&s(),i._readOnly=!0,i._parsed=!0}catch(h){h instanceof Error&&r._onError(h)}finally{r._dirtyElements=u,r._dirtyLeaves=d,r._cloneNotNeeded=f,r._dirtyType=p,vt=a,Gt=l,Ge=c}return i})(typeof t=="string"?JSON.parse(t):t,this,n)}read(...t){let[n,o]=t.length===1?["force-commit",t[0]]:t;return n==="force-commit"&&pr(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(o,{editor:this})}update(t,n){(function(o,r,s){o._updating?o._updates.push([r,s]):Pi(o,r,s)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),mn(this,()=>{let r=ce(),s=Lt();r!==null?r.dirty||Pt(r.clone()):s.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Es("focus"),FN(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Un(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,El("editable",this,!0,t),this._slotsUsed&&this.update(()=>uN()))}toJSON(){return{editorState:this._editorState.toJSON(Hb())}}};w(hr,"version",Wb);var Nm=null;function i_(e){Nm=e}var a_=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),ON=1;function B1(){ON=1}function l_(e,t){let n=Fd(e,t);return n===void 0&&M(30,t),n}function Fd(e,t){return e._nodes.get(t)}var z1=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Bd(e,t){let n=t!==void 0?t:(()=>{let s=e.getRootNode();return Yi(s)||Bo(s)?zi(s):null})();if(!we(n)||n.hasAttribute("data-lexical-slot"))return!1;let o=u_(n),r=n.nodeName;return Zm(o)&&(r==="INPUT"||r==="TEXTAREA"||n.contentEditable==="true"&&nc(n)==null)}var W1=Bd;function tc(e,t,n){let o=e.getRootElement();if(!o)return!1;try{if(!t||!o.contains(t)||!o.contains(n))return!1}catch{return!1}return gr(t)===e&&e.read("latest",()=>!Bd(t))}function zd(e){return e instanceof hr}function gr(e){let t=e;for(;t!=null;){let n=nc(t);if(zd(n))return n;t=Ro(t)}return null}function nc(e){return e?e.__lexicalEditor:null}function K1(e){return V$.test(e)?"rtl":j$.test(e)?"ltr":null}function Ul(e){return t_(e)||e.isToken()}function Fn(e){return Ul(e)||e.isSegmented()}function _n(e){return Xi(e)&&e.nodeType===3}function Yi(e){return Xi(e)&&e.nodeType===9}function DN(e){let t=e;for(;t!=null;){if(_n(t))return t;t=t.firstChild}return null}function xr(e,t,n){let o=xt[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~xt.superscript:t==="superscript"?r&=~xt.subscript:t==="lowercase"?(r&=~xt.uppercase,r&=~xt.capitalize):t==="uppercase"?(r&=~xt.lowercase,r&=~xt.capitalize):t==="capitalize"&&(r&=~xt.lowercase,r&=~xt.uppercase),r}function U1(e){return R(e)||pn(e)||he(e)}function wN(e,t){let n=(function(){let i=Nm;return Nm=null,i})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);dt(),cN();let o=ge(),r=yn(),s=""+ON++;r._nodeMap.set(s,e),k(e)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.set(s,e),o._dirtyType===0&&(o._dirtyType=1),e.__key=s}function Zn(e){Nt(e)!==null&&M(380,e.__key,String(Nt(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),s=e.getNextSibling(),i=s!==null?s.__key:null,a=r!==null?r.__key:null,l=r!==null?r.getWritable():null,c=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=a),l!==null&&(l.__next=i),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}var H1=Zn;function vd(e){cN(),ld(e)&&M(323,e.__key,e.__type);let t=e.__parent!==null?e.__parent:vr(e)?e.__slotHost:null,n=yn(),o=ge(),r=n._nodeMap,s=o._dirtyElements;t!==null&&(function(a,l,c){let u=a;for(;u!==null;){if(c.has(u))return;let d=l.get(u);if(d===void 0)break;c.set(u,!1),u=d.__parent!==null?d.__parent:vr(d)?d.__slotHost:null}})(t,r,s);let i=e.__key;o._dirtyType===0&&(o._dirtyType=1),k(e)?s.set(i,!0):o._dirtyLeaves.add(i)}function ft(e){dt();let t=ge(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=Ee(n);o!==null&&o.getWritable()}if(e!==null){let o=Ee(e);o!==null&&o.getWritable()}}}function _o(){return yr()?null:ge()._compositionKey}function Ee(e,t){let n=(t||yn())._nodeMap.get(e);return n===void 0?null:n}function c_(e,t){let n=Ds(e,ge());return n!==void 0?Ee(n,t):null}function MN(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Ds(e,t){return e[`__lexicalKey_${t._key}`]}function u_(e,t){let n=e;for(;n!=null;){let o=c_(n,t);if(o!==null)return o;n=Ro(n)}return null}function kN(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function yb(e){return e.read(()=>Lt().getTextContent())}function Lt(){return yn()._nodeMap.get("root")}function Sd(e,t){if(!(We(e)&&e.isAttached()&&(qe(e)?e.getChildrenSize()===0:e.isEmpty())&&(qe(e)||t!==null&&Rt(t))))return null;let n=qt();return e.append(n),n}function Pt(e){dt();let t=yn();e!==null&&(e.dirty=!0,e.setCachedNodes(null),K(e)&&ge()._slotsUsed&&nN(e)),t._selection=e}function xb(){dt(),Yb(ge())}function ys(e){let t=(function(n,o){let r=n;for(;r!=null;){let s=Ds(r,o);if(s!==void 0)return s;r=Ro(r)}return null})(e,ge());return t===null?null:Ee(t)}function AN(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function d_(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function IN(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function $N(e){return _n(e)?e.nodeValue:null}function f_(e,t,n){let o=Un(an(t));if(o===null)return;let r=sn(o,t._rootElement),s=r.anchorNode,{anchorOffset:i,focusOffset:a}=r;if(s!==null){let l=$N(s),c=u_(s);if(l!==null&&R(c)){if((l===Dl||l===Im)&&n){let u=n.length;l=n,i=u,a=u}l!==null&&p_(c,l,i,a,e)}}}function p_(e,t,n,o,r){let s=e;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing();if(s.isToken()&&i)return;let a=t;if((i||r)&&(t.endsWith(Dl)&&(a=t.slice(0,-Dl.length)),r)){let c=Im,u;for(;(u=a.indexOf(c))!==-1;)a=a.slice(0,u)+a.slice(u+c.length),n!==null&&n>u&&(n=Math.max(u,n-c.length)),o!==null&&o>u&&(o=Math.max(u,o-c.length))}let l=s.getTextContent();if(r||a!==l){let c=ce();if(a===""){if(ft(null),Ql||ro||Zl)s.remove();else{let g=ge();Vg(s,"",c),setTimeout(()=>{g.update(()=>{s.isAttached()&&s.getTextContent()===""&&s.remove()})},20)}return}let u=s.getParent(),d=Ts(),f=s.getTextContentSize(),p=_o(),h=s.getKey();if(s.isToken()&&!i||p!==null&&h===p&&!i||K(d)&&(u!==null&&!u.canInsertTextBefore()&&d.anchor.offset===0||d.anchor.key===e.__key&&d.anchor.offset===0&&!s.canInsertTextBefore()&&!i||d.focus.key===e.__key&&d.focus.offset===f&&!s.canInsertTextAfter()&&!i))return void s.markDirty();if(!K(c)||n===null||o===null)return void Vg(s,a,c);if(c.setTextNodeRange(s,n,s,o),s.isSegmented()){let g=rn(s.getTextContent());s.replace(g),s=g}Vg(s,a,c)}}}function Vg(e,t,n){if(e.setTextContent(t),K(n)){let o=e.getKey(),r=!1;for(let s of["anchor","focus"]){let i=n[s];i.type==="text"&&i.key===o&&(i.offset=to(e,i.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function V1(e,t){let n=e[Rm];return n&&t!==Lo?{...e,ctrlKey:e[n],[n]:e.ctrlKey}:e}function Bu(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function RN(e,t){return Bu(e,t,"altKey")&&Bu(e,t,"ctrlKey")&&Bu(e,t,"shiftKey")&&Bu(e,t,"metaKey")}function j1(e,t,n){if(!RN(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let o="Key"+t.toUpperCase();return e.code===o}function vb(e){let t=e;for(;t!==null;){let n=t.getParent();if(n===null)return null;if(qe(n))return t;t=n}return null}function zu(e,t){let{anchor:n,focus:o}=e,r=n.key,s=n.offset,i=n.type,a=o.key,l=o.offset,c=o.type;if(Km(e),!qe(t))return e;let u=vb(n.getNode());return k(u)&&u.isShadowRoot()&&u.is(vb(o.getNode()))&&(n.set(r,s,i),o.set(a,l,c)),e}function Y1(e){let t=Lt();if(K(e)){let n=e.anchor,o=e.focus,r=n.getNode();if(qe(r))return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),zu(e,r),e;let s=r.getTopLevelElementOrThrow(),i=s.getParent();return i===null?(k(s)&&(n.set(s.getKey(),0,"element"),o.set(s.getKey(),s.getChildrenSize(),"element"),zu(e,s)),e):(n.set(i.getKey(),0,"element"),o.set(i.getKey(),i.getChildrenSize(),"element"),zu(e,i),e)}{let n=t.select(0,t.getChildrenSize());return Pt(zu(n,t)),n}}function Hl(e,t){e.getAttribute(t)===""&&e.removeAttribute(t)}function wi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let s=rc(r);return n[t]=s,s}return r}function h_(e,t,n,o,r){if(n.size===0)return;let s=o.__type,i=o.__key,a=t.get(s);a===void 0&&M(33,s);let l=a.klass,c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));let u=c.get(i),d=u==="destroyed"&&r==="created";(u===void 0||d)&&c.set(i,d?"updated":r)}function G1(e){let t=e.getType(),n=yn();if(n._readOnly){let s=Tm(n).get(t);return s?Array.from(s.values()):[]}let o=n._nodeMap,r=[];for(let[,s]of o)s instanceof e&&s.__type===t&&s.isAttached()&&r.push(s);return r}function Sb(e,t,n){let o=e.getParent(),r=n,s=e;return o!==null&&(t&&n===0?(r=s.getIndexWithinParent(),s=o):t||n!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(t?r-1:r)}function PN(e,t){let n=e.offset;if(e.type==="element")return Sb(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?Sb(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function LN(e){let t=an(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function G(e,t,...n){return bm(e,t,n[0],e)}function Mi(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&M(75,t),n}function Ro(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Bo(n)?n.host:null}function Wd(e){return Yi(e)?e:we(e)?e.ownerDocument:null}function Cb(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith("%")?n*t/100:n:0}function q1(e,t,n,o){let r=t.clientWidth,s=t.scrollWidth-r;if(s<=0)return 0;let i=e.getComputedStyle(t);if(i.overflowX!=="auto"&&i.overflowX!=="scroll")return 0;let a=t.getBoundingClientRect(),l=t.offsetWidth,c=l>0&&Math.abs(a.width-l)>1?a.width/l:1,u=i.direction==="rtl",d=a.left+t.clientLeft*c,f=d+Cb(i.scrollPaddingLeft,r)*c,p=d+(r-Cb(i.scrollPaddingRight,r))*c,h=n,g=Math.max(o,n+1);g-h>p-f&&(u?h=g-1:g=h+1);let y=0;if(h<f?y=h-f:g>p&&(y=g-p),y===0)return 0;let m=t.scrollLeft,_=m+y/c,x=y>0?Math.ceil(_):Math.floor(_),v=u?Math.min(0,Math.max(-s,x)):Math.max(0,Math.min(s,x)),S=m*c;return Math.abs(v)<Math.abs(m)&&h+S>=f&&g+S<=p&&(v=0),v===m?0:(t.scrollLeft=v,(t.scrollLeft-m)*c)}function X1(e){return ge()._updateTags.has(e)}function Es(e){dt(),ge()._updateTags.add(e)}function FN(e){dt(),ge()._deferred.push(e)}function Vl(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function g_(e){let t=Wd(e);return t?t.defaultView:null}function an(e){let t=e._window;return t===null&&M(78),t}function BN(e){return k(e)&&e.isInline()||he(e)&&e.isInline()}function m_(e){let t=e.getLatest();for(;t!==null;){if(Nt(t)!==null&&k(t))return t;let n=t.getParentOrThrow();if(We(n))return n;t=n}return t}function __(e){return k(e)&&e.isShadowRoot()}function We(e){return qe(e)||__(e)}function y_(e,t=!1){let n=e.constructor.clone(e,a_);return wN(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Gi(e){let t=ge(),n=e.getType(),o=Fd(t,n);o===void 0&&M(200,e.constructor.name,n);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(e),a=i.constructor;return s!==null?i instanceof s||M(201,s.name,s.getType(),a.name,a.getType(),e.constructor.name,n):i instanceof e.constructor&&a!==e.constructor||M(202,a.name,a.getType(),e.constructor.name,n),i.__key===e.__key&&M(203,e.constructor.name,n,a.name,a.getType()),i}return e}function jg(e,t){!qe(e.getParent())||k(t)||he(t)||M(99)}function zN(e){let t=Ee(e);return t===null&&M(63,e),t}function Cd(e){if(!e||e.isInline())return!1;if(he(e))return!0;if(k(e)){if(e.isShadowRoot()){let t=e.getParent();return!(k(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function bd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Un(e){return Er?(e||window).getSelection():null}function WN(e){let t=g_(e);return t?t.getSelection():null}function Bo(e){return qN(e)&&"host"in e}var J1=[];function KN(e){let t=e.getRootNode();if(t===e||!Bo(t))return J1;let n=[t],o=t.host;for(;;){let r=o.getRootNode();if(r===o||!Bo(r))break;n.push(r),o=r.host}return n}function*UN(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');let o=(Yi(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=o.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function HN(e){return e!==null?e.ownerDocument:document}function Xt(){let e=fN();return HN(e!==null?e._rootElement:null)}function qi(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;let n=KN(t);if(n.length===0)return null;let o=e.getComposedRanges;try{let r=o.call(e,{shadowRoots:n})[0];if(r!==void 0)return r}catch{}try{let r=o.apply(e,n)[0];if(r!==void 0)return r}catch{}return null}function VN(e,t){let n=qi(e,t);if(n!==null){let o=jN(n);if(o!==null)return o}return e.rangeCount>0?e.getRangeAt(0):null}function sn(e,t){let n=qi(e,t);return n===null?e:YN(n,GN(e))}function Q1(e,t){let n=qi(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let o=jN(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:YN(n,GN(e)),range:o}}function jN(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 YN(e,t){let{startContainer:n,startOffset:o,endContainer:r,endOffset:s}=e;return t==="backward"?{anchorNode:r,anchorOffset:s,direction:t,focusNode:n,focusOffset:o}:{anchorNode:n,anchorOffset:o,direction:t,focusNode:r,focusOffset:s}}function GN(e){return e.direction}function Ed(e){let t=e.getRootNode();return Yi(t)||Bo(t)?t.activeElement:null}function zi(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let n=t.shadowRoot.activeElement;if(n===null)break;t=n}return t}function x_(e){let t=e.target;if(t!==null&&we(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){let n=e.composedPath();if(n.length>0)return n[0]}return t}function Z1(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),We(e)&&M(102);let o=i=>{let a=i.getParentOrThrow(),l=We(a),c=i!==n||l?y_(i):i;if(l)return k(i)&&k(c)||M(133),i.insertAfter(c),[i,c,c];{let[u,d,f]=o(a),p=i.getNextSiblings();return f.append(c,...p),[u,d,c]}},[r,s]=o(n);return[r,s]}function eP(e){return we(e)&&e.tagName==="A"}function tP(e){return we(e)&&e.tagName==="TR"}function nP(e){return we(e)&&(e.tagName==="TD"||e.tagName==="TH")}function we(e){return Xi(e)&&e.nodeType===1}function Xi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function qN(e){return Xi(e)&&e.nodeType===11}var oP=/^(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 XN(e){return!(!we(e)||!e.style.display.startsWith("inline"))||oP.test(e.nodeName)}var rP=/^(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 v_(e){return(!we(e)||!e.style.display.startsWith("inline"))&&rP.test(e.nodeName)}function Rt(e){if(he(e)&&!e.isInline())return!0;if(!k(e)||We(e))return!1;let t=e.getFirstChild(),n=t===null||pn(t)||R(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function vo(){return ge()}function Kd(e=vo()){return e._config.dom||Kl}function Jt(e,t,n=vo()){let o=Kd(n).$getDOMSlot(e,t,n);return k(e)&&(JN(o)||M(344,e.getKey(),e.getType())),o}function sP(e,t,n,o){let r=e.read("latest",()=>{let s=Ee(t);return s!==null?(function(i,a,l=vo()){let c=Ns(i,a);if(c===null)return null;let u=l.getElementByKey(c.getKey());return u!==null?u.parentElement:null})(s,n,e):null});return r!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display=""),r}function iP(e,t,n){n.style.display="none";let o=e.getElementByKey(t);o!==null&&n.parentElement!==o&&o.insertBefore(n,o.firstChild)}function JN(e){return e instanceof td}function Po(e,t,n=vo()){return DN(Jt(e,t,n).element)}var bb=new WeakMap,aP=new Map;function Tm(e){if(!e._readOnly&&e.isEmpty())return aP;e._readOnly||M(192);let t=bb.get(e);return t||(t=(function(n){let o=new Map;for(let[r,s]of n._nodeMap){let i=s.__type,a=o.get(i);a||(a=new Map,o.set(i,a)),a.set(r,s)}return o})(e),bb.set(e,t)),t}function S_(e){let t=e.constructor.clone(e,a_);return t.afterCloneFrom(e),t}function lP(e){return(t=S_(e))[BE]=!0,t;var t}function QN(e,t){let n=e.getAttribute("data-lexical-indent");if(n!==null){let s=parseInt(n,10);if(Number.isFinite(s)&&s>=0)return void t.setIndent(s)}let o=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(o/40);t.setIndent(r)}function ZN(e,t){let n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}function eT(e,t){let n=t.style.textAlign;return n&&n in Ai?e.setFormat(n):e}function tT(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function C_(e){return e.__lexicalUnmanaged===!0}function nT(e,t=vo()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}function jl(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(we(n)&&n.hasAttribute("data-lexical-slot")||Ds(n,t)!==void 0)return!1;n=Ro(n)}return!1}function xl(e,t){return Ln(e,t)&&e[t]!==st[t]}var Yg=new WeakMap;function Wi(e){let t=Yg.get(e);return t!==void 0?t:(function(n){let o=n.prototype!=null&&Og in n.prototype?n.prototype[Og]():void 0,r=(function(u){if(!(u===st||u.prototype instanceof st)){let d="<unknown>",f="<unknown>";try{d=u.getType()}catch{}try{hr.version&&(f=JSON.parse(hr.version))}catch{}M(290,u.name,d,f)}return u===zl||u===oo||u===st})(n),s=!r&&xl(n,"getType")?n.getType:void 0,i=s&&!(Eb in s)?s.call(n):void 0,a,l=i;if(o)if(i)a=o[i];else{for(let[u,d]of Object.entries(o))l=u,a=d;if(!a)for(let u of Object.getOwnPropertySymbols(o)){let d=o[u];if(d){a=d;break}}}let c={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Ln(n.prototype,Og),klass:n,ownNodeConfig:a,ownNodeType:l},ownFieldsValidated:!1};Yg.set(n,c);try{let u=(function(h){let g=h.prototype,y=new Map,{fieldsBaseFirst:m}=ki(h);for(let[_,x]of m){let v=hP(h,_,x);if(v===null)continue;if(Fo(v)){let b=v.field;if(b==="__proto__"&&M(430,h.name,_),v.setterTable!==void 0){let{setterTable:N}=v,{meta:D}=x;for(let O of D.kind==="enum"?D.values:[x.defaultValue])Ln(N,String(O))||M(431,h.name,_,JSON.stringify(O))}y.set(_,{field:b,key:_,kind:"ownField",schema:x,setterTable:v.setterTable});continue}let S=g[v];typeof S!="function"&&M(432,h.name,_,v),y.set(_,{key:_,kind:"field",schema:x,setter:S})}return y.size===0?cP:[...y.values()]})(n),d=(function(h){let g=h.prototype,y=new Map;for(let[m,_]of ki(h).fieldsDerivedFirst){let x=pP(h,m,_);if(x===null)continue;if(Fo(x)){let S=x.field;S==="__proto__"&&M(426,h.name,m);let b=x.when,N;if(b!==void 0){let D=g[b];typeof D!="function"&&M(427,h.name,m,b),N=D}y.set(m,{defaultValue:_.defaultValue,derived:_.setter===null,field:S,getterTable:x.getterTable,isEqual:_.isEqual,key:m,kind:"ownField",schema:_,when:N});continue}let v=g[x];typeof v!="function"&&M(428,h.name,m,x),y.set(m,{defaultValue:_.defaultValue,derived:_.setter===null,getter:v,isEqual:_.isEqual,key:m,kind:"method",schema:_})}return y.size===0?fP:[...y.values()]})(n),f=ki(n),p=(function(h,g,y){let m,_=h;for(let{klass:x,ownNodeConfig:v}of zo(h))v&&v.generated!==void 0&&(m===void 0?(m=v.generated,_=x):v.generated===m&&(_=x));return m===void 0?null:_===h||(function(x,v){if(x.getters.length!==v.getters.length||x.setters.length!==v.setters.length)return!1;for(let S=0;S<x.getters.length;S++){let b=x.getters[S],N=v.getters[S];if(b.kind!==N.kind||b.key!==N.key||b.schema!==N.schema||b.derived!==N.derived||b.isEqual!==N.isEqual||!Object.is(b.defaultValue,N.defaultValue)||b.kind==="ownField"&&N.kind==="ownField"&&(b.field!==N.field||b.getterTable===void 0!=(N.getterTable===void 0)))return!1}for(let S=0;S<x.setters.length;S++){let b=x.setters[S],N=v.setters[S];if(b.kind!==N.kind||b.key!==N.key||b.schema!==N.schema||b.kind==="ownField"&&N.kind==="ownField"&&(b.field!==N.field||b.setterTable===void 0!=(N.setterTable===void 0)))return!1}return!0})(y,Nd(Wi(_)))?m:null})(n,0,{getters:d,setters:u});c.compiled={flatStates:f.flatStates,generated:p===null?null:p(f.fields),getters:d,isCompactDefault:gP(d),setters:u},(function(h,g,y,m){if(!g&&y){if(!xl(h,"getType")){let _=h,x=function(){return this!==_?st.getType.call(this):y};x[Eb]=!0,h.getType=x}if(xl(h,"clone")||(h.clone=(_,x)=>{i_(_);let v=new h;return x!==a_&&v.afterCloneFrom(_),v}),xl(h,"importJSON")||(h.importJSON=m&&m.$importJSON||(function(_){return x=>{let v=sT(_);return v.updateFromJSON===st.prototype.updateFromJSON?(function(S,b){return rT(S.__state||b[Dd]!==void 0?rE(S,b):S,b)})(v,x):v.updateFromJSON(x)}})(h)),!xl(h,"importDOM")&&m){let{importDOM:_}=m;_&&(h.importDOM=()=>_)}}})(n,r,l,a),(function(h){for(let{klass:g,ownNodeConfig:y}of zo(h)){let m=g.prototype;if(Ln(m,"afterCloneFrom"))continue;let _=xP(g);if(_.length===0)continue;let x=Object.getPrototypeOf(m),v=y&&y.generated!==void 0?Nd(Wi(g)).generated:null,S=v!==null&&v.afterCloneFrom||((b,N)=>{let D=b,O=N;for(let T=0;T<_.length;T++){let A=_[T];D[A]=O[A]}});m.afterCloneFrom=function(b){x.afterCloneFrom.call(this,b),S(this,b)},m.afterCloneFrom[yP]=!0}})(n)}catch(u){throw Yg.delete(n),u}return c})(e)}function Nd(e){let{compiled:t}=e;return t===void 0&&M(422,e.config.klass.name),t}var Eb=Symbol("lexical.synthesizedGetType"),cP=[];function oT(e,t,n,o){let r=n.method===void 0?o:n.method,s=ki(e).declaredBy.get(t);if(s===void 0)return n;let i=e.prototype,a=s.prototype;return Nb(i,a,r)&&Nb(i,a,o)?n:r}function Nb(e,t,n){return e[n]===t[n]}function Tb(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Ob(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var uP={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function ki(e){let t=Wi(e);return t.composed===void 0&&(t.composed=(function(n){let o=[],r=[],s=[];for(let{klass:u,ownNodeConfig:d}of zo(n)){let f=d&&d.json;r.push(u),o.push(f&&f.meta.kind==="node"?Object.entries(f.meta.fields):[]);let p=[];if(d&&d.stateConfigs)for(let h of d.stateConfigs)"stateConfig"in h&&h.flat&&p.push(h.stateConfig);s.push(p)}let i=new Map;for(let u=0;u<o.length;u++)for(let[d,f]of o[u])i.has(d)||i.set(d,f);let a=new Map,l=new Map,c=new Map;for(let u=o.length-1;u>=0;u--){for(let[d,f]of o[u]){let p=i.get(d);p===void 0||a.has(d)||a.set(d,p),p===void 0||f!==p||l.has(d)||l.set(d,r[u])}for(let d of s[u])c.has(d.key)||c.set(d.key,d)}return i.size===0&&c.size===0?uP:{declaredBy:l,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...c.values()]}})(e)),t.composed}function dP(e){let{fieldsDerivedFirst:t,flatStates:n}=ki(e),o={};for(let r of n)r.schema&&(o[r.key]=r.schema);for(let[r,s]of t)o[r]=s;return o}var fP=[];function pP(e,t,n){let o=n.getter;if(o===null)return null;let r=o===void 0?Ob(t):o;return Fo(r)?oT(e,t,r,Ob(t)):r}function hP(e,t,n){let o=n.setter;if(o===null)return null;let r=o===void 0?Tb(t):o;return Fo(r)?oT(e,t,r,Tb(t)):r}function Om(e,t){let{defaultValue:n,isEqual:o}=e;return t===void 0||t===n||o!==void 0&&o(t,n)}function gP(e){let t;return(n,o)=>{t===void 0&&(t=new Map(e.map(s=>[s.key,s])));let r=t.get(n);return r!==void 0&&Om(r,o)}}function mP(e){let{setterTable:t,schema:n}=e,{defaultValue:o}=n;return t===void 0?o:t[String(o)]}function rT(e,t){let n=Wi(e.constructor),{flatStates:o,generated:r,setters:s}=Nd(n),i=(function(a,l,c){let u=a;for(let d=0;d<c.length;d++){let f=c[d],p=l[f.key];if(p!==void 0){let h=f.parse(p);u=nE(u,f,()=>h)}}return u})(e,t,o);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(i,t):(function(a,l,c){for(let u=0;u<c.length;u++){let d=c[u],f=d.schema(l[d.key]);d.kind==="ownField"?a[d.field]=d.setterTable===void 0?f:Ln(d.setterTable,f)?d.setterTable[f]:mP(d):d.setter.call(a,f)}return a})(i,t,s)}function oc(e){return Wi(e).config}function _P(e){let t=[];for(let n of[e.getter,e.setter])Fo(n)&&n.field!=="__proto__"&&!t.includes(n.field)&&t.push(n.field);return t}var yP="__lexicalSynthesizedAfterCloneFrom";function Db(e){let{declaredBy:t,fieldsBaseFirst:n}=ki(e),o=[];for(let[r,s]of n)if(t.get(r)===e)for(let i of _P(s))o.includes(i)||o.push(i);return o}function xP(e){let t=Db(e);if(t.length===0)return t;let n=new Set;for(let{klass:o}of zo(e))if(o!==e)for(let r of Db(o))n.add(r);return n.size===0?t:t.filter(o=>!n.has(o))}function*zo(e){for(let t=e;t&&(t===st||Zm(t.prototype));){let n=oc(t),o=n.declaresOwnConfig;yield o?n:{...n,ownNodeConfig:void 0},t=o&&n.ownNodeConfig&&n.ownNodeConfig.extends||iT(t)}}function vP(e){let t=new Map,n=new Map;for(let o of e){let{ownNodeType:r}=oc(o);r&&(n.set(r,o),t.set(r,new Set))}for(let[o,r]of n)for(let{ownNodeType:s}of zo(r)){let i=s&&t.get(s);i&&i.add(o)}return t}function sT(e){let t=vo();dt();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),o=new n.klass;return n.replace===null?o:Gi(o)}var cr=(e,t)=>{let n=e;for(;n!=null&&!qe(n);){if(t(n))return n;n=n.getParent()}return null};function Yl(e,t){let n=[],o=e.__first;for(;o!==null;){let r=t===null?Ee(o):t.get(o);r==null&&M(174),n.push(o),o=r.__next}return n}function iT(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}var aT=new Map;function mr(e){return k(e)||he(e)}function vr(e){return k(e)||he(e)}function Nt(e){let t=e.getLatest();return vr(t)?t.__slotHost:null}function gn(e){let t=Nt(e);if(t===null)return null;let n=Ee(t);return k(n)||he(n)||M(370),n}function lT(e){let t=gn(e);if(t===null)return null;let n=e.getLatest().__key;for(let[o,r]of Ud(t))if(r===n)return o;return null}function Gl(e){let t=e.getLatest();for(;t!==null;){if(Nt(t)!==null)return t;t=t.getParent()}return null}function cT(e){if(e===null)return null;let t=K(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Gl(t)}function Ud(e){let t=e.getLatest();return mr(t)&&t.__slots!==null?t.__slots:aT}function yo(e){return Array.from(Ud(e).keys())}function Ns(e,t){let n=Ud(e).get(t);return n===void 0?null:Ee(n)}var SP=["__proto__","constructor","prototype"],wb=Symbol("slotMapOwner");function Dm(e){let t=e.__slots;return t!==null&&t[wb]===e||(t=new Map(t),t[wb]=e,e.__slots=t),t}var Mb=new WeakMap,CP=[];function uT(e){for(let{ownNodeConfig:t}of zo(e)){let n=t&&t.slots;if(n)return n}return CP}function dT(e){let t="";for(let n of yo(e)){let o=Ns(e,n);o!==null&&(t+=o.getTextContent())}return t}function kb(e,t,n){let o=n.get(e),r=n.get(t);return o!==void 0?r!==void 0?o-r:-1:r!==void 0?1:e<t?-1:e>t?1:0}function fT(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||M(373,t);let o=e.getLatest();if(o.__slots!==null&&o.__slots.get(t)===n.getLatest().__key)return o;(!k(n)&&!he(n)||n.isInline())&&M(374,n.__key);let r=e.getWritable(),s=Dm(r),i=s.get(t);i!==void 0&&pT(i);let a=n.getWritable(),l=gn(a);if(l!==null){let c=lT(a);c!==null&&Dm(l.getWritable()).delete(c),a.__slotHost=null}return Zn(a),a.__slotHost=r.__key,s.set(t,a.__key),(function(c){let u=c.__slots;if(u===null||u.size<2)return;let d=(function(g){let y=Mb.get(g);if(y===void 0){let m=uT(g),_=new Map;for(let x of m)SP.includes(x)&&M(371,g.name,x),_.has(x)&&M(372,g.name,x),_.set(x,_.size);y=_,Mb.set(g,y)}return y})(c.constructor),f=null,p=!0;for(let g of u.keys()){if(f!==null&&kb(f,g,d)>0){p=!1;break}f=g}if(p)return;let h=Array.from(u).sort(([g],[y])=>kb(g,y,d));u.clear();for(let[g,y]of h)u.set(g,y)})(r),ge()._slotsUsed=!0,yn()._slotsUsed=!0,r}function bP(e,t){let n=e.getWritable();if(n.__slots===null)return n;let o=n.__slots.get(t);return o!==void 0&&(pT(o),Dm(n).delete(t)),n}function pT(e){let t=Ee(e);if(t===null)return;let n=t.getWritable();vr(n)||M(377,e),n.__slotHost=null,n.remove()}var EP={next:"previous",previous:"next"},Ki=class{constructor(t){w(this,"origin");this.origin=t}[Symbol.iterator](){return N_({hasNext:Sr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Xe(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Xe(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),s=this,i=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){let c=l.origin.getWritable();a.set(c.getKey(),c)}for(let l of r){if(a.size>0){let c=s.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||s.origin.is(l))){let u=l.getParent();u&&u.is(i)&&l.remove(),c.replace(l)}}else c===null&&M(263,Array.from(a).join(" "))}else s.insert(l);s=Xe(l,this.direction)}for(let l of a.values())l.remove();return this}},ql=class e extends Ki{constructor(){super(...arguments);w(this,"type","child")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:zn(n,this.direction)}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return Xe(this.getNodeAtCaret(),n)||zn(this.origin,n)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)}isSamePointCaret(n){return this.isSameNodeCaret(n)}},NP={root:qe,shadowRoot:We};function Wo(e){return EP[e]}function b_(e,t="root"){return e===null||NP[t](e)?null:Nt(e)===null?e:null}var Ui=class e extends Ki{constructor(){super(...arguments);w(this,"type","sibling")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Xe(n,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return k(this.origin)?zn(this.origin,this.direction):null}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return Xe(this.getNodeAtCaret(),n)||zn(this.origin.getParentOrThrow(),n)}isSamePointCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)}isSameNodeCaret(n){return(n instanceof e||n instanceof Hi)&&this.direction===n.direction&&this.origin.is(n.origin)}},Hi=class e extends Ki{constructor(n,o){super(n);w(this,"type","text");w(this,"offset");this.offset=o}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Cr(n,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){return Cr(this.origin,Wo(this.direction),this.offset)}isSamePointCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)&&this.offset===n.offset}isSameNodeCaret(n){return(n instanceof Ui||n instanceof e)&&this.direction===n.direction&&this.origin.is(n.origin)}getSiblingCaret(){return Xe(this.origin,this.direction)}};function eo(e){return e instanceof Hi}function TP(e){return e instanceof Ki}function Sr(e){return e instanceof Ui}function Bn(e){return e instanceof ql}var OP={next:class extends Hi{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Hi{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},DP={next:class extends Ui{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Ui{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},wP={next:class extends ql{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends ql{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Xe(e,t){return e?new DP[t](e):null}function Cr(e,t,n){return e?new OP[t](e,to(e,n)):null}function to(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&km(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function wm(e,t){return new Td(e,t)}function zn(e,t){return k(e)?new wP[t](e):null}function hT(e){return e&&e.getChildCaret()||e}function Vi(e){return e&&hT(e.getAdjacentCaret())}var Mm=class e{constructor(t,n,o){w(this,"type","node-caret-range");w(this,"direction");w(this,"anchor");w(this,"focus");this.anchor=t,this.focus=n,this.direction=o}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 t=r=>{let s=this[r].getLatest();return eo(s)?(function(i,a){let{direction:l,origin:c}=i;return wm(i,to(c,a==="focus"?Wo(l):l)-i.offset)})(s,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:s}=o;if(r.isSameNodeCaret(s))return[wm(r,s.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=eo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=eo(o),s=i=>i.isSameNodeCaret(o)?null:Vi(i)||i.getParentCaret(t);return N_({hasNext:i=>i!==null&&!(r&&o.isSameNodeCaret(i)),initial:n.isSameNodeCaret(o)?null:s(n),map:i=>i,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Td=class{constructor(t,n){w(this,"type","slice");w(this,"caret");w(this,"distance");this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),s=t.getTextContent();return Cr(t.setTextContent(s.slice(0,o)+s.slice(r)),n,o)}};function MP(e){return e instanceof Td}function Wn(e,t){return e.direction===t?e:e.getFlipped()}function E_(e){return br(e,Wn(zn(Lt(),Wo(e.direction)),e.direction))}function gT(e){return br(e,e)}function br(e,t){return e.direction!==t.direction&&M(265),new Mm(e,t,e.direction)}function N_(e){let{initial:t,hasNext:n,step:o,map:r}=e,s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function Xl(e,t){let n=O_(e.origin,t.origin);switch(n===null&&M(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(s,i){return Math.sign(s-i)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return T_(n)}}function T_(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,s=t,i=n;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function Wu(e,t){return t.is(e)}function Ab(e){return k(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function O_(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=Ab(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=Ab(t);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(Wu(e,o)||M(276),{commonAncestor:o,type:"ancestor"}):r===null?(Wu(t,o)||M(277),{commonAncestor:o,type:"descendant"}):((k(s)||Wu(e,s))&&(k(r)||Wu(t,r))&&o.is(s.getParent())&&o.is(r.getParent())||M(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function kP(e){return e}function AP(...e){return e}function IP(...e){return e}function $P(e){return e}function RP(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function rc(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function PP(e,...t){let n=rc(...t);n.length>0&&e.classList.add(...n)}function LP(e,...t){let n=rc(...t);n.length>0&&e.classList.remove(...n)}function D_(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function FP(e,t,n){return D_(...Object.entries(t).map(([o,r])=>Qm(e,o,r,n)))}var C=w_,ZU=C.$addUpdateTag,Ji=C.$applyNodeReplacement,mT=C.$assumeActiveEditor,xn=C.$caretFromPoint,Nr=C.$caretRangeFromSelection,Hd=C.$cloneWithProperties,_T=C.$cloneWithPropertiesEphemeral,Qi=C.$comparePointCaretNext,Vd=C.$copyNode,yT=C.$create,eH=C.$createChildrenArray,jd=C.$createLineBreakNode,Yd=C.$createNodeSelection,it=C.$createParagraphNode,tH=C.$createPoint,xT=C.$createRangeSelection,nH=C.$createRangeSelectionFromDom,Gd=C.$createTabNode,Hn=C.$createTextNode,vT=C.$exportNodeJSON,qd=C.$extendCaretToRange,Me=C.$findMatchingParent,ST=C.$flushSyncAfterUpdate,CT=C.$formatText,Xd=C.$fullReconcile,bT=C.$generateNodesFromRawText,M_=C.$getAdjacentChildCaret,oH=C.$getAdjacentNode,Tr=C.$getAdjacentSiblingOrParentSiblingCaret,rH=C.$getCaretInDirection,so=C.$getCaretRange,Or=C.$getCaretRangeInDirection,ET=C.$getCharacterOffsets,Qt=C.$getChildCaret,k_=C.$getChildCaretAtIndex,A_=C.$getChildCaretOrSelf,ws=C.$getCollapsedCaretRange,sH=C.$getCommonAncestor,iH=C.$getCommonAncestorResultBranchOrder,NT=C.$getDOMSlot,TT=C.$getDOMTextNode,Ft=C.$getDocument,Ne=C.$getEditor,I_=C.$getEditorDOMRenderConfig,Ko=C.$getNearestNodeFromDOMNode,aH=C.$getNearestRootOrShadowRoot,Zi=C.$getNodeByKey,lH=C.$getNodeByKeyOrThrow,OT=C.$getNodeFromDOMNode,Ms=C.$getPreviousSelection,Ue=C.$getRoot,z=C.$getSelection,Jd=C.$getSelectionSlotFrame,Je=C.$getSiblingCaret,ea=C.$getSlot,Qd=C.$getSlotFrame,Zd=C.$getSlotHost,cH=C.$getSlotNameWithinHost,ks=C.$getSlotNames,ef=C.$getState,uH=C.$getStateChange,dH=C.$getTextContent,fH=C.$getTextNodeOffset,DT=C.$getTextPointCaret,pH=C.$getTextPointCaretSlice,hH=C.$getWritableNodeState,sc=C.$hasAncestor,gH=C.$hasUpdateTag,ta=C.$insertNodeToNearestRootAtCaret,wT=C.$insertNodes,na=C.$isBlockElementNode,MT=C.$isBlockFullySelected,Uo=C.$isChildCaret,mH=C.$isCompactExport,vn=C.$isDecoratorNode,kT=C.$isEditorState,_H=C.$isElementDOMSlot,W=C.$isElementNode,ic=C.$isExtendableTextPointCaret,yH=C.$isInlineElementOrDecoratorNode,xH=C.$isInlineFormattable,AT=C.$isLeafNode,$_=C.$isLexicalNode,Dr=C.$isLineBreakNode,vH=C.$isNodeCaret,De=C.$isNodeSelection,IT=C.$isParagraphNode,F=C.$isRangeSelection,As=C.$isRootNode,io=C.$isRootOrShadowRoot,$T=C.$isSelectionCapturedInDecoratorInput,tf=C.$isShadowRootNode,Ho=C.$isSiblingCaret,SH=C.$isSlotChild,ac=C.$isSlotHost,R_=C.$isTabNode,H=C.$isTextNode,ao=C.$isTextPointCaret,CH=C.$isTextPointCaretSlice,P_=C.$isTokenOrSegmented,bH=C.$isTokenOrTab,EH=C.$markSlotEditable,L_=C.$needsBlockCursorBeside,NH=C.$nodesOfType,Vn=C.$normalizeCaret,oa=C.$normalizeSelection__EXPERIMENTAL,TH=C.$onUpdate,RT=C.$parseSerializedNode,OH=C.$removeFromParent,DH=C.$removeSlot,PT=C.$removeTextFromCaretRange,Sn=C.$rewindSiblingCaret,nf=C.$selectAll,wH=C.$setCompositionKey,wr=C.$setDirectionFromDOM,Mr=C.$setFormatFromDOM,LT=C.$setPointFromCaret,Cn=C.$setSelection,jn=C.$setSelectionFromCaretRange,MH=C.$setSlot,of=C.$setState,FT=C.$setTextFormat,rf=C.$splitAtPointCaretNext,BT=C.$splitNode,zT=C.$updateDOMSelection,kH=C.$updateRangeSelectionFromCaretRange,AH=C.$withCompactExport,F_=C.ArtificialNode__DO_NOT_USE,IH=C.BEFORE_INPUT_COMMAND,$H=C.BLUR_COMMAND,lc=C.CAN_REDO_COMMAND,cc=C.CAN_UNDO_COMMAND,uc=C.CAN_USE_BEFORE_INPUT,bn=C.CAN_USE_DOM,WT=C.CLEAR_EDITOR_COMMAND,KT=C.CLEAR_HISTORY_COMMAND,sf=C.CLICK_COMMAND,RH=C.COLLABORATION_TAG,UT=C.COMMAND_PRIORITY_BEFORE_CRITICAL,PH=C.COMMAND_PRIORITY_BEFORE_EDITOR,LH=C.COMMAND_PRIORITY_BEFORE_HIGH,FH=C.COMMAND_PRIORITY_BEFORE_LOW,BH=C.COMMAND_PRIORITY_BEFORE_NORMAL,HT=C.COMMAND_PRIORITY_CRITICAL,te=C.COMMAND_PRIORITY_EDITOR,zH=C.COMMAND_PRIORITY_HIGH,Vo=C.COMMAND_PRIORITY_LOW,WH=C.COMMAND_PRIORITY_NORMAL,KH=C.COMPOSITION_END_COMMAND,VT=C.COMPOSITION_END_TAG,UH=C.COMPOSITION_START_COMMAND,jT=C.COMPOSITION_START_TAG,YT=C.CONTROLLED_TEXT_INSERTION_COMMAND,HH=C.CONTROL_OR_ALT,VH=C.CONTROL_OR_META,jH=C.CONTROL_OR_OTHER_KEY,af=C.COPY_COMMAND,GT=C.CUT_COMMAND,dc=C.CUT_TAG,B_=C.DEFAULT_EDITOR_DOM_CONFIG,lf=C.DELETE_CHARACTER_COMMAND,qT=C.DELETE_LINE_COMMAND,XT=C.DELETE_WORD_COMMAND,YH=C.DRAGEND_COMMAND,JT=C.DRAGOVER_COMMAND,QT=C.DRAGSTART_COMMAND,ZT=C.DROP_COMMAND,z_=C.DecoratorNode,lo=C.ElementNode,GH=C.FOCUS_COMMAND,eO=C.FORMAT_ELEMENT_COMMAND,tO=C.FORMAT_TEXT_COMMAND,cf=C.HISTORIC_TAG,ra=C.HISTORY_MERGE_TAG,nO=C.HISTORY_PUSH_TAG,oO=C.INDENT_CONTENT_COMMAND,qH=C.INPUT_COMMAND,W_=C.INSERT_LINE_BREAK_COMMAND,K_=C.INSERT_PARAGRAPH_COMMAND,rO=C.INSERT_TAB_COMMAND,sO=C.INTERNAL_$expandSelectionToWholeDocument,fc=C.INTERNAL_$isBlock,XH=C.IS_ALL_FORMATTING,iO=C.IS_ANDROID,aO=C.IS_ANDROID_CHROME,lO=C.IS_APPLE,uf=C.IS_APPLE_WEBKIT,U_=C.IS_BOLD,cO=C.IS_CHROME,uO=C.IS_CODE,df=C.IS_FIREFOX,dO=C.IS_HIGHLIGHT,pc=C.IS_IOS,H_=C.IS_ITALIC,ff=C.IS_SAFARI,V_=C.IS_STRIKETHROUGH,pf=C.IS_SUBSCRIPT,hf=C.IS_SUPERSCRIPT,j_=C.IS_UNDERLINE,fO=C.KEY_ARROW_DOWN_COMMAND,pO=C.KEY_ARROW_LEFT_COMMAND,hO=C.KEY_ARROW_RIGHT_COMMAND,gO=C.KEY_ARROW_UP_COMMAND,mO=C.KEY_BACKSPACE_COMMAND,_O=C.KEY_DELETE_COMMAND,yO=C.KEY_DOWN_COMMAND,xO=C.KEY_ENTER_COMMAND,vO=C.KEY_ESCAPE_COMMAND,JH=C.KEY_MODIFIER_COMMAND,SO=C.KEY_SPACE_COMMAND,CO=C.KEY_TAB_COMMAND,bO=C.LineBreakNode,EO=C.MOVE_TO_END,NO=C.MOVE_TO_START,QH=C.NODE_STATE_DIRECT,ZH=C.NODE_STATE_KEY,eV=C.NODE_STATE_LATEST,Y_=C.OUTDENT_CONTENT_COMMAND,gf=C.PASTE_COMMAND,mf=C.PASTE_TAG,TO=C.ParagraphNode,_f=C.REDO_COMMAND,OO=C.REMOVE_TEXT_COMMAND,yf=C.RootNode,DO=C.SELECTION_CHANGE_COMMAND,wO=C.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,MO=C.SELECT_ALL_COMMAND,kO=C.SET_TEXT_FORMAT_COMMAND,tV=C.SKIP_COLLAB_TAG,nV=C.SKIP_DOM_SELECTION_TAG,AO=C.SKIP_SCROLL_INTO_VIEW_TAG,IO=C.SKIP_SELECTION_FOCUS_TAG,En=C.TEXT_TYPE_TO_FORMAT,$O=C.TabNode,kr=C.TextNode,xf=C.UNDO_COMMAND,So=C.addClassNamesToElement,oV=C.aliasTableOf,rV=C.aliasedValue,sV=C.arrayValue,vf=C.booleanValue,iV=C.buildImportMap,aV=C.compileKeyboardShortcuts,lV=C.configExtension,sa=C.createCommand,Sf=C.createEditor,Cf=C.createRefCountedRegistry,cV=C.createSharedNodeState,bf=C.createState,uV=C.declarePeerDependency,dV=C.declaredAccepts,fV=C.defineExtension,RO=C.enumValue,PO=C.findAllLexicalElementsDeep,LO=C.flipDirection,FO=C.getActiveElement,Is=C.getActiveElementDeep,G_=C.getComposedEventTarget,pV=C.getComposedSchemaFields,hV=C.getComposedStaticRange,gV=C.getDOMOwnerDocument,Ar=C.getDOMSelection,mV=C.getDOMSelectionFromTarget,Ef=C.getDOMSelectionPoints,_V=C.getDOMSelectionRange,yV=C.getDOMSelectionRangeAndPoints,BO=C.getDOMShadowRoots,zO=C.getDOMTextNode,xV=C.getDeclaredSlots,Nf=C.getEditorPropertyFromDOMNode,WO=C.getNearestEditorFromDOMNode,hc=C.getParentElement,vV=C.getRegisteredNode,SV=C.getRegisteredNodeOrThrow,KO=C.getRegisteredSubtypeMap,$s=C.getRootOwnerDocument,UO=C.getStaticNodeConfig,gc=C.getStyleObjectFromCSS,CV=C.getTextDirection,bV=C.getTransformSetFromKlass,ia=C.getterTableOf,Ir=C.isBlockDomNode,EV=C.isCurrentlyReadOnlyMode,NV=C.isDOMCapturingSelection,Tf=C.isDOMDocumentNode,aa=C.isDOMNode,Of=C.isDOMShadowRoot,mc=C.isDOMTextNode,TV=C.isDOMUnmanaged,q_=C.isDocumentFragment,OV=C.isExactShortcutMatch,la=C.isHTMLAnchorElement,me=C.isHTMLElement,DV=C.isHTMLTableCellElement,wV=C.isHTMLTableRowElement,ca=C.isInlineDomNode,HO=C.isLastChildInBlockNode,Df=C.isLexicalEditor,MV=C.isModifierMatch,VO=C.isOnlyChildInBlockNode,kV=C.isSchemaField,AV=C.isSelectionCapturedInDecoratorInput,jO=C.isSelectionWithinEditor,YO=C.iterStaticNodeConfigChain,IV=C.keyboardEventMaskForPlatform,X_=C.makeStepwiseIterator,Se=C.mergeRegister,$V=C.mountSlotContainer,_c=C.nodeSchema,RV=C.normalizeClassNames,wf=C.nullable,PV=C.numberValue,LV=C.objectValue,FV=C.optional,BV=C.rawValue,Rs=C.registerEventListener,Mf=C.registerEventListeners,kf=C.removeClassNamesFromElement,zV=C.removeFromParent,WV=C.resetRandomKey,KV=C.safeCast,UV=C.setDOMStyleFromCSS,HV=C.setDOMStyleObject,VV=C.setDOMUnmanaged,$r=C.setNodeIndentFromDOM,ua=C.setterDefaultOf,da=C.setterTableOf,Bt=C.shallowMergeConfig,jV=C.stopLexicalPropagation,yc=C.stringValue,YV=C.toggleTextFormatType,GO=C.tokenizeRawText,GV=C.transformValue,qV=C.unionValue,XV=C.unmountSlotContainer,JV=C.withAccessors,Rr=C.withField;var qO=globalThis.React,Af=qO.Fragment,Tt=(e,t,n)=>qO.createElement(e,n===void 0?t:{...t,key:n}),If=Tt;var J_={};de(J_,{LexicalComposer:()=>zP});var BP=bn?fo:et,$f={tag:ra};function zP({initialConfig:e,children:t}){let n=Dn(()=>{let{theme:o,namespace:r,nodes:s,onError:i,onWarn:a,editorState:l,html:c}=e,u=yC(null,o),d=Sf({editable:e.editable,html:c,namespace:r,nodes:s,onError:f=>i(f,d),...a?{onWarn:f=>a(f,d)}:{},theme:o});return(function(f,p){if(p!==null){if(p===void 0)f.update(()=>{let h=Ue();if(h.isEmpty()){let g=it();h.append(g);let y=f.getRootElement(),m=bn&&y!==null?FO(y):null;(z()!==null||m!==null&&m===y)&&g.select()}},$f);else if(p!==null)switch(typeof p){case"string":{let h=f.parseEditorState(p);f.setEditorState(h,$f);break}case"object":f.setEditorState(p,$f);break;case"function":f.update(()=>{Ue().isEmpty()&&p(f)},$f)}}})(d,l),[d,u]},[]);return BP(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),Tt(_C.Provider,{value:n,children:t})}var WP=J_,XO=WP.LexicalComposer;var Q_={};de(Q_,{useLexicalSubscription:()=>UP});var KP=bn?fo:et;function UP(e){let[t]=Yt(),n=Dn(()=>e(t),[t,e]),[o,r]=Ie(()=>n.initialValueFn()),s=Xo(o);return KP(()=>{let{initialValueFn:i,subscribe:a}=n,l=i();return s.current!==l&&(s.current=l,r(l)),a(c=>{s.current=c,r(c)})},[n,e]),o}var HP=Q_,JO=HP.useLexicalSubscription;var Z_={};de(Z_,{useLexicalEditable:()=>jP});function VP(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function jP(){return JO(VP)}var YP=Z_,QO=YP.useLexicalEditable;var ey={};de(ey,{getKnownTypesAndNodes:()=>GP,getNodeConfig:()=>ZO});function GP(e){let t=new Set,n=new Set;for(let o of ZO(e)){let r=typeof o=="function"?o:o.replace;UO(r),t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function ZO(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var eD=ey,tD=eD.getKnownTypesAndNodes,nD=eD.getNodeConfig;var ty={};de(ty,{InitialStateExtension:()=>XP});var oD={tag:ra};function qP(){let e=Ue();e.isEmpty()&&e.append(it())}var XP={config:{setOptions:oD,updateOptions:oD},init:({$initialEditorState:e=qP})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(kT(s))e.setEditorState(s,n);else if(typeof s=="function")e.update(()=>{s(e)},t);else if(s&&(typeof s=="string"||typeof s=="object")){let i=e.parseEditorState(s);e.setEditorState(i,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[yf,kr,bO,$O,TO]};var JP=ty,rD=JP.InitialStateExtension;var iy={};de(iy,{LexicalBuilder:()=>Pf,buildEditorFromExtensions:()=>nL,builderSymbol:()=>sy});function ke(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function QP(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var ZP=QP(),eL=new Set(["__proto__","constructor","prototype"]);function iD(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)!eL.has(r)&&Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=iD(n[r],o[r]));return e}return t}function ny(e){return e.id===0}function aD(e){return e.id===2}var tL=new Set,ry=class{constructor(t,n){w(this,"builder");w(this,"configs");w(this,"_dependency");w(this,"_peerNameSet");w(this,"extension");w(this,"state");w(this,"_signal");this.builder=t,this.extension=n,this.configs=new Set,this.state={id:0}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Bt;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;aD(n)||ke(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,c){return Object.assign(a,{config:l,id:3,registerState:c})})(n,this.mergeConfigs(),o),i;this.state=s,this.extension.init&&(i=this.extension.init(t,s.config,o)),this.state=(function(a,l,c){return Object.assign(a,{id:4,initResult:l,registerState:c})})(s,i,r)}build(t){let n=this.state,o;n.id!==4&&ke(307,String(n.id),String(5)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(s,i,a){return Object.assign(s,{id:5,output:i,registerState:a})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==5&&ke(308,String(o.id),String(5));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(s){return Object.assign(s,{id:6})})(o),()=>{let s=this.state;s.id!==7&&ke(309,String(o.id),String(7)),this.state=(function(i){return Object.assign(i,{id:5})})(s),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==6&&ke(310,String(n.id),String(6)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:7})})(n),o}getSignal(){return this._signal===void 0&&ke(311),this._signal}getInitResult(){this.extension.init===void 0&&ke(312,this.extension.name);let t=this.state;return(function(n){return n.id>=4})(t)||ke(313,String(t.id),String(4)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=3})(t)||ke(314,String(t.id),String(3)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&ke(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&ke(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=7})(t)||ke(316,String(t.id),String(7)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||tL}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=5})(t)||ke(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},sy=Symbol.for("@lexical/extension/LexicalBuilder");function nL(...e){return Pf.fromExtensions(e).buildEditor()}function sD(){}function oL(e){throw e}function Rf(e){return Array.isArray(e)?e:[e]}var oy=ZP,Pf=class e{constructor(t){w(this,"roots");w(this,"extensionNameMap");w(this,"outgoingConfigEdges");w(this,"incomingEdges");w(this,"conflicts");w(this,"_sortedExtensionReps");w(this,"PACKAGE_VERSION");this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=oy,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[Rf(rD)];for(let o of t)n.push(Rf(o));return new e(n)}static maybeFromEditor(t){let n=t[sy];return n&&(n.PACKAGE_VERSION!==oy&&ke(292,n.PACKAGE_VERSION,oy),n instanceof e||ke(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&ke(294),n}constructEditor(){let{$initialEditorState:t,onError:n,onWarn:o,...r}=this.buildCreateEditorArgs(),s=Object.assign(Sf({...r,...n?{onError:i=>{n(i,s)}}:{},...o?{onWarn:i=>{o(i,s)}}:{}}),{[sy]:this});for(let i of this.sortedExtensionReps())i.build(s);return s}buildEditor(){let t=sD;function n(){try{t()}finally{t=sD}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Se(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&ke(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);if(r){let i=r.get(n);i?i.push(...o):r.set(n,o)}else this.outgoingConfigEdges.set(t,new Map([[n,o]]));let s=this.incomingEdges.get(n);s?s.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&ke(296);let n=Rf(t),[o]=n;typeof o.name!="string"&&ke(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&ke(298,o.name),!r){r=new ry(this,o),this.extensionNameMap.set(o.name,r);let s=this.conflicts.get(o.name);typeof s=="string"&&ke(299,o.name,s);for(let i of o.conflictsWith||[])this.extensionNameMap.has(i)&&ke(299,o.name,i),this.conflicts.set(i,o.name);for(let i of o.dependencies||[]){let a=Rf(i);this.addEdge(o.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[i,a]of o.peerDependencies||[])this.addEdge(o.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let s=o.state;if(aD(s))return;let i=o.extension.name;var a;ny(s)||ke(300,i,r||"[unknown]"),ny(a=s)||ke(304,String(a.id),String(0)),s=Object.assign(a,{id:1}),o.state=s;let l=this.outgoingConfigEdges.get(i);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&n(u,i)}s=(function(c){return(function(u){return u.id===1})(c)||ke(305,String(c.id),String(1)),Object.assign(c,{id:2})})(s),o.state=s,t.push(o)};for(let o of this.extensionNameMap.values())ny(o.state)&&n(o);for(let o of t)for(let[r,s]of this.outgoingConfigEdges.get(o.extension.name)||[])if(s.length>0){let i=this.extensionNameMap.get(r);if(i)for(let a of s)i.configs.add(a)}for(let[o,...r]of this.roots)if(r.length>0){let s=this.extensionNameMap.get(o.name);s===void 0&&ke(301,o.name);for(let i of r)s.configs.add(i)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],s=o.signal;for(let i of n){let a=i.register(t,s);a&&r.push(a)}for(let i of n){let a=i.afterRegistration(t);a&&r.push(a)}return Se(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,s={},i={},a=this.sortedExtensionReps();for(let u of a){let{extension:d}=u;if(d.onError!==void 0&&(t.onError=d.onError),d.onWarn!==void 0&&(t.onWarn=d.onWarn),d.disableEvents!==void 0&&(t.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(t.parentEditor=d.parentEditor),d.editable!==void 0&&(t.editable=d.editable),d.namespace!==void 0&&(t.namespace=d.namespace),d.$initialEditorState!==void 0&&(t.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of nD(d)){if(typeof f!="function"){let p=o.get(f.replace);p&&ke(302,d.name,f.replace.name,p.extension.name),o.set(f.replace,u)}n.add(f)}if(d.html){if(d.html.export)for(let[f,p]of d.html.export.entries())r.set(f,p);d.html.import&&Object.assign(s,d.html.import)}d.theme&&iD(i,d.theme)}Object.keys(i).length>0&&(t.theme=i),n.size&&(t.nodes=Array.from(n));let l=Object.keys(s).length>0,c=r.size>0;(l||c)&&(t.html={},l&&(t.html.import=s),c&&(t.html.export=r));for(let u of a)u.init(t);return t.onError||(t.onError=oL),t}};var ay=iy,fa=ay.LexicalBuilder,xj=ay.buildEditorFromExtensions,vj=ay.builderSymbol;var ly={};de(ly,{ReactProviderExtension:()=>rL});var rL={name:"@lexical/react/ReactProvider"};var sL=ly,lD=sL.ReactProviderExtension;var uy={};de(uy,{$canShowPlaceholder:()=>uD,$canShowPlaceholderCurry:()=>aL,$findTextIntersectionFromCharacters:()=>lL,$isRootTextContentEmpty:()=>cy,$isRootTextContentEmptyCurry:()=>iL,$rootTextContent:()=>cD,registerLexicalTextEntity:()=>uL});function cD(){return Ue().getTextContent()}function cy(e,t=!0){if(e)return!1;let n=cD();return t&&(n=n.trim()),n===""}function iL(e,t){return()=>cy(e,t)}function uD(e){if(!cy(e,!1))return!1;let t=Ue().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(vn(r))return!1;if(W(r)){if(!IT(r)||r.__indent!==0)return!1;let s=r.getChildren(),i=s.length;for(let a=0;a<i;a++){let l=s[a];if(!H(l))return!1}}}return!0}function aL(e){return()=>uD(e)}function lL(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(W(n)){let i=n.getFirstChild();if(i!==null){n=i;continue}}else if(H(n)){let i=n.getTextContentSize();if(o+i>t)return{node:n,offset:t-o};o+=i}let r=n.getNextSibling();if(r!==null){n=r;continue}let s=n.getParent();for(;s!==null;){let i=s.getNextSibling();if(i!==null){n=i;continue e}s=s.getParent()}break}return null}function cL(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function uL(e,t,n,o){let r=i=>i instanceof n,s=i=>{let a=Hn(i.getTextContent()).setFormat(i.getFormat()).setStyle(i.getStyle()).setDetail(i.getDetail());i.replace(a)};return[e.registerNodeTransform(kr,i=>{if(!i.isSimpleText())return;let a,l=i.getPreviousSibling(),c=i.getTextContent(),u=i;if(H(l)){let f=l.getTextContent(),p=t(f+c);if(r(l)){if(p===null||(h=>h.getLatest().__mode)(l)!==0)return void s(l);{let h=p.end-f.length;if(h>0){let g=f+c.slice(0,h);if(l.select(),l.setTextContent(g),h===c.length)i.remove();else{let y=c.slice(h);i.setTextContent(y)}return}}}else if(p===null||p.start<f.length)return}let d=0;for(;;){let f=c;a=t(f);let p=a===null?"":f.slice(a.end);if(c=p,p===""){let y=u.getNextSibling();if(H(y)){let m=f+y.getTextContent(),_=t(m);if(_===null)return void(r(y)?s(y):y.markDirty());if(a===null||_.start!==a.start)return}}if(a===null)return;if(a.start===0&&H(l)&&l.isTextEntity()){d+=a.end;continue}let h;a.start===0?[h,u]=u.splitText(a.end):[,h,u]=u.splitText(a.start+d,a.end+d),h===void 0&&cL(165,"nodeToReplace");let g=o(h);if(g.setFormat(h.getFormat()).setStyle(h.getStyle()).setDetail(h.getDetail()),h.replace(g),u==null)return;d=0,l=g}}),e.registerNodeTransform(n,i=>{let a=i.getTextContent(),l=t(a);if(l===null||l.start!==0)return void s(i);if(a.length>l.end)return void i.splitText(l.end);let c=i.getPreviousSibling();H(c)&&c.isTextEntity()&&(s(c),s(i));let u=i.getNextSibling();H(u)&&u.isTextEntity()&&(s(u),r(i)&&s(i))})]}var Ps=uy,Ej=Ps.$canShowPlaceholder,Lf=Ps.$canShowPlaceholderCurry,Nj=Ps.$findTextIntersectionFromCharacters,Tj=Ps.$isRootTextContentEmpty,Oj=Ps.$isRootTextContentEmptyCurry,Dj=Ps.$rootTextContent,wj=Ps.registerLexicalTextEntity;var dy={};de(dy,{batch:()=>Oe,computed:()=>wa,effect:()=>gt,signal:()=>wn,untracked:()=>ie});var xc=dy,vc=xc.batch,dD=xc.computed,Ae=xc.effect,St=xc.signal,Aj=xc.untracked;var fy={};de(fy,{namedSignals:()=>dL});function dL(e,t={}){let n={};for(let o in e){let r=t[o],s=St(r===void 0?e[o]:r);n[o]=s}return n}var fL=fy,Qe=fL.namedSignals;var py={};de(py,{watchedSignal:()=>pL});function pL(e,t){let n;return St(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var hL=py,Pr=hL.watchedSignal;var hy={};de(hy,{DragonExtension:()=>xL,installDragonSupport:()=>mL,registerDragonSupport:()=>hD});var gL={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Ff=Symbol.for("@lexical/dragon/WindowState");function mL(e=(function(){return typeof window<"u"?window:void 0})()){return e?pD(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function pD(e,t,n){let o=(function(r){let s=r[Ff];return s===void 0&&(s={dispose:()=>{},editors:new Map,installs:new Set},r[Ff]=s),s})(e);if(o.installs.size===0){let r=yL.bind(e);e.addEventListener("message",r,!0),o.dispose=()=>{e.removeEventListener("message",r,!0)}}if(o.installs.add(t),n){let r=o.editors.get(n)||new Set;r.add(t),o.editors.set(n,r)}return _L.bind(null,e,o,t,n)}function _L(e,t,n,o){if(o){let r=t.editors.get(o);r&&r.delete(n)&&r.size===0&&t.editors.delete(o)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[Ff])}function fD(e){return e&&e.ownerDocument.defaultView}function hD(e){let t=Pr(()=>fD(e.getRootElement()),n=>e.registerRootListener(o=>{n.value=fD(o)}));return Ae(()=>{let n=t.value;if(n)return pD(n,Symbol("@lexical/dragon/editorInstall"),e)})}function yL(e){if(e.origin!==this.location.origin)return;let t=(function(o){let r=o[Ff];if(r===void 0)return null;let s=Nf(Is(o.document));return Df(s)&&r.editors.has(s)?s:null})(this);if(t===null)return;let n=e.data;if(typeof n=="string"){let o;try{o=JSON.parse(n)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){let r=o.payload;if(r&&r.functionId==="makeChanges"){let s=r.args;if(Array.isArray(s)){let[i,a,l,c,u,d]=s;if(![i,a,c,u].every(Number.isFinite)||typeof l!="string"&&l!==-1)return;t.update(()=>{let f=z();if(F(f)){let p=f.anchor,h=p.getNode(),g=0,y=0;if(H(h)&&i>=0&&a>=0&&(g=i,y=i+a,f.setTextNodeRange(h,g,h,y)),typeof l!="string"||g===y&&l===""||(f.insertRawText(l),h=p.getNode()),H(h)){let m=h.getTextContentSize();g=Math.min(Math.max(c,0),m),y=c<0||u<0?g:Math.min(c+u,m),f.setTextNodeRange(h,g,h,y)}if(typeof d=="string"&&u>0&&!f.isCollapsed()){let m=gL[d];m!==void 0&&f.formatText(m)}e.stopImmediatePropagation()}})}}}}}var xL={build:(e,t,n)=>Qe(t),config:{disabled:typeof window>"u"},name:"@lexical/dragon",register:(e,t,n)=>Ae(()=>n.getOutput().disabled.value?void 0:hD(e))};var gy=hy,gD=gy.DragonExtension,Kj=gy.installDragonSupport,mD=gy.registerDragonSupport;var my={};de(my,{getPeerDependencyFromEditor:()=>_D,getPeerDependencyFromEditorOrThrow:()=>vL});function _D(e,t){let n=fa.maybeFromEditor(e);if(!n)return;let o=n.extensionNameMap.get(t);return o?o.getExtensionDependency():void 0}function vL(e,t){let n=_D(e,t);return n===void 0&&(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(291,t),n}var yD=my,co=yD.getPeerDependencyFromEditor,Vj=yD.getPeerDependencyFromEditorOrThrow;var Cy={};de(Cy,{$addNodeStyle:()=>OL,$cloneWithProperties:()=>Hd,$copyBlockFormatIndent:()=>TD,$ensureForwardRangeSelection:()=>ND,$forEachSelectedTextNode:()=>ED,$getComputedStyleForElement:()=>xy,$getComputedStyleForParent:()=>vy,$getSelectionStyleValueForProperty:()=>RL,$isAtEdgeOfElement:()=>OD,$isAtNodeEnd:()=>TL,$isParentElementRTL:()=>Sy,$isParentRTL:()=>EL,$moveCaretSelection:()=>MD,$moveCharacter:()=>IL,$patchStyleText:()=>DL,$selectAll:()=>nf,$setBlocksType:()=>wL,$shouldOverrideDefaultCharacterSelection:()=>AL,$sliceSelectedTextNodeContent:()=>NL,$trimTextContentFromAnchor:()=>bD,$wrapNodes:()=>kL,createDOMRange:()=>CL,createRectsFromDOMRange:()=>bL,getCSSFromStyleObject:()=>CD,getStyleObjectFromCSS:()=>PL,trimTextContentFromAnchor:()=>LL});function yy(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function SL(e){return()=>{}}function xD(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function vD(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function CL(e,t,n,o,r){let s=t.getKey(),i=o.getKey(),a=$s(e.getRootElement()).createRange(),l=e.getElementByKey(s),c=e.getElementByKey(i),u=n,d=r;if(H(t)&&(l=xD(l)),H(o)&&(c=xD(c)),t===void 0||o===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=vD(l)),c.nodeName==="BR"&&([c,d]=vD(c));let f=l.firstChild;l===c&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{a.setStart(l,u),a.setEnd(c,d)}catch{return null}return!a.collapsed||u===d&&s===i||(a.setStart(c,d),a.setEnd(l,u)),a}function bL(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(t.getClientRects()),a,l=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<l;c++){let u=i[c],d=a&&a.top<=u.top&&a.bottom>=u.bottom&&a.left<=u.left&&a.right>=u.right,f=u.width+s===o.width;d||f?(i.splice(c--,1),l--):a=u}return i}function CD(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function xy(e){let t=Ne().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function vy(e){let t=As(e)?e:e.getParent();return t&&xy(t)}function EL(e){let t=vy(e);return t!==null&&t.direction==="rtl"}function NL(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!P_(t)&&o!==null){let[r,s]=o,i=e.isBackward(),a=r.getNode(),l=s.getNode(),c=t.is(a),u=t.is(l);if(c||u){let[d,f]=ET(e),p=a.is(l),h=t.is(i?l:a),g=t.is(i?a:l),y,m=0;p?(m=d>f?f:d,y=d>f?d:f):h?(m=i?f:d,y=void 0):g&&(m=0,y=i?d:f);let _=t.__text.slice(m,y);_!==t.__text&&(n==="clone"&&(t=_T(t)),t.__text=_)}}return t}function TL(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return W(t)||yy(177),e.offset===t.getChildrenSize()}function bD(e,t,n){let o=t.getNode(),r=n;if(W(o)){let s=o.getDescendantByIndex(t.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(W(o)){let c=o.getLastDescendant();c!==null&&(o=c)}let s=o.getPreviousSibling(),i=0;if(s===null){let c=o.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let a=o.getTextContent();a===""&&W(o)&&!o.isInline()&&(a=`
76
+ `?t.linebreak():n===" "?t.tab():n!==""&&t.text(n)}function o_(e){let t=[];return cN(e,{linebreak:()=>t.push(Pd()),tab:()=>t.push(qE()),text:n=>t.push(rn(n))}),t}function d1(){let e=ce();return e===null?"":e.getTextContent()}function Cm(e){let t=[];for(let n of e)pn(n)||(!k(n)&&!he(n)||n.isInline()?t.push(n):k(n)&&t.push(...Cm(n.getChildren())));return t}function _l(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let o=ce();K(o)&&(n=o),K(n)||M(161);let r=n.anchor,s=r.getNode(),i=r.offset;for(;!Rt(s)&&Nt(s)===null;){let a=s;if([s,i]=f1(s,i,t),a.is(s))break}return[s,i]}function f1(e,t,n=!1){let o=e.getParent();if(!o){let s=qt();return Lt().append(s),s.select(),[Lt(),0]}if(R(e)){let s=e.splitText(t);if(s.length===0)return[o,e.getIndexWithinParent()];let i=t===0?0:1;return[o,s[0].getIndexWithinParent()+i]}if(!k(e)||t===0)return[o,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let s=new Cs(oo(e.__key,t,"element"),oo(e.__key,t,"element"),0,""),i=e.insertNewAfter(s);if(i)i.append(r,...r.getNextSiblings());else if(n)return[e,t]}return[o,e.getIndexWithinParent()+1]}function ub(e){return pn(e)||zN(e)||R(e)||e.isParentRequired()}function zg(e){let t=qt(),n=null;for(let o=0;o<e.length;o++){let r=e[o];if(ub(r)){if(n===null){n=r.createParentElementNode(),t.append(n);let s=e[o+1];if(pn(r)&&(s===void 0||!ub(s)))continue}n.append(r)}else t.append(r),n=null}return t}function gd(e,t,n,o,r="decorators-and-blocks"){if(t==="move"&&o==="character"&&!e.isCollapsed()){let[d,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}let s=$o(e.focus,n?"previous":"next"),i=o==="lineboundary",a=t==="move",l=s,c=r==="decorators-and-blocks",u=!1;if(!SN(l)){for(let d of l){c=!1;let{origin:f}=d;if(he(f)){if(f.isIsolated()){u=!0;break}if(l=d,i&&f.isInline())continue}break}if(u)return!0;if(c)for(let d of E_(s).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(zn(d))d.origin.isInline()||(l=d);else{if(k(d.origin))continue;he(d.origin)&&!d.origin.isInline()&&(l=d)}break}}if(l===s)return!1;if(a&&!i&&he(l.origin)&&l.origin.isKeyboardSelectable()){let d=n_();return d.add(l.origin.getKey()),Pt(d),!0}return l=hn(l),a&&bs(e.anchor,l),bs(e.focus,l),c||!i}var vt=null,Ge=null,Gt=!1,Wg=!1,Ju=!1,Kg=new Set,Ug=new Set,Qu=0,db={characterData:!0,childList:!0,subtree:!0};function yr(){return Gt||vt!==null&&vt._readOnly}function dt(){Gt&&M(13)}function uN(){Qu>99&&M(14)}function yn(){return vt===null&&M(195,fN()),vt}function p1(e){yn()!==null&&Ge===null&&(Ge=e),Ge!==e&&km(378)}function ge(){return Ge===null&&M(337,fN()),Ge}function dN(){ge()._dirtyType=2}function fN(){let e=0,t=new Set,n=hr.version;if(typeof window<"u")for(let r of HN(document)){let s=nc(r);if(zd(s))e++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===n&&(i+=" (separately built, likely a bundler configuration issue)"),t.add(i)}}let o=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(o+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),o}function pN(){return Ge}function fb(e,t,n){let o=t.__type,r=l_(e,o),s=n.get(o);s===void 0&&(s=Array.from(r.transforms),n.set(o,s));let i=s.length;for(let a=0;a<i&&(s[a](t),t.isAttached());a++);}function pb(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function hN(e,t){if(!t)return;let n=e._updateTags,o=t;Array.isArray(t)||(o=[t]);for(let r of o)n.add(r)}function h1(e){return md(e,ge()._nodes)}function md(e,t){let n=e.type,o=t.get(n);o===void 0&&M(17,n);let r=o.klass;e.type!==r.getType()&&M(18,r.name);let s=r.importJSON(e),i=e.children;if(k(s)&&Array.isArray(i))for(let l=0;l<i.length;l++){let c=md(i[l],t);s.append(c)}let a=e.$slots;if(a){mr(s)||M(379,r.name);for(let l in a)pT(s,l,md(a[l],t))}return s}function hb(e,t,n){let o=vt,r=Gt,s=Ge;vt=t,Gt=!0,Ge=e;try{return n()}finally{vt=o,Gt=r,Ge=s}}function pr(e,t){let n=Ju;Ju=!0;try{let o=(function(r){if(Ug.has(r))return!1;Ug.add(r);try{for(let s=0;r._pendingEditorState!==null;s++){let i=r._pendingEditorState._selection,a=r._rootElement;if(!gN(r,i))return!1;let l=(i===null||K(i))&&(r._headless||a===null||!a.isConnected);if(l||s===100)return r._lastNotifiedSelection=i===null?null:i.clone(),!l;Pi(r,()=>r.dispatchCommand(Rd),void 0,!0)}return!1}finally{Ug.delete(r)}})(e);(function(r,s){let i=r._pendingEditorState,a=r._rootElement,l=r._headless||a===null;if(i===null)return void(!r._updating&&r._deferred.length>0&&gb(r,r._deferred));let c=r._editorState,u=c._selection,d=i._selection,f=r._dirtyType!==0,p=vt,h=Gt,g=Ge,y=r._updating,m=r._observer,_=null;if(r._pendingEditorState=null,r._editorState=i,!l&&f&&m!==null){Ge=r,vt=i,Gt=!1,r._updating=!0;try{let T=r._dirtyType,A=r._dirtyElements,$=r._dirtyLeaves;m.disconnect(),_=gR(c,i,r,T,A,$)}catch(T){if(T instanceof Error&&r._onError(T),Wg)throw T;return TN(r,null,a,i),qb(r),r._dirtyType=2,Wg=!0,pr(r,c),void(Wg=!1)}finally{m.observe(a,db),r._updating=y,vt=p,Gt=h,Ge=g}}i._readOnly||(i._readOnly=!0);let x=r._dirtyLeaves,v=r._dirtyElements,S=r._normalizedNodes,b=r._updateTags;f&&(r._dirtyType=0,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set),r._updateTags=new Set;let N=r._deferred;y||(r._deferred=[]),(function(T,A){let $=T._decorators,I=T._pendingDecorators||$,L=A._nodeMap,P;for(P in I)L.has(P)||(I===$&&(I=AN(T)),delete I[P])})(r,i);let D=l?null:Hn(an(r));if(r._editable&&D!==null&&(f||d===null||d.dirty||!d.is(u))&&a!==null&&!b.has(UE)){Ge=r,vt=i;try{if(m!==null&&m.disconnect(),f||d===null||d.dirty){let T=r._blockCursorElement;T!==null&&bd(T,r,a),lN(u,d,r,D,b,a)}(function(T,A,$){let I=T._blockCursorElement;if(K($)&&$.isCollapsed()&&$.anchor.type==="element"&&A.contains(Ed(A))){let L=$.anchor,P=L.getNode(),Y=L.offset,Q=!1,ee=null;if(Y===P.getChildrenSize())Cd(P.getChildAtIndex(Y-1))&&(Q=!0);else{let Z=P.getChildAtIndex(Y);Z!==null&&Cd(Z)&&(Q=!0,ee=T.getElementByKey(Z.__key))}if(Q){let Z=Jt(P,T.getElementByKey(P.__key),T).element;return I===null&&(T._blockCursorElement=I=(function(ne){let ae=ne.theme,xe=Xt().createElement("div");xe.contentEditable="false",xe.setAttribute("data-lexical-cursor","true");let ue=ae.blockCursor;if(ue!==void 0){if(typeof ue=="string"){let q=rc(ue);ue=ae.blockCursor=q}ue!==void 0&&xe.classList.add(...ue)}return xe})(T._config)),A.style.caretColor="transparent",void(ee===null?Z.appendChild(I):Z.insertBefore(I,ee))}}I!==null&&bd(I,T,A)})(r,a,d)}finally{m!==null&&m.observe(a,db),Ge=g,vt=p}}_!==null&&(function(T,A,$,I,L){let P=Array.from(T._listeners.mutation),Y=P.length;for(let Q=0;Q<Y;Q++){let[ee,Z]=P[Q];for(let ne of Z){let ae=A.get(ne);ae!==void 0&&ee(ae,{dirtyLeaves:I,prevEditorState:L,updateTags:$})}}})(r,_,b,x,c);let O=r._pendingDecorators;O!==null&&(r._decorators=O,r._pendingDecorators=null,El("decorator",r,!0,O)),(function(T,A,$){let I=xb(A),L=xb($);I!==L&&El("textcontent",T,!0,L)})(r,s||c,i),El("update",r,!0,{dirtyElements:v,dirtyLeaves:x,editorState:i,mutatedNodes:_,normalizedNodes:S,prevEditorState:s||c,tags:b}),y||gb(r,N),(function(T){let A=T._updates;if(A.length===0)return void(T._cascadeCount=0);if((function(I){Kg.has(I)||(Kg.add(I),setTimeout(()=>{Kg.delete(I),I._cascadeCount=0},0))})(T),T._cascadeCount++>99)return T._updates=[],T._cascadeCount=0,void T._onWarn(Gg(437,T._config.namespace));let $=A.shift();if($){let[I,L]=$;Pi(T,I,L)}})(r)})(e,t),o&&e._onWarn(Gg(436))}finally{Ju=n}}function El(e,t,n,...o){let r=t._updating;t._updating=n;try{let s=t._listeners[e],i=Array.from(s);for(let[a,l]of i){l&&l();let c=a(...o),u=typeof c=="function"?c:void 0;s.has(a)?s.set(a,u):u&&u()}}finally{t._updating=r}}function gN(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function bm(e,t,n,o){let r=d_(e),s;if(!Ju)for(let i=0;i<r.length;i++)r[i]._updating||(r[i]._cascadeCount=0);if(t===Rd){if(Ge!==e||Gt){let a=!1;return mn(e,()=>{a=bm(e,t,n,o)}),a}let i=yn()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let i=4;i>=0;i--)for(let a=0;a<r.length;a++){let l=r[a];if(a>0&&l._updating){s=l;break}let c=l._commands.get(t);if(c!==void 0){let u=c[i];if(u.size>0){let d=!1;if(mn(l,()=>{for(let f of u)if(f(n,o))return void(d=!0)}),d)return d}}}return s&&s.update(()=>{bm(s,t,n,o)}),!1}function gb(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let o=0;o<t.length;o++)t[o]()}finally{e._updating=n}}}function mb(e,t){let n=e._updates,o=t||!1;for(;n.length!==0;){let r=n.shift();if(r){let[s,i]=r,a=e._pendingEditorState,l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(a===null&&M(191),a._flushSync=!0),l&&e._deferred.push(l),hN(e,i.tag)),a==null?Pi(e,s,i):s()}}return o}function g1(){let e=yn();dt(),e._flushSync=!0}function Pi(e,t,n,o=!1){let r=e._updateTags,s,i=!1,a=!1;n!==void 0&&(s=n.onUpdate,hN(e,n.tag),i=n.skipTransforms||!1,a=n.discrete||!1),s&&e._deferred.push(s);let l=e._editorState,c=e._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=mN(c||l),u=!0),c._flushSync=a;let d=vt,f=Gt,p=Ge,h=e._updating;vt=c,Gt=!1,e._updating=!0,Ge=e;let g=e._headless||e.getRootElement()===null;i_(null);try{u&&(g?l._selection!==null&&(c._selection=l._selection.clone()):c._selection=(function(x,v){let S=x.getEditorState()._selection,b=Hn(an(x));return K(S)||S==null?Bl(S,b,x,v):S.clone()})(e,n&&n.event||null));let m=e._compositionKey;t(),i=mb(e,i),(function(x,v){let S=v.getEditorState()._selection,b=x._selection;if(K(b)){let N=b.anchor,D=b.focus,O;if(N.type==="text"&&(O=N.getNode(),O.selectionTransform(S,b)),D.type==="text"){let T=D.getNode();O!==T&&T.selectionTransform(S,b)}}})(c,e),e._dirtyType!==0&&(i?(function(x,v){let S=v._dirtyLeaves,b=x._nodeMap;for(let N of S){let D=b.get(N);R(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&kC(D)}})(c,e):(function(x,v){let S=v._dirtyLeaves,b=v._dirtyElements,N=x._nodeMap,D=_o(),O=new Map,T=S,A=T.size,$=b,I=$.size;for(;A>0||I>0;){if(A>0){v._dirtyLeaves=new Set;for(let L of T){let P=N.get(L);R(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&kC(P),P!==void 0&&pb(P,D)&&fb(v,P,O),S.add(L)}if(T=v._dirtyLeaves,A=T.size,A>0){Qu++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,$.delete("root")&&$.set("root",!0);for(let L of $){let P=L[0],Y=L[1];if(b.set(P,Y),!Y)continue;let Q=N.get(P);Q!==void 0&&pb(Q,D)&&fb(v,Q,O)}T=v._dirtyLeaves,A=T.size,$=v._dirtyElements,I=$.size,Qu++}v._dirtyLeaves=S,v._dirtyElements=b})(c,e),mb(e),(function(x,v,S,b){let N=x._nodeMap,D=v._nodeMap,O=[];for(let[I]of b){let L=D.get(I);L!==void 0&&(L.isAttached()||(k(L)&&nd(L,I,N,D,O,b),N.has(I)||b.delete(I),O.push(I)))}for(let I of S){let L=D.get(I);L===void 0||L.isAttached()||(mr(L)&&L.__slots!==null&&nd(L,I,N,D,O,S),N.has(I)||S.delete(I),O.push(I))}let T=ge(),A=T._cloneNotNeeded;for(let I of O)D.delete(I),A.delete(I);let $=T._compositionKey;$===null||D.has($)||(T._compositionKey=null)})(l,c,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(c._flushSync=!0);let _=c._selection;if(K(_)){e._slotsUsed&&oN(_);let x=c._nodeMap,v=_.anchor.key,S=_.focus.key;x.get(v)!==void 0&&x.get(S)!==void 0||M(19)}else ji(_)&&_._nodes.size===0&&(c._selection=null)}catch(m){m instanceof Error&&e._onError(m),e._pendingEditorState=l;let _=l._selection;return e._lastNotifiedSelection=_===null?null:_.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void pr(e)}finally{vt=d,Gt=f,Ge=p,e._updating=h,Qu=0}if(o)return;e._dirtyType!==0||e._deferred.length>0||(function(m,_){let x=_.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(x))return!0}else if(x!==null)return!0;return!1})(c,e)?c._flushSync?(c._flushSync=!1,pr(e)):u&&K1(()=>{pr(e)}):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function mn(e,t,n){Ge===e&&n===void 0?yr()?Pi(e,t,n):t():Pi(e,t,n)}function m1(){return{...zb,0:""}}function _1(){return{...Ai,"":0}}var y1=m1(),x1=_1(),v1=Id()({direction:Io(kl([null,"ltr","rtl"]),{field:"__dir"}),format:Io(kl(["","left","start","center","right","end","justify"]),{field:"__format",getter:"getFormatType",getterTable:y1,setter:"setFormat",setterTable:x1}),indent:Io(Ii(0,{integer:!0,min:0}),{field:"__indent"}),textFormat:Ni(Ii(),{getter:{field:"__textFormat",method:"getSerializedTextFormat",when:"shouldSerializeTextStyles"},setter:{field:"__textFormat"}}),textStyle:Ni(Ml(),{getter:{field:"__textStyle",method:"getSerializedTextStyle",when:"shouldSerializeTextStyles"},setter:{field:"__textStyle"}})});function S1(e){if(We(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var ro=class extends st{constructor(n){super(n);w(this,"__first");w(this,"__last");w(this,"__size");w(this,"__format");w(this,"__style");w(this,"__indent");w(this,"__dir");w(this,"__textFormat");w(this,"__textStyle");w(this,"__slotHost");w(this,"__slots");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}$config(){return this.config(Symbol.for("ElementNode"),{$transform:S1,extends:st,generated:jR,json:v1})}afterCloneFrom(n){super.afterCloneFrom(n),this.__key===n.__key&&(this.__first=n.__first,this.__last=n.__last,this.__size=n.__size,this.__slotHost=n.__slotHost,this.__slotHost!==null&&this.__parent!==null&&M(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=n.__slots),this.__style=n.__style,(function(o,r){o.__dir=r.__dir,o.__format=r.__format,o.__indent=r.__indent,o.__textFormat=r.__textFormat,o.__textStyle=r.__textStyle})(this,n)}getFormat(){return this.getLatest().__format}getFormatType(){let n=this.getFormat();return zb[n]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let n=[],o=this.getFirstChild();for(;o!==null;)n.push(o),o=o.getNextSibling();return n}getChildrenKeys(){let n=[],o=this.getFirstChild();for(;o!==null;)n.push(o.__key),o=o.getNextSibling();return n}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&yo(this).length===0}isDirty(){let n=ge()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){let n=this.getLatest(),o=this.getParentOrThrow().getLastChild();return o!==null&&o.is(n)}getAllTextNodes(){let n=[];for(let r of yo(this)){let s=Ns(this,r);if(k(s))for(let i of s.getAllTextNodes())n.push(i)}let o=this.getFirstChild();for(;o!==null;){if(R(o)&&n.push(o),k(o))for(let r of o.getAllTextNodes())n.push(r);o=o.getNextSibling()}return n}getFirstDescendant(){let n=this.getFirstChild();for(;k(n);){let o=n.getFirstChild();if(o===null)break;n=o}return n}getLastDescendant(){let n=this.getLastChild();for(;k(n);){let o=n.getLastChild();if(o===null)break;n=o}return n}getDescendantByIndex(n){let o=this.getChildren(),r=o.length;if(n>=r){let i=o[r-1];return k(i)&&i.getLastDescendant()||i||null}let s=o[n];return k(s)&&s.getFirstDescendant()||s||null}getFirstChild(){let n=this.getLatest().__first;return n===null?null:Ee(n)}getFirstChildOrThrow(){let n=this.getFirstChild();return n===null&&M(45,this.__key),n}getLastChild(){let n=this.getLatest().__last;return n===null?null:Ee(n)}getLastChildOrThrow(){let n=this.getLastChild();return n===null&&M(96,this.__key),n}getChildAtIndex(n){let o=this.getChildrenSize(),r,s;if(n<o/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=n;){if(s===n)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=o-1;r!==null&&s>=n;){if(s===n)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let n=fT(this),o=this.getChildren(),r=o.length;for(let s=0;s<r;s++){let i=o[s];n+=i.getTextContent(),k(i)&&s!==r-1&&!i.isInline()&&(n+=_s)}return n}getTextContentSize(){let n=(function(s){let i=0;for(let a of yo(s)){let l=Ns(s,a);l!==null&&(i+=l.getTextContentSize())}return i})(this),o=this.getChildren(),r=o.length;for(let s=0;s<r;s++){let i=o[s];n+=i.getTextContentSize(),k(i)&&s!==r-1&&!i.isInline()&&(n+=2)}return n}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(n){if(n!==""){let o=Ai[n];return(this.getFormat()&o)!==0}return!1}hasTextFormat(n){let o=xt[n];return(this.getTextFormat()&o)!==0}getFormatFlags(n,o){return xr(this.getLatest().__textFormat,n,o)}getTextStyle(){return this.getLatest().__textStyle}select(n,o){dt();let r=ce(),s=n,i=o,a=this.getChildrenSize();if(!this.canBeEmpty()){if(n===0&&o===0){let c=this.getFirstChild();if(R(c)||k(c))return c.select(0,0)}else if(!(n!==void 0&&n!==a||o!==void 0&&o!==a)){let c=this.getLastChild();if(R(c)||k(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return K(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):iN(l,s,l,i,"element","element")}selectStart(){let n=this.getFirstDescendant();return n?n.selectStart():this.select()}selectEnd(){let n=this.getLastDescendant();return n?n.selectEnd():this.select()}clear(){let n=this.getWritable();return this.getChildren().forEach(o=>o.remove()),n}append(...n){return this.splice(this.getChildrenSize(),0,n)}setDirection(n){let o=this.getWritable();return o.__dir=n,o}setFormat(n){let o=this.getWritable();return o.__format=n!==""&&Ai[n]||0,o}setStyle(n){let o=this.getWritable();return o.__style=n||"",o}setTextFormat(n){let o=this.getWritable();return o.__textFormat=n,o}setTextStyle(n){let o=this.getWritable();return o.__textStyle=n,o}setIndent(n){let o=this.getWritable();return o.__indent=n,o}splice(n,o,r){ld(this)&&M(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();n+o<=s||M(226,String(n),String(o),String(s));for(let h of r);let a=i.__key,l=[],c=[],u=this.getChildAtIndex(n+o),d=null,f=s-o+r.length;if(n!==0)if(n===s)d=this.getLastChild();else{let h=this.getChildAtIndex(n);h!==null&&(d=h.getPreviousSibling())}if(o>0){let h=d===null?this.getFirstChild():d.getNextSibling();for(let g=0;g<o;g++){h===null&&M(100);let y=h.getNextSibling(),m=h.__key;eo(h.getWritable()),c.push(m),h=y}}let p=d;for(let h of r){p!==null&&h.is(p)&&(d=p=p.getPreviousSibling()),u!==null&&h.is(u)&&(u=u.getNextSibling());let g=h.getWritable();g.__parent===a&&f--,eo(g);let y=h.__key;if(p===null)i.__first=y,g.__prev=null;else{let m=p.getWritable();m.__next=y,g.__prev=m.__key}h.__key===a&&M(76),g.__parent=a,l.push(y),p=h}if(u===null)p!==null&&(p.getWritable().__next=null,i.__last=p.__key);else{let h=u.getWritable();if(p!==null){let g=p.getWritable();h.__prev=p.__key,g.__next=u.__key}else h.__prev=null}if(i.__size=f,c.length){let h=ce();if(K(h)){let g=new Set(c),y=new Set(l),{anchor:m,focus:_}=h;_b(m,g,y)&&pd(m,m.getNode(),this,d,u),_b(_,g,y)&&pd(_,_.getNode(),this,d,u),f!==0||this.canBeEmpty()||We(this)||this.remove()}}return i}getDOMSlot(n){return new td(n)}exportDOM(n){let{element:o}=super.exportDOM(n);if(we(o)){let r=this.getIndent();r>0&&(o.style.paddingInlineStart=40*r+"px",o.setAttribute("data-lexical-indent",String(r)));let s=this.getDirection();s&&(o.dir=s)}return{element:o}}shouldSerializeTextStyles(){if(We(this))return!1;for(let n=this.getFirstChild();n!==null;n=n.getNextSibling())if(R(n))return!1;return!0}getSerializedTextFormat(){let n=this.getTextFormat();return n!==0&&this.shouldSerializeTextStyles()?n:void 0}getSerializedTextStyle(){let n=this.getTextStyle();return n!==""&&this.shouldSerializeTextStyles()?n:void 0}insertNewAfter(n,o){return null}canIndent(){return!0}collapseAtStart(n){return!1}excludeFromCopy(n){return!1}canReplaceWith(n){return!0}canInsertAfter(n){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(n){return!1}extractWithChild(n,o,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(n,o){let r=Jt(this,n,o),s=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let a=o.getElementByKey(i.getKey());a!==null&&(s==null?(r.insertChild(a),s=a):s!==a&&r.replaceChild(a,s),s=s.nextSibling)}}};function k(e){return e instanceof ro}function _b(e,t,n){let o=e.getNode();for(;o;){let r=o.__key;if(t.has(r)&&!n.has(r))return!0;o=o.getParent()}return!1}var zl=class extends st{constructor(n){super(n);w(this,"__slotHost");w(this,"__slots");this.__slotHost=null,this.__slots=null}afterCloneFrom(n){super.afterCloneFrom(n),this.__key===n.__key&&(this.__slotHost=n.__slotHost,this.__slotHost!==null&&this.__parent!==null&&M(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=n.__slots)}decorate(n,o){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function he(e){return e instanceof zl}var Li=class extends ro{constructor(){super("root");w(this,"__cachedText");this.__cachedText=null}$config(){return this.config("root",{extends:ro})}getTopLevelElementOrThrow(){M(51)}getTextContent(){let n=this.__cachedText;return n===null||!yr()&&ge()._dirtyType!==0?super.getTextContent():n}remove(){M(52)}replace(n){M(53)}insertBefore(n){M(54)}insertAfter(n){M(55)}updateDOM(n,o){return!1}splice(n,o,r){for(let s of r)k(s)||he(s)||M(282);return super.splice(n,o,r)}static importJSON(n){return Lt().updateFromJSON(n)}collapseAtStart(){return!0}};function qe(e){return e instanceof Li}function mN(e){return new Wl(Ub(e._nodeMap),null,e._slotsUsed)}function r_(){return new Wl(new Map([["root",new Li]]),null,!1)}function Em(e){let t=e.constructor,n=jb(e);if(k(e)){let r=n.children,s=e.getChildren();for(let i=0;i<s.length;i++)r.push(Em(s[i]))}let o=yo(e);if(o.length>0){let r={};for(let s of o){let i=Ns(e,s);i===null&&M(366,t.name,s),r[s]=Em(i)}n.$slots=r}return n}function C1(e){return e instanceof Wl}var Wl=class e{constructor(t,n=null,o=!1){w(this,"_nodeMap");w(this,"_selection");w(this,"_flushSync");w(this,"_readOnly");w(this,"_parsed");w(this,"_slotsUsed");this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=o}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(t,n){return hb(n&&n.editor||null,this,t)}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(t){return Hb(typeof t=="boolean"&&t,()=>hb(null,this,()=>({root:Em(Lt())})))}},_d=class extends ro{$config(){return this.config("artificial",{extends:ro})}createDOM(t){return Xt().createElement("div")}},Fi=class extends st{$config(){return this.config("linebreak",{extends:st,generated:XR,importDOM:{br:t=>_N(t)||yN(t)?null:{conversion:b1,priority:0}}})}getTextContent(){return`
77
+ `}createDOM(){return Xt().createElement("br")}updateDOM(){return!1}isInline(){return!0}};function b1(e){return{node:Pd()}}function Pd(){return Gi(new Fi)}function pn(e){return e instanceof Fi}function _N(e){let t=e.parentElement;if(t!==null&&v_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yd(n)){let o=t.lastChild;if(o===e||o.previousSibling===e&&yd(o))return!0}}return!1}function yN(e){let t=e.parentElement;if(t!==null&&v_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yd(n))return!1;let o=t.lastChild;if(o===e||o.previousSibling===e&&yd(o))return!0}return!1}function yd(e){return _n(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function $o(e,t){let{type:n,key:o,offset:r}=e,s=WN(e.key);return n==="text"?(R(s)||M(266,s.getType(),o),Cr(s,t,r)):(k(s)||M(267,s.getType(),o),CN(s,e.offset,t))}function bs(e,t){let{origin:n,direction:o}=t,r=o==="next";to(t)?e.set(n.getKey(),t.offset,"text"):Sr(t)?R(n)?e.set(n.getKey(),no(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(zn(t)&&k(n)||M(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function xN(e){let t=ce(),n=K(t)?t:aN();return Nl(n,e),Pt(n),n}function Nl(e,t){bs(e.anchor,t.anchor),bs(e.focus,t.focus)}function xd(e){let{anchor:t,focus:n}=e,o=$o(t,"next"),r=$o(n,"next"),s=Xl(o,r)<=0?"next":"previous";return br(Kn(o,s),Kn(r,s))}function Os(e){let{direction:t,origin:n}=e,o=Xe(n,Wo(t)).getNodeAtCaret();return o?Xe(o,t):Wn(n.getParentOrThrow(),t)}function yb(e,t="root"){let n=[e];for(let o=zn(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Os(o));return n}function Hg(e){return!!e&&e.origin.isAttached()}function vN(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,s=Ld(e,o),i=s.anchor.origin;for(;i!==null&&!We(i);)i=i.getParent();let a=k(i)?i.getFirstChild():null,l=yb(s.anchor,n),c=yb(s.focus.getFlipped(),n),u=new Set,d=[];for(let m of s.iterNodeCarets(n))if(zn(m))u.add(m.origin.getKey());else if(Sr(m)){let{origin:_}=m;k(_)&&!u.has(_.getKey())||d.push(_)}let f=new Set;for(let m of d){let _=m.getParent();_===null||u.has(_.getKey())||f.add(_),eo(m)}for(let m of f)!m.canBeEmpty()&&!We(m)&&m.isEmpty()&&m.isAttached()&&m.remove();for(let m of s.getTextSlices()){if(!m)continue;let{origin:_}=m.caret,x=_.getTextContentSize(),v=Os(Xe(_,o)),S=_.getMode();if(Math.abs(m.distance)===x&&r==="removeEmptySlices"||S==="token"&&m.distance!==0)v.remove();else if(m.distance!==0){r="removeEmptySlices";let b=m.removeTextSlice(),N=m.caret.origin;if(S==="segmented"){let D=b.origin,O=rn(D.getTextContent()).setStyle(D.getStyle()).setFormat(D.getFormat());v.replaceOrInsert(O),b=Cr(O,o,b.offset)}N.is(l[0].origin)&&(l[0]=b),N.is(c[0].origin)&&(c[0]=b.getFlipped())}}let p,h;for(let m of l)if(Hg(m)){p=hn(m);break}for(let m of c)if(Hg(m)){h=hn(m);break}let g=(function(m,_,x){if(!m||!_)return null;let v=m.getParentAtCaret(),S=_.getParentAtCaret();if(!v||!S)return null;let b=v.getParents().reverse();b.push(v);let N=S.getParents().reverse();N.push(S);let D=Math.min(b.length,N.length),O;for(O=0;O<D&&b[O]===N[O];O++);let T=(I,L)=>{let P;for(let Y=O;Y<I.length;Y++){let Q=I[Y];if(We(Q))return;!P&&L(Q)&&(P=Q)}return P},A=T(b,Rt),$=A&&T(N,I=>x.has(I.getKey())&&Rt(I));return $&&yo($).length>0?null:A&&$?[A,$]:null})(p,h,u);if(g){let[m,_]=g;Wn(m,"previous").splice(0,_.getChildren());let x=_.getParent();for(_.remove(!0);x&&x.isEmpty();){let v=x;x=x.getParent(),v.remove(!0)}}else if(h){let m=(function(v){if(zn(v)){let S=v.origin;if(Rt(S))return S}else{let S=v.getParentAtCaret();if(S&&Rt(S))return S}return null})(h),_=m&&m.getParent(),x=m&&m.getParents().findLast(__);if(m&&_&&!qe(_)&&m.isEmpty()&&u.has(m.getKey())&&yo(m).length===0&&(!x||u.has(x.getKey()))){m.remove(!0);let v=_;for(;v&&!qe(v)&&v.isEmpty();){let S=v.getParent();if(S&&qe(S)&&S.getChildrenSize()<=1&&v.canBeEmpty())break;let b=v;v=S,b.remove(!0)}}}Sd(i,a)!==null||i===null||i.isAttached()||Sd(Lt(),null);let y=[p,h,...l,...c].find(Hg);if(y)return mT(Kn(hn(y),e.direction));M(269,JSON.stringify(l.map(m=>m.origin.__key)))}function hn(e){let t=(function(r){let s=r;for(;zn(s);){let i=Vi(s);if(!zn(i))break;s=i}return s})(e.getLatest()),{direction:n}=t;if(R(t.origin))return to(t)?t:Cr(t.origin,n,n);let o=t.getAdjacentCaret();return Sr(o)&&R(o.origin)?Cr(o.origin,n,Wo(n)):t}function SN(e){return to(e)&&e.offset!==no(e.origin,e.direction)}function Ld(e,t){return e.direction===t?e:br(Kn(e.focus,t),Kn(e.anchor,t))}function CN(e,t,n){let o=Wn(e,"next");for(let r=0;r<t;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return Kn(o,n)}function E1(e,t="root"){let n=0,o=e,r=Vi(o);for(;r===null;){if(n--,r=o.getParentCaret(t),!r)return null;o=r,r=Vi(o)}return r&&[r,n]}function N1(e){let{origin:t,offset:n,direction:o}=e;if(n===no(t,o))return e.getSiblingCaret();if(n===no(t,Wo(o)))return Os(e.getSiblingCaret());let[r]=t.splitText(n);return R(r)||M(281),Kn(Xe(r,"next"),o)}function T1(e,t){return!0}function bN(e,{$copyElementNode:t=y_,$splitTextPointCaretNext:n=N1,rootMode:o="shadowRoot",$shouldSplit:r=T1,removeEmptyDestination:s=!1}={}){if(to(e))return n(e);let i=e.getParentCaret(o);if(i){let{origin:a}=i;if(zn(e)){let c=Os(i);if(s&&a.isEmpty())return a.remove(),c;if(!a.canBeEmpty()||!r(a,"first"))return c}let l=(function(c){let u=[];for(let d=c.getAdjacentCaret();d;d=d.getAdjacentCaret())u.push(d.origin);return u})(e);(l.length>0||!s&&a.canBeEmpty()&&r(a,"last"))&&i.insert(t(a).splice(0,0,l))}return i}function EN(e,t,n){let o=Kn(t,"next");to(o)&&(o.offset===0?o=Xe(o.origin,"previous").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=Xe(o.origin,"next"))),o.origin.is(e)&&(Sr(o)||M(342,e.getKey(),e.getType()),o=Os(o)),(e.is(o.getNodeAtCaret())||e.is(o.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let r=o;r;r=bN(r,n))o=r;return to(o)&&M(283),o.insert(e.isInline()?qt().append(e):e),Kn(Xe(e.getLatest(),"next"),t.direction)}function s_(e,t){let n=Ld(K(t)?xd(t):t,"next"),o=Gl(n.anchor.origin),r=Gl(e.getLatest());if(o===null?r!==null:!o.is(r))return!1;let s=hn(Wn(e,"next")),i=Kn(hn(Wn(e,"previous")),"next");return Xl(n.anchor,s)<=0&&Xl(n.focus,i)>=0}var Bi=class extends ro{$config(){return this.config("paragraph",{extends:ro,generated:qR,importDOM:{p:()=>({conversion:O1,priority:0})}})}createDOM(t){let n=Xt().createElement("p"),o=wi(t.theme,"paragraph");return o!==void 0&&n.classList.add(...o),n}updateDOM(t,n,o){return!1}exportDOM(t){let{element:n}=super.exportDOM(t);if(we(n)){this.isEmpty()&&n.append(Xt().createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o)}return{element:n}}exportJSON(t=!1){let n=super.exportJSON(t);if(n.textFormat===void 0||n.textStyle===void 0){let o=this.getChildren().find(R),r=o?o.getFormat():this.getTextFormat(),s=o?o.getStyle():this.getTextStyle();t&&r===0||(n.textFormat=r),t&&s===""||(n.textStyle=s)}return n}extractWithChild(t,n,o){if(!K(n)||this.getFormatType()===""&&this.getIndent()===0&&this.getStyle()==="")return!1;if(s_(this,n)){let r=this.getTextContent();return r!==""&&n.getTextContent()===r}return!1}insertNewAfter(t,n){let o=qt();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){if(this.getChildren().every(t=>R(t)&&!/\S/.test(t.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function O1(e){let t=qt();if(tT(t,e),ZN(e,t),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in Ai&&t.setFormat(n)}return eT(t,e),{node:t}}function qt(){return Gi(new Bi)}function NN(e){return e instanceof Bi}function D1(e){console.warn(e)}var w1=0,M1=1,k1=2,A1=3,I1=4,$1=-8,R1=-7,P1=-6,L1=-5,F1=-4;function TN(e,t,n,o,r){let s=e._keyToDOMMap;s.clear(),e._editorState=r_(),e._pendingEditorState=o,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,r&&r.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent="",(function(a,l){delete a[`__lexicalKey_${l._key}`]})(t,e)),n!==null&&(n.textContent="",s.set("root",n),kN(n,e,"root"))}function ON(e){let t=new Set,n=new Set;for(let{klass:o,ownNodeConfig:r}of zo(e)){let s=o.transform;if(!n.has(s)){n.add(s);let i=o.transform();i&&t.add(i)}if(r){let i=r.$transform;i&&t.add(i)}}return t}var Kl={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,o)=>{},$exportDOM:(e,t)=>{let n=Fd(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,o,r)=>k(e)&&e.extractWithChild(t,n,o),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,o)=>null,$shouldExclude:(e,t,n)=>k(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,o)=>e.updateDOM(t,n,o._config)};function B1(e){let t=e||{},n=pN(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,s=t.disableEvents||!1,i=r_(),a=t.namespace||(r!==null?r._config.namespace:$N()),l=t.editorState,c=[Li,_r,Fi,Ri,Bi,_d,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let y=0;y<c.length;y++){let m=c[y],_=null,x=null;if(m&&typeof m=="object"){let b=m;m=b.replace,_=b.with,x=b.withKlass||null}if(typeof m!="function"||!m.prototype||!(m===st||m.prototype instanceof st)){let b="<unknown>";try{b=JSON.parse(Kb)}catch{}M(365,String(y-c.length+(t.nodes?t.nodes.length:0)),typeof m=="function"?`${m.name}${typeof m.getType=="function"?` (type ${String(m.getType())})`:""}`:String(m),String(b))}oc(m);let v=m.getType(),S=ON(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:x,sharedNodeState:rE(c[y]),transforms:S})}}let g=new hr(i,r,h,{disableEvents:s,dom:{...Kl,...e&&e.dom},namespace:a,theme:o},u||console.error,d||D1,(function(y,m){let _=new Map,x=new Set,v=S=>{Object.keys(S).forEach(b=>{let N=_.get(b);N===void 0&&(N=[],_.set(b,N)),N.push(S[b])})};return y.forEach(S=>{let b=S.klass.importDOM;if(b==null||x.has(b))return;x.add(b);let N=b.call(S.klass);N!==null&&v(N)}),m&&v(m),_})(h,f?f.import:void 0),p,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(y){y.registerCommand(Um,MR,0),y.registerCommand(Hm,AR,0),y.registerCommand(Vm,$R,0),y.registerCommand(jm,RR,0),y.registerCommand(Gm,FR,0)})(g),g}function z1(e,t){let n=e.get(t);e.delete(t),n&&n()}function yl(e,t,n){return e.set(t,n),z1.bind(null,e,t)}var hr=class{constructor(t,n,o,r,s,i,a,l,c){w(this,"_headless");w(this,"_parentEditor");w(this,"_rootElement");w(this,"_editorState");w(this,"_pendingEditorState");w(this,"_compositionKey");w(this,"_deferred");w(this,"_keyToDOMMap");w(this,"_updates");w(this,"_updating");w(this,"_cascadeCount");w(this,"_listeners");w(this,"_commands");w(this,"_nodes");w(this,"_decorators");w(this,"_pendingDecorators");w(this,"_config");w(this,"_dirtyType");w(this,"_cloneNotNeeded");w(this,"_dirtyLeaves");w(this,"_dirtyElements");w(this,"_normalizedNodes");w(this,"_updateTags");w(this,"_observer");w(this,"_key");w(this,"_onError");w(this,"_onWarn");w(this,"_htmlConversions");w(this,"_window");w(this,"_editable");w(this,"_blockCursorElement");w(this,"_slotsUsed");w(this,"_keyDownShortcuts");w(this,"_inputState");w(this,"_lastNotifiedSelection");w(this,"_createEditorArgs");this._createEditorArgs=c,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new wl,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=o,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=$N(),this._onError=s,this._onWarn=i,this._htmlConversions=a,this._editable=l,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){return yl(this._listeners.update,t)}registerEditableListener(t){return yl(this._listeners.editable,t)}registerDecoratorListener(t){return yl(this._listeners.decorator,t)}registerTextContentListener(t){return yl(this._listeners.textcontent,t)}registerRootListener(t){let n=this._listeners.root;return D_(yl(n,t,t(this._rootElement,null)||void 0),()=>(function(o,r,s){let i=o.get(r);i&&i(),o.set(r,r(...s)||void 0)})(n,t,[null,this._rootElement]))}registerCommand(t,n,o){o===void 0&&M(35);let r=this._commands;r.has(t)||r.set(t,[new hs,new hs,new hs,new hs,new hs]);let s=r.get(t);s===void 0&&M(36,String(t));let i=(function(l){return 7&l})(o),a=s[i];return i!==o?a.addFront(n):a.addBack(n),()=>{a.delete(n),s.every(l=>l.size===0)&&r.delete(t)}}registerMutationListener(t,n,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,s=this._listeners.mutation,i=s.get(n);i===void 0&&(i=new Set,s.set(n,i)),i.add(r);let a=o&&o.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,r),()=>{i.delete(r),i.size===0&&s.delete(n)}}getRegisteredNode(t){let n=this._nodes.get(t.getType());return n===void 0&&M(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=Tm(o).get(n.getType());if(!r)return;let s=new Map;for(let i of r.keys())s.set(i,"created");s.size>0&&t(s,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){let o=this.getRegisteredNode(t);return o.transforms.add(n),o}registerNodeTransform(t,n){let o=this.registerNodeTransformToKlass(t,n),r=[o],s=o.replaceWithKlass;if(s!=null){let i=this.registerNodeTransformToKlass(s,n);r.push(i)}return(function(i,a){let l=Tm(i.getEditorState()),c=[];for(let u of a){let d=l.get(u);d&&c.push(d)}c.length!==0&&i.update(()=>{for(let u of c)for(let d of u.keys()){let f=Ee(d);f&&f.markDirty()}},i._pendingEditorState===null?{tag:qu}:void 0)})(this,r.map(i=>i.klass.getType())),()=>{r.forEach(i=>i.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,...n){return G(this,t,...n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){let n=this._rootElement;if(t!==n){let o=wi(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,TN(this,n,t,r,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||(function(s){let i=Rg.get(s);if(i===void 0)return void qC();let a=ju.get(i);if(a===void 0)return void qC();Rg.delete(s);let l=nc(s);zd(l)?((function(u){if(u._parentEditor!==null){let d=d_(u),f=d[d.length-1]._key;Di.get(f)===u&&Di.delete(f)}else Di.delete(u._key)})(l),a.editors.delete(l),a.hasShadowEditor=void 0,s.__lexicalEditor=null):l&&M(198);let c=jC(s);for(let u=0;u<c.length;u++)c[u]();s.__lexicalEventHandles=[]})(n),o!=null&&n.classList.remove(...o)),t!==null){let s=g_(t),i=t.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,qb(this),this._updateTags.add(qu),pr(this),this._config.disableEvents||(function(a,l){let c=a.ownerDocument;Rg.set(a,c);let u=ju.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},ju.set(c,u)),u.editors.add(l),u.hasShadowEditor=void 0,a.__lexicalEditor=l;let d=jC(a);d.push(OR.register(c));let f=(function(){if($g!==void 0)return $g;let p=[["keydown",LR],["pointerdown",wR],["compositionstart",IR],["compositionend",PR],["input",kR],["click",DR],["cut",wo],["copy",wo],["dragstart",wo],["dragover",wo],["dragend",wo],["paste",wo],["focus",wo],["blur",wo],["drop",wo]];return Tl&&p.push(["beforeinput",(h,g)=>(function(y,m){let _=y.inputType;_==="deleteCompositionText"||xo&&FN(m)||_!=="insertCompositionText"&&mn(m,()=>{BE(y,m)||G(m,Um,y)},{event:y})})(h,g)]),so&&p.push(["keyup",(h,g)=>(function(y,m){y.shiftKey&&y.key!=="CapsLock"||(m._inputState.isShiftKeyDown=!1)})(h,g)]),$g=p,p})();for(let p=0;p<f.length;p++){let[h,g]=f[p],y=typeof g=="function"?m=>{GC(m)||(gm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(GC(m))return;gm(m);let _=l.isEditable();switch(h){case"cut":return _&&G(l,Jm,m);case"copy":return G(l,Xm,m);case"paste":return _&&G(l,Ym,m);case"dragstart":return _&&G(l,TE,m);case"dragover":return _&&G(l,OE,m);case"dragend":return _&&G(l,DE,m);case"focus":return _&&G(l,ME,m);case"blur":return l._inputState.isShiftKeyDown=!1,l._inputState.isInsertLineBreak=!1,_&&G(l,kE,m);case"drop":return _&&G(l,NE,m)}};d.push(Qm(a,h,y))}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(qu),pr(this);El("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){let o=t.isEmpty(),r=t;r._readOnly&&(r=mN(t),r._selection=t._selection?t._selection.clone():null),Gb(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),pr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||t._slotsUsed,mn(this,()=>{if(i&&this._updateTags.add(i),o&&(km(38),Lt().append(qt())),t._parsed)for(let[a,l]of r._nodeMap.entries())k(l)?this._dirtyElements.set(a,!0):this._dirtyLeaves.add(a)},{discrete:!this._updating||void 0})}parseEditorState(t,n){return(function(o,r,s){let i=r_(),a=vt,l=Gt,c=Ge,u=r._dirtyElements,d=r._dirtyLeaves,f=r._cloneNotNeeded,p=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Map,r._dirtyType=0,vt=i,Gt=!1,Ge=r,i_(null);try{let h=r._nodes;md(o.root,h),s&&s(),i._readOnly=!0,i._parsed=!0}catch(h){h instanceof Error&&r._onError(h)}finally{r._dirtyElements=u,r._dirtyLeaves=d,r._cloneNotNeeded=f,r._dirtyType=p,vt=a,Gt=l,Ge=c}return i})(typeof t=="string"?JSON.parse(t):t,this,n)}read(...t){let[n,o]=t.length===1?["force-commit",t[0]]:t;return n==="force-commit"&&pr(this),(n==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(o,{editor:this})}update(t,n){(function(o,r,s){o._updating?o._updates.push([r,s]):Pi(o,r,s)})(this,t,n)}focus(t,n={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),mn(this,()=>{let r=ce(),s=Lt();r!==null?r.dirty||Pt(r.clone()):s.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Es("focus"),BN(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Hn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,El("editable",this,!0,t),this._slotsUsed&&this.update(()=>dN()))}toJSON(){return{editorState:this._editorState.toJSON(Vb())}}};w(hr,"version",Kb);var Nm=null;function i_(e){Nm=e}var a_=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),DN=1;function W1(){DN=1}function l_(e,t){let n=Fd(e,t);return n===void 0&&M(30,t),n}function Fd(e,t){return e._nodes.get(t)}var K1=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Bd(e,t){let n=t!==void 0?t:(()=>{let s=e.getRootNode();return Yi(s)||Bo(s)?zi(s):null})();if(!we(n)||n.hasAttribute("data-lexical-slot"))return!1;let o=u_(n),r=n.nodeName;return Zm(o)&&(r==="INPUT"||r==="TEXTAREA"||n.contentEditable==="true"&&nc(n)==null)}var U1=Bd;function tc(e,t,n){let o=e.getRootElement();if(!o)return!1;try{if(!t||!o.contains(t)||!o.contains(n))return!1}catch{return!1}return gr(t)===e&&e.read("latest",()=>!Bd(t))}function zd(e){return e instanceof hr}function gr(e){let t=e;for(;t!=null;){let n=nc(t);if(zd(n))return n;t=Ro(t)}return null}function nc(e){return e?e.__lexicalEditor:null}function H1(e){return Y$.test(e)?"rtl":G$.test(e)?"ltr":null}function Ul(e){return t_(e)||e.isToken()}function Bn(e){return Ul(e)||e.isSegmented()}function _n(e){return Xi(e)&&e.nodeType===3}function Yi(e){return Xi(e)&&e.nodeType===9}function wN(e){let t=e;for(;t!=null;){if(_n(t))return t;t=t.firstChild}return null}function xr(e,t,n){let o=xt[t];if(n!==null&&(e&o)===(n&o))return e;let r=e^o;return t==="subscript"?r&=~xt.superscript:t==="superscript"?r&=~xt.subscript:t==="lowercase"?(r&=~xt.uppercase,r&=~xt.capitalize):t==="uppercase"?(r&=~xt.lowercase,r&=~xt.capitalize):t==="capitalize"&&(r&=~xt.lowercase,r&=~xt.uppercase),r}function V1(e){return R(e)||pn(e)||he(e)}function MN(e,t){let n=(function(){let i=Nm;return Nm=null,i})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);dt(),uN();let o=ge(),r=yn(),s=""+DN++;r._nodeMap.set(s,e),k(e)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.set(s,e),o._dirtyType===0&&(o._dirtyType=1),e.__key=s}function eo(e){Nt(e)!==null&&M(380,e.__key,String(Nt(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),o=t.getWritable(),r=e.getPreviousSibling(),s=e.getNextSibling(),i=s!==null?s.__key:null,a=r!==null?r.__key:null,l=r!==null?r.getWritable():null,c=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=a),l!==null&&(l.__next=i),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,o.__size--}}var j1=eo;function vd(e){uN(),ld(e)&&M(323,e.__key,e.__type);let t=e.__parent!==null?e.__parent:vr(e)?e.__slotHost:null,n=yn(),o=ge(),r=n._nodeMap,s=o._dirtyElements;t!==null&&(function(a,l,c){let u=a;for(;u!==null;){if(c.has(u))return;let d=l.get(u);if(d===void 0)break;c.set(u,!1),u=d.__parent!==null?d.__parent:vr(d)?d.__slotHost:null}})(t,r,s);let i=e.__key;o._dirtyType===0&&(o._dirtyType=1),k(e)?s.set(i,!0):o._dirtyLeaves.add(i)}function ft(e){dt();let t=ge(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=Ee(n);o!==null&&o.getWritable()}if(e!==null){let o=Ee(e);o!==null&&o.getWritable()}}}function _o(){return yr()?null:ge()._compositionKey}function Ee(e,t){let n=(t||yn())._nodeMap.get(e);return n===void 0?null:n}function c_(e,t){let n=Ds(e,ge());return n!==void 0?Ee(n,t):null}function kN(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Ds(e,t){return e[`__lexicalKey_${t._key}`]}function u_(e,t){let n=e;for(;n!=null;){let o=c_(n,t);if(o!==null)return o;n=Ro(n)}return null}function AN(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function xb(e){return e.read(()=>Lt().getTextContent())}function Lt(){return yn()._nodeMap.get("root")}function Sd(e,t){if(!(We(e)&&e.isAttached()&&(qe(e)?e.getChildrenSize()===0:e.isEmpty())&&(qe(e)||t!==null&&Rt(t))))return null;let n=qt();return e.append(n),n}function Pt(e){dt();let t=yn();e!==null&&(e.dirty=!0,e.setCachedNodes(null),K(e)&&ge()._slotsUsed&&oN(e)),t._selection=e}function vb(){dt(),Gb(ge())}function ys(e){let t=(function(n,o){let r=n;for(;r!=null;){let s=Ds(r,o);if(s!==void 0)return s;r=Ro(r)}return null})(e,ge());return t===null?null:Ee(t)}function IN(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function d_(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function $N(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function RN(e){return _n(e)?e.nodeValue:null}function f_(e,t,n){let o=Hn(an(t));if(o===null)return;let r=sn(o,t._rootElement),s=r.anchorNode,{anchorOffset:i,focusOffset:a}=r;if(s!==null){let l=RN(s),c=u_(s);if(l!==null&&R(c)){if((l===Dl||l===Im)&&n){let u=n.length;l=n,i=u,a=u}l!==null&&p_(c,l,i,a,e)}}}function p_(e,t,n,o,r){let s=e;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing();if(s.isToken()&&i)return;let a=t;if((i||r)&&(t.endsWith(Dl)&&(a=t.slice(0,-Dl.length)),r)){let c=Im,u;for(;(u=a.indexOf(c))!==-1;)a=a.slice(0,u)+a.slice(u+c.length),n!==null&&n>u&&(n=Math.max(u,n-c.length)),o!==null&&o>u&&(o=Math.max(u,o-c.length))}let l=s.getTextContent();if(r||a!==l){let c=ce();if(a===""){if(ft(null),Ql||so||Zl)s.remove();else{let g=ge();Vg(s,"",c),setTimeout(()=>{g.update(()=>{s.isAttached()&&s.getTextContent()===""&&s.remove()})},20)}return}let u=s.getParent(),d=Ts(),f=s.getTextContentSize(),p=_o(),h=s.getKey();if(s.isToken()&&!i||p!==null&&h===p&&!i||K(d)&&(u!==null&&!u.canInsertTextBefore()&&d.anchor.offset===0||d.anchor.key===e.__key&&d.anchor.offset===0&&!s.canInsertTextBefore()&&!i||d.focus.key===e.__key&&d.focus.offset===f&&!s.canInsertTextAfter()&&!i))return void s.markDirty();if(!K(c)||n===null||o===null)return void Vg(s,a,c);if(c.setTextNodeRange(s,n,s,o),s.isSegmented()){let g=rn(s.getTextContent());s.replace(g),s=g}Vg(s,a,c)}}}function Vg(e,t,n){if(e.setTextContent(t),K(n)){let o=e.getKey(),r=!1;for(let s of["anchor","focus"]){let i=n[s];i.type==="text"&&i.key===o&&(i.offset=no(e,i.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Y1(e,t){let n=e[Rm];return n&&t!==Lo?{...e,ctrlKey:e[n],[n]:e.ctrlKey}:e}function Bu(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function PN(e,t){return Bu(e,t,"altKey")&&Bu(e,t,"ctrlKey")&&Bu(e,t,"shiftKey")&&Bu(e,t,"metaKey")}function G1(e,t,n){if(!PN(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let o="Key"+t.toUpperCase();return e.code===o}function Sb(e){let t=e;for(;t!==null;){let n=t.getParent();if(n===null)return null;if(qe(n))return t;t=n}return null}function zu(e,t){let{anchor:n,focus:o}=e,r=n.key,s=n.offset,i=n.type,a=o.key,l=o.offset,c=o.type;if(Km(e),!qe(t))return e;let u=Sb(n.getNode());return k(u)&&u.isShadowRoot()&&u.is(Sb(o.getNode()))&&(n.set(r,s,i),o.set(a,l,c)),e}function q1(e){let t=Lt();if(K(e)){let n=e.anchor,o=e.focus,r=n.getNode();if(qe(r))return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),zu(e,r),e;let s=r.getTopLevelElementOrThrow(),i=s.getParent();return i===null?(k(s)&&(n.set(s.getKey(),0,"element"),o.set(s.getKey(),s.getChildrenSize(),"element"),zu(e,s)),e):(n.set(i.getKey(),0,"element"),o.set(i.getKey(),i.getChildrenSize(),"element"),zu(e,i),e)}{let n=t.select(0,t.getChildrenSize());return Pt(zu(n,t)),n}}function Hl(e,t){e.getAttribute(t)===""&&e.removeAttribute(t)}function wi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,o=n[t];if(o!==void 0)return o;let r=e[t];if(typeof r=="string"){let s=rc(r);return n[t]=s,s}return r}function h_(e,t,n,o,r){if(n.size===0)return;let s=o.__type,i=o.__key,a=t.get(s);a===void 0&&M(33,s);let l=a.klass,c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));let u=c.get(i),d=u==="destroyed"&&r==="created";(u===void 0||d)&&c.set(i,d?"updated":r)}function X1(e){let t=e.getType(),n=yn();if(n._readOnly){let s=Tm(n).get(t);return s?Array.from(s.values()):[]}let o=n._nodeMap,r=[];for(let[,s]of o)s instanceof e&&s.__type===t&&s.isAttached()&&r.push(s);return r}function Cb(e,t,n){let o=e.getParent(),r=n,s=e;return o!==null&&(t&&n===0?(r=s.getIndexWithinParent(),s=o):t||n!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(t?r-1:r)}function LN(e,t){let n=e.offset;if(e.type==="element")return Cb(e.getNode(),t,n);{let o=e.getNode();if(t&&n===0||!t&&n===o.getTextContentSize()){let r=t?o.getPreviousSibling():o.getNextSibling();return r===null?Cb(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function FN(e){let t=an(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function G(e,t,...n){return bm(e,t,n[0],e)}function Mi(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&M(75,t),n}function Ro(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Bo(n)?n.host:null}function Wd(e){return Yi(e)?e:we(e)?e.ownerDocument:null}function bb(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith("%")?n*t/100:n:0}function J1(e,t,n,o){let r=t.clientWidth,s=t.scrollWidth-r;if(s<=0)return 0;let i=e.getComputedStyle(t);if(i.overflowX!=="auto"&&i.overflowX!=="scroll")return 0;let a=t.getBoundingClientRect(),l=t.offsetWidth,c=l>0&&Math.abs(a.width-l)>1?a.width/l:1,u=i.direction==="rtl",d=a.left+t.clientLeft*c,f=d+bb(i.scrollPaddingLeft,r)*c,p=d+(r-bb(i.scrollPaddingRight,r))*c,h=n,g=Math.max(o,n+1);g-h>p-f&&(u?h=g-1:g=h+1);let y=0;if(h<f?y=h-f:g>p&&(y=g-p),y===0)return 0;let m=t.scrollLeft,_=m+y/c,x=y>0?Math.ceil(_):Math.floor(_),v=u?Math.min(0,Math.max(-s,x)):Math.max(0,Math.min(s,x)),S=m*c;return Math.abs(v)<Math.abs(m)&&h+S>=f&&g+S<=p&&(v=0),v===m?0:(t.scrollLeft=v,(t.scrollLeft-m)*c)}function Q1(e){return ge()._updateTags.has(e)}function Es(e){dt(),ge()._updateTags.add(e)}function BN(e){dt(),ge()._deferred.push(e)}function Vl(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function g_(e){let t=Wd(e);return t?t.defaultView:null}function an(e){let t=e._window;return t===null&&M(78),t}function zN(e){return k(e)&&e.isInline()||he(e)&&e.isInline()}function m_(e){let t=e.getLatest();for(;t!==null;){if(Nt(t)!==null&&k(t))return t;let n=t.getParentOrThrow();if(We(n))return n;t=n}return t}function __(e){return k(e)&&e.isShadowRoot()}function We(e){return qe(e)||__(e)}function y_(e,t=!1){let n=e.constructor.clone(e,a_);return MN(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Gi(e){let t=ge(),n=e.getType(),o=Fd(t,n);o===void 0&&M(200,e.constructor.name,n);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(e),a=i.constructor;return s!==null?i instanceof s||M(201,s.name,s.getType(),a.name,a.getType(),e.constructor.name,n):i instanceof e.constructor&&a!==e.constructor||M(202,a.name,a.getType(),e.constructor.name,n),i.__key===e.__key&&M(203,e.constructor.name,n,a.name,a.getType()),i}return e}function jg(e,t){!qe(e.getParent())||k(t)||he(t)||M(99)}function WN(e){let t=Ee(e);return t===null&&M(63,e),t}function Cd(e){if(!e||e.isInline())return!1;if(he(e))return!0;if(k(e)){if(e.isShadowRoot()){let t=e.getParent();return!(k(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function bd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Hn(e){return Er?(e||window).getSelection():null}function KN(e){let t=g_(e);return t?t.getSelection():null}function Bo(e){return XN(e)&&"host"in e}var Z1=[];function UN(e){let t=e.getRootNode();if(t===e||!Bo(t))return Z1;let n=[t],o=t.host;for(;;){let r=o.getRootNode();if(r===o||!Bo(r))break;n.push(r),o=r.host}return n}function*HN(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');let o=(Yi(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=o.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function VN(e){return e!==null?e.ownerDocument:document}function Xt(){let e=pN();return VN(e!==null?e._rootElement:null)}function qi(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;let n=UN(t);if(n.length===0)return null;let o=e.getComposedRanges;try{let r=o.call(e,{shadowRoots:n})[0];if(r!==void 0)return r}catch{}try{let r=o.apply(e,n)[0];if(r!==void 0)return r}catch{}return null}function jN(e,t){let n=qi(e,t);if(n!==null){let o=YN(n);if(o!==null)return o}return e.rangeCount>0?e.getRangeAt(0):null}function sn(e,t){let n=qi(e,t);return n===null?e:GN(n,qN(e))}function eP(e,t){let n=qi(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let o=YN(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:GN(n,qN(e)),range:o}}function YN(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 GN(e,t){let{startContainer:n,startOffset:o,endContainer:r,endOffset:s}=e;return t==="backward"?{anchorNode:r,anchorOffset:s,direction:t,focusNode:n,focusOffset:o}:{anchorNode:n,anchorOffset:o,direction:t,focusNode:r,focusOffset:s}}function qN(e){return e.direction}function Ed(e){let t=e.getRootNode();return Yi(t)||Bo(t)?t.activeElement:null}function zi(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let n=t.shadowRoot.activeElement;if(n===null)break;t=n}return t}function x_(e){let t=e.target;if(t!==null&&we(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){let n=e.composedPath();if(n.length>0)return n[0]}return t}function tP(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),We(e)&&M(102);let o=i=>{let a=i.getParentOrThrow(),l=We(a),c=i!==n||l?y_(i):i;if(l)return k(i)&&k(c)||M(133),i.insertAfter(c),[i,c,c];{let[u,d,f]=o(a),p=i.getNextSiblings();return f.append(c,...p),[u,d,c]}},[r,s]=o(n);return[r,s]}function nP(e){return we(e)&&e.tagName==="A"}function oP(e){return we(e)&&e.tagName==="TR"}function rP(e){return we(e)&&(e.tagName==="TD"||e.tagName==="TH")}function we(e){return Xi(e)&&e.nodeType===1}function Xi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function XN(e){return Xi(e)&&e.nodeType===11}var sP=/^(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 JN(e){return!(!we(e)||!e.style.display.startsWith("inline"))||sP.test(e.nodeName)}var iP=/^(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 v_(e){return(!we(e)||!e.style.display.startsWith("inline"))&&iP.test(e.nodeName)}function Rt(e){if(he(e)&&!e.isInline())return!0;if(!k(e)||We(e))return!1;let t=e.getFirstChild(),n=t===null||pn(t)||R(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function vo(){return ge()}function Kd(e=vo()){return e._config.dom||Kl}function Jt(e,t,n=vo()){let o=Kd(n).$getDOMSlot(e,t,n);return k(e)&&(QN(o)||M(344,e.getKey(),e.getType())),o}function aP(e,t,n,o){let r=e.read("latest",()=>{let s=Ee(t);return s!==null?(function(i,a,l=vo()){let c=Ns(i,a);if(c===null)return null;let u=l.getElementByKey(c.getKey());return u!==null?u.parentElement:null})(s,n,e):null});return r!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display=""),r}function lP(e,t,n){n.style.display="none";let o=e.getElementByKey(t);o!==null&&n.parentElement!==o&&o.insertBefore(n,o.firstChild)}function QN(e){return e instanceof td}function Po(e,t,n=vo()){return wN(Jt(e,t,n).element)}var Eb=new WeakMap,cP=new Map;function Tm(e){if(!e._readOnly&&e.isEmpty())return cP;e._readOnly||M(192);let t=Eb.get(e);return t||(t=(function(n){let o=new Map;for(let[r,s]of n._nodeMap){let i=s.__type,a=o.get(i);a||(a=new Map,o.set(i,a)),a.set(r,s)}return o})(e),Eb.set(e,t)),t}function S_(e){let t=e.constructor.clone(e,a_);return t.afterCloneFrom(e),t}function uP(e){return(t=S_(e))[zE]=!0,t;var t}function ZN(e,t){let n=e.getAttribute("data-lexical-indent");if(n!==null){let s=parseInt(n,10);if(Number.isFinite(s)&&s>=0)return void t.setIndent(s)}let o=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(o/40);t.setIndent(r)}function eT(e,t){let n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}function tT(e,t){let n=t.style.textAlign;return n&&n in Ai?e.setFormat(n):e}function nT(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function C_(e){return e.__lexicalUnmanaged===!0}function oT(e,t=vo()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}function jl(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(we(n)&&n.hasAttribute("data-lexical-slot")||Ds(n,t)!==void 0)return!1;n=Ro(n)}return!1}function xl(e,t){return Fn(e,t)&&e[t]!==st[t]}var Yg=new WeakMap;function Wi(e){let t=Yg.get(e);return t!==void 0?t:(function(n){let o=n.prototype!=null&&Og in n.prototype?n.prototype[Og]():void 0,r=(function(u){if(!(u===st||u.prototype instanceof st)){let d="<unknown>",f="<unknown>";try{d=u.getType()}catch{}try{hr.version&&(f=JSON.parse(hr.version))}catch{}M(290,u.name,d,f)}return u===zl||u===ro||u===st})(n),s=!r&&xl(n,"getType")?n.getType:void 0,i=s&&!(Nb in s)?s.call(n):void 0,a,l=i;if(o)if(i)a=o[i];else{for(let[u,d]of Object.entries(o))l=u,a=d;if(!a)for(let u of Object.getOwnPropertySymbols(o)){let d=o[u];if(d){a=d;break}}}let c={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Fn(n.prototype,Og),klass:n,ownNodeConfig:a,ownNodeType:l},ownFieldsValidated:!1};Yg.set(n,c);try{let u=(function(h){let g=h.prototype,y=new Map,{fieldsBaseFirst:m}=ki(h);for(let[_,x]of m){let v=mP(h,_,x);if(v===null)continue;if(Fo(v)){let b=v.field;if(b==="__proto__"&&M(430,h.name,_),v.setterTable!==void 0){let{setterTable:N}=v,{meta:D}=x;for(let O of D.kind==="enum"?D.values:[x.defaultValue])Fn(N,String(O))||M(431,h.name,_,JSON.stringify(O))}y.set(_,{field:b,key:_,kind:"ownField",schema:x,setterTable:v.setterTable});continue}let S=g[v];typeof S!="function"&&M(432,h.name,_,v),y.set(_,{key:_,kind:"field",schema:x,setter:S})}return y.size===0?dP:[...y.values()]})(n),d=(function(h){let g=h.prototype,y=new Map;for(let[m,_]of ki(h).fieldsDerivedFirst){let x=gP(h,m,_);if(x===null)continue;if(Fo(x)){let S=x.field;S==="__proto__"&&M(426,h.name,m);let b=x.when,N;if(b!==void 0){let D=g[b];typeof D!="function"&&M(427,h.name,m,b),N=D}y.set(m,{defaultValue:_.defaultValue,derived:_.setter===null,field:S,getterTable:x.getterTable,isEqual:_.isEqual,key:m,kind:"ownField",schema:_,when:N});continue}let v=g[x];typeof v!="function"&&M(428,h.name,m,x),y.set(m,{defaultValue:_.defaultValue,derived:_.setter===null,getter:v,isEqual:_.isEqual,key:m,kind:"method",schema:_})}return y.size===0?hP:[...y.values()]})(n),f=ki(n),p=(function(h,g,y){let m,_=h;for(let{klass:x,ownNodeConfig:v}of zo(h))v&&v.generated!==void 0&&(m===void 0?(m=v.generated,_=x):v.generated===m&&(_=x));return m===void 0?null:_===h||(function(x,v){if(x.getters.length!==v.getters.length||x.setters.length!==v.setters.length)return!1;for(let S=0;S<x.getters.length;S++){let b=x.getters[S],N=v.getters[S];if(b.kind!==N.kind||b.key!==N.key||b.schema!==N.schema||b.derived!==N.derived||b.isEqual!==N.isEqual||!Object.is(b.defaultValue,N.defaultValue)||b.kind==="ownField"&&N.kind==="ownField"&&(b.field!==N.field||b.getterTable===void 0!=(N.getterTable===void 0)))return!1}for(let S=0;S<x.setters.length;S++){let b=x.setters[S],N=v.setters[S];if(b.kind!==N.kind||b.key!==N.key||b.schema!==N.schema||b.kind==="ownField"&&N.kind==="ownField"&&(b.field!==N.field||b.setterTable===void 0!=(N.setterTable===void 0)))return!1}return!0})(y,Nd(Wi(_)))?m:null})(n,0,{getters:d,setters:u});c.compiled={flatStates:f.flatStates,generated:p===null?null:p(f.fields),getters:d,isCompactDefault:_P(d),setters:u},(function(h,g,y,m){if(!g&&y){if(!xl(h,"getType")){let _=h,x=function(){return this!==_?st.getType.call(this):y};x[Nb]=!0,h.getType=x}if(xl(h,"clone")||(h.clone=(_,x)=>{i_(_);let v=new h;return x!==a_&&v.afterCloneFrom(_),v}),xl(h,"importJSON")||(h.importJSON=m&&m.$importJSON||(function(_){return x=>{let v=iT(_);return v.updateFromJSON===st.prototype.updateFromJSON?(function(S,b){return sT(S.__state||b[Dd]!==void 0?sE(S,b):S,b)})(v,x):v.updateFromJSON(x)}})(h)),!xl(h,"importDOM")&&m){let{importDOM:_}=m;_&&(h.importDOM=()=>_)}}})(n,r,l,a),(function(h){for(let{klass:g,ownNodeConfig:y}of zo(h)){let m=g.prototype;if(Fn(m,"afterCloneFrom"))continue;let _=SP(g);if(_.length===0)continue;let x=Object.getPrototypeOf(m),v=y&&y.generated!==void 0?Nd(Wi(g)).generated:null,S=v!==null&&v.afterCloneFrom||((b,N)=>{let D=b,O=N;for(let T=0;T<_.length;T++){let A=_[T];D[A]=O[A]}});m.afterCloneFrom=function(b){x.afterCloneFrom.call(this,b),S(this,b)},m.afterCloneFrom[vP]=!0}})(n)}catch(u){throw Yg.delete(n),u}return c})(e)}function Nd(e){let{compiled:t}=e;return t===void 0&&M(422,e.config.klass.name),t}var Nb=Symbol("lexical.synthesizedGetType"),dP=[];function rT(e,t,n,o){let r=n.method===void 0?o:n.method,s=ki(e).declaredBy.get(t);if(s===void 0)return n;let i=e.prototype,a=s.prototype;return Tb(i,a,r)&&Tb(i,a,o)?n:r}function Tb(e,t,n){return e[n]===t[n]}function Ob(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Db(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var fP={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function ki(e){let t=Wi(e);return t.composed===void 0&&(t.composed=(function(n){let o=[],r=[],s=[];for(let{klass:u,ownNodeConfig:d}of zo(n)){let f=d&&d.json;r.push(u),o.push(f&&f.meta.kind==="node"?Object.entries(f.meta.fields):[]);let p=[];if(d&&d.stateConfigs)for(let h of d.stateConfigs)"stateConfig"in h&&h.flat&&p.push(h.stateConfig);s.push(p)}let i=new Map;for(let u=0;u<o.length;u++)for(let[d,f]of o[u])i.has(d)||i.set(d,f);let a=new Map,l=new Map,c=new Map;for(let u=o.length-1;u>=0;u--){for(let[d,f]of o[u]){let p=i.get(d);p===void 0||a.has(d)||a.set(d,p),p===void 0||f!==p||l.has(d)||l.set(d,r[u])}for(let d of s[u])c.has(d.key)||c.set(d.key,d)}return i.size===0&&c.size===0?fP:{declaredBy:l,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...c.values()]}})(e)),t.composed}function pP(e){let{fieldsDerivedFirst:t,flatStates:n}=ki(e),o={};for(let r of n)r.schema&&(o[r.key]=r.schema);for(let[r,s]of t)o[r]=s;return o}var hP=[];function gP(e,t,n){let o=n.getter;if(o===null)return null;let r=o===void 0?Db(t):o;return Fo(r)?rT(e,t,r,Db(t)):r}function mP(e,t,n){let o=n.setter;if(o===null)return null;let r=o===void 0?Ob(t):o;return Fo(r)?rT(e,t,r,Ob(t)):r}function Om(e,t){let{defaultValue:n,isEqual:o}=e;return t===void 0||t===n||o!==void 0&&o(t,n)}function _P(e){let t;return(n,o)=>{t===void 0&&(t=new Map(e.map(s=>[s.key,s])));let r=t.get(n);return r!==void 0&&Om(r,o)}}function yP(e){let{setterTable:t,schema:n}=e,{defaultValue:o}=n;return t===void 0?o:t[String(o)]}function sT(e,t){let n=Wi(e.constructor),{flatStates:o,generated:r,setters:s}=Nd(n),i=(function(a,l,c){let u=a;for(let d=0;d<c.length;d++){let f=c[d],p=l[f.key];if(p!==void 0){let h=f.parse(p);u=oE(u,f,()=>h)}}return u})(e,t,o);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(i,t):(function(a,l,c){for(let u=0;u<c.length;u++){let d=c[u],f=d.schema(l[d.key]);d.kind==="ownField"?a[d.field]=d.setterTable===void 0?f:Fn(d.setterTable,f)?d.setterTable[f]:yP(d):d.setter.call(a,f)}return a})(i,t,s)}function oc(e){return Wi(e).config}function xP(e){let t=[];for(let n of[e.getter,e.setter])Fo(n)&&n.field!=="__proto__"&&!t.includes(n.field)&&t.push(n.field);return t}var vP="__lexicalSynthesizedAfterCloneFrom";function wb(e){let{declaredBy:t,fieldsBaseFirst:n}=ki(e),o=[];for(let[r,s]of n)if(t.get(r)===e)for(let i of xP(s))o.includes(i)||o.push(i);return o}function SP(e){let t=wb(e);if(t.length===0)return t;let n=new Set;for(let{klass:o}of zo(e))if(o!==e)for(let r of wb(o))n.add(r);return n.size===0?t:t.filter(o=>!n.has(o))}function*zo(e){for(let t=e;t&&(t===st||Zm(t.prototype));){let n=oc(t),o=n.declaresOwnConfig;yield o?n:{...n,ownNodeConfig:void 0},t=o&&n.ownNodeConfig&&n.ownNodeConfig.extends||aT(t)}}function CP(e){let t=new Map,n=new Map;for(let o of e){let{ownNodeType:r}=oc(o);r&&(n.set(r,o),t.set(r,new Set))}for(let[o,r]of n)for(let{ownNodeType:s}of zo(r)){let i=s&&t.get(s);i&&i.add(o)}return t}function iT(e){let t=vo();dt();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),o=new n.klass;return n.replace===null?o:Gi(o)}var cr=(e,t)=>{let n=e;for(;n!=null&&!qe(n);){if(t(n))return n;n=n.getParent()}return null};function Yl(e,t){let n=[],o=e.__first;for(;o!==null;){let r=t===null?Ee(o):t.get(o);r==null&&M(174),n.push(o),o=r.__next}return n}function aT(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}var lT=new Map;function mr(e){return k(e)||he(e)}function vr(e){return k(e)||he(e)}function Nt(e){let t=e.getLatest();return vr(t)?t.__slotHost:null}function gn(e){let t=Nt(e);if(t===null)return null;let n=Ee(t);return k(n)||he(n)||M(370),n}function cT(e){let t=gn(e);if(t===null)return null;let n=e.getLatest().__key;for(let[o,r]of Ud(t))if(r===n)return o;return null}function Gl(e){let t=e.getLatest();for(;t!==null;){if(Nt(t)!==null)return t;t=t.getParent()}return null}function uT(e){if(e===null)return null;let t=K(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Gl(t)}function Ud(e){let t=e.getLatest();return mr(t)&&t.__slots!==null?t.__slots:lT}function yo(e){return Array.from(Ud(e).keys())}function Ns(e,t){let n=Ud(e).get(t);return n===void 0?null:Ee(n)}var bP=["__proto__","constructor","prototype"],Mb=Symbol("slotMapOwner");function Dm(e){let t=e.__slots;return t!==null&&t[Mb]===e||(t=new Map(t),t[Mb]=e,e.__slots=t),t}var kb=new WeakMap,EP=[];function dT(e){for(let{ownNodeConfig:t}of zo(e)){let n=t&&t.slots;if(n)return n}return EP}function fT(e){let t="";for(let n of yo(e)){let o=Ns(e,n);o!==null&&(t+=o.getTextContent())}return t}function Ab(e,t,n){let o=n.get(e),r=n.get(t);return o!==void 0?r!==void 0?o-r:-1:r!==void 0?1:e<t?-1:e>t?1:0}function pT(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||M(373,t);let o=e.getLatest();if(o.__slots!==null&&o.__slots.get(t)===n.getLatest().__key)return o;(!k(n)&&!he(n)||n.isInline())&&M(374,n.__key);let r=e.getWritable(),s=Dm(r),i=s.get(t);i!==void 0&&hT(i);let a=n.getWritable(),l=gn(a);if(l!==null){let c=cT(a);c!==null&&Dm(l.getWritable()).delete(c),a.__slotHost=null}return eo(a),a.__slotHost=r.__key,s.set(t,a.__key),(function(c){let u=c.__slots;if(u===null||u.size<2)return;let d=(function(g){let y=kb.get(g);if(y===void 0){let m=dT(g),_=new Map;for(let x of m)bP.includes(x)&&M(371,g.name,x),_.has(x)&&M(372,g.name,x),_.set(x,_.size);y=_,kb.set(g,y)}return y})(c.constructor),f=null,p=!0;for(let g of u.keys()){if(f!==null&&Ab(f,g,d)>0){p=!1;break}f=g}if(p)return;let h=Array.from(u).sort(([g],[y])=>Ab(g,y,d));u.clear();for(let[g,y]of h)u.set(g,y)})(r),ge()._slotsUsed=!0,yn()._slotsUsed=!0,r}function NP(e,t){let n=e.getWritable();if(n.__slots===null)return n;let o=n.__slots.get(t);return o!==void 0&&(hT(o),Dm(n).delete(t)),n}function hT(e){let t=Ee(e);if(t===null)return;let n=t.getWritable();vr(n)||M(377,e),n.__slotHost=null,n.remove()}var TP={next:"previous",previous:"next"},Ki=class{constructor(t){w(this,"origin");this.origin=t}[Symbol.iterator](){return N_({hasNext:Sr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Xe(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Xe(this.origin,this.direction)}remove(){let t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){let o=this.getNodeAtCaret();return t.is(this.origin)||t.is(o)||(o===null?this.insert(t):o.replace(t,n)),this}splice(t,n,o="next"){let r=o===this.direction?n:Array.from(n).reverse(),s=this,i=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){let c=l.origin.getWritable();a.set(c.getKey(),c)}for(let l of r){if(a.size>0){let c=s.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||s.origin.is(l))){let u=l.getParent();u&&u.is(i)&&l.remove(),c.replace(l)}}else c===null&&M(263,Array.from(a).join(" "))}else s.insert(l);s=Xe(l,this.direction)}for(let l of a.values())l.remove();return this}},ql=class e extends Ki{constructor(){super(...arguments);w(this,"type","child")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Wn(n,this.direction)}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return Xe(this.getNodeAtCaret(),n)||Wn(this.origin,n)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)}isSamePointCaret(n){return this.isSameNodeCaret(n)}},OP={root:qe,shadowRoot:We};function Wo(e){return TP[e]}function b_(e,t="root"){return e===null||OP[t](e)?null:Nt(e)===null?e:null}var Ui=class e extends Ki{constructor(){super(...arguments);w(this,"type","sibling")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Xe(n,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return k(this.origin)?Wn(this.origin,this.direction):null}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return Xe(this.getNodeAtCaret(),n)||Wn(this.origin.getParentOrThrow(),n)}isSamePointCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)}isSameNodeCaret(n){return(n instanceof e||n instanceof Hi)&&this.direction===n.direction&&this.origin.is(n.origin)}},Hi=class e extends Ki{constructor(n,o){super(n);w(this,"type","text");w(this,"offset");this.offset=o}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Cr(n,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(n="root"){return Xe(b_(this.getParentAtCaret(),n),this.direction)}getFlipped(){return Cr(this.origin,Wo(this.direction),this.offset)}isSamePointCaret(n){return n instanceof e&&this.direction===n.direction&&this.origin.is(n.origin)&&this.offset===n.offset}isSameNodeCaret(n){return(n instanceof Ui||n instanceof e)&&this.direction===n.direction&&this.origin.is(n.origin)}getSiblingCaret(){return Xe(this.origin,this.direction)}};function to(e){return e instanceof Hi}function DP(e){return e instanceof Ki}function Sr(e){return e instanceof Ui}function zn(e){return e instanceof ql}var wP={next:class extends Hi{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Hi{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},MP={next:class extends Ui{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Ui{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},kP={next:class extends ql{constructor(){super(...arguments);w(this,"direction","next")}getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends ql{constructor(){super(...arguments);w(this,"direction","previous")}getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Xe(e,t){return e?new MP[t](e):null}function Cr(e,t,n){return e?new wP[t](e,no(e,n)):null}function no(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&km(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function wm(e,t){return new Td(e,t)}function Wn(e,t){return k(e)?new kP[t](e):null}function gT(e){return e&&e.getChildCaret()||e}function Vi(e){return e&&gT(e.getAdjacentCaret())}var Mm=class e{constructor(t,n,o){w(this,"type","node-caret-range");w(this,"direction");w(this,"anchor");w(this,"focus");this.anchor=t,this.focus=n,this.direction=o}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 t=r=>{let s=this[r].getLatest();return to(s)?(function(i,a){let{direction:l,origin:c}=i;return wm(i,no(c,a==="focus"?Wo(l):l)-i.offset)})(s,r):null},n=t("anchor"),o=t("focus");if(n&&o){let{caret:r}=n,{caret:s}=o;if(r.isSameNodeCaret(s))return[wm(r,s.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=to(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=to(o),s=i=>i.isSameNodeCaret(o)?null:Vi(i)||i.getParentCaret(t);return N_({hasNext:i=>i!==null&&!(r&&o.isSameNodeCaret(i)),initial:n.isSameNodeCaret(o)?null:s(n),map:i=>i,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Td=class{constructor(t,n){w(this,"type","slice");w(this,"caret");w(this,"distance");this.caret=t,this.distance=n}getSliceIndices(){let{distance:t,caret:{offset:n}}=this,o=n+t;return o<n?[o,n]:[n,o]}getTextContent(){let[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:t,direction:n}}=this,[o,r]=this.getSliceIndices(),s=t.getTextContent();return Cr(t.setTextContent(s.slice(0,o)+s.slice(r)),n,o)}};function AP(e){return e instanceof Td}function Kn(e,t){return e.direction===t?e:e.getFlipped()}function E_(e){return br(e,Kn(Wn(Lt(),Wo(e.direction)),e.direction))}function mT(e){return br(e,e)}function br(e,t){return e.direction!==t.direction&&M(265),new Mm(e,t,e.direction)}function N_(e){let{initial:t,hasNext:n,step:o,map:r}=e,s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function Xl(e,t){let n=O_(e.origin,t.origin);switch(n===null&&M(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{let o=e.type==="text",r=t.type==="text";return o&&r?(function(s,i){return Math.sign(s-i)})(e.offset,t.offset):e.type===t.type?0:o?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return T_(n)}}function T_(e){let{a:t,b:n}=e,o=t.__key,r=n.__key,s=t,i=n;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function Wu(e,t){return t.is(e)}function Ib(e){return k(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function O_(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=Ib(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=Ib(t);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(Wu(e,o)||M(276),{commonAncestor:o,type:"ancestor"}):r===null?(Wu(t,o)||M(277),{commonAncestor:o,type:"descendant"}):((k(s)||Wu(e,s))&&(k(r)||Wu(t,r))&&o.is(s.getParent())&&o.is(r.getParent())||M(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function IP(e){return e}function $P(...e){return e}function RP(...e){return e}function PP(e){return e}function LP(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function rc(...e){let t=[];for(let n of e)if(n&&typeof n=="string")for(let[o]of n.matchAll(/\S+/g))t.push(o);return t}function FP(e,...t){let n=rc(...t);n.length>0&&e.classList.add(...n)}function BP(e,...t){let n=rc(...t);n.length>0&&e.classList.remove(...n)}function D_(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function zP(e,t,n){return D_(...Object.entries(t).map(([o,r])=>Qm(e,o,r,n)))}var C=w_,sH=C.$addUpdateTag,Ji=C.$applyNodeReplacement,_T=C.$assumeActiveEditor,xn=C.$caretFromPoint,Nr=C.$caretRangeFromSelection,Hd=C.$cloneWithProperties,yT=C.$cloneWithPropertiesEphemeral,Qi=C.$comparePointCaretNext,Vd=C.$copyNode,xT=C.$create,iH=C.$createChildrenArray,jd=C.$createLineBreakNode,Yd=C.$createNodeSelection,it=C.$createParagraphNode,aH=C.$createPoint,vT=C.$createRangeSelection,lH=C.$createRangeSelectionFromDom,Gd=C.$createTabNode,Vn=C.$createTextNode,ST=C.$exportNodeJSON,qd=C.$extendCaretToRange,Me=C.$findMatchingParent,CT=C.$flushSyncAfterUpdate,bT=C.$formatText,Xd=C.$fullReconcile,ET=C.$generateNodesFromRawText,M_=C.$getAdjacentChildCaret,cH=C.$getAdjacentNode,Tr=C.$getAdjacentSiblingOrParentSiblingCaret,uH=C.$getCaretInDirection,io=C.$getCaretRange,Or=C.$getCaretRangeInDirection,NT=C.$getCharacterOffsets,Qt=C.$getChildCaret,k_=C.$getChildCaretAtIndex,A_=C.$getChildCaretOrSelf,ws=C.$getCollapsedCaretRange,dH=C.$getCommonAncestor,fH=C.$getCommonAncestorResultBranchOrder,TT=C.$getDOMSlot,OT=C.$getDOMTextNode,Ft=C.$getDocument,Ne=C.$getEditor,I_=C.$getEditorDOMRenderConfig,Ko=C.$getNearestNodeFromDOMNode,pH=C.$getNearestRootOrShadowRoot,Zi=C.$getNodeByKey,hH=C.$getNodeByKeyOrThrow,DT=C.$getNodeFromDOMNode,Ms=C.$getPreviousSelection,Ue=C.$getRoot,z=C.$getSelection,Jd=C.$getSelectionSlotFrame,Je=C.$getSiblingCaret,ea=C.$getSlot,Qd=C.$getSlotFrame,Zd=C.$getSlotHost,gH=C.$getSlotNameWithinHost,ks=C.$getSlotNames,ef=C.$getState,mH=C.$getStateChange,_H=C.$getTextContent,yH=C.$getTextNodeOffset,wT=C.$getTextPointCaret,xH=C.$getTextPointCaretSlice,vH=C.$getWritableNodeState,sc=C.$hasAncestor,SH=C.$hasUpdateTag,ta=C.$insertNodeToNearestRootAtCaret,MT=C.$insertNodes,na=C.$isBlockElementNode,kT=C.$isBlockFullySelected,Uo=C.$isChildCaret,CH=C.$isCompactExport,vn=C.$isDecoratorNode,AT=C.$isEditorState,bH=C.$isElementDOMSlot,W=C.$isElementNode,ic=C.$isExtendableTextPointCaret,EH=C.$isInlineElementOrDecoratorNode,NH=C.$isInlineFormattable,IT=C.$isLeafNode,$_=C.$isLexicalNode,Dr=C.$isLineBreakNode,TH=C.$isNodeCaret,De=C.$isNodeSelection,$T=C.$isParagraphNode,F=C.$isRangeSelection,As=C.$isRootNode,ao=C.$isRootOrShadowRoot,RT=C.$isSelectionCapturedInDecoratorInput,tf=C.$isShadowRootNode,Ho=C.$isSiblingCaret,OH=C.$isSlotChild,ac=C.$isSlotHost,R_=C.$isTabNode,H=C.$isTextNode,lo=C.$isTextPointCaret,DH=C.$isTextPointCaretSlice,P_=C.$isTokenOrSegmented,wH=C.$isTokenOrTab,MH=C.$markSlotEditable,L_=C.$needsBlockCursorBeside,kH=C.$nodesOfType,jn=C.$normalizeCaret,oa=C.$normalizeSelection__EXPERIMENTAL,AH=C.$onUpdate,PT=C.$parseSerializedNode,IH=C.$removeFromParent,$H=C.$removeSlot,LT=C.$removeTextFromCaretRange,Sn=C.$rewindSiblingCaret,nf=C.$selectAll,RH=C.$setCompositionKey,wr=C.$setDirectionFromDOM,Mr=C.$setFormatFromDOM,FT=C.$setPointFromCaret,Cn=C.$setSelection,Yn=C.$setSelectionFromCaretRange,PH=C.$setSlot,of=C.$setState,BT=C.$setTextFormat,rf=C.$splitAtPointCaretNext,zT=C.$splitNode,WT=C.$updateDOMSelection,LH=C.$updateRangeSelectionFromCaretRange,FH=C.$withCompactExport,F_=C.ArtificialNode__DO_NOT_USE,BH=C.BEFORE_INPUT_COMMAND,zH=C.BLUR_COMMAND,lc=C.CAN_REDO_COMMAND,cc=C.CAN_UNDO_COMMAND,uc=C.CAN_USE_BEFORE_INPUT,bn=C.CAN_USE_DOM,KT=C.CLEAR_EDITOR_COMMAND,UT=C.CLEAR_HISTORY_COMMAND,sf=C.CLICK_COMMAND,WH=C.COLLABORATION_TAG,HT=C.COMMAND_PRIORITY_BEFORE_CRITICAL,KH=C.COMMAND_PRIORITY_BEFORE_EDITOR,UH=C.COMMAND_PRIORITY_BEFORE_HIGH,HH=C.COMMAND_PRIORITY_BEFORE_LOW,VH=C.COMMAND_PRIORITY_BEFORE_NORMAL,VT=C.COMMAND_PRIORITY_CRITICAL,te=C.COMMAND_PRIORITY_EDITOR,jH=C.COMMAND_PRIORITY_HIGH,Vo=C.COMMAND_PRIORITY_LOW,YH=C.COMMAND_PRIORITY_NORMAL,GH=C.COMPOSITION_END_COMMAND,jT=C.COMPOSITION_END_TAG,qH=C.COMPOSITION_START_COMMAND,YT=C.COMPOSITION_START_TAG,GT=C.CONTROLLED_TEXT_INSERTION_COMMAND,XH=C.CONTROL_OR_ALT,JH=C.CONTROL_OR_META,QH=C.CONTROL_OR_OTHER_KEY,af=C.COPY_COMMAND,qT=C.CUT_COMMAND,dc=C.CUT_TAG,B_=C.DEFAULT_EDITOR_DOM_CONFIG,lf=C.DELETE_CHARACTER_COMMAND,XT=C.DELETE_LINE_COMMAND,JT=C.DELETE_WORD_COMMAND,ZH=C.DRAGEND_COMMAND,QT=C.DRAGOVER_COMMAND,ZT=C.DRAGSTART_COMMAND,eO=C.DROP_COMMAND,z_=C.DecoratorNode,co=C.ElementNode,eV=C.FOCUS_COMMAND,tO=C.FORMAT_ELEMENT_COMMAND,nO=C.FORMAT_TEXT_COMMAND,cf=C.HISTORIC_TAG,ra=C.HISTORY_MERGE_TAG,oO=C.HISTORY_PUSH_TAG,rO=C.INDENT_CONTENT_COMMAND,tV=C.INPUT_COMMAND,W_=C.INSERT_LINE_BREAK_COMMAND,K_=C.INSERT_PARAGRAPH_COMMAND,sO=C.INSERT_TAB_COMMAND,iO=C.INTERNAL_$expandSelectionToWholeDocument,fc=C.INTERNAL_$isBlock,nV=C.IS_ALL_FORMATTING,aO=C.IS_ANDROID,lO=C.IS_ANDROID_CHROME,cO=C.IS_APPLE,uf=C.IS_APPLE_WEBKIT,U_=C.IS_BOLD,uO=C.IS_CHROME,dO=C.IS_CODE,df=C.IS_FIREFOX,fO=C.IS_HIGHLIGHT,pc=C.IS_IOS,H_=C.IS_ITALIC,ff=C.IS_SAFARI,V_=C.IS_STRIKETHROUGH,pf=C.IS_SUBSCRIPT,hf=C.IS_SUPERSCRIPT,j_=C.IS_UNDERLINE,pO=C.KEY_ARROW_DOWN_COMMAND,hO=C.KEY_ARROW_LEFT_COMMAND,gO=C.KEY_ARROW_RIGHT_COMMAND,mO=C.KEY_ARROW_UP_COMMAND,_O=C.KEY_BACKSPACE_COMMAND,yO=C.KEY_DELETE_COMMAND,xO=C.KEY_DOWN_COMMAND,vO=C.KEY_ENTER_COMMAND,SO=C.KEY_ESCAPE_COMMAND,oV=C.KEY_MODIFIER_COMMAND,CO=C.KEY_SPACE_COMMAND,bO=C.KEY_TAB_COMMAND,EO=C.LineBreakNode,NO=C.MOVE_TO_END,TO=C.MOVE_TO_START,rV=C.NODE_STATE_DIRECT,sV=C.NODE_STATE_KEY,iV=C.NODE_STATE_LATEST,Y_=C.OUTDENT_CONTENT_COMMAND,gf=C.PASTE_COMMAND,mf=C.PASTE_TAG,OO=C.ParagraphNode,_f=C.REDO_COMMAND,DO=C.REMOVE_TEXT_COMMAND,yf=C.RootNode,wO=C.SELECTION_CHANGE_COMMAND,MO=C.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,kO=C.SELECT_ALL_COMMAND,AO=C.SET_TEXT_FORMAT_COMMAND,aV=C.SKIP_COLLAB_TAG,lV=C.SKIP_DOM_SELECTION_TAG,IO=C.SKIP_SCROLL_INTO_VIEW_TAG,$O=C.SKIP_SELECTION_FOCUS_TAG,En=C.TEXT_TYPE_TO_FORMAT,RO=C.TabNode,kr=C.TextNode,xf=C.UNDO_COMMAND,So=C.addClassNamesToElement,cV=C.aliasTableOf,uV=C.aliasedValue,dV=C.arrayValue,vf=C.booleanValue,fV=C.buildImportMap,pV=C.compileKeyboardShortcuts,hV=C.configExtension,sa=C.createCommand,Sf=C.createEditor,Cf=C.createRefCountedRegistry,gV=C.createSharedNodeState,bf=C.createState,mV=C.declarePeerDependency,_V=C.declaredAccepts,yV=C.defineExtension,PO=C.enumValue,LO=C.findAllLexicalElementsDeep,FO=C.flipDirection,BO=C.getActiveElement,Is=C.getActiveElementDeep,G_=C.getComposedEventTarget,xV=C.getComposedSchemaFields,vV=C.getComposedStaticRange,SV=C.getDOMOwnerDocument,Ar=C.getDOMSelection,CV=C.getDOMSelectionFromTarget,Ef=C.getDOMSelectionPoints,bV=C.getDOMSelectionRange,EV=C.getDOMSelectionRangeAndPoints,zO=C.getDOMShadowRoots,WO=C.getDOMTextNode,NV=C.getDeclaredSlots,Nf=C.getEditorPropertyFromDOMNode,KO=C.getNearestEditorFromDOMNode,hc=C.getParentElement,TV=C.getRegisteredNode,OV=C.getRegisteredNodeOrThrow,UO=C.getRegisteredSubtypeMap,$s=C.getRootOwnerDocument,HO=C.getStaticNodeConfig,gc=C.getStyleObjectFromCSS,DV=C.getTextDirection,wV=C.getTransformSetFromKlass,ia=C.getterTableOf,Ir=C.isBlockDomNode,MV=C.isCurrentlyReadOnlyMode,kV=C.isDOMCapturingSelection,Tf=C.isDOMDocumentNode,aa=C.isDOMNode,Of=C.isDOMShadowRoot,mc=C.isDOMTextNode,AV=C.isDOMUnmanaged,q_=C.isDocumentFragment,IV=C.isExactShortcutMatch,la=C.isHTMLAnchorElement,me=C.isHTMLElement,$V=C.isHTMLTableCellElement,RV=C.isHTMLTableRowElement,ca=C.isInlineDomNode,VO=C.isLastChildInBlockNode,Df=C.isLexicalEditor,PV=C.isModifierMatch,jO=C.isOnlyChildInBlockNode,LV=C.isSchemaField,FV=C.isSelectionCapturedInDecoratorInput,YO=C.isSelectionWithinEditor,GO=C.iterStaticNodeConfigChain,BV=C.keyboardEventMaskForPlatform,X_=C.makeStepwiseIterator,Se=C.mergeRegister,zV=C.mountSlotContainer,_c=C.nodeSchema,WV=C.normalizeClassNames,wf=C.nullable,KV=C.numberValue,UV=C.objectValue,HV=C.optional,VV=C.rawValue,Rs=C.registerEventListener,Mf=C.registerEventListeners,kf=C.removeClassNamesFromElement,jV=C.removeFromParent,YV=C.resetRandomKey,GV=C.safeCast,qV=C.setDOMStyleFromCSS,XV=C.setDOMStyleObject,JV=C.setDOMUnmanaged,$r=C.setNodeIndentFromDOM,ua=C.setterDefaultOf,da=C.setterTableOf,Bt=C.shallowMergeConfig,QV=C.stopLexicalPropagation,yc=C.stringValue,ZV=C.toggleTextFormatType,qO=C.tokenizeRawText,ej=C.transformValue,tj=C.unionValue,nj=C.unmountSlotContainer,oj=C.withAccessors,Rr=C.withField;var XO=globalThis.React,Af=XO.Fragment,Tt=(e,t,n)=>XO.createElement(e,n===void 0?t:{...t,key:n}),If=Tt;var J_={};de(J_,{LexicalComposer:()=>KP});var WP=bn?po:et,$f={tag:ra};function KP({initialConfig:e,children:t}){let n=Dn(()=>{let{theme:o,namespace:r,nodes:s,onError:i,onWarn:a,editorState:l,html:c}=e,u=xC(null,o),d=Sf({editable:e.editable,html:c,namespace:r,nodes:s,onError:f=>i(f,d),...a?{onWarn:f=>a(f,d)}:{},theme:o});return(function(f,p){if(p!==null){if(p===void 0)f.update(()=>{let h=Ue();if(h.isEmpty()){let g=it();h.append(g);let y=f.getRootElement(),m=bn&&y!==null?BO(y):null;(z()!==null||m!==null&&m===y)&&g.select()}},$f);else if(p!==null)switch(typeof p){case"string":{let h=f.parseEditorState(p);f.setEditorState(h,$f);break}case"object":f.setEditorState(p,$f);break;case"function":f.update(()=>{Ue().isEmpty()&&p(f)},$f)}}})(d,l),[d,u]},[]);return WP(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),Tt(yC.Provider,{value:n,children:t})}var UP=J_,JO=UP.LexicalComposer;var Q_={};de(Q_,{useLexicalSubscription:()=>VP});var HP=bn?po:et;function VP(e){let[t]=Yt(),n=Dn(()=>e(t),[t,e]),[o,r]=Ie(()=>n.initialValueFn()),s=Xo(o);return HP(()=>{let{initialValueFn:i,subscribe:a}=n,l=i();return s.current!==l&&(s.current=l,r(l)),a(c=>{s.current=c,r(c)})},[n,e]),o}var jP=Q_,QO=jP.useLexicalSubscription;var Z_={};de(Z_,{useLexicalEditable:()=>GP});function YP(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function GP(){return QO(YP)}var qP=Z_,ZO=qP.useLexicalEditable;var ey={};de(ey,{getKnownTypesAndNodes:()=>XP,getNodeConfig:()=>eD});function XP(e){let t=new Set,n=new Set;for(let o of eD(e)){let r=typeof o=="function"?o:o.replace;HO(r),t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function eD(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var tD=ey,nD=tD.getKnownTypesAndNodes,oD=tD.getNodeConfig;var ty={};de(ty,{InitialStateExtension:()=>QP});var rD={tag:ra};function JP(){let e=Ue();e.isEmpty()&&e.append(it())}var QP={config:{setOptions:rD,updateOptions:rD},init:({$initialEditorState:e=JP})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(AT(s))e.setEditorState(s,n);else if(typeof s=="function")e.update(()=>{s(e)},t);else if(s&&(typeof s=="string"||typeof s=="object")){let i=e.parseEditorState(s);e.setEditorState(i,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[yf,kr,EO,RO,OO]};var ZP=ty,sD=ZP.InitialStateExtension;var iy={};de(iy,{LexicalBuilder:()=>Pf,buildEditorFromExtensions:()=>rL,builderSymbol:()=>sy});function ke(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function eL(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var tL=eL(),nL=new Set(["__proto__","constructor","prototype"]);function aD(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)!nL.has(r)&&Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=aD(n[r],o[r]));return e}return t}function ny(e){return e.id===0}function lD(e){return e.id===2}var oL=new Set,ry=class{constructor(t,n){w(this,"builder");w(this,"configs");w(this,"_dependency");w(this,"_peerNameSet");w(this,"extension");w(this,"state");w(this,"_signal");this.builder=t,this.extension=n,this.configs=new Set,this.state={id:0}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Bt;for(let o of this.configs)t=n(t,o);return t}init(t){let n=this.state;lD(n)||ke(306,String(n.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,c){return Object.assign(a,{config:l,id:3,registerState:c})})(n,this.mergeConfigs(),o),i;this.state=s,this.extension.init&&(i=this.extension.init(t,s.config,o)),this.state=(function(a,l,c){return Object.assign(a,{id:4,initResult:l,registerState:c})})(s,i,r)}build(t){let n=this.state,o;n.id!==4&&ke(307,String(n.id),String(5)),this.extension.build&&(o=this.extension.build(t,n.config,n.registerState));let r={...n.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(s,i,a){return Object.assign(s,{id:5,output:i,registerState:a})})(n,o,r)}register(t,n){this._signal=n;let o=this.state;o.id!==5&&ke(308,String(o.id),String(5));let r=this.extension.register&&this.extension.register(t,o.config,o.registerState);return this.state=(function(s){return Object.assign(s,{id:6})})(o),()=>{let s=this.state;s.id!==7&&ke(309,String(o.id),String(7)),this.state=(function(i){return Object.assign(i,{id:5})})(s),r&&r()}}afterRegistration(t){let n=this.state,o;return n.id!==6&&ke(310,String(n.id),String(6)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:7})})(n),o}getSignal(){return this._signal===void 0&&ke(311),this._signal}getInitResult(){this.extension.init===void 0&&ke(312,this.extension.name);let t=this.state;return(function(n){return n.id>=4})(t)||ke(313,String(t.id),String(4)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=3})(t)||ke(314,String(t.id),String(3)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&ke(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&ke(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=7})(t)||ke(316,String(t.id),String(7)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||oL}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=5})(t)||ke(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},sy=Symbol.for("@lexical/extension/LexicalBuilder");function rL(...e){return Pf.fromExtensions(e).buildEditor()}function iD(){}function sL(e){throw e}function Rf(e){return Array.isArray(e)?e:[e]}var oy=tL,Pf=class e{constructor(t){w(this,"roots");w(this,"extensionNameMap");w(this,"outgoingConfigEdges");w(this,"incomingEdges");w(this,"conflicts");w(this,"_sortedExtensionReps");w(this,"PACKAGE_VERSION");this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=oy,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[Rf(sD)];for(let o of t)n.push(Rf(o));return new e(n)}static maybeFromEditor(t){let n=t[sy];return n&&(n.PACKAGE_VERSION!==oy&&ke(292,n.PACKAGE_VERSION,oy),n instanceof e||ke(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&ke(294),n}constructEditor(){let{$initialEditorState:t,onError:n,onWarn:o,...r}=this.buildCreateEditorArgs(),s=Object.assign(Sf({...r,...n?{onError:i=>{n(i,s)}}:{},...o?{onWarn:i=>{o(i,s)}}:{}}),{[sy]:this});for(let i of this.sortedExtensionReps())i.build(s);return s}buildEditor(){let t=iD;function n(){try{t()}finally{t=iD}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Se(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&ke(295,t.name),n}addEdge(t,n,o){let r=this.outgoingConfigEdges.get(t);if(r){let i=r.get(n);i?i.push(...o):r.set(n,o)}else this.outgoingConfigEdges.set(t,new Map([[n,o]]));let s=this.incomingEdges.get(n);s?s.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&ke(296);let n=Rf(t),[o]=n;typeof o.name!="string"&&ke(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&ke(298,o.name),!r){r=new ry(this,o),this.extensionNameMap.set(o.name,r);let s=this.conflicts.get(o.name);typeof s=="string"&&ke(299,o.name,s);for(let i of o.conflictsWith||[])this.extensionNameMap.has(i)&&ke(299,o.name,i),this.conflicts.set(i,o.name);for(let i of o.dependencies||[]){let a=Rf(i);this.addEdge(o.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[i,a]of o.peerDependencies||[])this.addEdge(o.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(o,r)=>{let s=o.state;if(lD(s))return;let i=o.extension.name;var a;ny(s)||ke(300,i,r||"[unknown]"),ny(a=s)||ke(304,String(a.id),String(0)),s=Object.assign(a,{id:1}),o.state=s;let l=this.outgoingConfigEdges.get(i);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&n(u,i)}s=(function(c){return(function(u){return u.id===1})(c)||ke(305,String(c.id),String(1)),Object.assign(c,{id:2})})(s),o.state=s,t.push(o)};for(let o of this.extensionNameMap.values())ny(o.state)&&n(o);for(let o of t)for(let[r,s]of this.outgoingConfigEdges.get(o.extension.name)||[])if(s.length>0){let i=this.extensionNameMap.get(r);if(i)for(let a of s)i.configs.add(a)}for(let[o,...r]of this.roots)if(r.length>0){let s=this.extensionNameMap.get(o.name);s===void 0&&ke(301,o.name);for(let i of r)s.configs.add(i)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],s=o.signal;for(let i of n){let a=i.register(t,s);a&&r.push(a)}for(let i of n){let a=i.afterRegistration(t);a&&r.push(a)}return Se(...r)}buildCreateEditorArgs(){let t={},n=new Set,o=new Map,r=new Map,s={},i={},a=this.sortedExtensionReps();for(let u of a){let{extension:d}=u;if(d.onError!==void 0&&(t.onError=d.onError),d.onWarn!==void 0&&(t.onWarn=d.onWarn),d.disableEvents!==void 0&&(t.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(t.parentEditor=d.parentEditor),d.editable!==void 0&&(t.editable=d.editable),d.namespace!==void 0&&(t.namespace=d.namespace),d.$initialEditorState!==void 0&&(t.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of oD(d)){if(typeof f!="function"){let p=o.get(f.replace);p&&ke(302,d.name,f.replace.name,p.extension.name),o.set(f.replace,u)}n.add(f)}if(d.html){if(d.html.export)for(let[f,p]of d.html.export.entries())r.set(f,p);d.html.import&&Object.assign(s,d.html.import)}d.theme&&aD(i,d.theme)}Object.keys(i).length>0&&(t.theme=i),n.size&&(t.nodes=Array.from(n));let l=Object.keys(s).length>0,c=r.size>0;(l||c)&&(t.html={},l&&(t.html.import=s),c&&(t.html.export=r));for(let u of a)u.init(t);return t.onError||(t.onError=sL),t}};var ay=iy,fa=ay.LexicalBuilder,Nj=ay.buildEditorFromExtensions,Tj=ay.builderSymbol;var ly={};de(ly,{ReactProviderExtension:()=>iL});var iL={name:"@lexical/react/ReactProvider"};var aL=ly,cD=aL.ReactProviderExtension;var uy={};de(uy,{$canShowPlaceholder:()=>dD,$canShowPlaceholderCurry:()=>cL,$findTextIntersectionFromCharacters:()=>uL,$isRootTextContentEmpty:()=>cy,$isRootTextContentEmptyCurry:()=>lL,$rootTextContent:()=>uD,registerLexicalTextEntity:()=>fL});function uD(){return Ue().getTextContent()}function cy(e,t=!0){if(e)return!1;let n=uD();return t&&(n=n.trim()),n===""}function lL(e,t){return()=>cy(e,t)}function dD(e){if(!cy(e,!1))return!1;let t=Ue().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(vn(r))return!1;if(W(r)){if(!$T(r)||r.__indent!==0)return!1;let s=r.getChildren(),i=s.length;for(let a=0;a<i;a++){let l=s[a];if(!H(l))return!1}}}return!0}function cL(e){return()=>dD(e)}function uL(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(W(n)){let i=n.getFirstChild();if(i!==null){n=i;continue}}else if(H(n)){let i=n.getTextContentSize();if(o+i>t)return{node:n,offset:t-o};o+=i}let r=n.getNextSibling();if(r!==null){n=r;continue}let s=n.getParent();for(;s!==null;){let i=s.getNextSibling();if(i!==null){n=i;continue e}s=s.getParent()}break}return null}function dL(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function fL(e,t,n,o){let r=i=>i instanceof n,s=i=>{let a=Vn(i.getTextContent()).setFormat(i.getFormat()).setStyle(i.getStyle()).setDetail(i.getDetail());i.replace(a)};return[e.registerNodeTransform(kr,i=>{if(!i.isSimpleText())return;let a,l=i.getPreviousSibling(),c=i.getTextContent(),u=i;if(H(l)){let f=l.getTextContent(),p=t(f+c);if(r(l)){if(p===null||(h=>h.getLatest().__mode)(l)!==0)return void s(l);{let h=p.end-f.length;if(h>0){let g=f+c.slice(0,h);if(l.select(),l.setTextContent(g),h===c.length)i.remove();else{let y=c.slice(h);i.setTextContent(y)}return}}}else if(p===null||p.start<f.length)return}let d=0;for(;;){let f=c;a=t(f);let p=a===null?"":f.slice(a.end);if(c=p,p===""){let y=u.getNextSibling();if(H(y)){let m=f+y.getTextContent(),_=t(m);if(_===null)return void(r(y)?s(y):y.markDirty());if(a===null||_.start!==a.start)return}}if(a===null)return;if(a.start===0&&H(l)&&l.isTextEntity()){d+=a.end;continue}let h;a.start===0?[h,u]=u.splitText(a.end):[,h,u]=u.splitText(a.start+d,a.end+d),h===void 0&&dL(165,"nodeToReplace");let g=o(h);if(g.setFormat(h.getFormat()).setStyle(h.getStyle()).setDetail(h.getDetail()),h.replace(g),u==null)return;d=0,l=g}}),e.registerNodeTransform(n,i=>{let a=i.getTextContent(),l=t(a);if(l===null||l.start!==0)return void s(i);if(a.length>l.end)return void i.splitText(l.end);let c=i.getPreviousSibling();H(c)&&c.isTextEntity()&&(s(c),s(i));let u=i.getNextSibling();H(u)&&u.isTextEntity()&&(s(u),r(i)&&s(i))})]}var Ps=uy,Mj=Ps.$canShowPlaceholder,Lf=Ps.$canShowPlaceholderCurry,kj=Ps.$findTextIntersectionFromCharacters,Aj=Ps.$isRootTextContentEmpty,Ij=Ps.$isRootTextContentEmptyCurry,$j=Ps.$rootTextContent,Rj=Ps.registerLexicalTextEntity;var dy={};de(dy,{batch:()=>Oe,computed:()=>wa,effect:()=>gt,signal:()=>wn,untracked:()=>ie});var xc=dy,vc=xc.batch,fD=xc.computed,Ae=xc.effect,St=xc.signal,Fj=xc.untracked;var fy={};de(fy,{namedSignals:()=>pL});function pL(e,t={}){let n={};for(let o in e){let r=t[o],s=St(r===void 0?e[o]:r);n[o]=s}return n}var hL=fy,Qe=hL.namedSignals;var py={};de(py,{watchedSignal:()=>gL});function gL(e,t){let n;return St(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var mL=py,Pr=mL.watchedSignal;var hy={};de(hy,{DragonExtension:()=>SL,installDragonSupport:()=>yL,registerDragonSupport:()=>gD});var _L={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Ff=Symbol.for("@lexical/dragon/WindowState");function yL(e=(function(){return typeof window<"u"?window:void 0})()){return e?hD(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function hD(e,t,n){let o=(function(r){let s=r[Ff];return s===void 0&&(s={dispose:()=>{},editors:new Map,installs:new Set},r[Ff]=s),s})(e);if(o.installs.size===0){let r=vL.bind(e);e.addEventListener("message",r,!0),o.dispose=()=>{e.removeEventListener("message",r,!0)}}if(o.installs.add(t),n){let r=o.editors.get(n)||new Set;r.add(t),o.editors.set(n,r)}return xL.bind(null,e,o,t,n)}function xL(e,t,n,o){if(o){let r=t.editors.get(o);r&&r.delete(n)&&r.size===0&&t.editors.delete(o)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[Ff])}function pD(e){return e&&e.ownerDocument.defaultView}function gD(e){let t=Pr(()=>pD(e.getRootElement()),n=>e.registerRootListener(o=>{n.value=pD(o)}));return Ae(()=>{let n=t.value;if(n)return hD(n,Symbol("@lexical/dragon/editorInstall"),e)})}function vL(e){if(e.origin!==this.location.origin)return;let t=(function(o){let r=o[Ff];if(r===void 0)return null;let s=Nf(Is(o.document));return Df(s)&&r.editors.has(s)?s:null})(this);if(t===null)return;let n=e.data;if(typeof n=="string"){let o;try{o=JSON.parse(n)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){let r=o.payload;if(r&&r.functionId==="makeChanges"){let s=r.args;if(Array.isArray(s)){let[i,a,l,c,u,d]=s;if(![i,a,c,u].every(Number.isFinite)||typeof l!="string"&&l!==-1)return;t.update(()=>{let f=z();if(F(f)){let p=f.anchor,h=p.getNode(),g=0,y=0;if(H(h)&&i>=0&&a>=0&&(g=i,y=i+a,f.setTextNodeRange(h,g,h,y)),typeof l!="string"||g===y&&l===""||(f.insertRawText(l),h=p.getNode()),H(h)){let m=h.getTextContentSize();g=Math.min(Math.max(c,0),m),y=c<0||u<0?g:Math.min(c+u,m),f.setTextNodeRange(h,g,h,y)}if(typeof d=="string"&&u>0&&!f.isCollapsed()){let m=_L[d];m!==void 0&&f.formatText(m)}e.stopImmediatePropagation()}})}}}}}var SL={build:(e,t,n)=>Qe(t),config:{disabled:typeof window>"u"},name:"@lexical/dragon",register:(e,t,n)=>Ae(()=>n.getOutput().disabled.value?void 0:gD(e))};var gy=hy,mD=gy.DragonExtension,Gj=gy.installDragonSupport,_D=gy.registerDragonSupport;var my={};de(my,{getPeerDependencyFromEditor:()=>yD,getPeerDependencyFromEditorOrThrow:()=>CL});function yD(e,t){let n=fa.maybeFromEditor(e);if(!n)return;let o=n.extensionNameMap.get(t);return o?o.getExtensionDependency():void 0}function CL(e,t){let n=yD(e,t);return n===void 0&&(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(291,t),n}var xD=my,uo=xD.getPeerDependencyFromEditor,Jj=xD.getPeerDependencyFromEditorOrThrow;var Cy={};de(Cy,{$addNodeStyle:()=>wL,$cloneWithProperties:()=>Hd,$copyBlockFormatIndent:()=>OD,$ensureForwardRangeSelection:()=>TD,$forEachSelectedTextNode:()=>ND,$getComputedStyleForElement:()=>xy,$getComputedStyleForParent:()=>vy,$getSelectionStyleValueForProperty:()=>LL,$isAtEdgeOfElement:()=>DD,$isAtNodeEnd:()=>DL,$isParentElementRTL:()=>Sy,$isParentRTL:()=>TL,$moveCaretSelection:()=>kD,$moveCharacter:()=>RL,$patchStyleText:()=>ML,$selectAll:()=>nf,$setBlocksType:()=>kL,$shouldOverrideDefaultCharacterSelection:()=>$L,$sliceSelectedTextNodeContent:()=>OL,$trimTextContentFromAnchor:()=>ED,$wrapNodes:()=>IL,createDOMRange:()=>EL,createRectsFromDOMRange:()=>NL,getCSSFromStyleObject:()=>bD,getStyleObjectFromCSS:()=>FL,trimTextContentFromAnchor:()=>BL});function yy(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function bL(e){return()=>{}}function vD(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function SD(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function EL(e,t,n,o,r){let s=t.getKey(),i=o.getKey(),a=$s(e.getRootElement()).createRange(),l=e.getElementByKey(s),c=e.getElementByKey(i),u=n,d=r;if(H(t)&&(l=vD(l)),H(o)&&(c=vD(c)),t===void 0||o===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=SD(l)),c.nodeName==="BR"&&([c,d]=SD(c));let f=l.firstChild;l===c&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{a.setStart(l,u),a.setEnd(c,d)}catch{return null}return!a.collapsed||u===d&&s===i||(a.setStart(c,d),a.setEnd(l,u)),a}function NL(e,t){let n=e.getRootElement();if(n===null)return[];let o=n.getBoundingClientRect(),r=getComputedStyle(n),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(t.getClientRects()),a,l=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<l;c++){let u=i[c],d=a&&a.top<=u.top&&a.bottom>=u.bottom&&a.left<=u.left&&a.right>=u.right,f=u.width+s===o.width;d||f?(i.splice(c--,1),l--):a=u}return i}function bD(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function xy(e){let t=Ne().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function vy(e){let t=As(e)?e:e.getParent();return t&&xy(t)}function TL(e){let t=vy(e);return t!==null&&t.direction==="rtl"}function OL(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!P_(t)&&o!==null){let[r,s]=o,i=e.isBackward(),a=r.getNode(),l=s.getNode(),c=t.is(a),u=t.is(l);if(c||u){let[d,f]=NT(e),p=a.is(l),h=t.is(i?l:a),g=t.is(i?a:l),y,m=0;p?(m=d>f?f:d,y=d>f?d:f):h?(m=i?f:d,y=void 0):g&&(m=0,y=i?d:f);let _=t.__text.slice(m,y);_!==t.__text&&(n==="clone"&&(t=yT(t)),t.__text=_)}}return t}function DL(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return W(t)||yy(177),e.offset===t.getChildrenSize()}function ED(e,t,n){let o=t.getNode(),r=n;if(W(o)){let s=o.getDescendantByIndex(t.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(W(o)){let c=o.getLastDescendant();c!==null&&(o=c)}let s=o.getPreviousSibling(),i=0;if(s===null){let c=o.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let a=o.getTextContent();a===""&&W(o)&&!o.isInline()&&(a=`
78
78
 
79
- `);let l=a.length;if(!H(o)||r>=l){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||As(c)||c.remove(),r-=l+i,o=s}else{let c=o.getKey(),u=e.read("latest",()=>{let p=Zi(c);return H(p)&&p.isSimpleText()?p.getTextContent():null}),d=l-r,f=a.slice(0,d);if(u!==null&&u!==a){let p=Ms(),h=o;if(o.isSimpleText())o.setTextContent(u);else{let g=Hn(u);o.replace(g),h=g}if(F(p)&&p.isCollapsed()){let g=p.anchor.offset;h.select(g,g)}}else if(o.isSimpleText()){let p=t.key===c,h=t.offset;h<r&&(h=l);let g=p?h-r:0,y=p?h:d;if(p&&g===0){let[m]=o.splitText(g,y);m.remove()}else{let[,m]=o.splitText(g,y);m.remove()}}else{let p=Hn(f);o.replace(p)}r=0}}}var OL=SL();function Bf(e,t){(F(e)?e.isCollapsed():H(e)||W(e))||yy(280);let n=gc(F(e)?e.style:H(e)?e.getStyle():e.getTextStyle()),o=CD(Object.entries(t).reduce((r,[s,i])=>(typeof i=="function"?r[s]=i(n[s],e):i===null?delete r[s]:r[s]=i,r),{...n}));F(e)||H(e)?e.setStyle(o):e.setTextStyle(o)}function DL(e,t){let n=new Set;if(F(e)&&e.isCollapsed()){Bf(e,t);let r=e.anchor.getNode();W(r)&&r.isEmpty()&&(n.add(r.getKey()),Bf(r,t))}ED(r=>{Bf(r,t)});let o=e.getNodes();if(o.length>0)for(let r of o){if(!W(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();n.has(s)||(n.add(s),Bf(r,t))}}function ED(e){let t=z();if(!t)return;let n=new Map,o=s=>n.get(s.getKey())||[0,s.getTextContentSize()];if(F(t))for(let s of Nr(t).getTextSlices())s&&n.set(s.caret.origin.getKey(),s.getSliceIndices());let r=t.getNodes();for(let s of r){if(!H(s)||!s.canHaveFormat())continue;let[i,a]=o(s);a!==i&&(P_(s)||i===0&&a===s.getTextContentSize()?e(s):e(s.splitText(i,a)[i===0?0:1]))}F(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&ND(t)}function ND(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:s}=t;t.set(n.key,n.offset,n.type),n.set(o,r,s)}}function TD(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function OD(e,t,n){let o=xn(e,n);if(ic(o))return!1;for(;o;o=o.getParentCaret()){let r=o.getParentAtCaret();if(!r||o.getNodeAtCaret())return!1;if(t.is(r))return!0}return!1}function wL(e,t,n=TD){if(!e)return;let o=e.getStartEndPoints(),r=!1,s=null,i=new Map;if(o){let[a,l]=o,c=Me(a.getNode(),fc);s=Me(l.getNode(),fc);let u=e.isBackward()?"previous":"next";r=W(s)&&!s.is(c)&&(function(d,f,p){let h=d.getNode();return(!W(h)||!h.isEmpty())&&OD(d,f,p)})(l,s,LO(u)),W(c)&&i.set(c.getKey(),c),W(s)&&!r&&i.set(s.getKey(),s)}for(let a of e.getNodes())if(W(a)&&fc(a)){if(r&&a.is(s))continue;i.set(a.getKey(),a)}else if(!o){let l=Me(a,fc);W(l)&&i.set(l.getKey(),l)}for(let a of i.values()){if(Zd(a)!==null)continue;let l=t();n(a,l),a.replace(l,!0)}}function SD(e){return e.getNode().isAttached()}function ML(e){let t=e;for(;t!==null&&!io(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function kL(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,s=e.getNodes(),i=s.length;if(r!==null){let c=Qd(r.getNode());if(c!==null&&!io(c))return}if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let c=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=c.getChildren(),d=t();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach(f=>d.append(f)),n&&(d=n.append(d)),void c.replace(d)}let a=null,l=[];for(let c=0;c<i;c++){let u=s[c];io(u)?(_y(e,l,l.length,t,n),l=[],a=u):a===null||a!==null&&sc(u,a)?l.push(u):(_y(e,l,l.length,t,n),l=[u])}_y(e,l,l.length,t,n)}function _y(e,t,n,o,r=null){if(t.length===0)return;let s=t[0],i=new Map,a=[],l=W(s)?s:s.getParentOrThrow(),c=l.isInline()?l.getParentOrThrow():l,u=!1;for(;c!==null;){let g=c.getPreviousSibling();if(g!==null){c=g,u=!0;break}if(c=c.getParentOrThrow(),io(c))break}let d=new Set;for(let g=0;g<n;g++){let y=t[g];W(y)&&y.getChildrenSize()===0&&d.add(y.getKey())}let f=new Set;for(let g=0;g<n;g++){let y=t[g],m=y.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&AT(y)&&!f.has(y.getKey())){let _=m.getKey();if(i.get(_)===void 0){let x=o();x.setFormat(m.getFormatType()),x.setIndent(m.getIndent()),a.push(x),i.set(_,x);let v=m.getChildren();x.splice(x.getChildrenSize(),0,v);for(let S of v)if(f.add(S.getKey()),W(S))for(let b of S.getChildrenKeys())f.add(b);ML(m)}}else if(d.has(y.getKey())){W(y)||yy(179);let _=o();_.setFormat(y.getFormatType()),_.setIndent(y.getIndent()),a.push(_),y.remove(!0)}}if(r!==null)for(let g=0;g<a.length;g++){let y=a[g];r.append(y)}let p=null;if(io(c))if(u)if(r!==null)c.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let y=a[g];c.insertAfter(y)}else{let g=c,y=g.getFirstChild();if(W(y)&&(c=y),y===null)if(r)g.append(r);else for(let m=0;m<a.length;m++){let _=a[m];g.append(_),p=_}else if(r!==null)y.insertBefore(r);else for(let m=0;m<a.length;m++){let _=a[m];y.insertBefore(_),p=_}}else if(r)c.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let y=a[g];c.insertAfter(y),p=y}let h=Ms();F(h)&&SD(h.anchor)&&SD(h.focus)?Cn(h.clone()):p!==null?p.selectEnd():e.dirty=!0}function DD(e){let t=wD(e);return t!==null&&t.writingMode==="vertical-rl"}function wD(e){let t=e.anchor.getNode();return W(t)?xy(t):vy(t)}function AL(e,t){let n=DD(e)?!t:t;Sy(e)&&(n=!n);let o=xn(e.focus,n?"previous":"next");if(ic(o))return!1;if(ao(o)&&!R_(o.origin)&&o.origin.isUnmergeable()){let r=o.getNodeAtCaret();if(H(r)&&!R_(r))return!0}for(let r of qd(o)){if(Uo(r))return!r.origin.isInline();if(!W(r.origin)){if(vn(r.origin))return!0;break}}return!1}function MD(e,t,n,o){e.modify(t?"extend":"move",n,o)}function Sy(e){let t=wD(e);return t!==null&&t.direction==="rtl"}function IL(e,t,n){let o=Sy(e),r;r=DD(e)||o?!n:n,MD(e,t,r,"character")}function $L(e,t,n){let o=e.getStyle(),r=gc(o);return r!==null&&r[t]||n}function RL(e,t,n=""){let o=null,r=e.getNodes(),s,i;if(F(e)){if(e.isCollapsed()&&e.style!==""){let h=gc(e.style);if(h!==null&&t in h)return h[t]}let{anchor:a,focus:l}=e,c=e.isBackward(),u=c?l.getNode():a.getNode(),d=c?a.getNode():l.getNode(),f=c?l.offset:a.offset,p=c?a.offset:l.offset;H(u)&&f===u.getTextContentSize()&&(s=u),p===0&&(i=d)}for(let a=0;a<r.length;a++){let l=r[a];if(H(l)&&!l.is(a===0?s:i)){let c=$L(l,t,n);if(o===null)o=c;else if(o!==c){o="";break}}}return o===null?n:o}var PL=gc,LL=bD;var Le=Cy,qj=Le.$addNodeStyle,Xj=Le.$cloneWithProperties,Jj=Le.$copyBlockFormatIndent,Qj=Le.$ensureForwardRangeSelection,Zj=Le.$forEachSelectedTextNode,e3=Le.$getComputedStyleForElement,t3=Le.$getComputedStyleForParent,n3=Le.$getSelectionStyleValueForProperty,by=Le.$isAtEdgeOfElement,o3=Le.$isAtNodeEnd,r3=Le.$isParentElementRTL,Sc=Le.$isParentRTL,s3=Le.$moveCaretSelection,Ey=Le.$moveCharacter,i3=Le.$patchStyleText,a3=Le.$selectAll,l3=Le.$setBlocksType,Ny=Le.$shouldOverrideDefaultCharacterSelection,zf=Le.$sliceSelectedTextNodeContent,c3=Le.$trimTextContentFromAnchor,u3=Le.$wrapNodes,d3=Le.createDOMRange,kD=Le.createRectsFromDOMRange,f3=Le.getCSSFromStyleObject,p3=Le.getStyleObjectFromCSS,h3=Le.trimTextContentFromAnchor;var Ay={};de(Ay,{$descendantsMatching:()=>dF,$dfs:()=>HL,$dfsIterator:()=>LD,$dfsWithSlots:()=>YL,$dfsWithSlotsIterator:()=>FD,$filter:()=>sF,$findMatchingParent:()=>Me,$firstToLastIterator:()=>fF,$getAdjacentCaret:()=>VL,$getAdjacentSiblingOrParentSiblingCaret:()=>Tr,$getDepth:()=>BD,$getNearestBlockElementAncestorOrThrow:()=>QL,$getNearestNodeOfType:()=>JL,$getNextRightPreorderNode:()=>qL,$getNextSiblingOrParentSibling:()=>GL,$handleIndentAndOutdent:()=>iF,$insertFirst:()=>aF,$insertNodeIntoLeaf:()=>nF,$insertNodeToNearestRoot:()=>tF,$insertNodeToNearestRootAtCaret:()=>ta,$isAtEndOfNode:()=>jD,$isAtStartOfNode:()=>VD,$isBlockFullySelected:()=>MT,$isEditorIsNestedEditor:()=>cF,$lastToFirstIterator:()=>ky,$onEscapeDown:()=>mF,$onEscapeUp:()=>gF,$restoreEditorState:()=>eF,$reverseDfs:()=>jL,$reverseDfsIterator:()=>zD,$reverseDfsWithSlots:()=>XL,$reverseDfsWithSlotsIterator:()=>WD,$splitNode:()=>BT,$unwrapAndFilterDescendants:()=>uF,$unwrapNode:()=>pF,$wrapNodeInElement:()=>oF,CAN_USE_BEFORE_INPUT:()=>uc,CAN_USE_DOM:()=>bn,IS_ANDROID:()=>iO,IS_ANDROID_CHROME:()=>aO,IS_APPLE:()=>lO,IS_APPLE_WEBKIT:()=>uf,IS_CHROME:()=>cO,IS_FIREFOX:()=>df,IS_IOS:()=>pc,IS_SAFARI:()=>ff,addClassNamesToElement:()=>So,calculateZoomLevel:()=>lF,dedupeSelectionRects:()=>FL,eventFiles:()=>rF,getScrollParent:()=>KL,isBlockDomNode:()=>Ir,isHTMLAnchorElement:()=>la,isHTMLElement:()=>me,isInlineDomNode:()=>ca,isMimeType:()=>PD,makeStateWrapper:()=>hF,markSelection:()=>RD,mediaFileReader:()=>UL,mergeRegister:()=>Se,objectKlassEquals:()=>My,positionNodeOnRange:()=>$D,registerNestedElementResolver:()=>ZL,removeClassNamesFromElement:()=>kf,selectionAlwaysOnDisplay:()=>WL});function Oy(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function FL(e){let t=(o,r)=>r.left>=o.left-1&&r.top>=o.top-1&&r.right<=o.right+1&&r.bottom<=o.bottom+1,n=[];for(let o of Array.from(e))if(!(o.width<.5||o.height<.5||n.some(r=>t(o,r)))){for(let r=n.length-1;r>=0;r--)t(n[r],o)&&n.splice(r,1);n.push(o)}return n}function Co(e){return`${e}px`}var BL={attributes:!0,characterData:!0,childList:!0,subtree:!0};function $D(e,t,n){let o=null,r=null,s=null,i=[],a=$s(e.getRootElement()).createElement("div");function l(){o===null&&Oy(182),r===null&&Oy(183);let{left:f,top:p}=r.getBoundingClientRect(),h=(function(_){let x=[];for(let v of _)v.width<.5||v.height<.5||x.some(S=>Math.abs(S.left-v.left)<=1&&Math.abs(S.top-v.top)<=1&&Math.abs(S.right-v.right)<=1&&Math.abs(S.bottom-v.bottom)<=1)||x.push(v);return x})(kD(e,t));var g,y;a.isConnected||(y=a,(g=r).insertBefore(y,g.firstChild));let m=!1;for(let _=0;_<h.length;_++){let x=h[_],v=i[_]||$s(o).createElement("div"),S=v.style;S.position!=="absolute"&&(S.position="absolute",m=!0);let b=Co(x.left-f);S.left!==b&&(S.left=b,m=!0);let N=Co(x.top-p);S.top!==N&&(v.style.top=N,m=!0);let D=Co(x.width);S.width!==D&&(v.style.width=D,m=!0);let O=Co(x.height);S.height!==O&&(v.style.height=O,m=!0),v.parentNode!==a&&(a.append(v),m=!0),i[_]=v}for(;i.length>h.length;){let _=i.pop();_!=null&&(_.remove(),m=!0)}m&&n(i)}function c(){r=null,o=null,s!==null&&s.disconnect(),s=null,a.remove();for(let f of i)f.remove();i=[]}function u(){let f=e.getRootElement();if(f===null)return c();let p=f.parentElement;if(!me(p))return c();c(),o=f,r=p,s=new MutationObserver(h=>{let g=e.getRootElement(),y=g&&g.parentElement;if(g!==o||y!==r)return u();for(let m of h)if(!a.contains(m.target))return l()}),s.observe(p,BL),l()}a.style.position="relative";let d=e.registerRootListener(()=>(u(),c));return()=>{d(),c()}}function AD(e,t,n,o){if(t.type!=="text"&&W(n)){let r=NT(n,o,e);return[r.element,r.getFirstChildOffset()+t.offset]}return[(H(n)?TT(n,o,e):zO(o))||o,t.offset]}function zL(e){for(let t of e){let n=t.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==Co(-1.5)&&(n.marginTop=Co(-1.5)),n.paddingTop!==Co(4)&&(n.paddingTop=Co(4)),n.paddingBottom!==Co(0)&&(n.paddingBottom=Co(0))}}function RD(e,t=zL){let n=null,o=null,r=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=z();if(!F(d))return n=null,r=null,s=null,a=null,l(),void(l=()=>{});let[f,p]=(function(D){let O=D.getStartEndPoints();return D.isBackward()?[O[1],O[0]]:O})(d),h=f.getNode(),g=h.getKey(),y=f.offset,m=p.getNode(),_=m.getKey(),x=p.offset,v=e.getElementByKey(g),S=e.getElementByKey(_),b=n===null||v!==o||y!==r||g!==n.getKey(),N=s===null||S!==i||x!==a||_!==s.getKey();if((b||N)&&v!==null&&S!==null){let D=(function(O,T,A,$,I,L,P){let Y=(O._window?O._window.document:document).createRange();return Y.setStart(...AD(O,T,A,$)),Y.setEnd(...AD(O,I,L,P)),Y})(e,f,h,v,p,m,S);l(),l=$D(e,D,t)}n=h,o=v,r=y,s=m,i=S,a=x},{editor:e})}return c(e.getEditorState()),Se(e.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function WL(e,t){let n=null,o=()=>{let r=e.getRootElement(),s=r!==null?r.ownerDocument.defaultView:null,i=s!==null?s.getSelection():null,a=i!==null?Ef(i,r).anchorNode:null;a!==null&&r!==null&&r.contains(a)?n!==null&&(n(),n=null):n===null&&(n=RD(e,t))};return e.registerRootListener(r=>{if(r){let s=r.ownerDocument,i=Se(Rs(s,"selectionchange",o),()=>{n!==null&&n()});return o(),i}})}function KL(e,t){let n=e.ownerDocument,o=n.defaultView||window,r=o.getComputedStyle(e),s=r.position==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(r.position==="fixed")return n.body;for(let a=e;a=hc(a);)if(r=o.getComputedStyle(a),(!s||r.position!=="static")&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n.body}function PD(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function UL(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:a,value:l}=n.next();if(a)return o(s);let c=new FileReader;c.addEventListener("error",r),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:l,result:u}),i()}),PD(l,t)?c.readAsDataURL(l):i()};i()})}function HL(e,t){return Array.from(LD(e,t))}function VL(e){return e?e.getAdjacentCaret():null}function jL(e,t){return Array.from(zD(e,t))}function LD(e,t){return Wf("next",e,t)}function YL(e,t){return Array.from(FD(e,t))}function*FD(e,t){for(let n of Wf("next",e,t)){yield n;let{node:o,depth:r}=n;if(ac(o)&&!o.is(t))for(let s of ks(o)){let i=ea(o,s);i!==null&&(yield*Dy(i,r+1))}}}function*Dy(e,t){yield{depth:t,node:e};let n=t+1;if(ac(e))for(let o of ks(e)){let r=ea(e,o);r!==null&&(yield*Dy(r,n))}if(W(e))for(let o of e.getChildren())yield*Dy(o,n)}function ID(e,t){let n=Tr(Je(e,t));return n&&n[0]}function Wf(e,t,n){let o=Ue(),r=t||o,s=W(r)?Qt(r,e):Je(r,e),i=BD(r),a=n?M_(A_(Je(n,e)))||ID(n,e):ID(r,e),l=i;return X_({hasNext:c=>c!==null,initial:s,map:c=>({depth:l,node:c.origin}),step:c=>{if(c.isSameNodeCaret(a))return null;Uo(c)&&l++;let u=Tr(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function GL(e){let t=Tr(Je(e,"next"));return t&&[t[0].origin,t[1]]}function BD(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Zd(n))t++;return t}function qL(e){let t=A_(Je(e,"previous")),n=Tr(t,"root");return n&&n[0].origin}function zD(e,t){return Wf("previous",e,t)}function XL(e,t){return Array.from(WD(e,t))}function*WD(e,t){let n=[];for(let o of Wf("previous",e,t)){for(;n.length>0&&o.depth<=n[n.length-1].depth;){let i=n.pop();yield*wy(i.node,i.depth+1)}yield o;let{node:r,depth:s}=o;ac(r)&&ks(r).length>0&&!r.is(t)&&n.push({depth:s,node:r})}for(;n.length>0;){let o=n.pop();yield*wy(o.node,o.depth+1)}}function*wy(e,t){let n=ks(e);for(let o=n.length-1;o>=0;o--){let r=ea(e,n[o]);r!==null&&(yield*KD(r,t))}}function*KD(e,t){yield{depth:t,node:e};let n=t+1;if(W(e)){let o=e.getChildren();for(let r=o.length-1;r>=0;r--)yield*KD(o[r],n)}ac(e)&&(yield*wy(e,n))}function JL(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function QL(e){let t=Me(e,n=>W(n)&&!n.isInline());return W(t)||Oy(4,e.__key),t}function ZL(e,t,n,o){let r=s=>s instanceof t;return e.registerNodeTransform(t,s=>{let i=(a=>{let l=a.getChildren();for(let d=0;d<l.length;d++){let f=l[d];if(r(f))return null}let c=a,u=a;for(;c!==null;)if(u=c,c=c.getParent(),r(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:a,parent:l}=i;if(a.is(s)){o(l,s);let c=a.getNextSiblings(),u=c.length;if(l.insertAfter(a),u!==0){let d=n(l);a.insertAfter(d);for(let f=0;f<u;f++)d.append(c[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function eF(e,t){let n=new Map,o=e._pendingEditorState;for(let[s,i]of t._nodeMap)n.set(s,Hd(i));o&&(o._nodeMap=n),Xd();let r=t._selection;Cn(r===null?null:r.clone())}function tF(e){let t=z()||Ms(),n;if(F(t))n=xn(t.focus,"next");else{if(t!=null){let a=t.getNodes(),l=a[a.length-1];l&&(n=Je(l,"next"))}n=n||Qt(Ue(),"previous").getFlipped().insert(it())}let o=ta(e,n,ic(r=n)||Tr(ao(r)?r.getSiblingCaret():r,"shadowRoot")!==null?{$shouldSplit:(a,l)=>l!=="last"}:void 0);var r;let s=M_(o),i=Uo(s)?Vn(s):o;return jn(ws(i)),e.getLatest()}function nF(e){let t=z();if(!F(t))return void(t&&t.insertNodes([e]));let n=Nr(t),o=Or(PT(n),"next").anchor;if(ao(o)){let s=rf(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(e),jn(so(r,r))}function oF(e,t){let n=t();return e.replace(n),n.append(e),n}function My(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function rF(e){let t=null;if(My(e,DragEvent)?t=e.dataTransfer:My(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,o=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[o,Array.from(t.files),r]}function sF(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function iF(e){let t=z();if(!F(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(n.has(i))continue;let a=Me(s,c=>W(c)&&!c.isInline());if(a===null)continue;let l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function aF(e,t){Qt(e,"next").insert(t)}var Ty=!(df||!bn)&&void 0;function lF(e,t=!1){let n=1;if((function(){if(Ty===void 0){let o=document.createElement("div");o.style.position="absolute",o.style.opacity="0",o.style.width="100px",o.style.left="-1000px",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),Ty=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Ty})()||t){let o=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(o.getComputedStyle(e).getPropertyValue("zoom")),e=hc(e)}return n}function cF(e){return e._parentEditor!==null}function uF(e,t){return UD(e,t,null)}function UD(e,t,n){let o=!1;for(let r of ky(e))t(r)?n!==null&&n(r):(o=!0,W(r)&&UD(r,t,n||(s=>r.insertAfter(s))),r.remove());return o}function dF(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(W(r))for(let s of ky(r))o.push(s);return n}function fF(e){return HD(Qt(e,"next"))}function ky(e){return HD(Qt(e,"previous"))}function HD(e){return X_({hasNext:Ho,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function pF(e){Sn(Je(e,"next")).splice(1,e.getChildren())}function hF(e){let t=o=>ef(o,e),n=(o,r)=>of(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}function gF(e,t){let n=z();if(F(n)&&n.isCollapsed()){let o=Me(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getFirstChild()===o&&VD(n.anchor,o))return o.insertBefore(it()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function mF(e,t){let n=z();if(F(n)&&n.isCollapsed()){let o=Me(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getLastChild()===o&&jD(n.anchor,o))return o.insertAfter(it()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function VD(e,t){return by(e,t,"previous")}function jD(e,t){return by(e,t,"next")}var U=Ay,x3=U.$descendantsMatching,v3=U.$dfs,S3=U.$dfsIterator,C3=U.$dfsWithSlots,b3=U.$dfsWithSlotsIterator,E3=U.$filter,N3=U.$findMatchingParent,T3=U.$firstToLastIterator,O3=U.$getAdjacentCaret,D3=U.$getAdjacentSiblingOrParentSiblingCaret,w3=U.$getDepth,YD=U.$getNearestBlockElementAncestorOrThrow,M3=U.$getNearestNodeOfType,k3=U.$getNextRightPreorderNode,A3=U.$getNextSiblingOrParentSibling,Iy=U.$handleIndentAndOutdent,I3=U.$insertFirst,$3=U.$insertNodeIntoLeaf,GD=U.$insertNodeToNearestRoot,R3=U.$insertNodeToNearestRootAtCaret,P3=U.$isAtEndOfNode,L3=U.$isAtStartOfNode,F3=U.$isBlockFullySelected,B3=U.$isEditorIsNestedEditor,z3=U.$lastToFirstIterator,W3=U.$onEscapeDown,K3=U.$onEscapeUp,U3=U.$restoreEditorState,H3=U.$reverseDfs,V3=U.$reverseDfsIterator,j3=U.$reverseDfsWithSlots,Y3=U.$reverseDfsWithSlotsIterator,G3=U.$splitNode,q3=U.$unwrapAndFilterDescendants,X3=U.$unwrapNode,J3=U.$wrapNodeInElement,Q3=U.CAN_USE_BEFORE_INPUT,Z3=U.CAN_USE_DOM,e4=U.IS_ANDROID,t4=U.IS_ANDROID_CHROME,n4=U.IS_APPLE,o4=U.IS_APPLE_WEBKIT,r4=U.IS_CHROME,s4=U.IS_FIREFOX,i4=U.IS_IOS,a4=U.IS_SAFARI,l4=U.addClassNamesToElement,c4=U.calculateZoomLevel,u4=U.dedupeSelectionRects,Ls=U.eventFiles,d4=U.getScrollParent,f4=U.isBlockDomNode,p4=U.isHTMLAnchorElement,h4=U.isHTMLElement,g4=U.isInlineDomNode,m4=U.isMimeType,_4=U.makeStateWrapper,y4=U.markSelection,x4=U.mediaFileReader,v4=U.mergeRegister,uo=U.objectKlassEquals,S4=U.positionNodeOnRange,C4=U.registerNestedElementResolver,b4=U.removeClassNamesFromElement,E4=U.selectionAlwaysOnDisplay;var $y={};de($y,{EditorStateExtension:()=>_F});var _F={build:e=>Pr(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"};var yF=$y,Cc=yF.EditorStateExtension;var Ry={};de(Ry,{NodeSelectionExtension:()=>vF});var xF=new Set,vF={build(e,t,n){let o=n.getDependency(Cc).output,r=St({watchedNodeKeys:new Map}),s=Pr(()=>{},()=>Ae(()=>{let i=s.peek(),{watchedNodeKeys:a}=r.value,l,c=!1;o.value.read(()=>{if(z())for(let[u,d]of a.entries()){if(d.size===0){a.delete(u);continue}let f=Zi(u),p=f&&f.isSelected()||!1;c=c||p!==(!!i&&i.has(u)),p&&(l=l||new Set,l.add(u))}}),!c&&l&&i&&l.size===i.size||(s.value=l)}));return{watchNodeKey:function(i){let a=dD(()=>(s.value||xF).has(i)),{watchedNodeKeys:l}=r.peek(),c=l.get(i),u=c!==void 0;return c=c||new Set,c.add(a),u||(l.set(i,c),r.value={watchedNodeKeys:l}),a}}},dependencies:[Cc],name:"@lexical/extension/NodeSelection"};var SF=Ry,Py=SF.NodeSelectionExtension;var Fy={};de(Fy,{$createHorizontalRuleNode:()=>Ly,$isHorizontalRuleNode:()=>XD,HorizontalRuleExtension:()=>bF,HorizontalRuleNode:()=>Fs,INSERT_HORIZONTAL_RULE_COMMAND:()=>qD});var qD=sa("INSERT_HORIZONTAL_RULE_COMMAND"),Fs=class extends z_{$config(){return this.config("horizontalrule",{extends:z_,importDOM:{hr:()=>({conversion:CF,priority:0})}})}exportDOM(){return{element:Ft().createElement("hr")}}createDOM(t){let n=Ft().createElement("hr");return So(n,t.theme.hr),n}getTextContent(){return`
80
- `}isInline(){return!1}updateDOM(){return!1}};function CF(){return{node:Ly()}}function Ly(){return yT(Fs)}function XD(e){return e instanceof Fs}var bF={dependencies:[Cc,Py],name:"@lexical/extension/HorizontalRule",nodes:()=>[Fs],register(e,t,n){let{watchNodeKey:o}=n.getDependency(Py).output,r=St({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return Se(e.registerCommand(qD,i=>{let a=z();if(!F(a))return!1;if(a.focus.getNode()!==null){let l=Ly();GD(l)}return!0},te),e.registerCommand(sf,i=>{if(aa(i.target)){let a=OT(i.target);if(XD(a))return(function(l,c=!1){let u=z(),d=l.isSelected(),f=l.getKey(),p;c&&De(u)?p=u:(p=Yd(),Cn(p)),d?p.delete(f):p.add(f)})(a,i.shiftKey),!0}return!1},Vo),e.registerMutationListener(Fs,(i,a)=>{vc(()=>{let l=!1,{nodeSelections:c}=r.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),l=!0;else{let f=c.get(u),p=e.getElementByKey(u);f?f.domNode.value=p:(l=!0,c.set(u,{domNode:St(p),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:c})})}),Ae(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of r.value.nodeSelections.values())i.push(Ae(()=>{let c=a.value;c&&(l.value?So(c,s):kf(c,s))}));return Se(...i)}))}};var bc=Fy,JD=bc.$createHorizontalRuleNode,F4=bc.$isHorizontalRuleNode,QD=bc.HorizontalRuleExtension,ZD=bc.HorizontalRuleNode,B4=bc.INSERT_HORIZONTAL_RULE_COMMAND;var By={};de(By,{getExtensionDependencyFromEditor:()=>EF});function EF(e,t){let n=fa.fromEditor(e).getExtensionRep(t);return n===void 0&&(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(303,t.name),n.getExtensionDependency()}var NF=By,ew=NF.getExtensionDependencyFromEditor;var zy={};de(zy,{$getExtensionDependency:()=>tw,$getExtensionOutput:()=>TF,$getPeerDependency:()=>OF});function tw(e){return ew(Ne(),e)}function TF(e){return tw(e).output}function OF(e){return co(Ne(),e)}var Wy=zy,j4=Wy.$getExtensionDependency,nw=Wy.$getExtensionOutput,ow=Wy.$getPeerDependency;var ax={};de(ax,{$appendNodeToHTML:()=>TB,$distributeInlineWrapper:()=>zw,$generateDOMFromNodes:()=>Qw,$generateDOMFromRoot:()=>EB,$generateHtmlFromNodes:()=>NB,$generateNodesFromDOM:()=>bB,$generateNodesFromDOMViaExtension:()=>yB,$getImportContextValue:()=>Bw,$getRenderContextValue:()=>AF,$getSessionDOMRenderConfig:()=>jf,$inlineStylesFromStyleSheets:()=>_w,$isBlockLevel:()=>ha,$propagateTextAlignToBlockChildren:()=>Ww,$setRenderContextValue:()=>IF,$updateRenderContextValue:()=>$F,$withImportContext:()=>ox,$withRenderContext:()=>tx,BlockSchema:()=>Uw,CoreImportExtension:()=>Xw,CoreImportRules:()=>jw,DOMImportExtension:()=>ix,DOMRenderExtension:()=>YF,HorizontalRuleImportExtension:()=>SB,HorizontalRuleImportRules:()=>vB,ImportOverlays:()=>Lw,ImportSource:()=>QF,ImportSourceDataTransfer:()=>ZF,ImportTextFormat:()=>Uf,ImportTextStyle:()=>Iw,ImportWhitespaceConfig:()=>Pw,InlineSchema:()=>eB,NestedBlockSchema:()=>tB,RenderContextExport:()=>Zy,RenderContextRoot:()=>vw,RootSchema:()=>Hw,contextUpdater:()=>MF,contextValue:()=>Ec,createImportState:()=>zs,createRenderState:()=>Qy,defaultIsInline:()=>Rw,defaultPreservesWhitespace:()=>$w,defineImportRule:()=>xB,defineOverlayRules:()=>hB,domOverride:()=>RF,isElementOfTag:()=>XF,parseSelector:()=>Aw,sel:()=>CB});function Bs(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}var pa;function Lr(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Xy(e){return pa&&pa.editor===e?pa:void 0}function Hf(e,t){let n=Xy(t);return n&&n[e]}function DF(e,t){if("cfg"in t){let{cfg:n,updater:o}=t;return[n,o(Lr(e,n))]}return t}function Kf(e,t){let n=t;for(let o of e){let[r,s]=DF(n,o),i=r.key;if(n===t&&Lr(n,r)===s)continue;let a=n===t||n===void 0?wF(t):n;a[i]=s,n=a}return n}function wF(e){return Object.create(e||null)}function Ec(e,t){return[e,t]}function MF(e,t){return{cfg:e,updater:t}}function hw(e,t,n,o=Ne()){let r=pa,s=Xy(o);try{return pa={...s,editor:o,[e]:t},n()}finally{pa=r}}function gw(e,t=()=>{}){return(n,o=Ne())=>r=>{let s=Xy(o),i=s&&s[e],a=Kf(n,i||t(o));return a&&a!==i?hw(e,a,r,o):r()}}function mw(e,t,n,o){return Object.assign(bf(Symbol(t),{isEqual:o,parse:n}),{[e]:!0})}var _w=(e,t,n)=>{yw(e),n()};function yw(e){if(!Tf(e))return;let t=e;if(t.querySelector("style")===null)return;let n=new Map;function o(r){let s=n.get(r);if(s===void 0){s=new Set;for(let i=0;i<r.style.length;i++)s.add(r.style[i]);n.set(r,s)}return s}try{for(let r of Array.from(t.styleSheets)){let s;try{s=r.cssRules}catch{continue}for(let i of Array.from(s)){if(!uo(i,CSSStyleRule))continue;let a;try{a=t.querySelectorAll(i.selectorText)}catch{continue}for(let l of Array.from(a)){if(!me(l))continue;let c=o(l);for(let u=0;u<i.style.length;u++){let d=i.style[u];c.has(d)||l.style.setProperty(d,i.style.getPropertyValue(d),i.style.getPropertyPriority(d))}}}}}catch{}}var Jy="@lexical/html/DOM",Vf=Symbol.for("@lexical/html/DOMExportContext"),xw="@lexical/html/DOMImport",Nc=Symbol.for("@lexical/html/DOMImportContext"),kF=()=>!0;function Qy(e,t,n){return mw(Vf,e,t,n)}var vw=Qy("root",Boolean),Zy=Qy("isExport",Boolean);function Sw(e){let t=co(e,Jy);return t?t.output.defaults:void 0}function AF(e,t=Ne()){return Lr((function(n){return Hf(Vf,n)||Sw(n)})(t),e)}function ex(e){let t=co(e,Jy);return t?t.output.runtime:void 0}function IF(e,t,n=Ne()){let o=ex(n);o&&o.setContextValue(e,t)}function $F(e,t,n=Ne()){let o=ex(n);o&&o.setContextValue(e,t(Lr(o.editorContext,e)))}function jf(e=Ne()){let t=ex(e);return t?t.getSessionConfig():I_(e)}var tx=gw(Vf,Sw);function RF(e,t,n){return{...t,...n,nodes:e}}function PF(e){return t=>t instanceof e}function LF(e,{nodes:t}){if(t==="*")return kF;let n={},o=[];for(let r of t)if("getType"in r){let s=r.getType();if(n){let i=e.get(s);i===void 0&&Bs(339,r.name,s);for(let a of i)n[a]=!0}o.push(PF(r))}else n=void 0,o.push(r);return n||(o.length===1?o[0]:r=>{for(let s of o)if(s(r))return!0;return!1})}function rw(e){return(t,n,o)=>e(t,o)}function Ky(e){return(t,n,o,r)=>e(t,n,r)}function sw(e){return(t,n,o,r,s)=>e(t,n,o,s)}function FF(e){return(t,n,o,r,s,i)=>e(t,n,o,r,i)}function iw(e,t){return(n,o)=>{let r=()=>e(n,o),s=t(n);return s?s(n,r,o):r()}}function Uy(e,t){return(n,o,r)=>{let s=()=>e(n,o,r),i=t(n);return i?i(n,o,s,r):s()}}var BF=Uy,zF=Ky;function aw(e,t){return(n,o,r,s)=>{let i=()=>e(n,o,r,s),a=t(n);return a?a(n,o,r,i,s):i()}}function WF(e,t){return(n,o,r,s,i)=>{let a=()=>e(n,o,r,s,i),l=t(n);return l?l(n,o,r,s,a,i):a()}}function KF(e,t){return(n,o,r,s)=>{e(n,o,r,s);let i=t(n);i&&i(n,o,r,s)}}function jo(e,t,n,o,r){let s=n[t];for(let i of e[t])if(typeof i[0]=="function"){let[a,l]=i;s=o(s,c=>a(c)&&l||void 0)}else{let a=i[1],l={};for(let c in a){let u=a[c];u&&(l[c]=u.reduce((d,f)=>o(d,()=>f),s))}s=o(s,c=>{let u=l[c.getType()];return u&&r(u)})}n[t]=s}function UF(e,t,n,o){if(!o)return;let r=e[t];if(typeof n=="function")r.push([n,o]);else{let s=r[r.length-1],i;s&&s[0]==="types"?i=s[1]:(i={},r.push(["types",i]));for(let a in n){let l=i[a]||[];i[a]=l,l.push(o)}}}function HF(e){return e.nodes==="*"}function VF(e){return e}function Hy(e,{overrides:t}){let n=(function(r,s){let i=KO(tD(r).nodes),a={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let l of(function(c){let u=[],d=[],f=[];for(let g of c)if(HF(g))u.push(g);else if(Array.isArray(g.nodes))for(let y of g.nodes)$_(y.prototype)?f.push(g.nodes.length===1?g:{...g,nodes:[y]}):d.push(g.nodes.length===1?g:{...g,nodes:[y]});let p=new Map,h=g=>{let y=p.get(g);if(y===void 0){y=-1;for(let m of YO(g))y++;p.set(g,y)}return y};return f.sort((g,y)=>h(g.nodes[0])-h(y.nodes[0])),[...f,...d,...u]})(s)){let c=LF(i,l);for(let u in a)UF(a,u,c,l[u])}return a})(e,t),o={...B_,...e.dom};return jo(n,"$createDOM",o,iw,rw),jo(n,"$exportDOM",o,iw,rw),jo(n,"$extractWithChild",o,WF,FF),jo(n,"$getDOMSlot",o,BF,zF),jo(n,"$shouldExclude",o,Uy,Ky),jo(n,"$shouldInclude",o,Uy,Ky),jo(n,"$getSlotTargetElement",o,aw,sw),jo(n,"$updateDOM",o,aw,sw),jo(n,"$decorateDOM",o,KF,VF),o}function Cw(e){return{get:t=>Lr(e,t)}}function lw(e){let t=Object.create(null);return Kf(e,t)||t}function Vy(e,t){let n=Cw(t);return e.filter(o=>!(o.disabledForEditor&&o.disabledForEditor(n)))}function jF(e){if(e.nodes==="*")return()=>!0;let t=e.nodes.map(n=>{let o=n;return $_(o.prototype)?r=>r instanceof o:n});return n=>t.some(o=>o(n))}var jy=class{constructor(t,n,o,r){w(this,"editor");w(this,"initialEditorConfig");w(this,"overrides");w(this,"editorContext");w(this,"hasSessionGates");w(this,"installed");w(this,"sessionCache",new Map);this.editor=t,this.initialEditorConfig=n,this.overrides=o,this.editorContext=r,this.installed=Vy(o,r),this.hasSessionGates=o.some(s=>s.disabledForSession)}setContextValue(t,n){let o=this.installed;this.editorContext[t.key]=n;let r=Vy(this.overrides,this.editorContext);if((function(c,u){if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==u[d])return!1;return!0})(o,r))return;let s=(function(c,u){let d=new Set(c),f=new Set(u),p=[];for(let h of c)f.has(h)||p.push(h);for(let h of u)d.has(h)||p.push(h);return p})(o,r);this.installed=r,this.sessionCache.clear();let i=Hy(this.initialEditorConfig,{overrides:r});this.editor._config.dom=i;let a=(function(c){let u=[];for(let d of c)(d.$createDOM||d.$getDOMSlot||d.$decorateDOM)&&u.push(jF(d));return u.length===0?null:d=>u.some(f=>f(d))})(s);if(!a)return;let l=i.$updateDOM;i.$updateDOM=(c,u,d,f)=>!!a(c)||l(c,u,d,f),this.editor.update(Xd,{discrete:!0}),i.$updateDOM=l}getSessionConfig(){let t=this.editor._config.dom||B_;if(!this.hasSessionGates)return t;let n=Cw(Hf(Vf,this.editor)||this.editorContext),o=[],r=[];if(this.installed.forEach((a,l)=>{a.disabledForSession&&a.disabledForSession(n)?o.push(String(l)):r.push(a)}),o.length===0)return t;let s=o.join(","),i=this.sessionCache.get(s);return i||(i=Hy(this.initialEditorConfig,{overrides:r}),this.sessionCache.set(s,i)),i}},YF={build(e,t,n){let{initialEditorConfig:o}=n.getInitResult(),r=lw(t.contextDefaults);return{defaults:r,runtime:new jy(e,o,t.overrides,r)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[yf,()=>{let e=Ft().createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){let n={dom:e.dom,nodes:e.nodes},o=lw(t.contextDefaults),r=Vy(t.overrides,o);return e.dom=Hy(e,{overrides:r}),{initialEditorConfig:n}},mergeConfig(e,t){let n=Bt(e,t);for(let o of["overrides","contextDefaults"])t[o]&&(n[o]=[...e[o],...t[o]]);return n},name:Jy},nx=Symbol.for("@lexical/html/SelectorImpl");function Tc(e,t){let n={kind:"element",predicate:(o=t,o.length===0?me:o.length===1?o[0]:(s,i)=>{for(let a of o)if(!a(s,i))return!1;return!0}),tags:e};var o;let r=s=>Tc(e,[...t,s]);return{[nx]:n,attr:(s,i,a)=>r(Yy(s,i,a)),classAll:(...s)=>r(Ew(s)),classAny:(...s)=>r((function(i){let a=bw(i);return a.length===0?()=>!1:l=>{if(!me(l))return!1;let c=l.classList;for(let u of a)if(c.contains(u))return!0;return!1}})(s)),styleAny:(s,i,a)=>r((function(l,c,u){if(typeof c=="string")return d=>me(d)&&d.style.getPropertyValue(l)===c;if(c instanceof RegExp){let d=u&&u.capture,f=c;return(p,h)=>{if(!me(p))return!1;let g=p.style.getPropertyValue(l);if(!g)return!1;let y=g.match(f);return y!==null&&(d!==void 0&&(h[d]=y),!0)}}Bs(362,JSON.stringify(l))})(s,i,a))}}function bw(e){let t=[];for(let n of e)n&&t.push(n);return t}function Ew(e){let t=bw(e);return t.length===0?()=>!0:n=>{if(!me(n))return!1;let o=n.classList;for(let r of t)if(!o.contains(r))return!1;return!0}}function Yy(e,t,n){if(t===!0)return o=>me(o)&&o.hasAttribute(e);if(typeof t=="string")return o=>me(o)&&o.getAttribute(e)===t;if(t instanceof RegExp){let o=n&&n.capture,r=t;return(s,i)=>{if(!me(s))return!1;let a=s.getAttribute(e);if(a==null)return!1;let l=a.match(r);return l!==null&&(o!==void 0&&(i[o]=l),!0)}}Bs(361,JSON.stringify(e))}function Nw(e){return{[nx]:e}}var GF=Nw({kind:"text",predicate:mc,tags:new Set}),qF=Nw({kind:"comment",predicate:e=>e.nodeType===8,tags:new Set});function Tw(){return Tc(new Set,[])}function Ow(){return qF}function Dw(...e){e.length>0||Bs(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Tc(t,[])}function ww(){return GF}var Mw={any:Tw,comment:Ow,tag:Dw,text:ww};function XF(e,t){return me(e)&&e.nodeName===t.toUpperCase()}var kw=/[A-Za-z0-9_-]/,Gy=class{constructor(t,n){this.source=t,this.pos=n}peek(t=0){return this.source[this.pos+t]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let t=this.pos;for(;!this.eof()&&kw.test(this.peek());)this.pos++;return this.source.slice(t,this.pos)}readQuoted(){let t=this.consume();this.assert(t==='"'||t==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==t;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let o=this.source.slice(n,this.pos);return this.pos++,o.replace(/\\(.)/g,"$1")}assert(t,n){t||Bs(364,String(this.pos+1),n,this.source)}};function JF(e){let t=new Set,n=[],o=[],r=!1;if(e.skipWhitespace(),e.peek()==="*")e.consume(),r=!0;else if(kw.test(e.peek())){let s=e.readIdent();s&&t.add(s.toUpperCase())}for(;!e.eof();){let s=e.peek();if(s==="."){e.consume();let i=e.readIdent();e.assert(i!=="",'expected class name after "."'),o.push(i)}else if(s==="#"){e.consume();let i=e.readIdent();e.assert(i!=="",'expected id after "#"'),n.push(Yy("id",i))}else{if(s!=="[")break;{e.consume(),e.skipWhitespace();let i=e.readIdent();e.assert(i!=="",'expected attribute name after "["'),e.skipWhitespace();let a=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let l=e.peek();l==='"'||l==="'"?a=e.readQuoted():(a=e.readIdent(),e.assert(a!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),n.push(Yy(i,a))}}}return o.length>0&&n.push(Ew(o)),e.assert(r||t.size>0||n.length>0,"expected a selector"),{predicates:n,tags:t}}function Aw(e){let t=new Gy(e,0),n=[];for(;n.push(JF(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace();if(n.length===1)return Tc(n[0].tags,n[0].predicates);let o=new Set;if(n.every(r=>r.tags.size>0))for(let r of n)for(let s of r.tags)o.add(s);return Tc(o,[(r,s)=>{for(let i of n){let a=r.nodeName;if(i.tags.size>0&&!i.tags.has(a))continue;let l=!0;for(let c of i.predicates)if(!c(r,s)){l=!1;break}if(l)return!0}return!1}])}function zs(e,t,n){return mw(Nc,e,t,n)}var QF=zs("importSource",()=>"unknown"),ZF=zs("importSourceDataTransfer",()=>null),Uf=zs("textFormat",()=>0),Iw=zs("textStyle",()=>({}));function $w(e){if(!me(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function Rw(e){if(mc(e))return!0;if(!me(e))return!1;let t=e.style.display;return t?t.startsWith("inline"):!Ir(e)&&ca(e)}var Pw=zs("whitespaceConfig",()=>({isInline:Rw,preservesWhitespace:$w})),Lw=zs("importOverlays",()=>[]),qy=class{constructor(t){this.record=t}get(t){return Lr(this.record,t)}set(t,n){this.record[t.key]=n}update(t,n){this.record[t.key]=n(Lr(this.record,t))}has(t){return Object.prototype.hasOwnProperty.call(this.record,t.key)}};function Fw(e){let t=co(e,xw);return t?t.output.defaults:void 0}function Bw(e,t=Ne()){return Lr((function(n){return Hf(Nc,n)||Fw(n)})(t),e)}var ox=gw(Nc,Fw);function ha(e){return na(e)||vn(e)&&!e.isInline()}function zw(e,t){let n=[],o=[],r=()=>{o.length!==0&&(n.push(t().splice(0,0,o)),o=[])};for(let s of e)if(ha(s)){if(r(),W(s)){let i=zw(s.getChildren(),t);s.splice(0,s.getChildrenSize(),i)}n.push(s)}else o.push(s);return r(),n}function Ww(e,t){if(!me(t))return e;let n=t.style.textAlign;if(!rx(n))return e;for(let o of e)na(o)&&o.getFormatType()===""&&o.setFormat(n);return e}function Kw(e,t,n){e.length===1&&Dr(e[0])&&(e=[]);let o=it();if(me(n)){let r=n.style.textAlign;rx(r)&&o.setFormat(r)}return[o.splice(0,0,e)]}var Uw={$accepts:ha,$packageRun:Kw,name:"BlockSchema"},eB={$accepts:e=>!ha(e),name:"InlineSchema"},tB={$accepts:ha,$packageRun:e=>e,name:"NestedBlockSchema"},Hw={$accepts:ha,$packageRun:Kw,name:"RootSchema"},Ws=Mw,nB=new Set(["center","end","justify","left","right","start"]);function rx(e){return nB.has(e)}var oB={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},rB={CODE:uO,MARK:dO},sB=new Set(["font-weight","font-style","text-decoration","text-transform","vertical-align"]),iB={$import:(e,t)=>{let n=e.get(Uf),o=oB[t.nodeName],r=(function(u){return{fontStyle:u.style.fontStyle,fontWeight:u.style.fontWeight,textDecoration:u.style.textDecoration,textTransform:u.style.textTransform,verticalAlign:u.style.verticalAlign}})(t);var s,i;let a=n&~(l=(function(u){let d=0,f=0,{fontWeight:p,fontStyle:h,textDecoration:g,textTransform:y,verticalAlign:m}=u;if(p==="700"||p==="bold"?d|=U_:p!=="normal"&&p!=="400"||(f|=U_),h==="italic"?d|=H_:h==="normal"&&(f|=H_),g){let _=g.split(" ");_.includes("underline")&&(d|=j_),_.includes("line-through")&&(d|=V_),_.includes("none")&&(f|=j_|V_)}return y==="lowercase"?(d|=En.lowercase,f|=En.uppercase|En.capitalize):y==="uppercase"?(d|=En.uppercase,f|=En.lowercase|En.capitalize):y==="capitalize"?(d|=En.capitalize,f|=En.lowercase|En.uppercase):y==="none"&&(f|=En.lowercase|En.uppercase|En.capitalize),m==="sub"?(d|=pf,f|=hf):m==="super"?(d|=hf,f|=pf):m==="baseline"&&(f|=pf|hf),{clear:f,set:d}})(o?(s=o,{fontStyle:(i=r).fontStyle||s.fontStyle,fontWeight:i.fontWeight||s.fontWeight,textDecoration:i.textDecoration||s.textDecoration,textTransform:i.textTransform||s.textTransform,verticalAlign:i.verticalAlign||s.verticalAlign}):r)).clear|l.set;var l;let c=rB[t.nodeName];return c&&(a|=c),a===n?e.$importChildren(t):e.$importChildren(t,{context:[Ec(Uf,a)]})},match:Ws.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function cw(e,t,n){let o=e;for(;;){let r=null;for(;(r=t?o.nextSibling:o.previousSibling)===null;){let i=o.parentNode;if(i===null)return null;o=i}if(o=r,!n.isInline(o))return null;let s=o;for(;(s=t?o.firstChild:o.lastChild)!==null;)o=s;if(mc(o))return o;if(o.nodeName==="BR")return null}}function uw(e,t){return t!==0&&H(e)?e.setFormat(t):e}function dw(e,t){if(H(e)){let n=(function(o){let r="";for(let s in o)sB.has(s)||(r+=`${s}: ${o[s]}; `);return r.trimEnd()})(t);n!==""&&e.setStyle(n)}return e}var aB={$import:(e,t)=>{let n=e.get(Uf),o=e.get(Iw),r=e.get(Pw);if((function(a,l){let c=a.parentNode;for(;c!==null;){if(l.preservesWhitespace(c))return!0;c=c.parentNode}return!1})(t,r)){let a=bT(t.textContent||"");for(let l of a)uw(l,n),dw(l,o);return a}let s=(function(a,l){let c=(a.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(c.length===0)return"";if(c[0]===" "){let u=a,d=!0;for(;u!==null&&(u=cw(u,!1,l))!==null;){let f=u.textContent||"";if(f.length>0){/[ \t\n]$/.test(f)&&(c=c.slice(1)),d=!1;break}}d&&(c=c.slice(1))}if(c.length>0&&c[c.length-1]===" "){let u=a,d=!0;for(;u!==null&&(u=cw(u,!0,l))!==null;)if((u.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){d=!1;break}d&&(c=c.slice(0,-1))}return c})(t,r);if(s==="")return[];let i=Hn(s);return uw(i,n),dw(i,o),[i]},match:Ws.text(),name:"@lexical/html/#text"},lB={$import:()=>[],match:Ws.tag("script","style"),name:"@lexical/html/script-style-ignore"},cB={$import:(e,t)=>VO(t)||HO(t)?[]:[jd()],match:Ws.tag("br"),name:"@lexical/html/br"},uB={$import:(e,t)=>{let n=it();if(Mr(n,t),$r(t,n),n.getFormatType()===""){let o=t.getAttribute("align");o&&rx(o)&&n.setFormat(o)}return wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Ws.tag("p"),name:"@lexical/html/p"},Vw={$import:(e,t,n)=>Ne().hasNode(ZD)?[JD()]:n(),match:Ws.tag("hr"),name:"@lexical/html/hr"},jw=[lB,uB,Vw,{$import:(e,t,n)=>Ir(t)?Ww(e.$importChildren(t,{schema:Uw}),t):n(),match:Ws.any(),name:"@lexical/html/transparent-block"},aB,cB,iB];function dB(e,t){let n=[],o=0,r=0;for(;o<e.length&&r<t.length;)e[o]<=t[r]?n.push(e[o++]):n.push(t[r++]);for(;o<e.length;)n.push(e[o++]);for(;r<t.length;)n.push(t[r++]);return n}function Yw(e){let t=[],n=new Map,o=[],r=[],s=[],i=new Set;e.forEach((l,c)=>{let u=(function(f){let p=f[nx];return p===void 0&&Bs(360),p})(l.match),d=l.name||(function(f,p){return f.kind==="text"?`#text@${p}`:f.kind==="comment"?`#comment@${p}`:f.tags.size===0?`*@${p}`:`${Array.from(f.tags).join(",").toLowerCase()}@${p}`})(u,c);if(l.name&&i.add(l.name),t.push({$import:l.$import,name:d,predicate:u.predicate}),u.kind==="text")r.push(c);else if(u.kind==="comment")s.push(c);else if(u.tags.size===0)o.push(c);else for(let f of u.tags){let p=n.get(f);p||(p=[],n.set(f,p)),p.push(c)}});let a=new Map;if(o.length===0)for(let[l,c]of n)a.set(l,c);else for(let[l,c]of n)a.set(l,dB(c,o));return{byTag:a,commentIndices:s,rules:t,textIndices:r,wildcardIndices:o}}function fw(e,t){return mc(t)?e.textIndices:t.nodeType===8?e.commentIndices:me(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:fB}var fB=Object.freeze([]);function Gw(e){let t=[];for(let n of e)if(pB(n))for(let o of n.rules)t.push(o);else t.push(n);return t}function pB(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function hB(e){let t=Gw(e);return{__type:"CompiledOverlayRules",dispatch:Yw(t),rules:t}}var gB=Object.freeze({});function mB(e,t){return{$importChildren:(o,r)=>(function(s,i,a){let l=a&&a.rules?a.rules.dispatch:void 0;l&&s.overlays.push(l);try{let c=()=>qw(s,i,a);return a&&a.context?ox(a.context,s.editor)(c):c()}finally{l&&s.overlays.pop()}})(e,o,r),$importOne:(o,r)=>sx(e,o,r),captures:t,get:o=>Bw(o,e.editor),session:e.session}}function qw(e,t,n){let o=n&&n.$onChild,r=[];for(let a of Array.from(t.childNodes)){let l=sx(e,a,void 0);for(let c of l){let u=o?o(c):c;u!=null&&r.push(u)}}let s=n&&n.$after?n.$after(r):r,i=n&&n.schema;return i?(function(a,l,c,u){let d=[],f=null,p=()=>{if(f===null)return;let h=f;if(f=null,a.$packageRun){let g=a.$packageRun(h,c,u);if(g.length>0){for(let y of g)d.push(y);return}}if(a.onReject==="hoist")for(let g of h)d.push(g)};for(let h of l)a.$accepts(h,c)?(p(),d.push(h)):(f===null&&(f=[]),f.push(h));return p(),a.$finalize?a.$finalize(d,c):d})(i,s,null,t):s}function sx(e,t,n){let o=()=>(function(r,s){let i=(function(u,d){let f=[];for(let h=u.overlays.length-1;h>=0;h--){let g=u.overlays[h],y=fw(g,d);y.length>0&&f.push({dispatch:g,indices:y})}let p=fw(u.dispatch,d);return p.length>0&&f.push({dispatch:u.dispatch,indices:p}),f})(r,s);if(i.length===0)return pw(r,s);let a=0,l=0,c=()=>{for(;a<i.length;){let{dispatch:u,indices:d}=i[a];for(;l<d.length;){let f=d[l++],p=u.rules[f],h={};if(p.predicate(s,h)){let g=mB(r,Object.keys(h).length===0?gB:h);try{return p.$import(g,s,c)}catch(y){throw y}}}a++,l=0}return pw(r,s)};return c()})(e,t);return n&&n.context?ox(n.context,e.editor)(o):o()}function pw(e,t){if(t.childNodes.length===0)return[];let n=[];for(let o of Array.from(t.childNodes)){let r=sx(e,o,void 0);for(let s of r)n.push(s)}return n}var _B={$import:(e,t)=>e.$importChildren(t),match:Mw.any(),name:"@lexical/html/default-hoist"},ix={build(e,t){let n=Yw(Gw(t.rules)),o=Kf(t.contextDefaults,void 0),r=t.preprocess;return{$generateNodesFromDOM:(s,i)=>{let a=Hf(Nc,e)||o,l=i&&i.context?Kf(i.context,a):a,c=l!==void 0&&l!==a?l:Object.create(a||null),u=new qy(c),d={session:u};return(function(f,p,h){let g=f.length-1,y=()=>{for(;g>=0;)return void(0,f[g--])(p,h,y)};y()})(i&&i.preprocess?[...r,...i.preprocess]:r,s,d),hw(Nc,c,()=>(function(f,p,h,g){return qw({dispatch:f,editor:p,overlays:g.get(Lw).map(y=>y.dispatch),session:g},Tf(h)?h.body:h,{schema:Hw})})(n,e,s,u),e)},defaults:o}},config:{contextDefaults:[],preprocess:[_w],rules:[_B]},mergeConfig:(e,t)=>Bt(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:xw};function yB(e,t){return nw(ix).$generateNodesFromDOM(e,t)}var Xw={dependencies:[[ix,{rules:jw}]],name:"@lexical/html/CoreImport"};function xB(e){return e}var vB=[Vw],SB={dependencies:[QD,Xw],name:"@lexical/html/HorizontalRuleImport"},CB={any:Tw,comment:Ow,css:Aw,tag:Dw,text:ww},Jw=new Set(["STYLE","SCRIPT"]);function bB(e,t){yw(t);let n=Tf(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let s of n)if(!Jw.has(s.nodeName)){let i=Zw(s,e,r,!1);if(i!==null)for(let a of i)o.push(a)}return(function(s){for(let i of s)i.getParent()&&i.getNextSibling()instanceof F_&&i.insertAfter(jd());for(let i of s){let a=i.getParent();a&&a.splice(i.getIndexWithinParent(),1,i.getChildren())}})(r),o}function Qw(e,t=null,n=Ne()){return tx([Ec(Zy,!0)],n)(()=>{let o=Ue(),r=jf(n),s=Jd(t),i=e.append.bind(e);for(let a of(W(s)?s:o).getChildren())Yf(n,a,i,t,r);return e})}function EB(e,t=Ue()){let n=Ne();return tx([Ec(Zy,!0),Ec(vw,!0)],n)(()=>{let o=jf(n),r=e.append.bind(e);return Yf(n,t,r,null,o),e})}function NB(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Bs(338),mT(e),Qw(Ft().createElement("div"),t,e).innerHTML}function Yf(e,t,n,o=null,r=I_(e)){let s=r.$shouldInclude(t,o,e),i=r.$shouldExclude(t,o,e),a=t;o!==null&&H(t)&&(a=zf(o,t,"clone"));let l=r.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;let p=Ft().createDocumentFragment(),h=f?f():W(a)?a.getChildren():[],g=s&&De(o)&&W(t)?null:o,y=p.append.bind(p),m=null;for(let _ of h){let x=Yf(e,_,y,g,r);x&&(m=_),!s&&x&&r.$extractWithChild(t,_,o,"html",e)&&(s=!0)}if(s&&!i){if((me(c)||q_(c))&&(d?d(p):c.append(p),(function(_,x){let v=_.lastChild;if(Dr(x)&&me(_)&&Ir(_)&&v!==null&&v.nodeName==="BR"){let S=Ft().createElement("br");S.setAttribute("data-lexical-managed-linebreak","true"),_.append(S)}})(c,m)),q_(c)){if(u){let _=u.call(a,c);_&&c.replaceChildren(_)}n(c)}else if(n(c),u){let _=u.call(a,c);_&&c.replaceWith(_)}}else n(p);return s}function TB(e,t,n,o=null){return Yf(e,t,n.append.bind(n),o,jf(e))}function Zw(e,t,n,o,r=new Map,s){let i=[];if(Jw.has(e.nodeName))return i;let a=null,l=(function(h,g){let{nodeName:y}=h,m=g._htmlConversions.get(y.toLowerCase()),_=null;if(m!==void 0)for(let x of m){let v=x(h);v!==null&&(_===null||(_.priority||0)<=(v.priority||0))&&(_=v)}return _!==null?_.conversion:null})(e,t),c=l?l(e):null,u=null;if(c!==null){u=c.after;let h=c.node;if(a=Array.isArray(h)?h[h.length-1]:h,a!==null){for(let[,g]of r)if(a=g(a,s),!a)break;a&&i.push(...Array.isArray(h)?h:[a])}c.forChild!=null&&r.set(e.nodeName,c.forChild)}let d=e.childNodes,f=[],p=(a==null||!io(a))&&(a!=null&&na(a)||o);for(let h=0;h<d.length;h++)f.push(...Zw(d[h],t,n,p,new Map(r),a));if(u!=null&&(f=u(f)),Ir(e)&&(f=(function(h,g,y){let m=h.style.textAlign,_=[],x=[];for(let v=0;v<g.length;v++){let S=g[v];if(na(S))m&&!S.getFormat()&&S.setFormat(m),_.push(S);else if(x.push(S),v===g.length-1||v<g.length-1&&na(g[v+1])){let b=y();b.setFormat(m),b.append(...x),_.push(b),x=[]}}return _})(e,f,p?()=>{let h=new F_;return n.push(h),h}:it)),a==null)if(f.length>0)for(let h of f)i.push(h);else Ir(e)&&(function(h){return h.nextSibling!=null&&h.previousSibling!=null&&ca(h.nextSibling)&&ca(h.previousSibling)})(e)&&i.push(jd());else W(a)&&a.append(...f);return i}var J=ax,nY=J.$appendNodeToHTML,eM=J.$distributeInlineWrapper,oY=J.$generateDOMFromNodes,rY=J.$generateDOMFromRoot,Gf=J.$generateHtmlFromNodes,qf=J.$generateNodesFromDOM,tM=J.$generateNodesFromDOMViaExtension,sY=J.$getImportContextValue,iY=J.$getRenderContextValue,aY=J.$getSessionDOMRenderConfig,lY=J.$inlineStylesFromStyleSheets,cY=J.$isBlockLevel,uY=J.$propagateTextAlignToBlockChildren,dY=J.$setRenderContextValue,fY=J.$updateRenderContextValue,pY=J.$withImportContext,hY=J.$withRenderContext,nM=J.BlockSchema,ga=J.CoreImportExtension,gY=J.CoreImportRules,Xf=J.DOMImportExtension,mY=J.DOMRenderExtension,_Y=J.HorizontalRuleImportExtension,yY=J.HorizontalRuleImportRules,xY=J.ImportOverlays,oM=J.ImportSource,rM=J.ImportSourceDataTransfer,vY=J.ImportTextFormat,SY=J.ImportTextStyle,CY=J.ImportWhitespaceConfig,bY=J.InlineSchema,EY=J.NestedBlockSchema,NY=J.RenderContextExport,TY=J.RenderContextRoot,OY=J.RootSchema,DY=J.contextUpdater,lx=J.contextValue,wY=J.createImportState,MY=J.createRenderState,kY=J.defaultIsInline,AY=J.defaultPreservesWhitespace,IY=J.defineImportRule,$Y=J.defineOverlayRules,RY=J.domOverride,PY=J.isElementOfTag,LY=J.parseSelector,Fr=J.sel;var hx={};de(hx,{$exportMimeTypeFromSelection:()=>RB,$generateJSONFromSelectedNodes:()=>hM,$generateNodesFromSerializedNodes:()=>gM,$getClipboardDataFromSelection:()=>mM,$getHtmlContent:()=>fx,$getLexicalContent:()=>px,$handlePlainTextDrop:()=>AB,$handleRichTextDrop:()=>kB,$insertDataTransferForPlainText:()=>uM,$insertDataTransferForRichText:()=>dM,$insertGeneratedNodes:()=>Zf,$writeDragSourceToDataTransfer:()=>MB,ClipboardDOMImportExtension:()=>wB,ClipboardImportExtension:()=>dx,DEFAULT_IMPORT_MIME_TYPE:()=>Qf,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>Jf,GetClipboardDataExtension:()=>SM,caretFromPoint:()=>aM,copyToClipboard:()=>IB,setLexicalClipboardDataTransfer:()=>_M});function aM(e,t,n=null){let o=$s(n),r=n?BO(n):[],s=n!==null&&r.length>0;if(s&&typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t,{shadowRoots:r});if(i!==null&&(function(a,l){for(let c=a;c!==null;){if(c===l)return!0;c=hc(c)}return!1})(i.offsetNode,n))return{node:i.offsetNode,offset:i.offset}}if(s){let i=n.getRootNode();if(Of(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let l=(function(c,u,d,f){let p=f.createRange(),h=N=>u<N.top?N.top-u:u>N.bottom?u-N.bottom:0,g=N=>c<N.left?N.left-c:c>N.right?c-N.right:0,y=f.createTreeWalker(d,NodeFilter.SHOW_TEXT),m=null,_=1/0,x=1/0;for(let N=y.nextNode();N;N=y.nextNode()){p.selectNodeContents(N);for(let D of p.getClientRects()){let O=h(D),T=g(D);(O<_||O===_&&T<x)&&(_=O,x=T,m=N)}}if(m===null)return null;let v=0,S=1/0,b=1/0;for(let N=0;N<=m.length;N++){p.setStart(m,N),p.collapse(!0);let D=p.getBoundingClientRect(),O=h(D),T=Math.abs(c-D.left);(O<S||O===S&&T<b)&&(S=O,b=T,v=N)}return{node:m,offset:v}})(e,t,a,o);if(l!==null)return l}}}if(typeof o.caretRangeFromPoint=="function"){let i=o.caretRangeFromPoint(e,t);return i===null?null:{node:i.startContainer,offset:i.startOffset}}if(typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t);return i===null?null:{node:i.offsetNode,offset:i.offset}}return null}function Oc(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}var Jf={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function lM(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(e):e}var sM=(e,t)=>{if(!F(t))return t.insertRawText(e),!0;t!==z()&&Cn(t);let n=o=>{let r=z();F(r)&&o(r)};return GO(e,{linebreak:()=>n(o=>o.insertParagraph()),tab:()=>n(o=>o.insertNodes([Gd()])),text:o=>n(r=>r.insertText(o))}),!0},Qf={"application/x-lexical-editor":[(e,t,n)=>{try{let o=Ne(),r=JSON.parse(e);if(r&&r.namespace===o._config.namespace&&Array.isArray(r.nodes))return Zf(o,gM(r.nodes),t),!0}catch(o){console.error(o)}return n()}],"text/html":[(e,t,n)=>{try{let o=Ne(),r=new DOMParser().parseFromString(lM(e),"text/html");return Zf(o,qf(o,r),t),!0}catch(o){return console.error(o),n()}}],"text/plain":[sM],"text/uri-list":[sM]};function OB(e,t,n,o){if(!e)return!1;let r=s=>!!e[s]&&e[s](t,n,r.bind(null,s-1),o);return r(e.length-1)}function cM(e,t,n){let o=t.getData("text/plain");for(let r of(function(s){return Object.keys(s.$importMimeType).filter(i=>s.$importMimeType[i]!==void 0).sort((i,a)=>{let l=s.priority[i],c=s.priority[a];return l===void 0&&c===void 0?i<a?-1:i>a?1:0:l===void 0?1:c===void 0?-1:l-c})})(e)){let s=t.getData(r);if(s&&(r!=="text/html"||s!==o)&&OB(e.$importMimeType[r],s,n,t))return!0}return!1}var DB={$importMimeType:Qf,$insertDataTransfer:(e,t)=>cM({$importMimeType:Qf,priority:Jf},e,t),priority:Jf},dx={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(n,o)=>cM(t,n,o),priority:t.priority}),config:{$importMimeType:Qf,priority:Jf},mergeConfig(e,t){let n=Bt(e,t);if(t.$importMimeType){let o={...e.$importMimeType};for(let[r,s]of Object.entries(t.$importMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$importMimeType=o}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"},wB={dependencies:[ga,[dx,{$importMimeType:{"text/html":[(e,t,n,o)=>{let r=new DOMParser().parseFromString(lM(e),"text/html"),s=tM(r,{context:[lx(oM,"paste"),lx(rM,o)]});return Zf(Ne(),s,t),!0}]}}]],name:"@lexical/clipboard/DOMImport"};function fx(e,t=z()){return t==null&&Oc(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?"":Gf(e,t)}function px(e,t=z()){return t==null&&Oc(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(hM(e,t))}function uM(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function dM(e,t,n){(function(){let o=ow(dx.name);return o?o.output:DB})().$insertDataTransfer(e,t)}var fM="application/x-lexical-drag";function MB(e,t){let n={editorKey:t.getKey()};e.setData(fM,JSON.stringify(n))}function cx(e){let t=e;if(ao(t))if(t.offset===0)t=Sn(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}for(;;){let n=t.getParentAtCaret();if(n===null||!n.isInline()||n.isShadowRoot())return t;if(Uo(t))t=Sn(Je(n,"next"));else{if(t.getNodeAtCaret()!==null)return t;t=Je(n,"next")}}}function pM(e,t,n){let o=e.dataTransfer;if(o===null)return!1;let r=(function(f){let p=f.getData(fM);if(!p)return null;let h;try{h=JSON.parse(p)}catch{return null}return(g=h)!==null&&typeof g=="object"&&"editorKey"in g&&typeof g.editorKey=="string"?h:null;var g})(o);if(r===null)return!1;let s=(function(f,p){let h=aM(f.clientX,f.clientY,p.getRootElement());if(h===null)return null;let g=Ko(h.node);if(g===null)return null;if(H(g))return DT(g,"next",h.offset);if(W(g))return k_(g,h.offset,"next");let y=g.getParent();return y===null?null:k_(y,g.getIndexWithinParent()+1,"next")})(e,t);if(s===null)return!1;let i=r.editorKey===t.getKey(),a=z();if(i){if(!F(a)||a.isCollapsed())return!1;if((function(f,p){let{anchor:h,focus:g}=Or(Nr(p),"next"),y=cx(f);return Qi(cx(h),y)<=0&&Qi(y,cx(g))<=0})(s,a))return e.preventDefault(),!0}let l=Vn(s),c=ao(l)?rf(l):l;if(c===null)return!1;let u=c.getFlipped();i&&F(a)&&a.removeText();let d=c.origin.isAttached()?c:u;if(d.origin.isAttached()||Oc(438),n(o,jn(ws(d)),t),!i){let f=t.getRootElement(),p=f?f.ownerDocument:null,h=p?(function(g,y){for(let m of PO(y)){let _=Nf(m);if(Df(_)&&_.getKey()===g&&me(m))return m}return null})(r.editorKey,p):null;h!==null&&h.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function kB(e,t){return pM(e,t,dM)}function AB(e,t){return pM(e,t,(n,o)=>uM(n,o))}function Zf(e,t,n){e.dispatchCommand(wO,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(F(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=xn(r,"previous");if(i)if(ao(i))s=i.origin;else{let a=so(i,Qt(Ue(),"next").getFlipped());for(let l of a){if(H(l.origin)){s=l.origin;break}if(W(l.origin)&&!l.origin.isInline())break}}if(s&&H(s)){let a=s.getFormat(),l=s.getStyle();o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)}}})(n))}function ux(e,t,n,o=[]){let r=t===null||n.isSelected(t),s=W(n)&&n.excludeFromCopy("clone"),i=n;t!==null&&H(i)&&(i=zf(t,i,"clone"));let a=vT(i),l=W(i)?i.getChildren():[],c=a.children||[];H(i)&&i.getTextContentSize()===0&&(r=!1);let u=r&&De(t)&&W(n)?null:t;for(let d=0;d<l.length;d++){let f=l[d],p=ux(e,u,f,c);!r&&W(n)&&p&&n.extractWithChild(f,t,"clone")&&(r=!0)}if(r&&!s){let d=ks(i);if(d.length>0){let f={};for(let p of d){let h=ea(i,p);h===null&&Oc(366,i.constructor.name,p);let g=[];ux(e,null,h,g),(g.length!==1||W(h)&&h.excludeFromCopy("clone"))&&Oc(435,p,i.constructor.name,String(g.length)),f[p]=g[0]}a.$slots=f}}if(r&&!s)o.push(a);else for(let d=0;d<c.length;d++)o.push(c[d]);return r}function hM(e,t){let n=[],o=Ue(),r=Jd(t),s=(W(r)?r:o).getChildren();for(let i=0;i<s.length;i++)ux(e,t,s[i],n);return{namespace:e._config.namespace,nodes:n}}function gM(e){let t=[];for(let n of e)t.push(RT(n));return t}var ma=null;async function IB(e,t,n){if(ma!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(iM(e,t,n))})});let o=e.getRootElement(),r=e._window||window,s=r.document,i=Ar(r);if(o===null||i===null)return!1;let a=s.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(s.createTextNode("#")),o.append(a);let l=s.createRange();return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((c,u)=>{let d=e.registerCommand(af,f=>(uo(f,ClipboardEvent)&&(d(),ma!==null&&(r.clearTimeout(ma),ma=null),c(iM(e,f,n))),!0),HT);ma=r.setTimeout(()=>{d(),ma=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function iM(e,t,n){if(n===void 0){let r=Ar(e._window),s=z();if(!s||s.isCollapsed()||!r)return!1;let i=Ef(r,e.getRootElement()),a=i.anchorNode,l=i.focusNode;if(a!==null&&l!==null&&!jO(e,a,l))return!1;n=mM(s)}t.preventDefault();let o=t.clipboardData;return o!==null&&(_M(o,n),!0)}var $B=[["text/html",fx],["application/x-lexical-editor",px]];function mM(e=z()){return(function(t,n){let o={"text/plain":""};for(let[r,s]of Object.entries(t))if(s){let i=vM(s,n);i!==null&&(o[r]=i)}return o})(yM(),e)}function _M(e,t){for(let[n]of $B)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}function yM(e=Ne()){let t=co(e,SM.name);return t?t.output:xM}var xM={"application/x-lexical-editor":[(e,t)=>e?px(Ne(),e):t()],"text/html":[(e,t)=>e?fx(Ne(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function vM(e,t){let n=o=>e[o]?e[o](t,n.bind(null,o-1)):null;return n(e.length-1)}function RB(e,t=z()){return vM(yM()[e]||[],t)}var SM={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:xM},mergeConfig(e,t){let n=Bt(e,t);if(t.$exportMimeType){let o={...e.$exportMimeType};for(let[r,s]of Object.entries(t.$exportMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$exportMimeType=o}return n},name:"@lexical/clipboard/GetClipboardData"};var at=hx,VY=at.$exportMimeTypeFromSelection,jY=at.$generateJSONFromSelectedNodes,YY=at.$generateNodesFromSerializedNodes,CM=at.$getClipboardDataFromSelection,GY=at.$getHtmlContent,qY=at.$getLexicalContent,XY=at.$handlePlainTextDrop,bM=at.$handleRichTextDrop,JY=at.$insertDataTransferForPlainText,gx=at.$insertDataTransferForRichText,QY=at.$insertGeneratedNodes,EM=at.$writeDragSourceToDataTransfer,ZY=at.ClipboardDOMImportExtension,eG=at.ClipboardImportExtension,tG=at.DEFAULT_IMPORT_MIME_TYPE,nG=at.DEFAULT_IMPORT_MIME_TYPE_PRIORITY,oG=at.GetClipboardDataExtension,ep=at.caretFromPoint,mx=at.copyToClipboard,NM=at.setLexicalClipboardDataTransfer;var _x={};de(_x,{RootElementExtension:()=>PB});var PB={build:e=>Pr(()=>e.getRootElement(),t=>e.registerRootListener(n=>{t.value=n})),name:"@lexical/extension/RootElement"};var LB=_x,yx=LB.RootElementExtension;var vx={};de(vx,{AriaLiveRegionExtension:()=>Dc,EditorModeAnnounceExtension:()=>KB,FocusManagerExtension:()=>VB,FocusTrapExtension:()=>UB,HistoryAnnounceExtension:()=>WB,RovingTabIndexExtension:()=>HB});var FB=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(",");function xx(e){return Array.from(e.querySelectorAll(FB))}function tp(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=Of(n)?n.host:n.parentNode}return!1}function BB(e,t={}){let n=t.initialFocus??"firstFocusable",o=e.ownerDocument,r=Is(o),s=me(r)?r:null,i=xx(e);return n==="container"&&e.hasAttribute("tabindex")?e.focus():i.length>0?i[0].focus():e.hasAttribute("tabindex")&&e.focus(),Se(()=>{s!==null&&typeof s.focus=="function"&&tp(o,s)&&s.focus()},Rs(e,"keydown",a=>{if(a.key!=="Tab")return;let l=xx(e);if(l.length===0)return void a.preventDefault();a.preventDefault();let c=l[0],u=l[l.length-1],d=Is(o),f=me(d)&&tp(e,d)?l.indexOf(d):-1;a.shiftKey?(f<=0?u:l[f-1]).focus():(f===-1||f===l.length-1?c:l[f+1]).focus()}),Rs(o,"focusin",a=>{let l=G_(a);if(!me(l)||tp(e,l)||t.allowOutside!=null&&t.allowOutside(l))return;let c=xx(e);c.length>0?c[0].focus():e.hasAttribute("tabindex")&&e.focus()}))}function zB(e,t={}){let n=t.orientation??"horizontal",o=t.itemSelector??":scope > button:not([disabled])",r=()=>Array.from(e.querySelectorAll(o)),s=(i,a)=>{i.forEach((l,c)=>{l.tabIndex=c===a?0:-1})};return(()=>{let i=r();if(i.length===0)return;let a=Is(e.ownerDocument),l=i.findIndex(c=>c===a);s(i,l>=0?l:0)})(),Se(Rs(e,"keydown",i=>{let a=r();if(a.length===0)return;let l=Is(e.ownerDocument),c=a.findIndex(p=>p===l);if(c<0)return void(i.key!=="ArrowRight"&&i.key!=="ArrowDown"&&i.key!=="ArrowLeft"&&i.key!=="ArrowUp"&&i.key!=="Home"&&i.key!=="End"||(i.preventDefault(),s(a,0),a[0].focus()));let u=n==="horizontal"||n==="both",d=n==="vertical"||n==="both",f=c;switch(i.key){case"ArrowRight":if(!u)return;f=c+1;break;case"ArrowLeft":if(!u)return;f=c-1;break;case"ArrowDown":if(!d)return;f=c+1;break;case"ArrowUp":if(!d)return;f=c-1;break;case"Home":f=0;break;case"End":f=a.length-1;break;default:return}i.preventDefault(),f=(f+a.length)%a.length,s(a,f),a[f].focus()}),()=>{r().forEach(i=>{i.tabIndex=0})})}var Dc={build(e,t,n){let o=n.getInitResult();return{...Qe(t),announce(r){o.value=r===o.peek()?r+"\u200B":r}}},config:{owner:null,politeness:"polite"},dependencies:[yx],init:()=>St(""),name:"@lexical/a11y/AriaLiveRegion",register(e,t,n){let o=n.getInitResult(),{owner:r,politeness:s}=n.getOutput(),i=n.getDependency(yx).output,a=St(null);return Se(Ae(()=>{let l=r.value,c=l?null:i.value,u=l??(c?c.ownerDocument.body:null);if(!u)return;let d=(function(f){let p=f.ownerDocument.createElement("div");return p.setAttribute("aria-atomic","true"),p.setAttribute("role","status"),(function(h){let g=h.style;g.border="0",g.clip="rect(0 0 0 0)",g.height="1px",g.margin="-1px",g.overflow="hidden",g.padding="0",g.position="absolute",g.whiteSpace="nowrap",g.width="1px"})(p),f.appendChild(p),p})(u);return a.value=d,()=>{d.remove(),a.value=null}}),Ae(()=>{let l=a.value;l&&l.setAttribute("aria-live",s.value)}),Ae(()=>{let l=o.value,c=a.peek();c&&(c.textContent=l)}))}},WB={build:(e,t)=>Qe(t),config:{disabled:!1,redone:"Redone",undone:"Undone"},dependencies:[Dc],name:"@lexical/a11y/HistoryAnnounce",register(e,t,n){let{disabled:o,redone:r,undone:s}=n.getOutput(),{announce:i}=n.getDependency(Dc).output;return Ae(()=>o.value?void 0:Se(e.registerCommand(xf,()=>(i(s.peek()),!1),Vo),e.registerCommand(_f,()=>(i(r.peek()),!1),Vo)))}},KB={build:(e,t)=>Qe(t),config:{disabled:!1,editable:"Editor is editable",readOnly:"Editor is read-only"},dependencies:[Dc],name:"@lexical/a11y/EditorModeAnnounce",register(e,t,n){let{disabled:o,editable:r,readOnly:s}=n.getOutput(),{announce:i}=n.getDependency(Dc).output;return Ae(()=>o.value?void 0:e.registerEditableListener(a=>{i(a?r.peek():s.peek())}))}},UB={build:()=>Cf(BB),name:"@lexical/a11y/FocusTrap",register:(e,t,n)=>()=>n.getOutput().dispose()},HB={build:()=>Cf(zB),name:"@lexical/a11y/RovingTabIndex",register:(e,t,n)=>()=>n.getOutput().dispose()},VB={build:e=>Cf((t,n)=>(function(o,r,s={}){let i=s.toolbarItemSelector??':scope > button:not([disabled]), :scope > [tabindex="0"]';return Se(o.registerCommand(yO,a=>{if(!a.altKey||a.key!=="F10")return!1;let l=r.querySelector('[tabindex="0"]')??r.querySelector(i);return l!==null&&(a.preventDefault(),l.focus(),!0)},Vo),Rs(r,"keydown",a=>{if(a.key!=="Escape")return;let l=G_(a);if(me(l)){let u=r.querySelectorAll(i),d=!1;for(let f of u)if(f===l||tp(f,l)){d=!0;break}if(!d)return}let c=o.getRootElement();c!==null&&(a.preventDefault(),a.stopPropagation(),o.focus(),c.focus())}))})(e,t,n)),name:"@lexical/a11y/FocusManager",register:(e,t,n)=>()=>n.getOutput().dispose()};var _a=vx,ya=_a.AriaLiveRegionExtension,dG=_a.EditorModeAnnounceExtension,fG=_a.FocusManagerExtension,pG=_a.FocusTrapExtension,hG=_a.HistoryAnnounceExtension,gG=_a.RovingTabIndexExtension;var Sx={};de(Sx,{NormalizeInlineElementsExtension:()=>jB});function TM(e){W(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var jB={build:(e,t,n)=>Qe(t),config:{disabled:!1},name:"@lexical/NormalizeInlineElements",register:(e,t,n)=>{let o=n.getOutput();return Ae(()=>{if(!o.disabled.value){let r=[];for(let{klass:s,transforms:i}of e._nodes.values())s.prototype instanceof lo&&s.prototype.isInline!==lo.prototype.isInline&&(i.add(TM),r.push(()=>i.delete(TM)));return()=>r.forEach(s=>s())}})}};var YB=Sx,OM=YB.NormalizeInlineElementsExtension;var Cx={};de(Cx,{NormalizeTripleClickSelectionExtension:()=>qB});var GB=new Set([IO,AO]),qB={build:(e,t,n)=>Qe(t),config:{$fixFocusOverselection:function(){let e=z();if(F(e)&&!e.isCollapsed()){let t=Or(Nr(e),"next"),n=t.focus;for(ao(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=Sn(n.getSiblingCaret())),Ho(n)&&t.anchor.origin!==n.origin&&Dr(n.origin)&&(n=Sn(n));Uo(n)&&t.anchor.origin!==n.origin;)n=Sn(Je(n.origin,"next"));if(Ho(n)&&W(n.origin)&&(n=Vn(Qt(n.origin,"previous")).getFlipped()),n=Vn(n),!n.isSamePointCaret(t.focus)){let o=jn(so(t.anchor,n)),r=Ne().getRootElement(),s=r&&Ar(r.ownerDocument.defaultView);s&&zT(Ms(),o,Ne(),s,GB,r)}}},dateNow:()=>Date.now(),disabled:!1,thresholdMsec:100},name:"@lexical/NormalizeTripleClickSelection",register:(e,t,n)=>Ae(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener(r=>{if(!r)return;let s=0,i=a=>{if(a?a.detail>2:s>0){let l=o.dateNow.peek()();s=a&&a.type==="mousedown"||l-s<=o.thresholdMsec.peek()?l:0}return s};return Se(e.registerCommand(DO,()=>(i(null)&&(s=0,o.$fixFocusOverselection.peek()()),!1),UT),Mf(r,{mousedown:i,mouseup:i},!0))})})};var XB=Cx,DM=XB.NormalizeTripleClickSelectionExtension;var Ox={};de(Ox,{$createHeadingNode:()=>Ca,$createQuoteNode:()=>wc,$isHeadingNode:()=>KM,$isQuoteNode:()=>iz,DRAG_DROP_PASTE:()=>Ex,HeadingAnnounceExtension:()=>BM,HeadingNode:()=>Ks,QuoteNode:()=>Sa,RichTextExtension:()=>WM,RichTextImportExtension:()=>sz,RichTextImportRules:()=>zM,ShadowRootQuoteRule:()=>oz,defaultShouldHandlePasteAsFiles:()=>Tx,eventFiles:()=>Ls,quoteShadowRootState:()=>sp,registerRichText:()=>VM});var JB=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Nx(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!JB.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function FM(e,t,n,o,r){let s=Nx(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function QB(e,t){e.__tag=t.__tag}var ZB=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],tag:r.__tag,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__tag;c!==void 0&&c!=="h1"&&(l.tag=c);let u=r.__dir;u!=null&&(l.direction=u);let d=t[r.__format];d!==void 0&&d!==""&&(l.format=d);let f=r.__indent;return f!==void 0&&f!==0&&(l.indent=f),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=FM(s.indent,0,0,1/0),r.__textFormat=Nx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.tag;return r.__tag=c==="h1"||c==="h2"||c==="h3"||c==="h4"||c==="h5"||c==="h6"?c:"h1",r},afterCloneFrom:QB}},ez=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=FM(s.indent,0,0,1/0),r.__textFormat=Nx(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}};function wM(e){let t=Zi(e);return KM(t)?t.getTag():null}var BM={build:(e,t)=>Qe(t),config:{created:"Heading level %s",destroyed:"Heading level %s removed",disabled:!1},dependencies:[ya],name:"@lexical/rich-text/HeadingAnnounce",register(e,t,n){let{created:o,destroyed:r,disabled:s}=n.getOutput(),{announce:i}=n.getDependency(ya).output;return Ae(()=>s.value?void 0:e.registerMutationListener(Ks,(a,{prevEditorState:l})=>{let c=null,u=null;for(let[d,f]of a)f==="created"&&c===null?c=e.read("latest",()=>wM(d)):f==="destroyed"&&u===null&&(u=l.read(()=>wM(d)));c!==null?i(o.peek().replace("%s",c.slice(1))):u!==null&&i(r.peek().replace("%s",u.slice(1)))},{skipInitialization:!0}))}},tz={$import:(e,t)=>{let n=Ca(t.nodeName.toLowerCase());return $r(t,n),Mr(n,t),wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Fr.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},nz={$import:(e,t)=>{let n=wc();return Mr(n,t),$r(t,n),wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Fr.tag("blockquote"),name:"@lexical/rich-text/blockquote"},oz={$import:(e,t)=>{let n=wc({shadowRoot:!0});return Mr(n,t),$r(t,n),wr(n,t),[n.splice(0,0,e.$importChildren(t,{schema:nM}))]},match:Fr.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"},zM=[tz,nz,{$import:(e,t,n)=>{let o=t.firstChild;return o&&me(r=o)&&r.nodeName==="SPAN"&&r.style.fontSize==="26pt"?e.$importChildren(t):n();var r},match:Fr.tag("p"),name:"@lexical/rich-text/google-docs-title-p"},{$import:(e,t,n)=>t.style.fontSize!=="26pt"?n():[Ca("h1").splice(0,0,e.$importChildren(t))],match:Fr.tag("span"),name:"@lexical/rich-text/google-docs-title-span"}];function rz(e,t){return e&&t!==null?Bt(e,t):t}var WM={build:(e,t)=>Qe(t),config:{escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}},shouldHandlePasteAsFiles:Tx},conflictsWith:["@lexical/plain-text"],dependencies:[BM,gD,OM,DM,ga,[Xf,{rules:zM}]],mergeConfig:function(e,t){let n=Bt(e,t);return t.escapeFormatTriggers&&(n.escapeFormatTriggers=(function(o,r){let s=Bt(o,r);for(let i of Object.keys(r))s[i]=rz(o[i],r[i]);return s})(e.escapeFormatTriggers,t.escapeFormatTriggers)),n},name:"@lexical/rich-text",nodes:()=>[Ks,Sa],register:(e,t,n)=>Ae(()=>{let{escapeFormatTriggers:o,shouldHandlePasteAsFiles:r}=n.getOutput();return VM(e,o,r)})},sz={dependencies:[WM],name:"@lexical/rich-text/Import"},Ex=sa("DRAG_DROP_PASTE_FILE"),sp=bf("shadowRoot",{parse:vf()}),Sa=class extends lo{$config(){return this.config("quote",{extends:lo,generated:ez,importDOM:{blockquote:()=>({conversion:lz,priority:0})},stateConfigs:[{flat:!0,stateConfig:sp}]})}isShadowRoot(){return ef(this,sp)}setIsShadowRoot(t){return of(this,sp,t)}createDOM(t){let n=Ft().createElement("blockquote");return So(n,t.theme.quote),n}updateDOM(t,n,o){return!1}exportDOM(t){let{element:n}=super.exportDOM(t);if(me(n)){this.isEmpty()&&n.append(Ft().createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o);let r=this.getDirection();r&&(n.dir=r)}return{element:n}}static importJSON(t){return wc().updateFromJSON(t)}insertNewAfter(t,n){let o=it();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let t=it();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function wc(e){let t=Ji(new Sa);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function iz(e){return e instanceof Sa}var az=_c()({tag:Rr(RO(["h1","h2","h3","h4","h5","h6"]),{field:"__tag"})}),Ks=class extends lo{constructor(n="h1",o){super(o);w(this,"__tag");this.__tag=n}$config(){return this.config("heading",{extends:lo,generated:ZB,importDOM:{h1:()=>({conversion:xa,priority:0}),h2:()=>({conversion:xa,priority:0}),h3:()=>({conversion:xa,priority:0}),h4:()=>({conversion:xa,priority:0}),h5:()=>({conversion:xa,priority:0}),h6:()=>({conversion:xa,priority:0}),p:n=>{let o=n.firstChild;return o!==null&&MM(o)?{conversion:()=>({node:null}),priority:3}:null},span:n=>MM(n)?{conversion:()=>({node:Ca("h1")}),priority:3}:null},json:az})}getTag(){return this.getLatest().__tag}setTag(n){let o=this.getWritable();return o.__tag=n,o}createDOM(n){let o=this.__tag,r=Ft().createElement(o),s=n.theme.heading;if(s!==void 0){let i=s[o];So(r,i)}return r}updateDOM(n,o,r){return n.__tag!==this.__tag}exportDOM(n){let{element:o}=super.exportDOM(n);if(me(o)){this.isEmpty()&&o.append(Ft().createElement("br"));let r=this.getFormatType();r&&(o.style.textAlign=r);let s=this.getDirection();s&&(o.dir=s)}return{element:o}}insertNewAfter(n,o=!0){let r=n?n.anchor.offset:0,s=this.getLastDescendant(),i=!s||n&&n.anchor.key===s.getKey()&&r===s.getTextContentSize()||!n?it():Ca(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,o),r===0&&!this.isEmpty()&&n){let l=it();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let n=it();this.getChildren().forEach(o=>n.append(o)),this.replace(n)}return!0}extractWithChild(){return!0}};function MM(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function xa(e){let t=e.nodeName.toLowerCase(),n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Ca(t),$r(e,n),Mr(n,e),wr(n,e)),{node:n}}function lz(e){let t=wc();return Mr(t,e),$r(e,t),wr(t,e),{node:t}}function Ca(e="h1"){return Ji(new Ks(e))}function KM(e){return e instanceof Ks}function kM(e){let t=Ko(e);return vn(t)}function UM(e){let t=e.focus;return t.key==="root"&&t.offset===Ue().getChildrenSize()}function HM(e){let t=e.focus;return t.key==="root"&&t.offset===0}function AM(e,t){if(!e.isCollapsed())return!1;let n=t==="next";if(!(n?UM(e):HM(e)))return!1;let o=e.focus.offset;return L_(Ue().getChildAtIndex(n?o-1:o))}function va(e,t,n,o){let r=!1,s=null;if(e.isCollapsed()&&e.anchor.type==="text"){let a=e.anchor.getNode();if(H(a)){s=a;let l=e.anchor.offset,c=l===a.getTextContentSize()&&a.getNextSibling()===null,u=l===0&&a.getPreviousSibling()===null;r=n==="end"&&c||n==="start"&&u||n==="both"&&(c||u)}}let i=!1;for(let[a,l]of Object.entries(o)){if(l==null||!l[t])continue;let c=a;if(l.onlyAtBoundary){if(!(r&&s&&H(s)&&s.hasFormat(c)))continue;i=!0}e.hasFormat(c)&&e.toggleFormat(c)}i&&e.setStyle("")}var cz={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function np(e,t){return(function(n,o){if(!n.isCollapsed())return!1;let r=xn(n.focus,o),s=Me(r.origin,tf);if(!s)return!1;let i=n.focus.getNode();if(!s.is(i)&&!sc(i,s))return!1;let a=so(r,Je(s,o));if(a.getTextSlices().some(d=>d&&d.getTextContentSize()>0))return!1;let l=so(a.anchor.getSiblingCaret(),a.focus),c=l.anchor.origin;for(let d of l){if(!Ho(d)||!d.origin.is(c.getParent()))return!1;c=d.origin}let u=s;for(let d of qd(Je(s,o))){if(!d.origin.is(u.getParent())){if(L_(d.origin)){let f=Je(u,o);return jn(so(f,f)),!0}break}if(!tf(d.origin))break;u=d.origin}return!1})(e,t)||(function(n,o){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;let r=xn(n.anchor,o).getNodeAtCaret();return!(!tf(r)||r.isInline()||(jn(ws(Vn(Qt(r,o)))),0))})(e,t)}function IM(e){return vn(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function bx(e){let t=Yd();t.add(e),Cn(t)}function $M(e,t){if(!e.isCollapsed())return!1;let n=e.focus,o=n.getNode(),r=t?"previous":"next",s=xn(n,r);if(n.type==="element"&&W(o)&&io(o)){let m=s.getNodeAtCaret();return!(m===null||!IM(m)||(bx(m.__key),0))}let i=Me(W(o)?o:o.getParentOrThrow(),m=>W(m)&&!m.isInline()&&io(m.getParent()));if(i===null)return!1;let a=Je(i,r).getNodeAtCaret();if(a===null||!IM(a))return!1;if(i.getTextContentSize()===0)return bx(a.__key),!0;let l=Ne().getRootElement();if(l===null)return!1;let c=Ar(l.ownerDocument.defaultView);if(c===null||c.rangeCount===0)return!1;let u=c.anchorNode,d=c.anchorOffset,f=c.focusNode,p=c.focusOffset;c.modify("move",t?"backward":"forward","line");let h=c.anchorNode,g=c.anchorOffset;if(h===null)return RM(c,u,d,f,p),!1;let y=Ko(h);return RM(c,u,d,f,p),y!==null&&(h===u&&g===d||!y.is(i)&&!sc(y,i))&&(bx(a.__key),!0)}function RM(e,t,n,o,r){t!==null&&o!==null&&e.setBaseAndExtent(t,n,o,r)}function PM(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),o=Me(W(n)?n:n.getParentOrThrow(),y=>W(y)&&!y.isInline());if(o===null)return!1;let r=Ne(),s=r.getRootElement();if(s===null)return!1;let i=s.ownerDocument.defaultView;if(i===null)return!1;let a=!1;for(let y of o.getChildren())if(W(y)&&y.isInline()){let m=r.getElementByKey(y.getKey());if(m!==null){let _=i.getComputedStyle(m).display;if(_==="inline-grid"||_==="inline-flex"){a=!0;break}}}if(!a)return!1;let l=Je(o,t?"previous":"next").getNodeAtCaret();if(l===null||!W(l)){if(t){let y=o.getFirstDescendant();H(y)?y.select(0,0):o.select(0,0)}else{let y=o.getLastDescendant();if(H(y)){let m=y.getTextContentSize();y.select(m,m)}else{let m=o.getChildrenSize();o.select(m,m)}}return!0}let c=r.getElementByKey(l.getKey());if(c===null)return!1;let u=Ar(i);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=c.getBoundingClientRect(),h=p.top+p.height/2;if(f.height>0){let y=ep(f.left,h,s);if(y!==null&&c.contains(y.node)){let m=s.ownerDocument.createRange();return m.setStart(y.node,y.offset),m.collapse(!0),e.applyDOMRange(m),e.dirty=!0,!0}}let g=t?l.getLastDescendant():l.getFirstDescendant();if(H(g)){let y=t?g.getTextContentSize():0;g.select(y,y)}else{let y=l.getChildrenSize();l.select(t?y:0,t?y:0)}return!0}function op(e,t){let n=Je(e,t),o=n.getAdjacentCaret();o!==null&&W(o.origin)&&!o.origin.isInline()&&o.origin.isShadowRoot()?jn(ws(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function rp(e,t){let n=e.getNodes().map(s=>Je(s,"next")).sort(Qi),o=n[0],r=n[n.length-1];if(!o||!r)return!1;for(let s=0;s<n.length-1;s++)if(!n[s+1].origin.is(n[s].getNodeAtCaret()))return!1;return jn(Or(so(Sn(o),r),t)),ST(),!0}function LM(e,t,n){n.preventDefault(),n.stopPropagation();let o=e.getNodes();if(o.length===0)return!0;let r=o.map(l=>Je(l,"next")).sort(Qi),s=(t?r[0]:r[r.length-1]).origin,i=Me(s,l=>l!==s&&W(l)&&!l.isInline())??Ue(),a=t?0:i.getChildrenSize();return i.select(a,a),!0}function Tx(e,t){return e.length>0&&!t}function VM(e,t=St(cz),n=St(Tx)){return Se(e.registerCommand(sf,o=>{let r=z();if(De(r)){let s=o.target;if(me(s))for(let i of r.getNodes()){let a=e.getElementByKey(i.getKey());if(a!==null&&a.contains(s))return!1}return r.clear(),!0}return F(r)&&va(r,"click","both",t.peek()),!1},te),e.registerCommand(lf,o=>{let r=z();return F(r)?(r.deleteCharacter(o),!0):!!De(r)&&(r.deleteNodes(),!0)},te),e.registerCommand(XT,o=>{let r=z();return!!F(r)&&(r.deleteWord(o),!0)},te),e.registerCommand(qT,o=>{let r=z();return!!F(r)&&(r.deleteLine(o),!0)},te),e.registerCommand(YT,o=>{let r=z();if(typeof o=="string")r!==null&&r.insertText(o);else{if(r===null)return!1;let s=o.dataTransfer;if(s!=null)gx(s,r,e);else if(F(r)){let i=o.data;return i&&r.insertText(i),!0}}return!0},te),e.registerCommand(OO,()=>{let o=z();return!!F(o)&&(o.removeText(),!0)},te),e.registerCommand(tO,o=>{let r=z();return!(!F(r)&&!De(r)||(CT(r,o),0))},te),e.registerCommand(kO,o=>{let r=z();return!(!F(r)&&!De(r)||(FT(r,o),0))},te),e.registerCommand(eO,o=>{let r=z();if(!F(r)&&!De(r))return!1;let s=r.getNodes();for(let i of s){let a=Me(i,l=>W(l)&&!l.isInline());a!==null&&a.setFormat(o)}return!0},te),e.registerCommand(W_,o=>{let r=z();return!!F(r)&&(r.insertLineBreak(o),!0)},te),e.registerCommand(K_,()=>{let o=z();return!!F(o)&&(o.insertParagraph(),!0)},te),e.registerCommand(rO,()=>{let o=Gd(),r=z();return F(r)&&(o.setFormat(r.format),o.setStyle(r.style)),wT([o]),!0},te),e.registerCommand(oO,()=>Iy(o=>{let r=o.getIndent();o.setIndent(r+1)}),te),e.registerCommand(Y_,()=>Iy(o=>{let r=o.getIndent();r>0&&o.setIndent(Math.max(0,r-1))}),te),e.registerCommand(gO,o=>{let r=z();if(De(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!rp(r,"previous"))return o.preventDefault(),op(s[0],"previous"),!0;r=z()}}return F(r)&&(HM(r)||!o.shiftKey&&np(r,"previous")||!o.shiftKey&&$M(r,!0)||!o.shiftKey&&PM(r,!0))?(o.preventDefault(),!0):!1},te),e.registerCommand(fO,o=>{let r=z();if(De(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!rp(r,"next"))return o.preventDefault(),op(s[0],"next"),!0;r=z()}}return F(r)&&(UM(r)||!o.shiftKey&&np(r,"next")||!o.shiftKey&&$M(r,!1)||!o.shiftKey&&PM(r,!1))?(o.preventDefault(),!0):!1},te),e.registerCommand(pO,o=>{let r=z();if(De(r)){let i=r.getNodes();if(i.length>0){let a=Sc(i[0])?"next":"previous";if(!o.shiftKey||!rp(r,a))return o.preventDefault(),op(i[0],a),!0;r=z()}}if(!F(r))return!1;let s=Sc(r.anchor.getNode())?"next":"previous";if(AM(r,s)||!o.shiftKey&&np(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","start",t.peek()),Ny(r,!0)){let i=o.shiftKey;return o.preventDefault(),Ey(r,i,!0),!0}return!1},te),e.registerCommand(hO,o=>{let r=z();if(De(r)){let i=r.getNodes();if(i.length>0){let a=Sc(i[0])?"previous":"next";if(!o.shiftKey||!rp(r,a))return o.preventDefault(),op(i[0],a),!0;r=z()}}if(!F(r))return!1;let s=Sc(r.anchor.getNode())?"previous":"next";if(AM(r,s)||!o.shiftKey&&np(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","end",t.peek()),Ny(r,!1)){let i=o.shiftKey;return o.preventDefault(),Ey(r,i,!1),!0}return!1},te),e.registerCommand(mO,o=>{let r=z();if(!De(r)&&kM(o.target))return!1;if(F(r)){if((function(s){if(!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();if(As(a))return!1;let l=YD(a);return l.getIndent()>0&&(l.is(a)||a.is(l.getFirstDescendant()))})(r))return o.preventDefault(),e.dispatchCommand(Y_);if(pc&&uc)return!1}else if(!De(r))return!1;return o.preventDefault(),e.dispatchCommand(lf,!0)},te),e.registerCommand(_O,o=>{let r=z();return!(!De(r)&&kM(o.target))&&!(!F(r)&&!De(r))&&(o.preventDefault(),e.dispatchCommand(lf,!1))},te),e.registerCommand(xO,o=>{let r=z();if(De(r)){let s=r.getNodes();s.length===1&&vn(s[0])&&!s[0].isInline()&&(r=s[0].selectNext())}if(!F(r))return!1;if(va(r,"enter","both",t.peek()),o!==null){if((pc||ff||uf)&&uc)return!1;if(o.preventDefault(),o.shiftKey)return e.dispatchCommand(W_,!1)}return e.dispatchCommand(K_)},te),e.registerCommand(vO,()=>{let o=z();return!!F(o)&&(e.blur(),!0)},te),e.registerCommand(ZT,o=>{let[,r]=Ls(o);if(r.length>0){let s=o.clientX,i=o.clientY,a=ep(s,i,e.getRootElement());if(a!==null){let{offset:l,node:c}=a,u=Ko(c);if(u!==null){let d=xT();if(H(u))d.anchor.set(u.getKey(),l,"text"),d.focus.set(u.getKey(),l,"text");else{let p=u.getParentOrThrow().getKey(),h=u.getIndexWithinParent()+1;d.anchor.set(p,h,"element"),d.focus.set(p,h,"element")}let f=oa(d);Cn(f)}}return e.dispatchCommand(Ex,r),o.preventDefault(),!0}return bM(o,e)},te),e.registerCommand(QT,o=>{let[r]=Ls(o),s=z();return!(r&&!F(s)||(F(s)&&!s.isCollapsed()&&o.dataTransfer!==null&&(NM(o.dataTransfer,CM(s)),EM(o.dataTransfer,e)),0))},te),e.registerCommand(JT,o=>{let[r]=Ls(o),s=z();if(r&&!F(s))return!1;let i=o.clientX,a=o.clientY,l=ep(i,a,e.getRootElement());if(l!==null){let c=Ko(l.node);vn(c)&&o.preventDefault()}return!0},te),e.registerCommand(MO,()=>{let o=z();return nf(F(o)&&Qd(o.anchor.getNode())!==null?o:null),!0},te),e.registerCommand(af,o=>(mx(e,uo(o,ClipboardEvent)?o:null),!0),te),e.registerCommand(GT,o=>((async function(r,s){s.update(()=>{let i=z();F(i)&&!i.isCollapsed()&&sO(i)},{discrete:!0,tag:dc}),await mx(s,uo(r,ClipboardEvent)?r:null),s.update(()=>{let i=z();F(i)?i.removeText():De(i)&&i.getNodes().forEach(a=>a.remove())},{tag:dc})})(o,e),!0),te),e.registerCommand(gf,o=>{let[,r,s]=Ls(o);return!(!n.peek()(r,s)||!e.dispatchCommand(Ex,r))||(!aa(o.target)||!$T(o.target))&&z()!==null&&((function(i,a){i.preventDefault(),a.update(()=>{let l=z(),c=uo(i,InputEvent)||uo(i,KeyboardEvent)?null:i.clipboardData;c!=null&&l!==null&&gx(c,l,a)},{tag:mf})})(o,e),!0)},te),e.registerCommand(SO,()=>{let o=z();return F(o)&&va(o,"space","both",t.peek()),!1},te),e.registerCommand(CO,()=>{let o=z();return F(o)&&va(o,"tab","both",t.peek()),!1},te),e.registerCommand(EO,o=>{let r=z();if(De(r))return LM(r,!1,o);if(!F(r))return!1;let{anchor:s}=r;if(s.type!=="element"||s.offset!==0)return!1;let i=s.getNode();if(!W(i))return!1;let a=i.getFirstChild();if(!vn(a)||!a.isInline())return!1;let l=i.getKey(),c=i.selectEnd();return o.shiftKey&&c.anchor.set(l,0,"element"),o.preventDefault(),o.stopPropagation(),!0},te),e.registerCommand(NO,o=>{let r=z();if(De(r))return LM(r,!0,o);if(!F(r))return!1;let{anchor:s,focus:i}=r,a=Me(i.getNode(),u=>W(u)&&!u.isInline());if(a===null)return!1;let l=a.getFirstChild();if(!vn(l)||!l.isInline()||Me(s.getNode(),u=>W(u)&&!u.isInline())!==a)return!1;let c=a.getKey();return(i.type!=="element"||i.key!==c||i.offset!==0)&&(r.focus.set(c,0,"element"),o.shiftKey||r.anchor.set(c,0,"element"),o.preventDefault(),o.stopPropagation(),!0)},te))}var zt=Ox,FG=zt.$createHeadingNode,BG=zt.$createQuoteNode,zG=zt.$isHeadingNode,WG=zt.$isQuoteNode,KG=zt.DRAG_DROP_PASTE,UG=zt.HeadingAnnounceExtension,HG=zt.HeadingNode,VG=zt.QuoteNode,jG=zt.RichTextExtension,YG=zt.RichTextImportExtension,GG=zt.RichTextImportRules,qG=zt.ShadowRootQuoteRule,XG=zt.defaultShouldHandlePasteAsFiles,JG=zt.eventFiles,QG=zt.quoteShadowRootState,jM=zt.registerRichText;var Dx={};de(Dx,{RichTextPlugin:()=>pz});function uz(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function dz({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,s]=Dn(()=>[l=>n.registerDecoratorListener(l),()=>n.getDecorators()],[n]),i=vp(r,s,s),a=(function(l){let[c,u]=Dn(()=>[l.registerRootListener.bind(l),l.getRootElement.bind(l)],[l]);return vp(c,u,u)})(n);return Dn(()=>{let l=u=>n._onError(u),c=[];for(let u in i){let d=n.getElementByKey(u);if(d!==null){let f=Tt(o,{onError:l,children:Tt(Zx,{fallback:null,children:i[u]})});c.push(qx(f,d,u))}}return c},[o,i,n,a])})(e,t)}function fz({editor:e,ErrorBoundary:t}){return(function(n){let o=fa.maybeFromEditor(n);if(o&&o.hasExtensionByName(lD.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&uz(320,r);return!0}return!1})(e)?null:Tt(dz,{editor:e,ErrorBoundary:t})}var GM=bn?fo:et;function YM(e){return e.read("latest",Lf(e.isComposing()))}function pz({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=Yt();return(function(r){GM(()=>Se(jM(r),mD(r)),[r])})(o),If(Af,{children:[e,Tt(hz,{content:t}),Tt(fz,{editor:o,ErrorBoundary:n})]})}function hz({content:e}){let[t]=Yt(),n=(function(r){let[s,i]=Ie(()=>YM(r));return GM(()=>{function a(){let l=YM(r);i(l)}return a(),Se(r.registerUpdateListener(()=>{a()}),r.registerEditableListener(()=>{a()}))},[r]),s})(t),o=QO();return n?typeof e=="function"?e(o):e:null}var gz=Dx,qM=gz.RichTextPlugin;var Mx={};de(Mx,{ContentEditable:()=>_z,ContentEditableElement:()=>JM});var wx=bn?fo:et;function mz({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:s,ariaExpanded:i,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:h,id:g,role:y="textbox",spellCheck:m=!0,style:_,tabIndex:x,"data-testid":v,...S},b){let[N,D]=Ie(e.isEditable()),O=tv(A=>{A&&A.ownerDocument&&A.ownerDocument.defaultView?e.setRootElement(A):e.setRootElement(null)},[e]),T=Dn(()=>(function(...A){return $=>{for(let I of A)typeof I=="function"?I($):I!=null&&(I.current=$)}})(b,O),[O,b]);return wx(()=>(D(e.isEditable()),e.registerEditableListener(A=>{D(A)})),[e]),Tt("div",{"aria-activedescendant":N?t:void 0,"aria-autocomplete":N?n:"none","aria-controls":N?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":N&&y==="combobox"?!!i:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":N?d:void 0,"aria-readonly":!N||void 0,"aria-required":f,autoCapitalize:p,className:h,contentEditable:N,"data-testid":v,id:g,ref:T,role:y,spellCheck:m,style:_,tabIndex:x??(N?void 0:-1),...S})}var JM=zr(mz);function XM(e){return e.read("latest",Lf(e.isComposing()))}var _z=zr(yz);function yz(e,t){let{placeholder:n,...o}=e,[r]=Yt();return If(Af,{children:[Tt(JM,{editor:r,...o,ref:t}),n!=null&&Tt(xz,{editor:r,content:n})]})}function xz({content:e,editor:t}){let n=(function(i){let[a,l]=Ie(()=>XM(i));return wx(()=>{function c(){let u=XM(i);l(u)}return c(),Se(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a})(t),[o,r]=Ie(t.isEditable());if(wx(()=>(r(t.isEditable()),t.registerEditableListener(i=>{r(i)})),[t]),!n)return null;let s=null;return typeof e=="function"?s=e(o):e!==null&&(s=e),s===null?null:Tt("div",{"aria-hidden":!0,children:s})}var QM=Mx,ZM=QM.ContentEditable,_5=QM.ContentEditableElement;var Ax={};de(Ax,{LexicalErrorBoundary:()=>vz});var kx=class extends Qx{constructor(){super(...arguments);w(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,o){this.props.onError(n instanceof Error?n:new Error(String(n),{cause:n}),o)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function vz({children:e,fallback:t,onError:n}){return Tt(kx,{fallback:t===void 0?Tt("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}var Sz=Ax,ek=Sz.LexicalErrorBoundary;var Ix={};de(Ix,{HistoryExtension:()=>ip,SharedHistoryExtension:()=>bz,createEmptyHistoryState:()=>sk,registerHistory:()=>rk});function Cz(e,t,n){let o=n(),r=0,s=o,i=0,a=null;return(l,c,u,d,f,p)=>{let h=n();if(p.has(jT)&&(s=o,i=r,a=l),p.has(cf))return r=0,o=h,2;p.has(VT)&&a&&(o=s,r=i,l=a);let g=p.has(mf)||p.has(dc)?0:(function(m,_,x,v,S){if(m===null||x.size===0&&v.size===0&&!S)return 0;let b=_._selection,N=m._selection;if(S)return 1;if(!(F(b)&&F(N)&&N.isCollapsed()&&b.isCollapsed()))return 0;let D=(function(ee,Z,ne){let ae=ee._nodeMap,xe=[];for(let ue of Z){let q=ae.get(ue);q!==void 0&&xe.push(q)}for(let[ue,q]of ne){if(!q)continue;let le=ae.get(ue);le===void 0||As(le)||xe.push(le)}return xe})(_,x,v);if(D.length===0)return 0;if(D.length>1){let ee=_._nodeMap,Z=ee.get(b.anchor.key),ne=ee.get(N.anchor.key);return Z&&ne&&!m._nodeMap.has(Z.__key)&&H(Z)&&Z.__text.length===1&&b.anchor.offset===1?2:0}let O=D[0],T=m._nodeMap.get(O.__key);if(!H(T)||!H(O)||T.__mode!==O.__mode)return 0;let A=T.__text,$=O.__text;if(A===$)return 0;let I=b.anchor,L=N.anchor;if(I.key!==L.key||I.type!=="text")return 0;let P=I.offset,Y=L.offset,Q=$.length-A.length;return Q===1&&Y===P-1?2:Q===-1&&Y===P+1?3:Q===-1&&Y===P?4:0})(l,c,d,f,e.isComposing()),y=(()=>{let m=u===null||u.editor===e,_=p.has(nO);if(!_&&m&&p.has(ra))return 0;if(g===1)return 2;if(l===null)return 1;let x=c._selection;if(!(d.size>0||f.size>0))return x!==null?0:2;let v=typeof t=="number"?t:t.peek();return _===!1&&g!==0&&g===r&&h<o+v&&m||d.size===1&&(function(S,b,N){let D=b._nodeMap.get(S),O=N._nodeMap.get(S),T=b._selection,A=N._selection;return!(F(T)&&F(A)&&T.anchor.type==="element"&&T.focus.type==="element"&&A.anchor.type==="text"&&A.focus.type==="text"||!H(D)||!H(O)||D.__parent!==O.__parent)&&JSON.stringify(b.read(()=>D.exportJSON()))===JSON.stringify(N.read(()=>O.exportJSON()))})(Array.from(d)[0],l,c)?0:1})();return o=h,r=g,y}}function tk(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,o=n.getEditorState();return o.isEmpty()?null:{editor:n,editorState:o}}function nk(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function rk(e,t,n,o=Date.now,r,s=null){let i=Cz(e,n,o),a=()=>{r&&r(t)};return a(),Se(e.registerCommand(xf,()=>((function(l,c,u){let d=c.redoStack,f=c.undoStack;if(f.length!==0){let p=c.current,h=f.pop();if(h){let g=tk(h,p);g!==null&&(d.push(g),l.dispatchCommand(lc,!0))}f.length===0&&l.dispatchCommand(cc,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:cf})}})(e,t,r),!0),te),e.registerCommand(_f,()=>((function(l,c,u){let d=c.redoStack,f=c.undoStack;if(d.length!==0){let p=c.current,h=d.pop();if(h){let g=tk(h,p);g!==null&&(f.push(g),l.dispatchCommand(cc,!0))}d.length===0&&l.dispatchCommand(lc,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:cf})}})(e,t,r),!0),te),e.registerCommand(WT,()=>(nk(t,r),!1),te),e.registerCommand(KT,()=>(nk(t,r),e.dispatchCommand(lc,!1),e.dispatchCommand(cc,!1),!0),te),e.registerUpdateListener(({editorState:l,prevEditorState:c,dirtyLeaves:u,dirtyElements:d,tags:f})=>{let p=t.current,h=t.redoStack,g=t.undoStack,y=p===null?null:p.editorState;if(p!==null&&l===y)return;let m=i(c,l,p,u,d,f);if(m===1){h.length!==0&&(t.redoStack=[],e.dispatchCommand(lc,!1));let _=(function(x,v,S){return S===null?null:S.editor===x?{...S}:v.isEmpty()?null:{editor:x,editorState:v}})(e,c,p);if(_!==null){g.push(_);let x=typeof s=="number"||s===null?s:s.peek();x!==null&&g.length>x&&g.splice(0,g.length-x),e.dispatchCommand(cc,!0)}}else if(m===2)return;t.current={editor:e,editorState:l},a()}))}function sk(){return{current:null,redoStack:[],undoStack:[]}}var ip={build:(e,{delay:t,createInitialHistoryState:n,disabled:o,maxDepth:r,now:s},i)=>({...Qe({delay:t,disabled:o,historyState:n(e),maxDepth:r,now:s}),...i.getInitResult()}),config:{createInitialHistoryState:sk,delay:300,disabled:typeof window>"u",maxDepth:null,now:()=>Date.now()},init:()=>({canRedo:St(!1),canUndo:St(!1)}),name:"@lexical/history/History",register:(e,t,n)=>{let{canUndo:o,canRedo:r}=n.getInitResult(),s=n.getOutput(),i=a=>vc(()=>{o.value=a!=null&&a.undoStack.length>0,r.value=a!=null&&a.redoStack.length>0});return Ae(()=>{if(!s.disabled.value)return rk(e,s.historyState.value,s.delay,()=>s.now.peek()(),i,s.maxDepth);i(null)})}};function ok(e){let t=e?co(e,"@lexical/extension/HMR"):void 0;return t?t.output.restoreCount.value:0}var bz={build:(e,{disabled:t,parentEditor:n})=>Qe({disabled:t,parentEditor:n||e._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[[ip,{disabled:!0}]],name:"@lexical/history/SharedHistory",register:(e,t,n)=>Ae(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(ip);ok(e),ok(r.value);let i=(function(l){return l?co(l,ip.name):null})(r.value);if(!i)return;let a=i.output;vc(()=>{s.delay.value=a.delay.value,s.historyState.value=a.historyState.value,s.now.value=a.now.value,s.maxDepth.value=a.maxDepth.value,s.disabled.value=a.disabled.value})}})};var ap=Ix,O5=ap.HistoryExtension,D5=ap.SharedHistoryExtension,lp=ap.createEmptyHistoryState,ik=ap.registerHistory;var $x={};de($x,{HistoryPlugin:()=>Ez,createEmptyHistoryState:()=>lp});function Ez({delay:e,externalHistoryState:t}){let[n]=Yt();return(function(o,r,s=1e3){let i=Dn(()=>r||lp(),[r]);et(()=>ik(o,i,s),[s,o,i])})(n,t,e),null}var ak=$x,lk=ak.HistoryPlugin,$5=ak.createEmptyHistoryState;var Bx={};de(Bx,{$createAutoLinkNode:()=>gk,$createLinkNode:()=>kc,$isAutoLinkNode:()=>Zt,$isLinkNode:()=>Nn,$toggleLink:()=>cp,AutoLinkAnnounceExtension:()=>mk,AutoLinkExtension:()=>Uz,AutoLinkNode:()=>Us,ClickableLinkExtension:()=>Pz,LinkExtension:()=>fp,LinkImportExtension:()=>Rz,LinkImportRules:()=>_k,LinkNode:()=>Yo,TOGGLE_LINK_COMMAND:()=>up,autoLinkEmailMatcher:()=>Bz,autoLinkUrlMatcher:()=>Fz,createLinkMatcherWithRegExp:()=>vk,formatUrl:()=>Rx,registerAutoLink:()=>Tk,registerClickableLink:()=>xk,registerLink:()=>yk});var Nz=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Fx(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!Nz.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function hk(e,t,n,o,r){let s=Fx(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function Tz(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Oz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],rel:r.__rel,target:r.__target,title:r.__title,url:r.__url,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__rel;c!=null&&(l.rel=c);let u=r.__target;u!=null&&(l.target=u);let d=r.__title;d!=null&&(l.title=d);let f=r.__url;f!==void 0&&f!==""&&(l.url=f);let p=r.__dir;p!=null&&(l.direction=p);let h=t[r.__format];h!==void 0&&h!==""&&(l.format=h);let g=r.__indent;return g!==void 0&&g!==0&&(l.indent=g),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=hk(s.indent,0,0,1/0),r.__textFormat=Fx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.rel;r.__rel=typeof c=="string"&&c!==""?c:null;let u=s.target;r.__target=typeof u=="string"&&u!==""?u:null;let d=s.title;r.__title=typeof d=="string"&&d!==""?d:null;let f=s.url;return r.__url=typeof f=="string"?f:"",r},afterCloneFrom:Tz}};function Dz(e,t){e.__isUnlinked=t.__isUnlinked}var wz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],isUnlinked:r.__isUnlinked,rel:r.__rel,target:r.__target,title:r.__title,url:r.__url,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__isUnlinked;c!==void 0&&c!==!1&&(l.isUnlinked=c);let u=r.__rel;u!=null&&(l.rel=u);let d=r.__target;d!=null&&(l.target=d);let f=r.__title;f!=null&&(l.title=f);let p=r.__url;p!==void 0&&p!==""&&(l.url=p);let h=r.__dir;h!=null&&(l.direction=h);let g=t[r.__format];g!==void 0&&g!==""&&(l.format=g);let y=r.__indent;return y!==void 0&&y!==0&&(l.indent=y),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=hk(s.indent,0,0,1/0),r.__textFormat=Fx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.rel;r.__rel=typeof c=="string"&&c!==""?c:null;let u=s.target;r.__target=typeof u=="string"&&u!==""?u:null;let d=s.title;r.__title=typeof d=="string"&&d!==""?d:null;let f=s.url;r.__url=typeof f=="string"?f:"";let p=s.isUnlinked;return r.__isUnlinked=typeof p=="boolean"&&p,r},afterCloneFrom:Dz}},ck=new Set(["http:","https:","mailto:","sms:","tel:"]),Mz=_c()({rel:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__rel"}),target:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__target"}),title:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__title"}),url:Rr(yc(),{field:"__url",getter:"getURL",setter:"setURL"})}),Yo=class extends lo{constructor(n="",o={},r){super(r);w(this,"__url");w(this,"__target");w(this,"__rel");w(this,"__title");let{target:s=null,rel:i=null,title:a=null}=o;this.__url=n,this.__target=s,this.__rel=i,this.__title=a}$config(){return this.config("link",{extends:lo,generated:Oz,importDOM:{a:()=>({conversion:Az,priority:1})},json:Mz})}createDOM(n){let o=Ft().createElement("a");return this.updateLinkDOM(null,o,n),So(o,n.theme.link),o}updateLinkDOM(n,o,r){if(la(o)){n&&n.__url===this.__url||(o.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];n&&n[i]===a||(a?o[s]=a:o.removeAttribute(s))}}}updateDOM(n,o,r){return this.updateLinkDOM(n,o,r),!1}sanitizeUrl(n){let o=n;n=Rx(n);try{let r=new URL(Rx(n));if(!ck.has(r.protocol))return"about:blank"}catch{let r=o.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(r!=null&&!ck.has(`${r[1].toLowerCase()}:`))return"about:blank"}return n}getURL(){return this.getLatest().__url}setURL(n){let o=this.getWritable();return o.__url=n,o}getTarget(){return this.getLatest().__target}setTarget(n){let o=this.getWritable();return o.__target=n,o}getRel(){return this.getLatest().__rel}setRel(n){let o=this.getWritable();return o.__rel=n,o}getTitle(){return this.getLatest().__title}setTitle(n){let o=this.getWritable();return o.__title=n,o}insertNewAfter(n,o=!0){let r=Vd(this);return this.insertAfter(r,o),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(n,o,r){if(!F(o))return!1;let s=o.anchor.getNode(),i=o.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&o.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith("mailto:")}isWebSiteURI(){let n=this.getURL();return n.startsWith("https://")||n.startsWith("http://")}shouldMergeAdjacentLink(n){return this.getType()===n.getType()&&this.getURL()===n.getURL()&&this.getTarget()===n.getTarget()&&this.getRel()===n.getRel()&&this.getTitle()===n.getTitle()}};function uk(e){let t=xn(e,"next");return[t,t.getFlipped()]}function dk(e,t){for(let n of t)if(n.origin.isAttached()){let o=Vn(n);return void LT(e,o)}}function kz(e){let t=z(),n=null,o=null;function r(){F(t)&&(dk(t.anchor,n),dk(t.focus,o),oa(t))}F(t)&&(n=uk(t.anchor),o=uk(t.focus));let s=!1;for(let a of Qt(e,"next")){let l=a.origin;if(W(l)&&!l.isInline()){let c=l.getChildren();if(c.length>0){let u=Vd(e);u.append(...c),l.append(u),s=!0}ta(l,Sn(a),{$shouldSplit:()=>!1})}}function i(a,l,c){let[u,d]=a,f=h=>Ho(h)&&h.origin.is(l);if(!f(u)&&!f(d))return a;let p=Vn(Qt(c,"next"));return[p,p.getFlipped()]}if(e.isAttached()){let a=e.getPreviousSibling();if(Nn(a)&&a.shouldMergeAdjacentLink(e))return n&&(n=i(n,a,e)),o&&(o=i(o,a,e)),a.append(...e.getChildren()),e.remove(),void r();let l=e.getNextSibling();Nn(l)&&e.shouldMergeAdjacentLink(l)&&(n&&(n=i(n,e,l)),o&&(o=i(o,e,l)),e.append(...l.getChildren()),l.remove(),s=!0)}if(s){if(!e.canBeEmpty()&&e.isEmpty()){let a=e.getParent();e.remove(),a&&a.isEmpty()&&a.remove()}r()}}function Az(e){let t=null;if(la(e)){let n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=kc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function kc(e="",t){return Ji(new Yo(e,t))}function Nn(e){return e instanceof Yo}var Iz=_c()({isUnlinked:Rr(vf(),{field:"__isUnlinked"})}),Us=class extends Yo{constructor(n="",o={},r){super(n,o,r);w(this,"__isUnlinked");this.__isUnlinked=o.isUnlinked!==void 0&&o.isUnlinked!==null&&o.isUnlinked}$config(){return this.config("autolink",{extends:Yo,generated:wz,json:Iz})}shouldMergeAdjacentLink(n){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(n){let o=this.getWritable();return o.__isUnlinked=n,o}createDOM(n){return this.__isUnlinked?Ft().createElement("span"):super.createDOM(n)}updateDOM(n,o,r){return super.updateDOM(n,o,r)||n.__isUnlinked!==this.__isUnlinked}};function gk(e="",t){return Ji(new Us(e,t))}function Zt(e){return e instanceof Us}var up=sa("TOGGLE_LINK_COMMAND");function fk(e,t){if(e.type==="element"){let n=e.getNode();return W(n)||(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(252),n.getChildren()[e.offset+t]||null}return null}function cp(e,t={}){let n;if(e&&typeof e=="object"){let{url:u,...d}=e;n=u,t={...d,...t}}else n=e;let{target:o,title:r}=t,s=t.rel===void 0?"noreferrer":t.rel,i=z();if(i===null||!F(i)&&!De(i))return;if(De(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(n===null){let f=Me(d,p=>!Zt(p)&&Nn(p));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=Me(d,p=>!Zt(p)&&Nn(p));if(f)f.setURL(n),o!==void 0&&f.setTarget(o),s!==void 0&&f.setRel(s),r!==void 0&&f.setTitle(r);else{let p=kc(n,{rel:s,target:o,title:r});d.insertBefore(p),p.append(d)}}})}if(i.isCollapsed()&&n===null)for(let u of i.getNodes()){let d=Me(u,f=>!Zt(f)&&Nn(f));return void(d!==null&&(d.getParentOrThrow().splice(d.getIndexWithinParent(),0,d.getChildren()),d.remove()))}let a=i.extract();if(n===null){let u=new Set;return void a.forEach(d=>{let f=Me(d,p=>!Zt(p)&&Nn(p));if(f!==null){let p=f.getKey();if(u.has(p))return;(function(h,g){let y=new Set(g.filter(D=>h.isParentOf(D)).map(D=>D.getKey())),m=h.getChildren(),_=D=>y.has(D.getKey())||W(D)&&g.some(O=>h.isParentOf(O)&&D.isParentOf(O)),x=m.filter(_);if(x.length===m.length)return m.forEach(D=>h.insertBefore(D)),void h.remove();let v=m.findIndex(_),S=m.findLastIndex(_),b=v===0,N=S===m.length-1;if(b)x.forEach(D=>h.insertBefore(D));else if(N)for(let D=x.length-1;D>=0;D--)h.insertAfter(x[D]);else{for(let O=x.length-1;O>=0;O--)h.insertAfter(x[O]);let D=m.slice(S+1);if(D.length>0){let O=Vd(h);x[x.length-1].insertAfter(O),D.forEach(T=>O.append(T))}}})(f,a),u.add(p)}})}let l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(n),o!==void 0&&u.setTarget(o),s!==void 0&&u.setRel(s),r!==void 0&&u.setTitle(r))};if(a.length===1){let u=a[0],d=Me(u,Nn);if(d!==null)return c(d)}(function(u){let d=z();if(!F(d))return u();let f=oa(d),p=f.isBackward(),h=fk(f.anchor,p?-1:0),g=fk(f.focus,p?0:-1);if(u(),h||g){let y=z();if(F(y)){let m=y.clone();if(h){let _=h.getParent();_&&m.anchor.set(_.getKey(),h.getIndexWithinParent()+(p?1:0),"element")}if(g){let _=g.getParent();_&&m.focus.set(_.getKey(),g.getIndexWithinParent()+(p?0:1),"element")}Cn(oa(m))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let f=Me(d,Nn);if(f){c(f);continue}if(W(d)){if(!d.isInline())continue;if(Nn(d)){if(!(Zt(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let h of d.getChildren())d.insertBefore(h);d.remove();continue}}let p=d.getPreviousSibling();Nn(p)&&p.is(u)?p.append(d):(u=kc(n,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var $z=/^\+?[0-9\s()-]{5,}$/;function Rx(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:$z.test(e)?`tel:${e}`:`https://${e}`}var mk={build:(e,t)=>Qe(t),config:{created:"Link",createdMany:"%s links",destroyed:"Link removed",destroyedMany:"%s links removed",disabled:!1},dependencies:[ya],name:"@lexical/link/AutoLinkAnnounce",register(e,t,n){let{created:o,createdMany:r,destroyed:s,destroyedMany:i,disabled:a}=n.getOutput(),{announce:l}=n.getDependency(ya).output;return Ae(()=>a.value?void 0:e.registerMutationListener(Us,c=>{let u=0,d=0;for(let[,f]of c)f==="created"?u++:f==="destroyed"&&d++;u>0&&d===0?l(u===1?o.peek():r.peek().replace("%s",String(u))):d>0&&u===0&&l(d===1?s.peek():i.peek().replace("%s",String(d)))},{skipInitialization:!0}))}},_k=[{$import:(e,t)=>{if(!t.textContent&&t.children.length===0)return[];let n=t.getAttribute("href")||"",o={rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")};return eM(e.$importChildren(t),()=>kc(n,o))},match:Fr.tag("a"),name:"@lexical/link/a"}];function yk(e,t){return Se(e.registerNodeTransform(Yo,kz),e.registerCommand(up,n=>{let o=t.validateUrl.peek(),r=t.attributes.peek();if(n===null)return cp(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n)||(cp(n,r),0));{let{url:s,...i}=n;return!(o!==void 0&&!o(s)||(cp(s,{...r,...i}),0))}},te),Ae(()=>{let n=t.validateUrl.value;if(!n)return;let o=t.attributes.value;return e.registerCommand(gf,r=>{let s=z();if(!F(s)||s.isCollapsed()||!uo(r,ClipboardEvent)||r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!n(i)&&!s.getNodes().some(a=>W(a)||H(a)&&!a.isSimpleText())&&(e.dispatchCommand(up,{...o,url:i}),r.preventDefault(),!0)},Vo)}))}var fp={build:(e,t,n)=>Qe(t),config:{attributes:void 0,validateUrl:void 0},dependencies:[ga,[Xf,{rules:_k}]],mergeConfig(e,t){let n=Bt(e,t);return e.attributes&&(n.attributes=Bt(e.attributes,n.attributes)),n},name:"@lexical/link/Link",nodes:()=>[Yo],register:(e,t,n)=>yk(e,n.getOutput())},Rz={dependencies:[fp],name:"@lexical/link/Import"};function xk(e,t,n={}){let o=r=>{let s=r.button===1;if(r.type==="auxclick"&&!s)return;let i=r.target;if(!aa(i))return;let a=WO(i);if(a===null)return;let l=null,c=null,u=!1;if(a.update(()=>{let f=Ko(i);if(f!==null){let p=Me(f,W);if(!t.disabled.peek())if(Nn(p))u=Zt(p)&&p.getIsUnlinked(),l=p.sanitizeUrl(p.getURL()),c=p.getTarget();else{let h=(function(g,y){let m=g;for(;m!=null;){if(y(m))return m;m=m.parentNode}return null})(i,la);h!==null&&(l=h.href,c=h.target)}}}),l===null||l===""||u)return;let d=e.read("latest",z);(!F(d)||d.isCollapsed())&&window.open(l,t.newTab.peek()||s||r.metaKey||r.ctrlKey||c==="_blank"?"_blank":"_self"),r.preventDefault()};return e.registerRootListener(r=>{if(r)return Mf(r,{auxclick:o,click:o},n)})}var Pz={build:(e,t,n)=>Qe(t),config:{disabled:!1,newTab:!1},dependencies:[fp],name:"@lexical/link/ClickableLink",register:(e,t,n)=>xk(e,n.getOutput())};function vk(e,t=n=>n){return n=>{let o=e.exec(n);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:t(o[0])}}}var Lz=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,Fz=e=>{let t=Lz.exec(e);if(t===null)return null;let n=t[0],o=0;for(let r of n)r==="("?o++:r===")"&&o--;for(;o<0&&n.endsWith(")");)n=n.slice(0,-1),o++;return{index:t.index,length:n.length,text:n,url:n.startsWith("http")?n:`https://${n}`}},Bz=vk(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,e=>`mailto:${e}`);function Px(e,t){for(let n=0;n<t.length;n++){let o=t[n](e);if(o)return o}return null}var Sk=/[.,;\s]/;function dp(e,t){return t.test(e)}function Ck(e,t){return dp(e[e.length-1],t)}function Lx(e,t){return dp(e[0],t)}function bk(e,t){let n=e.getPreviousSibling();return W(n)&&(n=n.getLastDescendant()),n===null||Dr(n)||H(n)&&Ck(n.getTextContent(),t)}function Ek(e,t){let n=e.getNextSibling();return W(n)&&(n=n.getFirstDescendant()),n===null||Dr(n)||H(n)&&Lx(n.getTextContent(),t)}function zz(e,t,n,o,r){return!!(e>0?dp(o[e-1],n):bk(r[0],n))&&(t<o.length?dp(o[t],n):Ek(r[r.length-1],n))}function Wz(e,t,n){let o=[],r=[],s=[],i=0,a=0,l=[...e];for(;l.length>0;){let c=l[0],u=c.getTextContent().length,d=a;a+u<=t?(o.push(c),i+=u):d>=n?s.push(c):r.push(c),a+=u,l.shift()}return[i,o,r,s]}function Kz(e,t,n,o){let r=gk(o.url,o.attributes);if(e.length===1){let s,i=e[0];t===0?[s,i]=i.splitText(n):[,s,i]=i.splitText(t,n);let a=Hn(o.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),r.append(a),s.replace(r),i}if(e.length>1){let s=e[0],i,a=s.getTextContent().length;t===0?i=s:[,i]=s.splitText(t);let l=[],c;for(let p=1;p<e.length;p++){let h=e[p],g=h.getTextContent().length,y=a;if(y<n)if(a+g<=n)l.push(h);else{let[m,_]=h.splitText(n-y);l.push(m),c=_}a+=g}let u=z(),d=u?u.getNodes().find(H):void 0,f=Hn(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),r.append(f,...l),d&&d===i&&(F(u)?f.select(u.anchor.offset,u.focus.offset):De(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function pk(e,t,n,o){let r=e.getChildren(),s=r.length;for(let c=0;c<s;c++){let u=r[c];if(!H(u)||!u.isSimpleText())return Mc(e),void n(null,e.getURL())}let i=e.getTextContent(),a=Px(i,t);if(a===null||a.text!==i||!bk(e,o)||!Ek(e,o))return Mc(e),void n(null,e.getURL());let l=e.getURL();l!==a.url&&(e.setURL(a.url),n(a.url,l)),a.attributes&&(e.getRel()!==a.attributes.rel&&e.setRel(a.attributes.rel||null),e.getTarget()!==a.attributes.target&&e.setTarget(a.attributes.target||null),e.getTitle()!==a.attributes.title&&e.setTitle(a.attributes.title||null))}function Mc(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(n=>n.getLatest())}var Nk={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:Sk};function Tk(e,t=Nk){let{matchers:n,changeHandlers:o,excludeParents:r,separatorRegex:s=Sk}=t,i=(a,l)=>{for(let c of o)c(a,l)};return Se(e.registerNodeTransform(kr,a=>{let l=a.getParentOrThrow(),c=a.getPreviousSibling();if(Zt(l))pk(l,n,i,s);else if(!Nn(l)&&!r.some(u=>u(l))){if(a.isSimpleText()&&(Lx(a.getTextContent(),s)||!Zt(c))){let u=(function(d){let f=[d],p=d.getNextSibling();for(;p!==null&&H(p)&&p.isSimpleText()&&(f.push(p),!/[\s]/.test(p.getTextContent()));)p=p.getNextSibling();return f})(a);(function(d,f,p,h){for(let v of d){let S=v.getParent();if(Zt(S)&&!S.getIsUnlinked())return}let g=[...d],y=g.map(v=>v.getTextContent()).join(""),m,_=y,x=0;for(;(m=Px(_,f))&&m!==null;){let v=m.index,S=v+m.length;if(zz(x+v,x+S,h,y,g)){let[b,,N,D]=Wz(g,x+v,x+S),O=!1;for(let A of N){let $=A.getParent();if(Zt($)&&!$.getIsUnlinked()){O=!0;break}}if(O){x+=S,_=_.substring(S);continue}let T=Kz(N,x+v-b,x+S-b,m);g=T?[T,...D]:D,p(m.url,null),x=0}else x+=S;_=_.substring(S)}})(u,n,i,s)}(function(u,d,f,p){let h=u.getParent(),g=u.getPreviousSibling(),y=u.getNextSibling(),m=u.getTextContent();if(!Zt(h)||h.getIsUnlinked()){if(Zt(g)&&!g.getIsUnlinked()&&g.is(u.getPreviousSibling())&&u.getParent()===g.getParent()){if(!Lx(m,p))return Mc(g),void f(null,g.getURL());if(_=m,g.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(_):/^\.[a-zA-Z0-9]{1,}/.test(_)){let x=g.getTextContent()+m,v=Px(x,d);v!==null&&v.text===x&&(g.append(u),pk(g,d,f,p),f(null,g.getURL()))}}var _;!Zt(y)||y.getIsUnlinked()||Ck(m,p)||y.is(u.getNextSibling())&&u.getParent()===y.getParent()&&(Mc(y),f(null,y.getURL()))}})(a,n,i,s)}}),e.registerCommand(up,a=>{let l=z();return!(a!==null||!F(l))&&(l.extract().forEach(c=>{let u=c.getParent();Zt(u)&&(u.setIsUnlinked(!u.getIsUnlinked()),u.markDirty())}),!1)},Vo))}var Uz={config:Nk,dependencies:[mk,fp],mergeConfig(e,t){let n=Bt(e,t);for(let o of["matchers","changeHandlers","excludeParents"]){let r=t[o];Array.isArray(r)&&(n[o]=[...e[o],...r])}return n},name:"@lexical/link/AutoLink",nodes:[Us],register:Tk};var ot=Bx,U5=ot.$createAutoLinkNode,H5=ot.$createLinkNode,V5=ot.$isAutoLinkNode,zx=ot.$isLinkNode,j5=ot.$toggleLink,Y5=ot.AutoLinkAnnounceExtension,G5=ot.AutoLinkExtension,q5=ot.AutoLinkNode,X5=ot.ClickableLinkExtension,J5=ot.LinkExtension,Q5=ot.LinkImportExtension,Z5=ot.LinkImportRules,pp=ot.LinkNode,Wx=ot.TOGGLE_LINK_COMMAND,e6=ot.autoLinkEmailMatcher,t6=ot.autoLinkUrlMatcher,n6=ot.createLinkMatcherWithRegExp,o6=ot.formatUrl,r6=ot.registerAutoLink,s6=ot.registerClickableLink,Ok=ot.registerLink;var Kx={};de(Kx,{LinkPlugin:()=>Hz});function Hz({validateUrl:e,attributes:t}){let[n]=Yt();return et(()=>{if(!n.hasNodes([pp]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),et(()=>Ok(n,Qe({attributes:t,validateUrl:e})),[n,e,t]),null}var Vz=Kx,Dk=Vz.LinkPlugin;var jz=e=>t=>{let n=Ue();if(e&&typeof e=="object"&&"html"in e){let o=new DOMParser().parseFromString(e.html,"text/html");n.append(...qf(t,o))}else n.append(it().append(Hn(e??"")))},Yz=()=>{let e=z();if(!F(e))return null;let t=e.anchor.getNode();return zx(t)?t:zx(t.getParent())?t.getParent():null},Gz=()=>{let[e]=Yt();return et(()=>e.registerNodeTransform(kr,t=>{t.getFormat()!==0&&t.setFormat(0),t.getStyle()!==""&&t.setStyle("")}),[e]),null},qz=()=>{let[e]=Yt(),[t,n]=Ie(null),o=()=>e.getEditorState().read(()=>n(Yz()?.getURL()??"")),r=()=>{e.dispatchCommand(Wx,t||null),n(null)},s=()=>{e.dispatchCommand(Wx,null),n(null)};return t===null?E.createElement(Re,{type:"button",variant:"secondary",onClick:o},"Link"):E.createElement("div",{className:"flex flex-col gap-2"},E.createElement(on,{htmlFor:"ks-pages-link-address"},"Link address"),E.createElement(_t,{id:"ks-pages-link-address",type:"url",value:t,onChange:i=>n(i.target.value)}),E.createElement("div",{className:"flex gap-2"},E.createElement(Re,{type:"button",onClick:r},"Save link"),E.createElement(Re,{type:"button",variant:"secondary",onClick:s},"Remove link")))},Xz=({fieldKey:e,onChange:t,children:n})=>{let[o]=Yt();return E.createElement("div",{"data-rich-text-field":e,onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||o.getEditorState().read(()=>t(e,{html:Gf(o,null)}))},className:"flex flex-col gap-2"},n)};function Ux({field:e,value:t,onChange:n}){let o={namespace:`ks-pages-${e.key}`,nodes:[pp],editorState:jz(t??e.default),onError:r=>{throw r}};return E.createElement(XO,{initialConfig:o},E.createElement(Xz,{fieldKey:e.key,onChange:n},E.createElement(qM,{contentEditable:E.createElement(ZM,{id:`ks-pages-field-${e.key}`,className:"ks-input min-h-24"}),ErrorBoundary:ek}),E.createElement(lk,null),E.createElement(Dk,null),E.createElement(Gz,null),E.createElement(qz,null)))}var Jz=({field:e,value:t,onChange:n})=>{let o=t??e.default??"",r={id:`ks-pages-field-${e.key}`,defaultValue:o,onBlur:s=>s.target.value!==o&&n(e.key,s.target.value)};return e.kind==="yes_or_no"?E.createElement(Pu,{id:r.id,defaultChecked:t==="true",onChange:s=>n(e.key,String(s.target.checked))}):e.kind==="one_of"?E.createElement(yt,{id:r.id,defaultValue:t??e.default??"",onChange:s=>n(e.key,s.target.value)},e.options.map(s=>E.createElement("option",{key:s,value:s},s))):e.kind==="long_text"?E.createElement(hC,{...r,rows:4}):e.kind==="number"?E.createElement(_t,{...r,type:"number"}):e.kind==="address"?E.createElement(_t,{...r,type:"url"}):E.createElement(_t,{...r,type:"text"})},Qz=["text","long_text","address","number","list","data",void 0],Ac=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&"value"in e,Zz=({field:e,stored:t,valueNames:n,onChange:o,onBind:r})=>{let s=Ac(t)?t:null,i=s?s.fallback??"":t??e.default??"";return E.createElement(yt,{id:`ks-pages-value-${e.key}`,"aria-label":`${e.label} value`,value:s?.value??"",onChange:a=>a.target.value?r(e.key,a.target.value,i):o(e.key,i)},E.createElement("option",{value:""},"Typed text"),Object.entries(n).map(([a,l])=>E.createElement("option",{key:a,value:a},l)))};function Hx({element:e,definition:t,alignments:n,valueNames:o={},onChange:r,onArrange:s,onBind:i,onRemove:a}){return E.createElement("aside",{"data-element-fields":!0,className:"flex flex-col gap-3"},t.fields.map(l=>E.createElement("div",{key:`${e.id}-${l.key}`,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-field-${l.key}`},l.label),Qz.includes(l.kind)&&Object.keys(o).length>0&&E.createElement(Zz,{field:l,stored:e.fields[l.key],valueNames:o,onChange:r,onBind:i}),l.kind==="list"&&!Ac(e.fields[l.key])&&E.createElement(Eg,{field:l,entries:e.fields[l.key]??l.default??[],onChange:r}),l.kind==="data"&&E.createElement("p",{className:"ks-hint"},"Filled with data the host supplies on a template page"),l.kind==="rich_text"&&E.createElement(Ux,{key:JSON.stringify(e.fields[l.key]??null),field:l,value:e.fields[l.key],onChange:r}),l.kind!=="list"&&l.kind!=="data"&&l.kind!=="rich_text"&&E.createElement(Jz,{key:JSON.stringify(e.fields[l.key]??null),field:l,value:Ac(e.fields[l.key])?e.fields[l.key].fallback??"":e.fields[l.key],onChange:(c,u)=>Ac(e.fields[c])?i(c,e.fields[c].value,u):r(c,u)}),Ac(e.fields[l.key])&&E.createElement("p",{className:"ks-hint"},"Shows ",o[e.fields[l.key].value]??e.fields[l.key].value,", or this text when it has no value"))),E.createElement("div",{className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:"ks-pages-element-align"},"Horizontal alignment"),E.createElement(yt,{key:`${e.id}-align`,id:"ks-pages-element-align",defaultValue:e.align??t.align??"stretch",onChange:l=>s(e.id,"align",l.target.value)},n.map(l=>E.createElement("option",{key:l,value:l},l)))),E.createElement(Re,{type:"button",variant:"danger",onClick:()=>a(e.id)},"Remove element"))}var wk=e=>e.sections.flatMap(t=>t.rows).flatMap(t=>t.columns),hp=(e,t)=>wk(e).flatMap(n=>n.elements).find(n=>n.id===t),gp=(e,t)=>{let n=e.sections.flatMap(o=>o.rows);return[...e.sections,...n,...wk(e)].find(o=>o.id===t)};var eW=[{kind:"section",selector:"[data-section-id]",id:e=>e.dataset.sectionId,group:()=>"page"},{kind:"row",selector:"[data-row-id]",id:e=>e.dataset.rowId,group:e=>e.closest("[data-section-id]").dataset.sectionId},{kind:"column",selector:"[data-column-id]",id:e=>e.dataset.columnId,group:e=>e.closest("[data-row-id]").dataset.rowId}],tW=[["[data-element-id]","Element"],["[data-column-id]","Column"],["[data-row-id]","Row"],["[data-section-id]","Section"]],nW=e=>tW.map(([t,n])=>[e.closest(t),n]).filter(([t])=>t).reduce((t,n)=>!t||t[0].contains(n[0])?n:t,null),oW=[eg.configure({preventActivation:()=>!1}),Zh];function rW({name:e,publish_url:t,unpublish_url:n,elements:o,canvas:r,document:s,elements_url:i,sections_url:a,columns_url:l,rows_url:c,nodes_url:u,arrangements:d,defaults:f,shares:p,value_names:h,looks:g=[],samples:y=[],sample:m,samples_url:_,title_url:x,access_exceptions:v=[],access_exception:S,access_exception_url:b,history_url:N,live_url:D,back_url:O,undo_url:T,redo_url:A,undoable:$,redoable:I,sequence:L,token:P}){let[Y,Q]=Ie(r),[ee,Z]=Ie($),[ne,ae]=Ie(I),[xe,ue]=Ie(s),[q,le]=Ie(null),[Fe,Te]=Ie(null),[Ot,Dt]=Ie(null),[Ze,Hs]=Ie("desktop"),bo=Xo(null),lt=Xo(null),[Go,_e]=Ie(null),[Be,pt]=Ie([]),en=Xo(null),Yn=Xo(null),Wt=Xo(null),Ke=({canvas:B,document:X,undoable:V,redoable:ye})=>{Dt(null),Q(B),ue(X),V!==void 0&&Z(V),ye!==void 0&&ae(ye)},wt=({error:B})=>Dt(B),Ic=B=>{Dt(null),Te(B)},mp=B=>{Wt.current.querySelectorAll("[data-hovered]").forEach(Mt=>delete Mt.dataset.hovered);let[X,V]=nW(B.target)??[];if(!X)return;X.dataset.hovered="";let ye=V==="Element"&&hp(xe,X.dataset.elementId);X.dataset.kind=ye?o.find(Mt=>Mt.key===ye.key)?.name??V:V},_p=B=>{let X=B.target.closest("[data-element-id]");if(X)return B.preventDefault(),Te(null),le(X.dataset.elementId);let V=B.target.closest("[data-column-id]");V&&(le(null),Te({kind:"column",id:V.dataset.columnId,rowId:V.closest("[data-row-id]").dataset.rowId,sectionId:V.closest("[data-section-id]").dataset.sectionId}))},Tn=q&&hp(xe,q),On=Tn&&o.find(B=>B.key===Tn.key);fo(()=>{Wt.current.innerHTML=Y},[Y]),et(()=>{let B=new w0;en.current=B;let X=[...Yn.current.querySelectorAll("[data-element-key]")].map(ye=>new cs({id:`palette-${ye.dataset.elementKey}`,element:ye,feedback:"clone",data:{key:ye.dataset.elementKey}},B)),V=()=>Wt.current.querySelectorAll("[data-drop-target]").forEach(ye=>delete ye.dataset.dropTarget);return B.monitor.addEventListener("dragover",({operation:ye})=>{V(),ye.target?.element&&(ye.target.element.dataset.dropTarget="")}),B.monitor.addEventListener("dragend",({operation:ye,canceled:Mt})=>{V();let{source:He,target:ht}=ye;if(Mt||!ht)return;if(He.data?.key)return ht.data?.columnId&&Z0(i,P,He.data.key,ht.data.columnId).then(Ke);if(He.type!=="element")return pg(u,P,He.id,He.group==="page"?null:He.group,He.index).then(Ke,wt);let Vs=He.group===He.initialGroup&&ht.data?.columnId&&ht.data.columnId!==He.group?ht.data.columnId:He.group,Ce=Vs===He.group?He.index:0;pg(u,P,He.id,Vs,Ce).then(Ke,wt)}),()=>{X.forEach(ye=>ye.destroy()),B.destroy()}},[]),et(()=>{let B=[...Wt.current.querySelectorAll("[data-column-id]")].map(V=>new xi({id:`drop-${V.dataset.columnId}`,element:V,data:{columnId:V.dataset.columnId},accept:ye=>!ye.type||ye.type==="element"},en.current)),X=[...Wt.current.querySelectorAll("[data-element-id]")].map(V=>{let ye=V.closest("[data-column-id]"),Mt=[...ye.children].indexOf(V);return new bi({id:V.dataset.elementId,element:V,index:Mt,group:ye.dataset.columnId,type:"element",accept:"element",sensors:oW},en.current)});return()=>[...B,...X].forEach(V=>V.destroy())},[Y]);let ba=B=>[["section","[data-section-id]","sectionId","Section"],["row","[data-row-id]","rowId","Row"],["column","[data-column-id]","columnId","Column"],["element","[data-element-id]","elementId",null]].flatMap(([X,V,ye,Mt])=>{let He=B.closest(V);if(!He)return[];let ht=X==="element"&&hp(xe,He.dataset[ye]);return[{kind:X,id:He.dataset[ye],label:Mt??o.find(Vs=>Vs.key===ht?.key)?.name??"Element"}]}),Br=({kind:B,id:X})=>{if(Dt(null),B==="element")return Te(null),le(X);let V=Wt.current.querySelector(`[data-${B}-id="${X}"]`);le(null),Te({kind:B,id:X,rowId:V.closest("[data-row-id]")?.dataset.rowId,sectionId:V.closest("[data-section-id]")?.dataset.sectionId})};et(()=>{let B=Be[Be.length-2],X=V=>{V.key!=="Escape"||!B||V.target.closest("input, textarea, select")||Br(B)};return window.document.addEventListener("keydown",X),()=>window.document.removeEventListener("keydown",X)},[Be]);let ln=q??Fe?.id;et(()=>{Wt.current.querySelectorAll("[data-selected]").forEach(ye=>delete ye.dataset.selected);let B=ln&&Wt.current.querySelector(`[data-element-id="${ln}"], [data-column-id="${ln}"], [data-row-id="${ln}"], [data-section-id="${ln}"]`);if(!B)return pt([]),_e(null);B.dataset.selected="",pt(ba(B));let X=bo.current.getBoundingClientRect(),V=B.getBoundingClientRect();_e({top:V.top-X.top,left:V.left-X.left})},[Y,ln,Ze]),et(()=>{let B=window.document.createElement("span"),X=eW.flatMap(({kind:V,selector:ye,id:Mt,group:He})=>[...Wt.current.querySelectorAll(ye)].map(ht=>new bi({id:Mt(ht),element:ht,index:[...ht.parentElement.children].indexOf(ht),group:He(ht),type:V,accept:V,handle:ln===Mt(ht)?lt.current:B},en.current)));return()=>X.forEach(V=>V.destroy())},[Y,ln]);let $c=B=>{let X=B.kind==="column"&&gp(xe,B.rowId),V=X?{wide:p[X.columns.length]??"1/1"}:{};return{...f[B.kind],...V,...gp(xe,B.id)}},Ea=()=>Iu(u,P,ln).then(B=>{Ke(B),Te(null),le(null)},wt);return E.createElement("div",{"data-builder":!0,className:"fixed inset-0 flex flex-col bg-(--ks-color-surface) text-(--ks-color-text) dark:bg-(--ks-color-surface-dark) dark:text-(--ks-color-text-dark)"},E.createElement("header",{"data-builder-top-bar":!0,className:"flex h-14 shrink-0 items-center justify-between gap-4 border-b border-(--ks-color-border) dark:border-(--ks-color-border-dark) px-4"},E.createElement("div",{className:"flex min-w-0 items-center gap-2"},E.createElement("a",{href:O,className:"text-sm hover:underline"},"Back"),E.createElement("h1",{className:"truncate text-base font-semibold"},e)),E.createElement("div",{className:"flex items-center gap-4 max-lg:hidden"},E.createElement(mg,{chosen:Ze,onChoose:Hs}),E.createElement(Cg,null),E.createElement(bg,{looks:g}),E.createElement(yg,{samples:y,chosen:m,onChoose:B=>aC(_,P,B).then(Ke,wt)}),E.createElement(vg,{exceptions:v,chosen:S,onChoose:B=>lC(b,P,B).then(Ke,wt)})),E.createElement("div",{className:"flex items-center gap-2"},E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:!ee,title:ee?"Undo the last change":"Nothing to undo",onClick:()=>hg(T,P).then(Ke,wt)},"\u21B6 Undo"),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:!ne,title:ne?"Redo the change you undid":"Nothing to redo",onClick:()=>hg(A,P).then(Ke,wt)},"\u21B7 Redo"),D&&E.createElement("a",{href:D,className:"text-sm whitespace-nowrap hover:underline"},"View live"),E.createElement("a",{href:N,className:"text-sm hover:underline"},"History"),n&&E.createElement("form",{method:"post",action:n},E.createElement("input",{type:"hidden",name:"authenticity_token",value:P}),E.createElement(Re,{type:"submit",size:"sm",variant:"secondary"},"Unpublish")),E.createElement("form",{method:"post",action:t},E.createElement("input",{type:"hidden",name:"authenticity_token",value:P}),E.createElement(Re,{type:"submit",size:"sm"},"Publish")))),E.createElement("div",{className:"relative flex min-h-0 flex-1"},L&&E.createElement(Ru,{sequence:L}),E.createElement(fC,{ref:Yn,elements:o},E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>nC(a,P).then(Ke)},"Add section")),E.createElement("main",{"data-page-frame":!0,className:"min-w-0 flex-1 overflow-auto bg-surface-200 p-8 dark:bg-surface-900"},E.createElement("div",{ref:bo,"data-page-sheet":!0,"data-theme":gl.find(B=>B.key===Ze).theme,style:{width:gl.find(B=>B.key===Ze).width,colorScheme:gl.find(B=>B.key===Ze).theme},className:"relative mx-auto min-h-full max-w-full bg-[Canvas] shadow-lg ring-1 ring-black/5"},E.createElement("div",{ref:Wt,"data-page-canvas":!0,className:"@container min-h-full px-6 [&_[data-hidden]]:opacity-40 bg-(--ks-color-page) text-(--ks-color-on-page) dark:bg-(--ks-color-page-dark) dark:text-(--ks-color-on-page-dark) [&_[data-selected]]:relative [&_[data-selected]]:outline-2 [&_[data-selected]]:outline-(--ks-color-accent) [&_[data-hovered]]:relative [&_[data-hovered]]:outline-1 [&_[data-hovered]]:outline-(--ks-color-accent) [&_[data-hovered]]:before:absolute [&_[data-hovered]]:before:-top-5 [&_[data-hovered]]:before:left-0 [&_[data-hovered]]:before:z-10 [&_[data-hovered]]:before:rounded-t [&_[data-hovered]]:before:bg-(--ks-color-accent) [&_[data-hovered]]:before:px-1.5 [&_[data-hovered]]:before:text-xs [&_[data-hovered]]:before:leading-5 [&_[data-hovered]]:before:text-white [&_[data-hovered]]:before:content-[attr(data-kind)] [&_[data-column-id]:empty]:min-h-16 [&_[data-column-id]:empty]:items-center [&_[data-column-id]:empty]:justify-center [&_[data-column-id]:empty]:rounded-md [&_[data-column-id]:empty]:border-2 [&_[data-column-id]:empty]:border-dashed [&_[data-column-id]:empty]:border-(--ks-color-border-strong) [&_[data-column-id]:empty]:after:text-sm [&_[data-column-id]:empty]:after:text-(--ks-color-icon) [&_[data-column-id]:empty]:after:content-['Drop_an_element_here'] [&_[data-drop-target]]:outline-2 [&_[data-drop-target]]:outline-dashed [&_[data-drop-target]]:outline-(--ks-color-accent)",onClick:_p,onMouseOver:mp,onMouseLeave:()=>Wt.current.querySelectorAll("[data-hovered]").forEach(B=>delete B.dataset.hovered)}),E.createElement(uC,{ref:lt,place:Go,onRemove:Ea,onDuplicate:()=>sC(u,P,ln).then(Ke,wt)}))),E.createElement("aside",{"data-settings-panel":!0,className:"w-72 shrink-0 overflow-y-auto border-l border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement(_g,{path:Be,onChoose:Br}),!Fe&&!On&&E.createElement("p",{className:"ks-hint"},"Select something on the page to change it."),!Fe&&!On&&E.createElement(xg,{key:xe.title??"",title:xe.title,onChange:B=>eC(x,P,B).then(Ke,wt)}),Fe&&E.createElement(gg,{node:Fe,values:$c(Fe),arrangements:d,onArrange:(B,X,V)=>fg(u,P,B,X,V).then(Ke,wt),refusal:Ot,onSelect:Ic,onRemove:B=>Iu(u,P,B).then(X=>{Ke(X),Te(null)},wt),onAddColumn:B=>oC(l,P,B).then(Ke),onAddRow:B=>rC(c,P,B).then(Ke)}),On&&E.createElement(Hx,{element:Tn,definition:On,alignments:d.element.align,onRemove:B=>Iu(u,P,B).then(X=>{Ke(X),le(null)}),onArrange:(B,X,V)=>fg(u,P,B,X,V).then(Ke),valueNames:h,onBind:(B,X,V)=>iC(i,P,Tn.id,B,X,V).then(Ke,wt),onChange:(B,X)=>tC(i,P,Tn.id,B,X).then(Ke)}),(Tn||Fe&&Fe.kind!=="column")&&E.createElement(Sg,{key:Tn?.id??Fe.id,condition:(Tn??gp(xe,Fe.id))?.show_when,valueNames:h,onChange:(B,X)=>cC(u,P,Tn?.id??Fe.id,B,X).then(Ke,wt)}))))}function sW({sequence:e,back_url:t}){return E.createElement("div",{"data-builder":!0,className:"fixed inset-0 flex flex-col bg-(--ks-color-surface) text-(--ks-color-text) dark:bg-(--ks-color-surface-dark) dark:text-(--ks-color-text-dark)"},E.createElement("header",{"data-builder-top-bar":!0,className:"flex h-14 shrink-0 items-center gap-2 border-b border-(--ks-color-border) dark:border-(--ks-color-border-dark) px-4"},E.createElement("a",{href:t,className:"text-sm hover:underline"},"Back"),E.createElement("h1",{className:"truncate text-base font-semibold"},e.title)),E.createElement("div",{className:"relative flex min-h-0 flex-1"},E.createElement(Ru,{sequence:e}),E.createElement("main",{"data-page-frame":!0,className:"flex min-w-0 flex-1 items-center justify-center bg-surface-200 p-8 dark:bg-surface-900"},E.createElement("p",{className:"ks-hint"},"No page has been added yet."))))}function Vx(e){return e.document?E.createElement(rW,{...e}):E.createElement(sW,{...e})}rv("keystone_ui_pages/editor",Vx);av(document,Xx);})();
79
+ `);let l=a.length;if(!H(o)||r>=l){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||As(c)||c.remove(),r-=l+i,o=s}else{let c=o.getKey(),u=e.read("latest",()=>{let p=Zi(c);return H(p)&&p.isSimpleText()?p.getTextContent():null}),d=l-r,f=a.slice(0,d);if(u!==null&&u!==a){let p=Ms(),h=o;if(o.isSimpleText())o.setTextContent(u);else{let g=Vn(u);o.replace(g),h=g}if(F(p)&&p.isCollapsed()){let g=p.anchor.offset;h.select(g,g)}}else if(o.isSimpleText()){let p=t.key===c,h=t.offset;h<r&&(h=l);let g=p?h-r:0,y=p?h:d;if(p&&g===0){let[m]=o.splitText(g,y);m.remove()}else{let[,m]=o.splitText(g,y);m.remove()}}else{let p=Vn(f);o.replace(p)}r=0}}}var wL=bL();function Bf(e,t){(F(e)?e.isCollapsed():H(e)||W(e))||yy(280);let n=gc(F(e)?e.style:H(e)?e.getStyle():e.getTextStyle()),o=bD(Object.entries(t).reduce((r,[s,i])=>(typeof i=="function"?r[s]=i(n[s],e):i===null?delete r[s]:r[s]=i,r),{...n}));F(e)||H(e)?e.setStyle(o):e.setTextStyle(o)}function ML(e,t){let n=new Set;if(F(e)&&e.isCollapsed()){Bf(e,t);let r=e.anchor.getNode();W(r)&&r.isEmpty()&&(n.add(r.getKey()),Bf(r,t))}ND(r=>{Bf(r,t)});let o=e.getNodes();if(o.length>0)for(let r of o){if(!W(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();n.has(s)||(n.add(s),Bf(r,t))}}function ND(e){let t=z();if(!t)return;let n=new Map,o=s=>n.get(s.getKey())||[0,s.getTextContentSize()];if(F(t))for(let s of Nr(t).getTextSlices())s&&n.set(s.caret.origin.getKey(),s.getSliceIndices());let r=t.getNodes();for(let s of r){if(!H(s)||!s.canHaveFormat())continue;let[i,a]=o(s);a!==i&&(P_(s)||i===0&&a===s.getTextContentSize()?e(s):e(s.splitText(i,a)[i===0?0:1]))}F(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&TD(t)}function TD(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:o,offset:r,type:s}=t;t.set(n.key,n.offset,n.type),n.set(o,r,s)}}function OD(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function DD(e,t,n){let o=xn(e,n);if(ic(o))return!1;for(;o;o=o.getParentCaret()){let r=o.getParentAtCaret();if(!r||o.getNodeAtCaret())return!1;if(t.is(r))return!0}return!1}function kL(e,t,n=OD){if(!e)return;let o=e.getStartEndPoints(),r=!1,s=null,i=new Map;if(o){let[a,l]=o,c=Me(a.getNode(),fc);s=Me(l.getNode(),fc);let u=e.isBackward()?"previous":"next";r=W(s)&&!s.is(c)&&(function(d,f,p){let h=d.getNode();return(!W(h)||!h.isEmpty())&&DD(d,f,p)})(l,s,FO(u)),W(c)&&i.set(c.getKey(),c),W(s)&&!r&&i.set(s.getKey(),s)}for(let a of e.getNodes())if(W(a)&&fc(a)){if(r&&a.is(s))continue;i.set(a.getKey(),a)}else if(!o){let l=Me(a,fc);W(l)&&i.set(l.getKey(),l)}for(let a of i.values()){if(Zd(a)!==null)continue;let l=t();n(a,l),a.replace(l,!0)}}function CD(e){return e.getNode().isAttached()}function AL(e){let t=e;for(;t!==null&&!ao(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function IL(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,s=e.getNodes(),i=s.length;if(r!==null){let c=Qd(r.getNode());if(c!==null&&!ao(c))return}if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let c=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=c.getChildren(),d=t();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach(f=>d.append(f)),n&&(d=n.append(d)),void c.replace(d)}let a=null,l=[];for(let c=0;c<i;c++){let u=s[c];ao(u)?(_y(e,l,l.length,t,n),l=[],a=u):a===null||a!==null&&sc(u,a)?l.push(u):(_y(e,l,l.length,t,n),l=[u])}_y(e,l,l.length,t,n)}function _y(e,t,n,o,r=null){if(t.length===0)return;let s=t[0],i=new Map,a=[],l=W(s)?s:s.getParentOrThrow(),c=l.isInline()?l.getParentOrThrow():l,u=!1;for(;c!==null;){let g=c.getPreviousSibling();if(g!==null){c=g,u=!0;break}if(c=c.getParentOrThrow(),ao(c))break}let d=new Set;for(let g=0;g<n;g++){let y=t[g];W(y)&&y.getChildrenSize()===0&&d.add(y.getKey())}let f=new Set;for(let g=0;g<n;g++){let y=t[g],m=y.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&IT(y)&&!f.has(y.getKey())){let _=m.getKey();if(i.get(_)===void 0){let x=o();x.setFormat(m.getFormatType()),x.setIndent(m.getIndent()),a.push(x),i.set(_,x);let v=m.getChildren();x.splice(x.getChildrenSize(),0,v);for(let S of v)if(f.add(S.getKey()),W(S))for(let b of S.getChildrenKeys())f.add(b);AL(m)}}else if(d.has(y.getKey())){W(y)||yy(179);let _=o();_.setFormat(y.getFormatType()),_.setIndent(y.getIndent()),a.push(_),y.remove(!0)}}if(r!==null)for(let g=0;g<a.length;g++){let y=a[g];r.append(y)}let p=null;if(ao(c))if(u)if(r!==null)c.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let y=a[g];c.insertAfter(y)}else{let g=c,y=g.getFirstChild();if(W(y)&&(c=y),y===null)if(r)g.append(r);else for(let m=0;m<a.length;m++){let _=a[m];g.append(_),p=_}else if(r!==null)y.insertBefore(r);else for(let m=0;m<a.length;m++){let _=a[m];y.insertBefore(_),p=_}}else if(r)c.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let y=a[g];c.insertAfter(y),p=y}let h=Ms();F(h)&&CD(h.anchor)&&CD(h.focus)?Cn(h.clone()):p!==null?p.selectEnd():e.dirty=!0}function wD(e){let t=MD(e);return t!==null&&t.writingMode==="vertical-rl"}function MD(e){let t=e.anchor.getNode();return W(t)?xy(t):vy(t)}function $L(e,t){let n=wD(e)?!t:t;Sy(e)&&(n=!n);let o=xn(e.focus,n?"previous":"next");if(ic(o))return!1;if(lo(o)&&!R_(o.origin)&&o.origin.isUnmergeable()){let r=o.getNodeAtCaret();if(H(r)&&!R_(r))return!0}for(let r of qd(o)){if(Uo(r))return!r.origin.isInline();if(!W(r.origin)){if(vn(r.origin))return!0;break}}return!1}function kD(e,t,n,o){e.modify(t?"extend":"move",n,o)}function Sy(e){let t=MD(e);return t!==null&&t.direction==="rtl"}function RL(e,t,n){let o=Sy(e),r;r=wD(e)||o?!n:n,kD(e,t,r,"character")}function PL(e,t,n){let o=e.getStyle(),r=gc(o);return r!==null&&r[t]||n}function LL(e,t,n=""){let o=null,r=e.getNodes(),s,i;if(F(e)){if(e.isCollapsed()&&e.style!==""){let h=gc(e.style);if(h!==null&&t in h)return h[t]}let{anchor:a,focus:l}=e,c=e.isBackward(),u=c?l.getNode():a.getNode(),d=c?a.getNode():l.getNode(),f=c?l.offset:a.offset,p=c?a.offset:l.offset;H(u)&&f===u.getTextContentSize()&&(s=u),p===0&&(i=d)}for(let a=0;a<r.length;a++){let l=r[a];if(H(l)&&!l.is(a===0?s:i)){let c=PL(l,t,n);if(o===null)o=c;else if(o!==c){o="";break}}}return o===null?n:o}var FL=gc,BL=ED;var Le=Cy,t3=Le.$addNodeStyle,n3=Le.$cloneWithProperties,o3=Le.$copyBlockFormatIndent,r3=Le.$ensureForwardRangeSelection,s3=Le.$forEachSelectedTextNode,i3=Le.$getComputedStyleForElement,a3=Le.$getComputedStyleForParent,l3=Le.$getSelectionStyleValueForProperty,by=Le.$isAtEdgeOfElement,c3=Le.$isAtNodeEnd,u3=Le.$isParentElementRTL,Sc=Le.$isParentRTL,d3=Le.$moveCaretSelection,Ey=Le.$moveCharacter,f3=Le.$patchStyleText,p3=Le.$selectAll,h3=Le.$setBlocksType,Ny=Le.$shouldOverrideDefaultCharacterSelection,zf=Le.$sliceSelectedTextNodeContent,g3=Le.$trimTextContentFromAnchor,m3=Le.$wrapNodes,_3=Le.createDOMRange,AD=Le.createRectsFromDOMRange,y3=Le.getCSSFromStyleObject,x3=Le.getStyleObjectFromCSS,v3=Le.trimTextContentFromAnchor;var Ay={};de(Ay,{$descendantsMatching:()=>pF,$dfs:()=>jL,$dfsIterator:()=>FD,$dfsWithSlots:()=>qL,$dfsWithSlotsIterator:()=>BD,$filter:()=>aF,$findMatchingParent:()=>Me,$firstToLastIterator:()=>hF,$getAdjacentCaret:()=>YL,$getAdjacentSiblingOrParentSiblingCaret:()=>Tr,$getDepth:()=>zD,$getNearestBlockElementAncestorOrThrow:()=>eF,$getNearestNodeOfType:()=>ZL,$getNextRightPreorderNode:()=>JL,$getNextSiblingOrParentSibling:()=>XL,$handleIndentAndOutdent:()=>lF,$insertFirst:()=>cF,$insertNodeIntoLeaf:()=>rF,$insertNodeToNearestRoot:()=>oF,$insertNodeToNearestRootAtCaret:()=>ta,$isAtEndOfNode:()=>YD,$isAtStartOfNode:()=>jD,$isBlockFullySelected:()=>kT,$isEditorIsNestedEditor:()=>dF,$lastToFirstIterator:()=>ky,$onEscapeDown:()=>yF,$onEscapeUp:()=>_F,$restoreEditorState:()=>nF,$reverseDfs:()=>GL,$reverseDfsIterator:()=>WD,$reverseDfsWithSlots:()=>QL,$reverseDfsWithSlotsIterator:()=>KD,$splitNode:()=>zT,$unwrapAndFilterDescendants:()=>fF,$unwrapNode:()=>gF,$wrapNodeInElement:()=>sF,CAN_USE_BEFORE_INPUT:()=>uc,CAN_USE_DOM:()=>bn,IS_ANDROID:()=>aO,IS_ANDROID_CHROME:()=>lO,IS_APPLE:()=>cO,IS_APPLE_WEBKIT:()=>uf,IS_CHROME:()=>uO,IS_FIREFOX:()=>df,IS_IOS:()=>pc,IS_SAFARI:()=>ff,addClassNamesToElement:()=>So,calculateZoomLevel:()=>uF,dedupeSelectionRects:()=>zL,eventFiles:()=>iF,getScrollParent:()=>HL,isBlockDomNode:()=>Ir,isHTMLAnchorElement:()=>la,isHTMLElement:()=>me,isInlineDomNode:()=>ca,isMimeType:()=>LD,makeStateWrapper:()=>mF,markSelection:()=>PD,mediaFileReader:()=>VL,mergeRegister:()=>Se,objectKlassEquals:()=>My,positionNodeOnRange:()=>RD,registerNestedElementResolver:()=>tF,removeClassNamesFromElement:()=>kf,selectionAlwaysOnDisplay:()=>UL});function Oy(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function zL(e){let t=(o,r)=>r.left>=o.left-1&&r.top>=o.top-1&&r.right<=o.right+1&&r.bottom<=o.bottom+1,n=[];for(let o of Array.from(e))if(!(o.width<.5||o.height<.5||n.some(r=>t(o,r)))){for(let r=n.length-1;r>=0;r--)t(n[r],o)&&n.splice(r,1);n.push(o)}return n}function Co(e){return`${e}px`}var WL={attributes:!0,characterData:!0,childList:!0,subtree:!0};function RD(e,t,n){let o=null,r=null,s=null,i=[],a=$s(e.getRootElement()).createElement("div");function l(){o===null&&Oy(182),r===null&&Oy(183);let{left:f,top:p}=r.getBoundingClientRect(),h=(function(_){let x=[];for(let v of _)v.width<.5||v.height<.5||x.some(S=>Math.abs(S.left-v.left)<=1&&Math.abs(S.top-v.top)<=1&&Math.abs(S.right-v.right)<=1&&Math.abs(S.bottom-v.bottom)<=1)||x.push(v);return x})(AD(e,t));var g,y;a.isConnected||(y=a,(g=r).insertBefore(y,g.firstChild));let m=!1;for(let _=0;_<h.length;_++){let x=h[_],v=i[_]||$s(o).createElement("div"),S=v.style;S.position!=="absolute"&&(S.position="absolute",m=!0);let b=Co(x.left-f);S.left!==b&&(S.left=b,m=!0);let N=Co(x.top-p);S.top!==N&&(v.style.top=N,m=!0);let D=Co(x.width);S.width!==D&&(v.style.width=D,m=!0);let O=Co(x.height);S.height!==O&&(v.style.height=O,m=!0),v.parentNode!==a&&(a.append(v),m=!0),i[_]=v}for(;i.length>h.length;){let _=i.pop();_!=null&&(_.remove(),m=!0)}m&&n(i)}function c(){r=null,o=null,s!==null&&s.disconnect(),s=null,a.remove();for(let f of i)f.remove();i=[]}function u(){let f=e.getRootElement();if(f===null)return c();let p=f.parentElement;if(!me(p))return c();c(),o=f,r=p,s=new MutationObserver(h=>{let g=e.getRootElement(),y=g&&g.parentElement;if(g!==o||y!==r)return u();for(let m of h)if(!a.contains(m.target))return l()}),s.observe(p,WL),l()}a.style.position="relative";let d=e.registerRootListener(()=>(u(),c));return()=>{d(),c()}}function ID(e,t,n,o){if(t.type!=="text"&&W(n)){let r=TT(n,o,e);return[r.element,r.getFirstChildOffset()+t.offset]}return[(H(n)?OT(n,o,e):WO(o))||o,t.offset]}function KL(e){for(let t of e){let n=t.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==Co(-1.5)&&(n.marginTop=Co(-1.5)),n.paddingTop!==Co(4)&&(n.paddingTop=Co(4)),n.paddingBottom!==Co(0)&&(n.paddingBottom=Co(0))}}function PD(e,t=KL){let n=null,o=null,r=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=z();if(!F(d))return n=null,r=null,s=null,a=null,l(),void(l=()=>{});let[f,p]=(function(D){let O=D.getStartEndPoints();return D.isBackward()?[O[1],O[0]]:O})(d),h=f.getNode(),g=h.getKey(),y=f.offset,m=p.getNode(),_=m.getKey(),x=p.offset,v=e.getElementByKey(g),S=e.getElementByKey(_),b=n===null||v!==o||y!==r||g!==n.getKey(),N=s===null||S!==i||x!==a||_!==s.getKey();if((b||N)&&v!==null&&S!==null){let D=(function(O,T,A,$,I,L,P){let Y=(O._window?O._window.document:document).createRange();return Y.setStart(...ID(O,T,A,$)),Y.setEnd(...ID(O,I,L,P)),Y})(e,f,h,v,p,m,S);l(),l=RD(e,D,t)}n=h,o=v,r=y,s=m,i=S,a=x},{editor:e})}return c(e.getEditorState()),Se(e.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function UL(e,t){let n=null,o=()=>{let r=e.getRootElement(),s=r!==null?r.ownerDocument.defaultView:null,i=s!==null?s.getSelection():null,a=i!==null?Ef(i,r).anchorNode:null;a!==null&&r!==null&&r.contains(a)?n!==null&&(n(),n=null):n===null&&(n=PD(e,t))};return e.registerRootListener(r=>{if(r){let s=r.ownerDocument,i=Se(Rs(s,"selectionchange",o),()=>{n!==null&&n()});return o(),i}})}function HL(e,t){let n=e.ownerDocument,o=n.defaultView||window,r=o.getComputedStyle(e),s=r.position==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(r.position==="fixed")return n.body;for(let a=e;a=hc(a);)if(r=o.getComputedStyle(a),(!s||r.position!=="static")&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n.body}function LD(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function VL(e,t){let n=e[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:a,value:l}=n.next();if(a)return o(s);let c=new FileReader;c.addEventListener("error",r),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:l,result:u}),i()}),LD(l,t)?c.readAsDataURL(l):i()};i()})}function jL(e,t){return Array.from(FD(e,t))}function YL(e){return e?e.getAdjacentCaret():null}function GL(e,t){return Array.from(WD(e,t))}function FD(e,t){return Wf("next",e,t)}function qL(e,t){return Array.from(BD(e,t))}function*BD(e,t){for(let n of Wf("next",e,t)){yield n;let{node:o,depth:r}=n;if(ac(o)&&!o.is(t))for(let s of ks(o)){let i=ea(o,s);i!==null&&(yield*Dy(i,r+1))}}}function*Dy(e,t){yield{depth:t,node:e};let n=t+1;if(ac(e))for(let o of ks(e)){let r=ea(e,o);r!==null&&(yield*Dy(r,n))}if(W(e))for(let o of e.getChildren())yield*Dy(o,n)}function $D(e,t){let n=Tr(Je(e,t));return n&&n[0]}function Wf(e,t,n){let o=Ue(),r=t||o,s=W(r)?Qt(r,e):Je(r,e),i=zD(r),a=n?M_(A_(Je(n,e)))||$D(n,e):$D(r,e),l=i;return X_({hasNext:c=>c!==null,initial:s,map:c=>({depth:l,node:c.origin}),step:c=>{if(c.isSameNodeCaret(a))return null;Uo(c)&&l++;let u=Tr(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function XL(e){let t=Tr(Je(e,"next"));return t&&[t[0].origin,t[1]]}function zD(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Zd(n))t++;return t}function JL(e){let t=A_(Je(e,"previous")),n=Tr(t,"root");return n&&n[0].origin}function WD(e,t){return Wf("previous",e,t)}function QL(e,t){return Array.from(KD(e,t))}function*KD(e,t){let n=[];for(let o of Wf("previous",e,t)){for(;n.length>0&&o.depth<=n[n.length-1].depth;){let i=n.pop();yield*wy(i.node,i.depth+1)}yield o;let{node:r,depth:s}=o;ac(r)&&ks(r).length>0&&!r.is(t)&&n.push({depth:s,node:r})}for(;n.length>0;){let o=n.pop();yield*wy(o.node,o.depth+1)}}function*wy(e,t){let n=ks(e);for(let o=n.length-1;o>=0;o--){let r=ea(e,n[o]);r!==null&&(yield*UD(r,t))}}function*UD(e,t){yield{depth:t,node:e};let n=t+1;if(W(e)){let o=e.getChildren();for(let r=o.length-1;r>=0;r--)yield*UD(o[r],n)}ac(e)&&(yield*wy(e,n))}function ZL(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function eF(e){let t=Me(e,n=>W(n)&&!n.isInline());return W(t)||Oy(4,e.__key),t}function tF(e,t,n,o){let r=s=>s instanceof t;return e.registerNodeTransform(t,s=>{let i=(a=>{let l=a.getChildren();for(let d=0;d<l.length;d++){let f=l[d];if(r(f))return null}let c=a,u=a;for(;c!==null;)if(u=c,c=c.getParent(),r(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:a,parent:l}=i;if(a.is(s)){o(l,s);let c=a.getNextSiblings(),u=c.length;if(l.insertAfter(a),u!==0){let d=n(l);a.insertAfter(d);for(let f=0;f<u;f++)d.append(c[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function nF(e,t){let n=new Map,o=e._pendingEditorState;for(let[s,i]of t._nodeMap)n.set(s,Hd(i));o&&(o._nodeMap=n),Xd();let r=t._selection;Cn(r===null?null:r.clone())}function oF(e){let t=z()||Ms(),n;if(F(t))n=xn(t.focus,"next");else{if(t!=null){let a=t.getNodes(),l=a[a.length-1];l&&(n=Je(l,"next"))}n=n||Qt(Ue(),"previous").getFlipped().insert(it())}let o=ta(e,n,ic(r=n)||Tr(lo(r)?r.getSiblingCaret():r,"shadowRoot")!==null?{$shouldSplit:(a,l)=>l!=="last"}:void 0);var r;let s=M_(o),i=Uo(s)?jn(s):o;return Yn(ws(i)),e.getLatest()}function rF(e){let t=z();if(!F(t))return void(t&&t.insertNodes([e]));let n=Nr(t),o=Or(LT(n),"next").anchor;if(lo(o)){let s=rf(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(e),Yn(io(r,r))}function sF(e,t){let n=t();return e.replace(n),n.append(e),n}function My(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function iF(e){let t=null;if(My(e,DragEvent)?t=e.dataTransfer:My(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,o=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[o,Array.from(t.files),r]}function aF(e,t){let n=[];for(let o=0;o<e.length;o++){let r=t(e[o]);r!==null&&n.push(r)}return n}function lF(e){let t=z();if(!F(t))return!1;let n=new Set,o=t.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(n.has(i))continue;let a=Me(s,c=>W(c)&&!c.isInline());if(a===null)continue;let l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function cF(e,t){Qt(e,"next").insert(t)}var Ty=!(df||!bn)&&void 0;function uF(e,t=!1){let n=1;if((function(){if(Ty===void 0){let o=document.createElement("div");o.style.position="absolute",o.style.opacity="0",o.style.width="100px",o.style.left="-1000px",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),Ty=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Ty})()||t){let o=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(o.getComputedStyle(e).getPropertyValue("zoom")),e=hc(e)}return n}function dF(e){return e._parentEditor!==null}function fF(e,t){return HD(e,t,null)}function HD(e,t,n){let o=!1;for(let r of ky(e))t(r)?n!==null&&n(r):(o=!0,W(r)&&HD(r,t,n||(s=>r.insertAfter(s))),r.remove());return o}function pF(e,t){let n=[],o=Array.from(e).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(t(r))n.push(r);else if(W(r))for(let s of ky(r))o.push(s);return n}function hF(e){return VD(Qt(e,"next"))}function ky(e){return VD(Qt(e,"previous"))}function VD(e){return X_({hasNext:Ho,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function gF(e){Sn(Je(e,"next")).splice(1,e.getChildren())}function mF(e){let t=o=>ef(o,e),n=(o,r)=>of(o,e,r);return{$get:t,$set:n,accessors:[t,n],makeGetterMethod:()=>function(){return t(this)},makeSetterMethod:()=>function(o){return n(this,o)},stateConfig:e}}function _F(e,t){let n=z();if(F(n)&&n.isCollapsed()){let o=Me(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getFirstChild()===o&&jD(n.anchor,o))return o.insertBefore(it()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function yF(e,t){let n=z();if(F(n)&&n.isCollapsed()){let o=Me(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getLastChild()===o&&YD(n.anchor,o))return o.insertAfter(it()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function jD(e,t){return by(e,t,"previous")}function YD(e,t){return by(e,t,"next")}var U=Ay,N3=U.$descendantsMatching,T3=U.$dfs,O3=U.$dfsIterator,D3=U.$dfsWithSlots,w3=U.$dfsWithSlotsIterator,M3=U.$filter,k3=U.$findMatchingParent,A3=U.$firstToLastIterator,I3=U.$getAdjacentCaret,$3=U.$getAdjacentSiblingOrParentSiblingCaret,R3=U.$getDepth,GD=U.$getNearestBlockElementAncestorOrThrow,P3=U.$getNearestNodeOfType,L3=U.$getNextRightPreorderNode,F3=U.$getNextSiblingOrParentSibling,Iy=U.$handleIndentAndOutdent,B3=U.$insertFirst,z3=U.$insertNodeIntoLeaf,qD=U.$insertNodeToNearestRoot,W3=U.$insertNodeToNearestRootAtCaret,K3=U.$isAtEndOfNode,U3=U.$isAtStartOfNode,H3=U.$isBlockFullySelected,V3=U.$isEditorIsNestedEditor,j3=U.$lastToFirstIterator,Y3=U.$onEscapeDown,G3=U.$onEscapeUp,q3=U.$restoreEditorState,X3=U.$reverseDfs,J3=U.$reverseDfsIterator,Q3=U.$reverseDfsWithSlots,Z3=U.$reverseDfsWithSlotsIterator,e4=U.$splitNode,t4=U.$unwrapAndFilterDescendants,n4=U.$unwrapNode,o4=U.$wrapNodeInElement,r4=U.CAN_USE_BEFORE_INPUT,s4=U.CAN_USE_DOM,i4=U.IS_ANDROID,a4=U.IS_ANDROID_CHROME,l4=U.IS_APPLE,c4=U.IS_APPLE_WEBKIT,u4=U.IS_CHROME,d4=U.IS_FIREFOX,f4=U.IS_IOS,p4=U.IS_SAFARI,h4=U.addClassNamesToElement,g4=U.calculateZoomLevel,m4=U.dedupeSelectionRects,Ls=U.eventFiles,_4=U.getScrollParent,y4=U.isBlockDomNode,x4=U.isHTMLAnchorElement,v4=U.isHTMLElement,S4=U.isInlineDomNode,C4=U.isMimeType,b4=U.makeStateWrapper,E4=U.markSelection,N4=U.mediaFileReader,T4=U.mergeRegister,fo=U.objectKlassEquals,O4=U.positionNodeOnRange,D4=U.registerNestedElementResolver,w4=U.removeClassNamesFromElement,M4=U.selectionAlwaysOnDisplay;var $y={};de($y,{EditorStateExtension:()=>xF});var xF={build:e=>Pr(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"};var vF=$y,Cc=vF.EditorStateExtension;var Ry={};de(Ry,{NodeSelectionExtension:()=>CF});var SF=new Set,CF={build(e,t,n){let o=n.getDependency(Cc).output,r=St({watchedNodeKeys:new Map}),s=Pr(()=>{},()=>Ae(()=>{let i=s.peek(),{watchedNodeKeys:a}=r.value,l,c=!1;o.value.read(()=>{if(z())for(let[u,d]of a.entries()){if(d.size===0){a.delete(u);continue}let f=Zi(u),p=f&&f.isSelected()||!1;c=c||p!==(!!i&&i.has(u)),p&&(l=l||new Set,l.add(u))}}),!c&&l&&i&&l.size===i.size||(s.value=l)}));return{watchNodeKey:function(i){let a=fD(()=>(s.value||SF).has(i)),{watchedNodeKeys:l}=r.peek(),c=l.get(i),u=c!==void 0;return c=c||new Set,c.add(a),u||(l.set(i,c),r.value={watchedNodeKeys:l}),a}}},dependencies:[Cc],name:"@lexical/extension/NodeSelection"};var bF=Ry,Py=bF.NodeSelectionExtension;var Fy={};de(Fy,{$createHorizontalRuleNode:()=>Ly,$isHorizontalRuleNode:()=>JD,HorizontalRuleExtension:()=>NF,HorizontalRuleNode:()=>Fs,INSERT_HORIZONTAL_RULE_COMMAND:()=>XD});var XD=sa("INSERT_HORIZONTAL_RULE_COMMAND"),Fs=class extends z_{$config(){return this.config("horizontalrule",{extends:z_,importDOM:{hr:()=>({conversion:EF,priority:0})}})}exportDOM(){return{element:Ft().createElement("hr")}}createDOM(t){let n=Ft().createElement("hr");return So(n,t.theme.hr),n}getTextContent(){return`
80
+ `}isInline(){return!1}updateDOM(){return!1}};function EF(){return{node:Ly()}}function Ly(){return xT(Fs)}function JD(e){return e instanceof Fs}var NF={dependencies:[Cc,Py],name:"@lexical/extension/HorizontalRule",nodes:()=>[Fs],register(e,t,n){let{watchNodeKey:o}=n.getDependency(Py).output,r=St({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return Se(e.registerCommand(XD,i=>{let a=z();if(!F(a))return!1;if(a.focus.getNode()!==null){let l=Ly();qD(l)}return!0},te),e.registerCommand(sf,i=>{if(aa(i.target)){let a=DT(i.target);if(JD(a))return(function(l,c=!1){let u=z(),d=l.isSelected(),f=l.getKey(),p;c&&De(u)?p=u:(p=Yd(),Cn(p)),d?p.delete(f):p.add(f)})(a,i.shiftKey),!0}return!1},Vo),e.registerMutationListener(Fs,(i,a)=>{vc(()=>{let l=!1,{nodeSelections:c}=r.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),l=!0;else{let f=c.get(u),p=e.getElementByKey(u);f?f.domNode.value=p:(l=!0,c.set(u,{domNode:St(p),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:c})})}),Ae(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of r.value.nodeSelections.values())i.push(Ae(()=>{let c=a.value;c&&(l.value?So(c,s):kf(c,s))}));return Se(...i)}))}};var bc=Fy,QD=bc.$createHorizontalRuleNode,H4=bc.$isHorizontalRuleNode,ZD=bc.HorizontalRuleExtension,ew=bc.HorizontalRuleNode,V4=bc.INSERT_HORIZONTAL_RULE_COMMAND;var By={};de(By,{getExtensionDependencyFromEditor:()=>TF});function TF(e,t){let n=fa.fromEditor(e).getExtensionRep(t);return n===void 0&&(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(303,t.name),n.getExtensionDependency()}var OF=By,tw=OF.getExtensionDependencyFromEditor;var zy={};de(zy,{$getExtensionDependency:()=>nw,$getExtensionOutput:()=>DF,$getPeerDependency:()=>wF});function nw(e){return tw(Ne(),e)}function DF(e){return nw(e).output}function wF(e){return uo(Ne(),e)}var Wy=zy,Q4=Wy.$getExtensionDependency,ow=Wy.$getExtensionOutput,rw=Wy.$getPeerDependency;var ax={};de(ax,{$appendNodeToHTML:()=>DB,$distributeInlineWrapper:()=>Ww,$generateDOMFromNodes:()=>Zw,$generateDOMFromRoot:()=>TB,$generateHtmlFromNodes:()=>OB,$generateNodesFromDOM:()=>NB,$generateNodesFromDOMViaExtension:()=>vB,$getImportContextValue:()=>zw,$getRenderContextValue:()=>$F,$getSessionDOMRenderConfig:()=>jf,$inlineStylesFromStyleSheets:()=>yw,$isBlockLevel:()=>ha,$propagateTextAlignToBlockChildren:()=>Kw,$setRenderContextValue:()=>RF,$updateRenderContextValue:()=>PF,$withImportContext:()=>ox,$withRenderContext:()=>tx,BlockSchema:()=>Hw,CoreImportExtension:()=>Jw,CoreImportRules:()=>Yw,DOMImportExtension:()=>ix,DOMRenderExtension:()=>qF,HorizontalRuleImportExtension:()=>bB,HorizontalRuleImportRules:()=>CB,ImportOverlays:()=>Fw,ImportSource:()=>eB,ImportSourceDataTransfer:()=>tB,ImportTextFormat:()=>Uf,ImportTextStyle:()=>$w,ImportWhitespaceConfig:()=>Lw,InlineSchema:()=>nB,NestedBlockSchema:()=>oB,RenderContextExport:()=>Zy,RenderContextRoot:()=>Sw,RootSchema:()=>Vw,contextUpdater:()=>AF,contextValue:()=>Ec,createImportState:()=>zs,createRenderState:()=>Qy,defaultIsInline:()=>Pw,defaultPreservesWhitespace:()=>Rw,defineImportRule:()=>SB,defineOverlayRules:()=>mB,domOverride:()=>LF,isElementOfTag:()=>QF,parseSelector:()=>Iw,sel:()=>EB});function Bs(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}var pa;function Lr(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Xy(e){return pa&&pa.editor===e?pa:void 0}function Hf(e,t){let n=Xy(t);return n&&n[e]}function MF(e,t){if("cfg"in t){let{cfg:n,updater:o}=t;return[n,o(Lr(e,n))]}return t}function Kf(e,t){let n=t;for(let o of e){let[r,s]=MF(n,o),i=r.key;if(n===t&&Lr(n,r)===s)continue;let a=n===t||n===void 0?kF(t):n;a[i]=s,n=a}return n}function kF(e){return Object.create(e||null)}function Ec(e,t){return[e,t]}function AF(e,t){return{cfg:e,updater:t}}function gw(e,t,n,o=Ne()){let r=pa,s=Xy(o);try{return pa={...s,editor:o,[e]:t},n()}finally{pa=r}}function mw(e,t=()=>{}){return(n,o=Ne())=>r=>{let s=Xy(o),i=s&&s[e],a=Kf(n,i||t(o));return a&&a!==i?gw(e,a,r,o):r()}}function _w(e,t,n,o){return Object.assign(bf(Symbol(t),{isEqual:o,parse:n}),{[e]:!0})}var yw=(e,t,n)=>{xw(e),n()};function xw(e){if(!Tf(e))return;let t=e;if(t.querySelector("style")===null)return;let n=new Map;function o(r){let s=n.get(r);if(s===void 0){s=new Set;for(let i=0;i<r.style.length;i++)s.add(r.style[i]);n.set(r,s)}return s}try{for(let r of Array.from(t.styleSheets)){let s;try{s=r.cssRules}catch{continue}for(let i of Array.from(s)){if(!fo(i,CSSStyleRule))continue;let a;try{a=t.querySelectorAll(i.selectorText)}catch{continue}for(let l of Array.from(a)){if(!me(l))continue;let c=o(l);for(let u=0;u<i.style.length;u++){let d=i.style[u];c.has(d)||l.style.setProperty(d,i.style.getPropertyValue(d),i.style.getPropertyPriority(d))}}}}}catch{}}var Jy="@lexical/html/DOM",Vf=Symbol.for("@lexical/html/DOMExportContext"),vw="@lexical/html/DOMImport",Nc=Symbol.for("@lexical/html/DOMImportContext"),IF=()=>!0;function Qy(e,t,n){return _w(Vf,e,t,n)}var Sw=Qy("root",Boolean),Zy=Qy("isExport",Boolean);function Cw(e){let t=uo(e,Jy);return t?t.output.defaults:void 0}function $F(e,t=Ne()){return Lr((function(n){return Hf(Vf,n)||Cw(n)})(t),e)}function ex(e){let t=uo(e,Jy);return t?t.output.runtime:void 0}function RF(e,t,n=Ne()){let o=ex(n);o&&o.setContextValue(e,t)}function PF(e,t,n=Ne()){let o=ex(n);o&&o.setContextValue(e,t(Lr(o.editorContext,e)))}function jf(e=Ne()){let t=ex(e);return t?t.getSessionConfig():I_(e)}var tx=mw(Vf,Cw);function LF(e,t,n){return{...t,...n,nodes:e}}function FF(e){return t=>t instanceof e}function BF(e,{nodes:t}){if(t==="*")return IF;let n={},o=[];for(let r of t)if("getType"in r){let s=r.getType();if(n){let i=e.get(s);i===void 0&&Bs(339,r.name,s);for(let a of i)n[a]=!0}o.push(FF(r))}else n=void 0,o.push(r);return n||(o.length===1?o[0]:r=>{for(let s of o)if(s(r))return!0;return!1})}function sw(e){return(t,n,o)=>e(t,o)}function Ky(e){return(t,n,o,r)=>e(t,n,r)}function iw(e){return(t,n,o,r,s)=>e(t,n,o,s)}function zF(e){return(t,n,o,r,s,i)=>e(t,n,o,r,i)}function aw(e,t){return(n,o)=>{let r=()=>e(n,o),s=t(n);return s?s(n,r,o):r()}}function Uy(e,t){return(n,o,r)=>{let s=()=>e(n,o,r),i=t(n);return i?i(n,o,s,r):s()}}var WF=Uy,KF=Ky;function lw(e,t){return(n,o,r,s)=>{let i=()=>e(n,o,r,s),a=t(n);return a?a(n,o,r,i,s):i()}}function UF(e,t){return(n,o,r,s,i)=>{let a=()=>e(n,o,r,s,i),l=t(n);return l?l(n,o,r,s,a,i):a()}}function HF(e,t){return(n,o,r,s)=>{e(n,o,r,s);let i=t(n);i&&i(n,o,r,s)}}function jo(e,t,n,o,r){let s=n[t];for(let i of e[t])if(typeof i[0]=="function"){let[a,l]=i;s=o(s,c=>a(c)&&l||void 0)}else{let a=i[1],l={};for(let c in a){let u=a[c];u&&(l[c]=u.reduce((d,f)=>o(d,()=>f),s))}s=o(s,c=>{let u=l[c.getType()];return u&&r(u)})}n[t]=s}function VF(e,t,n,o){if(!o)return;let r=e[t];if(typeof n=="function")r.push([n,o]);else{let s=r[r.length-1],i;s&&s[0]==="types"?i=s[1]:(i={},r.push(["types",i]));for(let a in n){let l=i[a]||[];i[a]=l,l.push(o)}}}function jF(e){return e.nodes==="*"}function YF(e){return e}function Hy(e,{overrides:t}){let n=(function(r,s){let i=UO(nD(r).nodes),a={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$getSlotTargetElement:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let l of(function(c){let u=[],d=[],f=[];for(let g of c)if(jF(g))u.push(g);else if(Array.isArray(g.nodes))for(let y of g.nodes)$_(y.prototype)?f.push(g.nodes.length===1?g:{...g,nodes:[y]}):d.push(g.nodes.length===1?g:{...g,nodes:[y]});let p=new Map,h=g=>{let y=p.get(g);if(y===void 0){y=-1;for(let m of GO(g))y++;p.set(g,y)}return y};return f.sort((g,y)=>h(g.nodes[0])-h(y.nodes[0])),[...f,...d,...u]})(s)){let c=BF(i,l);for(let u in a)VF(a,u,c,l[u])}return a})(e,t),o={...B_,...e.dom};return jo(n,"$createDOM",o,aw,sw),jo(n,"$exportDOM",o,aw,sw),jo(n,"$extractWithChild",o,UF,zF),jo(n,"$getDOMSlot",o,WF,KF),jo(n,"$shouldExclude",o,Uy,Ky),jo(n,"$shouldInclude",o,Uy,Ky),jo(n,"$getSlotTargetElement",o,lw,iw),jo(n,"$updateDOM",o,lw,iw),jo(n,"$decorateDOM",o,HF,YF),o}function bw(e){return{get:t=>Lr(e,t)}}function cw(e){let t=Object.create(null);return Kf(e,t)||t}function Vy(e,t){let n=bw(t);return e.filter(o=>!(o.disabledForEditor&&o.disabledForEditor(n)))}function GF(e){if(e.nodes==="*")return()=>!0;let t=e.nodes.map(n=>{let o=n;return $_(o.prototype)?r=>r instanceof o:n});return n=>t.some(o=>o(n))}var jy=class{constructor(t,n,o,r){w(this,"editor");w(this,"initialEditorConfig");w(this,"overrides");w(this,"editorContext");w(this,"hasSessionGates");w(this,"installed");w(this,"sessionCache",new Map);this.editor=t,this.initialEditorConfig=n,this.overrides=o,this.editorContext=r,this.installed=Vy(o,r),this.hasSessionGates=o.some(s=>s.disabledForSession)}setContextValue(t,n){let o=this.installed;this.editorContext[t.key]=n;let r=Vy(this.overrides,this.editorContext);if((function(c,u){if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==u[d])return!1;return!0})(o,r))return;let s=(function(c,u){let d=new Set(c),f=new Set(u),p=[];for(let h of c)f.has(h)||p.push(h);for(let h of u)d.has(h)||p.push(h);return p})(o,r);this.installed=r,this.sessionCache.clear();let i=Hy(this.initialEditorConfig,{overrides:r});this.editor._config.dom=i;let a=(function(c){let u=[];for(let d of c)(d.$createDOM||d.$getDOMSlot||d.$decorateDOM)&&u.push(GF(d));return u.length===0?null:d=>u.some(f=>f(d))})(s);if(!a)return;let l=i.$updateDOM;i.$updateDOM=(c,u,d,f)=>!!a(c)||l(c,u,d,f),this.editor.update(Xd,{discrete:!0}),i.$updateDOM=l}getSessionConfig(){let t=this.editor._config.dom||B_;if(!this.hasSessionGates)return t;let n=bw(Hf(Vf,this.editor)||this.editorContext),o=[],r=[];if(this.installed.forEach((a,l)=>{a.disabledForSession&&a.disabledForSession(n)?o.push(String(l)):r.push(a)}),o.length===0)return t;let s=o.join(","),i=this.sessionCache.get(s);return i||(i=Hy(this.initialEditorConfig,{overrides:r}),this.sessionCache.set(s,i)),i}},qF={build(e,t,n){let{initialEditorConfig:o}=n.getInitResult(),r=cw(t.contextDefaults);return{defaults:r,runtime:new jy(e,o,t.overrides,r)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[yf,()=>{let e=Ft().createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){let n={dom:e.dom,nodes:e.nodes},o=cw(t.contextDefaults),r=Vy(t.overrides,o);return e.dom=Hy(e,{overrides:r}),{initialEditorConfig:n}},mergeConfig(e,t){let n=Bt(e,t);for(let o of["overrides","contextDefaults"])t[o]&&(n[o]=[...e[o],...t[o]]);return n},name:Jy},nx=Symbol.for("@lexical/html/SelectorImpl");function Tc(e,t){let n={kind:"element",predicate:(o=t,o.length===0?me:o.length===1?o[0]:(s,i)=>{for(let a of o)if(!a(s,i))return!1;return!0}),tags:e};var o;let r=s=>Tc(e,[...t,s]);return{[nx]:n,attr:(s,i,a)=>r(Yy(s,i,a)),classAll:(...s)=>r(Nw(s)),classAny:(...s)=>r((function(i){let a=Ew(i);return a.length===0?()=>!1:l=>{if(!me(l))return!1;let c=l.classList;for(let u of a)if(c.contains(u))return!0;return!1}})(s)),styleAny:(s,i,a)=>r((function(l,c,u){if(typeof c=="string")return d=>me(d)&&d.style.getPropertyValue(l)===c;if(c instanceof RegExp){let d=u&&u.capture,f=c;return(p,h)=>{if(!me(p))return!1;let g=p.style.getPropertyValue(l);if(!g)return!1;let y=g.match(f);return y!==null&&(d!==void 0&&(h[d]=y),!0)}}Bs(362,JSON.stringify(l))})(s,i,a))}}function Ew(e){let t=[];for(let n of e)n&&t.push(n);return t}function Nw(e){let t=Ew(e);return t.length===0?()=>!0:n=>{if(!me(n))return!1;let o=n.classList;for(let r of t)if(!o.contains(r))return!1;return!0}}function Yy(e,t,n){if(t===!0)return o=>me(o)&&o.hasAttribute(e);if(typeof t=="string")return o=>me(o)&&o.getAttribute(e)===t;if(t instanceof RegExp){let o=n&&n.capture,r=t;return(s,i)=>{if(!me(s))return!1;let a=s.getAttribute(e);if(a==null)return!1;let l=a.match(r);return l!==null&&(o!==void 0&&(i[o]=l),!0)}}Bs(361,JSON.stringify(e))}function Tw(e){return{[nx]:e}}var XF=Tw({kind:"text",predicate:mc,tags:new Set}),JF=Tw({kind:"comment",predicate:e=>e.nodeType===8,tags:new Set});function Ow(){return Tc(new Set,[])}function Dw(){return JF}function ww(...e){e.length>0||Bs(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Tc(t,[])}function Mw(){return XF}var kw={any:Ow,comment:Dw,tag:ww,text:Mw};function QF(e,t){return me(e)&&e.nodeName===t.toUpperCase()}var Aw=/[A-Za-z0-9_-]/,Gy=class{constructor(t,n){this.source=t,this.pos=n}peek(t=0){return this.source[this.pos+t]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let t=this.pos;for(;!this.eof()&&Aw.test(this.peek());)this.pos++;return this.source.slice(t,this.pos)}readQuoted(){let t=this.consume();this.assert(t==='"'||t==="'","expected quote");let n=this.pos;for(;!this.eof()&&this.peek()!==t;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");let o=this.source.slice(n,this.pos);return this.pos++,o.replace(/\\(.)/g,"$1")}assert(t,n){t||Bs(364,String(this.pos+1),n,this.source)}};function ZF(e){let t=new Set,n=[],o=[],r=!1;if(e.skipWhitespace(),e.peek()==="*")e.consume(),r=!0;else if(Aw.test(e.peek())){let s=e.readIdent();s&&t.add(s.toUpperCase())}for(;!e.eof();){let s=e.peek();if(s==="."){e.consume();let i=e.readIdent();e.assert(i!=="",'expected class name after "."'),o.push(i)}else if(s==="#"){e.consume();let i=e.readIdent();e.assert(i!=="",'expected id after "#"'),n.push(Yy("id",i))}else{if(s!=="[")break;{e.consume(),e.skipWhitespace();let i=e.readIdent();e.assert(i!=="",'expected attribute name after "["'),e.skipWhitespace();let a=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();let l=e.peek();l==='"'||l==="'"?a=e.readQuoted():(a=e.readIdent(),e.assert(a!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),n.push(Yy(i,a))}}}return o.length>0&&n.push(Nw(o)),e.assert(r||t.size>0||n.length>0,"expected a selector"),{predicates:n,tags:t}}function Iw(e){let t=new Gy(e,0),n=[];for(;n.push(ZF(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace();if(n.length===1)return Tc(n[0].tags,n[0].predicates);let o=new Set;if(n.every(r=>r.tags.size>0))for(let r of n)for(let s of r.tags)o.add(s);return Tc(o,[(r,s)=>{for(let i of n){let a=r.nodeName;if(i.tags.size>0&&!i.tags.has(a))continue;let l=!0;for(let c of i.predicates)if(!c(r,s)){l=!1;break}if(l)return!0}return!1}])}function zs(e,t,n){return _w(Nc,e,t,n)}var eB=zs("importSource",()=>"unknown"),tB=zs("importSourceDataTransfer",()=>null),Uf=zs("textFormat",()=>0),$w=zs("textStyle",()=>({}));function Rw(e){if(!me(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function Pw(e){if(mc(e))return!0;if(!me(e))return!1;let t=e.style.display;return t?t.startsWith("inline"):!Ir(e)&&ca(e)}var Lw=zs("whitespaceConfig",()=>({isInline:Pw,preservesWhitespace:Rw})),Fw=zs("importOverlays",()=>[]),qy=class{constructor(t){this.record=t}get(t){return Lr(this.record,t)}set(t,n){this.record[t.key]=n}update(t,n){this.record[t.key]=n(Lr(this.record,t))}has(t){return Object.prototype.hasOwnProperty.call(this.record,t.key)}};function Bw(e){let t=uo(e,vw);return t?t.output.defaults:void 0}function zw(e,t=Ne()){return Lr((function(n){return Hf(Nc,n)||Bw(n)})(t),e)}var ox=mw(Nc,Bw);function ha(e){return na(e)||vn(e)&&!e.isInline()}function Ww(e,t){let n=[],o=[],r=()=>{o.length!==0&&(n.push(t().splice(0,0,o)),o=[])};for(let s of e)if(ha(s)){if(r(),W(s)){let i=Ww(s.getChildren(),t);s.splice(0,s.getChildrenSize(),i)}n.push(s)}else o.push(s);return r(),n}function Kw(e,t){if(!me(t))return e;let n=t.style.textAlign;if(!rx(n))return e;for(let o of e)na(o)&&o.getFormatType()===""&&o.setFormat(n);return e}function Uw(e,t,n){e.length===1&&Dr(e[0])&&(e=[]);let o=it();if(me(n)){let r=n.style.textAlign;rx(r)&&o.setFormat(r)}return[o.splice(0,0,e)]}var Hw={$accepts:ha,$packageRun:Uw,name:"BlockSchema"},nB={$accepts:e=>!ha(e),name:"InlineSchema"},oB={$accepts:ha,$packageRun:e=>e,name:"NestedBlockSchema"},Vw={$accepts:ha,$packageRun:Uw,name:"RootSchema"},Ws=kw,rB=new Set(["center","end","justify","left","right","start"]);function rx(e){return rB.has(e)}var sB={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},iB={CODE:dO,MARK:fO},aB=new Set(["font-weight","font-style","text-decoration","text-transform","vertical-align"]),lB={$import:(e,t)=>{let n=e.get(Uf),o=sB[t.nodeName],r=(function(u){return{fontStyle:u.style.fontStyle,fontWeight:u.style.fontWeight,textDecoration:u.style.textDecoration,textTransform:u.style.textTransform,verticalAlign:u.style.verticalAlign}})(t);var s,i;let a=n&~(l=(function(u){let d=0,f=0,{fontWeight:p,fontStyle:h,textDecoration:g,textTransform:y,verticalAlign:m}=u;if(p==="700"||p==="bold"?d|=U_:p!=="normal"&&p!=="400"||(f|=U_),h==="italic"?d|=H_:h==="normal"&&(f|=H_),g){let _=g.split(" ");_.includes("underline")&&(d|=j_),_.includes("line-through")&&(d|=V_),_.includes("none")&&(f|=j_|V_)}return y==="lowercase"?(d|=En.lowercase,f|=En.uppercase|En.capitalize):y==="uppercase"?(d|=En.uppercase,f|=En.lowercase|En.capitalize):y==="capitalize"?(d|=En.capitalize,f|=En.lowercase|En.uppercase):y==="none"&&(f|=En.lowercase|En.uppercase|En.capitalize),m==="sub"?(d|=pf,f|=hf):m==="super"?(d|=hf,f|=pf):m==="baseline"&&(f|=pf|hf),{clear:f,set:d}})(o?(s=o,{fontStyle:(i=r).fontStyle||s.fontStyle,fontWeight:i.fontWeight||s.fontWeight,textDecoration:i.textDecoration||s.textDecoration,textTransform:i.textTransform||s.textTransform,verticalAlign:i.verticalAlign||s.verticalAlign}):r)).clear|l.set;var l;let c=iB[t.nodeName];return c&&(a|=c),a===n?e.$importChildren(t):e.$importChildren(t,{context:[Ec(Uf,a)]})},match:Ws.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function uw(e,t,n){let o=e;for(;;){let r=null;for(;(r=t?o.nextSibling:o.previousSibling)===null;){let i=o.parentNode;if(i===null)return null;o=i}if(o=r,!n.isInline(o))return null;let s=o;for(;(s=t?o.firstChild:o.lastChild)!==null;)o=s;if(mc(o))return o;if(o.nodeName==="BR")return null}}function dw(e,t){return t!==0&&H(e)?e.setFormat(t):e}function fw(e,t){if(H(e)){let n=(function(o){let r="";for(let s in o)aB.has(s)||(r+=`${s}: ${o[s]}; `);return r.trimEnd()})(t);n!==""&&e.setStyle(n)}return e}var cB={$import:(e,t)=>{let n=e.get(Uf),o=e.get($w),r=e.get(Lw);if((function(a,l){let c=a.parentNode;for(;c!==null;){if(l.preservesWhitespace(c))return!0;c=c.parentNode}return!1})(t,r)){let a=ET(t.textContent||"");for(let l of a)dw(l,n),fw(l,o);return a}let s=(function(a,l){let c=(a.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(c.length===0)return"";if(c[0]===" "){let u=a,d=!0;for(;u!==null&&(u=uw(u,!1,l))!==null;){let f=u.textContent||"";if(f.length>0){/[ \t\n]$/.test(f)&&(c=c.slice(1)),d=!1;break}}d&&(c=c.slice(1))}if(c.length>0&&c[c.length-1]===" "){let u=a,d=!0;for(;u!==null&&(u=uw(u,!0,l))!==null;)if((u.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){d=!1;break}d&&(c=c.slice(0,-1))}return c})(t,r);if(s==="")return[];let i=Vn(s);return dw(i,n),fw(i,o),[i]},match:Ws.text(),name:"@lexical/html/#text"},uB={$import:()=>[],match:Ws.tag("script","style"),name:"@lexical/html/script-style-ignore"},dB={$import:(e,t)=>jO(t)||VO(t)?[]:[jd()],match:Ws.tag("br"),name:"@lexical/html/br"},fB={$import:(e,t)=>{let n=it();if(Mr(n,t),$r(t,n),n.getFormatType()===""){let o=t.getAttribute("align");o&&rx(o)&&n.setFormat(o)}return wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Ws.tag("p"),name:"@lexical/html/p"},jw={$import:(e,t,n)=>Ne().hasNode(ew)?[QD()]:n(),match:Ws.tag("hr"),name:"@lexical/html/hr"},Yw=[uB,fB,jw,{$import:(e,t,n)=>Ir(t)?Kw(e.$importChildren(t,{schema:Hw}),t):n(),match:Ws.any(),name:"@lexical/html/transparent-block"},cB,dB,lB];function pB(e,t){let n=[],o=0,r=0;for(;o<e.length&&r<t.length;)e[o]<=t[r]?n.push(e[o++]):n.push(t[r++]);for(;o<e.length;)n.push(e[o++]);for(;r<t.length;)n.push(t[r++]);return n}function Gw(e){let t=[],n=new Map,o=[],r=[],s=[],i=new Set;e.forEach((l,c)=>{let u=(function(f){let p=f[nx];return p===void 0&&Bs(360),p})(l.match),d=l.name||(function(f,p){return f.kind==="text"?`#text@${p}`:f.kind==="comment"?`#comment@${p}`:f.tags.size===0?`*@${p}`:`${Array.from(f.tags).join(",").toLowerCase()}@${p}`})(u,c);if(l.name&&i.add(l.name),t.push({$import:l.$import,name:d,predicate:u.predicate}),u.kind==="text")r.push(c);else if(u.kind==="comment")s.push(c);else if(u.tags.size===0)o.push(c);else for(let f of u.tags){let p=n.get(f);p||(p=[],n.set(f,p)),p.push(c)}});let a=new Map;if(o.length===0)for(let[l,c]of n)a.set(l,c);else for(let[l,c]of n)a.set(l,pB(c,o));return{byTag:a,commentIndices:s,rules:t,textIndices:r,wildcardIndices:o}}function pw(e,t){return mc(t)?e.textIndices:t.nodeType===8?e.commentIndices:me(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:hB}var hB=Object.freeze([]);function qw(e){let t=[];for(let n of e)if(gB(n))for(let o of n.rules)t.push(o);else t.push(n);return t}function gB(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function mB(e){let t=qw(e);return{__type:"CompiledOverlayRules",dispatch:Gw(t),rules:t}}var _B=Object.freeze({});function yB(e,t){return{$importChildren:(o,r)=>(function(s,i,a){let l=a&&a.rules?a.rules.dispatch:void 0;l&&s.overlays.push(l);try{let c=()=>Xw(s,i,a);return a&&a.context?ox(a.context,s.editor)(c):c()}finally{l&&s.overlays.pop()}})(e,o,r),$importOne:(o,r)=>sx(e,o,r),captures:t,get:o=>zw(o,e.editor),session:e.session}}function Xw(e,t,n){let o=n&&n.$onChild,r=[];for(let a of Array.from(t.childNodes)){let l=sx(e,a,void 0);for(let c of l){let u=o?o(c):c;u!=null&&r.push(u)}}let s=n&&n.$after?n.$after(r):r,i=n&&n.schema;return i?(function(a,l,c,u){let d=[],f=null,p=()=>{if(f===null)return;let h=f;if(f=null,a.$packageRun){let g=a.$packageRun(h,c,u);if(g.length>0){for(let y of g)d.push(y);return}}if(a.onReject==="hoist")for(let g of h)d.push(g)};for(let h of l)a.$accepts(h,c)?(p(),d.push(h)):(f===null&&(f=[]),f.push(h));return p(),a.$finalize?a.$finalize(d,c):d})(i,s,null,t):s}function sx(e,t,n){let o=()=>(function(r,s){let i=(function(u,d){let f=[];for(let h=u.overlays.length-1;h>=0;h--){let g=u.overlays[h],y=pw(g,d);y.length>0&&f.push({dispatch:g,indices:y})}let p=pw(u.dispatch,d);return p.length>0&&f.push({dispatch:u.dispatch,indices:p}),f})(r,s);if(i.length===0)return hw(r,s);let a=0,l=0,c=()=>{for(;a<i.length;){let{dispatch:u,indices:d}=i[a];for(;l<d.length;){let f=d[l++],p=u.rules[f],h={};if(p.predicate(s,h)){let g=yB(r,Object.keys(h).length===0?_B:h);try{return p.$import(g,s,c)}catch(y){throw y}}}a++,l=0}return hw(r,s)};return c()})(e,t);return n&&n.context?ox(n.context,e.editor)(o):o()}function hw(e,t){if(t.childNodes.length===0)return[];let n=[];for(let o of Array.from(t.childNodes)){let r=sx(e,o,void 0);for(let s of r)n.push(s)}return n}var xB={$import:(e,t)=>e.$importChildren(t),match:kw.any(),name:"@lexical/html/default-hoist"},ix={build(e,t){let n=Gw(qw(t.rules)),o=Kf(t.contextDefaults,void 0),r=t.preprocess;return{$generateNodesFromDOM:(s,i)=>{let a=Hf(Nc,e)||o,l=i&&i.context?Kf(i.context,a):a,c=l!==void 0&&l!==a?l:Object.create(a||null),u=new qy(c),d={session:u};return(function(f,p,h){let g=f.length-1,y=()=>{for(;g>=0;)return void(0,f[g--])(p,h,y)};y()})(i&&i.preprocess?[...r,...i.preprocess]:r,s,d),gw(Nc,c,()=>(function(f,p,h,g){return Xw({dispatch:f,editor:p,overlays:g.get(Fw).map(y=>y.dispatch),session:g},Tf(h)?h.body:h,{schema:Vw})})(n,e,s,u),e)},defaults:o}},config:{contextDefaults:[],preprocess:[yw],rules:[xB]},mergeConfig:(e,t)=>Bt(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:vw};function vB(e,t){return ow(ix).$generateNodesFromDOM(e,t)}var Jw={dependencies:[[ix,{rules:Yw}]],name:"@lexical/html/CoreImport"};function SB(e){return e}var CB=[jw],bB={dependencies:[ZD,Jw],name:"@lexical/html/HorizontalRuleImport"},EB={any:Ow,comment:Dw,css:Iw,tag:ww,text:Mw},Qw=new Set(["STYLE","SCRIPT"]);function NB(e,t){xw(t);let n=Tf(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let s of n)if(!Qw.has(s.nodeName)){let i=eM(s,e,r,!1);if(i!==null)for(let a of i)o.push(a)}return(function(s){for(let i of s)i.getParent()&&i.getNextSibling()instanceof F_&&i.insertAfter(jd());for(let i of s){let a=i.getParent();a&&a.splice(i.getIndexWithinParent(),1,i.getChildren())}})(r),o}function Zw(e,t=null,n=Ne()){return tx([Ec(Zy,!0)],n)(()=>{let o=Ue(),r=jf(n),s=Jd(t),i=e.append.bind(e);for(let a of(W(s)?s:o).getChildren())Yf(n,a,i,t,r);return e})}function TB(e,t=Ue()){let n=Ne();return tx([Ec(Zy,!0),Ec(Sw,!0)],n)(()=>{let o=jf(n),r=e.append.bind(e);return Yf(n,t,r,null,o),e})}function OB(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Bs(338),_T(e),Zw(Ft().createElement("div"),t,e).innerHTML}function Yf(e,t,n,o=null,r=I_(e)){let s=r.$shouldInclude(t,o,e),i=r.$shouldExclude(t,o,e),a=t;o!==null&&H(t)&&(a=zf(o,t,"clone"));let l=r.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;let p=Ft().createDocumentFragment(),h=f?f():W(a)?a.getChildren():[],g=s&&De(o)&&W(t)?null:o,y=p.append.bind(p),m=null;for(let _ of h){let x=Yf(e,_,y,g,r);x&&(m=_),!s&&x&&r.$extractWithChild(t,_,o,"html",e)&&(s=!0)}if(s&&!i){if((me(c)||q_(c))&&(d?d(p):c.append(p),(function(_,x){let v=_.lastChild;if(Dr(x)&&me(_)&&Ir(_)&&v!==null&&v.nodeName==="BR"){let S=Ft().createElement("br");S.setAttribute("data-lexical-managed-linebreak","true"),_.append(S)}})(c,m)),q_(c)){if(u){let _=u.call(a,c);_&&c.replaceChildren(_)}n(c)}else if(n(c),u){let _=u.call(a,c);_&&c.replaceWith(_)}}else n(p);return s}function DB(e,t,n,o=null){return Yf(e,t,n.append.bind(n),o,jf(e))}function eM(e,t,n,o,r=new Map,s){let i=[];if(Qw.has(e.nodeName))return i;let a=null,l=(function(h,g){let{nodeName:y}=h,m=g._htmlConversions.get(y.toLowerCase()),_=null;if(m!==void 0)for(let x of m){let v=x(h);v!==null&&(_===null||(_.priority||0)<=(v.priority||0))&&(_=v)}return _!==null?_.conversion:null})(e,t),c=l?l(e):null,u=null;if(c!==null){u=c.after;let h=c.node;if(a=Array.isArray(h)?h[h.length-1]:h,a!==null){for(let[,g]of r)if(a=g(a,s),!a)break;a&&i.push(...Array.isArray(h)?h:[a])}c.forChild!=null&&r.set(e.nodeName,c.forChild)}let d=e.childNodes,f=[],p=(a==null||!ao(a))&&(a!=null&&na(a)||o);for(let h=0;h<d.length;h++)f.push(...eM(d[h],t,n,p,new Map(r),a));if(u!=null&&(f=u(f)),Ir(e)&&(f=(function(h,g,y){let m=h.style.textAlign,_=[],x=[];for(let v=0;v<g.length;v++){let S=g[v];if(na(S))m&&!S.getFormat()&&S.setFormat(m),_.push(S);else if(x.push(S),v===g.length-1||v<g.length-1&&na(g[v+1])){let b=y();b.setFormat(m),b.append(...x),_.push(b),x=[]}}return _})(e,f,p?()=>{let h=new F_;return n.push(h),h}:it)),a==null)if(f.length>0)for(let h of f)i.push(h);else Ir(e)&&(function(h){return h.nextSibling!=null&&h.previousSibling!=null&&ca(h.nextSibling)&&ca(h.previousSibling)})(e)&&i.push(jd());else W(a)&&a.append(...f);return i}var J=ax,lY=J.$appendNodeToHTML,tM=J.$distributeInlineWrapper,cY=J.$generateDOMFromNodes,uY=J.$generateDOMFromRoot,Gf=J.$generateHtmlFromNodes,qf=J.$generateNodesFromDOM,nM=J.$generateNodesFromDOMViaExtension,dY=J.$getImportContextValue,fY=J.$getRenderContextValue,pY=J.$getSessionDOMRenderConfig,hY=J.$inlineStylesFromStyleSheets,gY=J.$isBlockLevel,mY=J.$propagateTextAlignToBlockChildren,_Y=J.$setRenderContextValue,yY=J.$updateRenderContextValue,xY=J.$withImportContext,vY=J.$withRenderContext,oM=J.BlockSchema,ga=J.CoreImportExtension,SY=J.CoreImportRules,Xf=J.DOMImportExtension,CY=J.DOMRenderExtension,bY=J.HorizontalRuleImportExtension,EY=J.HorizontalRuleImportRules,NY=J.ImportOverlays,rM=J.ImportSource,sM=J.ImportSourceDataTransfer,TY=J.ImportTextFormat,OY=J.ImportTextStyle,DY=J.ImportWhitespaceConfig,wY=J.InlineSchema,MY=J.NestedBlockSchema,kY=J.RenderContextExport,AY=J.RenderContextRoot,IY=J.RootSchema,$Y=J.contextUpdater,lx=J.contextValue,RY=J.createImportState,PY=J.createRenderState,LY=J.defaultIsInline,FY=J.defaultPreservesWhitespace,BY=J.defineImportRule,zY=J.defineOverlayRules,WY=J.domOverride,KY=J.isElementOfTag,UY=J.parseSelector,Fr=J.sel;var hx={};de(hx,{$exportMimeTypeFromSelection:()=>LB,$generateJSONFromSelectedNodes:()=>gM,$generateNodesFromSerializedNodes:()=>mM,$getClipboardDataFromSelection:()=>_M,$getHtmlContent:()=>fx,$getLexicalContent:()=>px,$handlePlainTextDrop:()=>$B,$handleRichTextDrop:()=>IB,$insertDataTransferForPlainText:()=>dM,$insertDataTransferForRichText:()=>fM,$insertGeneratedNodes:()=>Zf,$writeDragSourceToDataTransfer:()=>AB,ClipboardDOMImportExtension:()=>kB,ClipboardImportExtension:()=>dx,DEFAULT_IMPORT_MIME_TYPE:()=>Qf,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>Jf,GetClipboardDataExtension:()=>CM,caretFromPoint:()=>lM,copyToClipboard:()=>RB,setLexicalClipboardDataTransfer:()=>yM});function lM(e,t,n=null){let o=$s(n),r=n?zO(n):[],s=n!==null&&r.length>0;if(s&&typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t,{shadowRoots:r});if(i!==null&&(function(a,l){for(let c=a;c!==null;){if(c===l)return!0;c=hc(c)}return!1})(i.offsetNode,n))return{node:i.offsetNode,offset:i.offset}}if(s){let i=n.getRootNode();if(Of(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let l=(function(c,u,d,f){let p=f.createRange(),h=N=>u<N.top?N.top-u:u>N.bottom?u-N.bottom:0,g=N=>c<N.left?N.left-c:c>N.right?c-N.right:0,y=f.createTreeWalker(d,NodeFilter.SHOW_TEXT),m=null,_=1/0,x=1/0;for(let N=y.nextNode();N;N=y.nextNode()){p.selectNodeContents(N);for(let D of p.getClientRects()){let O=h(D),T=g(D);(O<_||O===_&&T<x)&&(_=O,x=T,m=N)}}if(m===null)return null;let v=0,S=1/0,b=1/0;for(let N=0;N<=m.length;N++){p.setStart(m,N),p.collapse(!0);let D=p.getBoundingClientRect(),O=h(D),T=Math.abs(c-D.left);(O<S||O===S&&T<b)&&(S=O,b=T,v=N)}return{node:m,offset:v}})(e,t,a,o);if(l!==null)return l}}}if(typeof o.caretRangeFromPoint=="function"){let i=o.caretRangeFromPoint(e,t);return i===null?null:{node:i.startContainer,offset:i.startOffset}}if(typeof o.caretPositionFromPoint=="function"){let i=o.caretPositionFromPoint(e,t);return i===null?null:{node:i.offsetNode,offset:i.offset}}return null}function Oc(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}var Jf={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function cM(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(e):e}var iM=(e,t)=>{if(!F(t))return t.insertRawText(e),!0;t!==z()&&Cn(t);let n=o=>{let r=z();F(r)&&o(r)};return qO(e,{linebreak:()=>n(o=>o.insertParagraph()),tab:()=>n(o=>o.insertNodes([Gd()])),text:o=>n(r=>r.insertText(o))}),!0},Qf={"application/x-lexical-editor":[(e,t,n)=>{try{let o=Ne(),r=JSON.parse(e);if(r&&r.namespace===o._config.namespace&&Array.isArray(r.nodes))return Zf(o,mM(r.nodes),t),!0}catch(o){console.error(o)}return n()}],"text/html":[(e,t,n)=>{try{let o=Ne(),r=new DOMParser().parseFromString(cM(e),"text/html");return Zf(o,qf(o,r),t),!0}catch(o){return console.error(o),n()}}],"text/plain":[iM],"text/uri-list":[iM]};function wB(e,t,n,o){if(!e)return!1;let r=s=>!!e[s]&&e[s](t,n,r.bind(null,s-1),o);return r(e.length-1)}function uM(e,t,n){let o=t.getData("text/plain");for(let r of(function(s){return Object.keys(s.$importMimeType).filter(i=>s.$importMimeType[i]!==void 0).sort((i,a)=>{let l=s.priority[i],c=s.priority[a];return l===void 0&&c===void 0?i<a?-1:i>a?1:0:l===void 0?1:c===void 0?-1:l-c})})(e)){let s=t.getData(r);if(s&&(r!=="text/html"||s!==o)&&wB(e.$importMimeType[r],s,n,t))return!0}return!1}var MB={$importMimeType:Qf,$insertDataTransfer:(e,t)=>uM({$importMimeType:Qf,priority:Jf},e,t),priority:Jf},dx={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(n,o)=>uM(t,n,o),priority:t.priority}),config:{$importMimeType:Qf,priority:Jf},mergeConfig(e,t){let n=Bt(e,t);if(t.$importMimeType){let o={...e.$importMimeType};for(let[r,s]of Object.entries(t.$importMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$importMimeType=o}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"},kB={dependencies:[ga,[dx,{$importMimeType:{"text/html":[(e,t,n,o)=>{let r=new DOMParser().parseFromString(cM(e),"text/html"),s=nM(r,{context:[lx(rM,"paste"),lx(sM,o)]});return Zf(Ne(),s,t),!0}]}}]],name:"@lexical/clipboard/DOMImport"};function fx(e,t=z()){return t==null&&Oc(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?"":Gf(e,t)}function px(e,t=z()){return t==null&&Oc(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(gM(e,t))}function dM(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function fM(e,t,n){(function(){let o=rw(dx.name);return o?o.output:MB})().$insertDataTransfer(e,t)}var pM="application/x-lexical-drag";function AB(e,t){let n={editorKey:t.getKey()};e.setData(pM,JSON.stringify(n))}function cx(e){let t=e;if(lo(t))if(t.offset===0)t=Sn(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}for(;;){let n=t.getParentAtCaret();if(n===null||!n.isInline()||n.isShadowRoot())return t;if(Uo(t))t=Sn(Je(n,"next"));else{if(t.getNodeAtCaret()!==null)return t;t=Je(n,"next")}}}function hM(e,t,n){let o=e.dataTransfer;if(o===null)return!1;let r=(function(f){let p=f.getData(pM);if(!p)return null;let h;try{h=JSON.parse(p)}catch{return null}return(g=h)!==null&&typeof g=="object"&&"editorKey"in g&&typeof g.editorKey=="string"?h:null;var g})(o);if(r===null)return!1;let s=(function(f,p){let h=lM(f.clientX,f.clientY,p.getRootElement());if(h===null)return null;let g=Ko(h.node);if(g===null)return null;if(H(g))return wT(g,"next",h.offset);if(W(g))return k_(g,h.offset,"next");let y=g.getParent();return y===null?null:k_(y,g.getIndexWithinParent()+1,"next")})(e,t);if(s===null)return!1;let i=r.editorKey===t.getKey(),a=z();if(i){if(!F(a)||a.isCollapsed())return!1;if((function(f,p){let{anchor:h,focus:g}=Or(Nr(p),"next"),y=cx(f);return Qi(cx(h),y)<=0&&Qi(y,cx(g))<=0})(s,a))return e.preventDefault(),!0}let l=jn(s),c=lo(l)?rf(l):l;if(c===null)return!1;let u=c.getFlipped();i&&F(a)&&a.removeText();let d=c.origin.isAttached()?c:u;if(d.origin.isAttached()||Oc(438),n(o,Yn(ws(d)),t),!i){let f=t.getRootElement(),p=f?f.ownerDocument:null,h=p?(function(g,y){for(let m of LO(y)){let _=Nf(m);if(Df(_)&&_.getKey()===g&&me(m))return m}return null})(r.editorKey,p):null;h!==null&&h.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function IB(e,t){return hM(e,t,fM)}function $B(e,t){return hM(e,t,(n,o)=>dM(n,o))}function Zf(e,t,n){e.dispatchCommand(MO,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(F(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=xn(r,"previous");if(i)if(lo(i))s=i.origin;else{let a=io(i,Qt(Ue(),"next").getFlipped());for(let l of a){if(H(l.origin)){s=l.origin;break}if(W(l.origin)&&!l.origin.isInline())break}}if(s&&H(s)){let a=s.getFormat(),l=s.getStyle();o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)}}})(n))}function ux(e,t,n,o=[]){let r=t===null||n.isSelected(t),s=W(n)&&n.excludeFromCopy("clone"),i=n;t!==null&&H(i)&&(i=zf(t,i,"clone"));let a=ST(i),l=W(i)?i.getChildren():[],c=a.children||[];H(i)&&i.getTextContentSize()===0&&(r=!1);let u=r&&De(t)&&W(n)?null:t;for(let d=0;d<l.length;d++){let f=l[d],p=ux(e,u,f,c);!r&&W(n)&&p&&n.extractWithChild(f,t,"clone")&&(r=!0)}if(r&&!s){let d=ks(i);if(d.length>0){let f={};for(let p of d){let h=ea(i,p);h===null&&Oc(366,i.constructor.name,p);let g=[];ux(e,null,h,g),(g.length!==1||W(h)&&h.excludeFromCopy("clone"))&&Oc(435,p,i.constructor.name,String(g.length)),f[p]=g[0]}a.$slots=f}}if(r&&!s)o.push(a);else for(let d=0;d<c.length;d++)o.push(c[d]);return r}function gM(e,t){let n=[],o=Ue(),r=Jd(t),s=(W(r)?r:o).getChildren();for(let i=0;i<s.length;i++)ux(e,t,s[i],n);return{namespace:e._config.namespace,nodes:n}}function mM(e){let t=[];for(let n of e)t.push(PT(n));return t}var ma=null;async function RB(e,t,n){if(ma!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(aM(e,t,n))})});let o=e.getRootElement(),r=e._window||window,s=r.document,i=Ar(r);if(o===null||i===null)return!1;let a=s.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(s.createTextNode("#")),o.append(a);let l=s.createRange();return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((c,u)=>{let d=e.registerCommand(af,f=>(fo(f,ClipboardEvent)&&(d(),ma!==null&&(r.clearTimeout(ma),ma=null),c(aM(e,f,n))),!0),VT);ma=r.setTimeout(()=>{d(),ma=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function aM(e,t,n){if(n===void 0){let r=Ar(e._window),s=z();if(!s||s.isCollapsed()||!r)return!1;let i=Ef(r,e.getRootElement()),a=i.anchorNode,l=i.focusNode;if(a!==null&&l!==null&&!YO(e,a,l))return!1;n=_M(s)}t.preventDefault();let o=t.clipboardData;return o!==null&&(yM(o,n),!0)}var PB=[["text/html",fx],["application/x-lexical-editor",px]];function _M(e=z()){return(function(t,n){let o={"text/plain":""};for(let[r,s]of Object.entries(t))if(s){let i=SM(s,n);i!==null&&(o[r]=i)}return o})(xM(),e)}function yM(e,t){for(let[n]of PB)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}function xM(e=Ne()){let t=uo(e,CM.name);return t?t.output:vM}var vM={"application/x-lexical-editor":[(e,t)=>e?px(Ne(),e):t()],"text/html":[(e,t)=>e?fx(Ne(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function SM(e,t){let n=o=>e[o]?e[o](t,n.bind(null,o-1)):null;return n(e.length-1)}function LB(e,t=z()){return SM(xM()[e]||[],t)}var CM={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:vM},mergeConfig(e,t){let n=Bt(e,t);if(t.$exportMimeType){let o={...e.$exportMimeType};for(let[r,s]of Object.entries(t.$exportMimeType))if(s){let i=o[r];o[r]=i?[...i,...s]:s}n.$exportMimeType=o}return n},name:"@lexical/clipboard/GetClipboardData"};var at=hx,JY=at.$exportMimeTypeFromSelection,QY=at.$generateJSONFromSelectedNodes,ZY=at.$generateNodesFromSerializedNodes,bM=at.$getClipboardDataFromSelection,eG=at.$getHtmlContent,tG=at.$getLexicalContent,nG=at.$handlePlainTextDrop,EM=at.$handleRichTextDrop,oG=at.$insertDataTransferForPlainText,gx=at.$insertDataTransferForRichText,rG=at.$insertGeneratedNodes,NM=at.$writeDragSourceToDataTransfer,sG=at.ClipboardDOMImportExtension,iG=at.ClipboardImportExtension,aG=at.DEFAULT_IMPORT_MIME_TYPE,lG=at.DEFAULT_IMPORT_MIME_TYPE_PRIORITY,cG=at.GetClipboardDataExtension,ep=at.caretFromPoint,mx=at.copyToClipboard,TM=at.setLexicalClipboardDataTransfer;var _x={};de(_x,{RootElementExtension:()=>FB});var FB={build:e=>Pr(()=>e.getRootElement(),t=>e.registerRootListener(n=>{t.value=n})),name:"@lexical/extension/RootElement"};var BB=_x,yx=BB.RootElementExtension;var vx={};de(vx,{AriaLiveRegionExtension:()=>Dc,EditorModeAnnounceExtension:()=>HB,FocusManagerExtension:()=>YB,FocusTrapExtension:()=>VB,HistoryAnnounceExtension:()=>UB,RovingTabIndexExtension:()=>jB});var zB=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(",");function xx(e){return Array.from(e.querySelectorAll(zB))}function tp(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=Of(n)?n.host:n.parentNode}return!1}function WB(e,t={}){let n=t.initialFocus??"firstFocusable",o=e.ownerDocument,r=Is(o),s=me(r)?r:null,i=xx(e);return n==="container"&&e.hasAttribute("tabindex")?e.focus():i.length>0?i[0].focus():e.hasAttribute("tabindex")&&e.focus(),Se(()=>{s!==null&&typeof s.focus=="function"&&tp(o,s)&&s.focus()},Rs(e,"keydown",a=>{if(a.key!=="Tab")return;let l=xx(e);if(l.length===0)return void a.preventDefault();a.preventDefault();let c=l[0],u=l[l.length-1],d=Is(o),f=me(d)&&tp(e,d)?l.indexOf(d):-1;a.shiftKey?(f<=0?u:l[f-1]).focus():(f===-1||f===l.length-1?c:l[f+1]).focus()}),Rs(o,"focusin",a=>{let l=G_(a);if(!me(l)||tp(e,l)||t.allowOutside!=null&&t.allowOutside(l))return;let c=xx(e);c.length>0?c[0].focus():e.hasAttribute("tabindex")&&e.focus()}))}function KB(e,t={}){let n=t.orientation??"horizontal",o=t.itemSelector??":scope > button:not([disabled])",r=()=>Array.from(e.querySelectorAll(o)),s=(i,a)=>{i.forEach((l,c)=>{l.tabIndex=c===a?0:-1})};return(()=>{let i=r();if(i.length===0)return;let a=Is(e.ownerDocument),l=i.findIndex(c=>c===a);s(i,l>=0?l:0)})(),Se(Rs(e,"keydown",i=>{let a=r();if(a.length===0)return;let l=Is(e.ownerDocument),c=a.findIndex(p=>p===l);if(c<0)return void(i.key!=="ArrowRight"&&i.key!=="ArrowDown"&&i.key!=="ArrowLeft"&&i.key!=="ArrowUp"&&i.key!=="Home"&&i.key!=="End"||(i.preventDefault(),s(a,0),a[0].focus()));let u=n==="horizontal"||n==="both",d=n==="vertical"||n==="both",f=c;switch(i.key){case"ArrowRight":if(!u)return;f=c+1;break;case"ArrowLeft":if(!u)return;f=c-1;break;case"ArrowDown":if(!d)return;f=c+1;break;case"ArrowUp":if(!d)return;f=c-1;break;case"Home":f=0;break;case"End":f=a.length-1;break;default:return}i.preventDefault(),f=(f+a.length)%a.length,s(a,f),a[f].focus()}),()=>{r().forEach(i=>{i.tabIndex=0})})}var Dc={build(e,t,n){let o=n.getInitResult();return{...Qe(t),announce(r){o.value=r===o.peek()?r+"\u200B":r}}},config:{owner:null,politeness:"polite"},dependencies:[yx],init:()=>St(""),name:"@lexical/a11y/AriaLiveRegion",register(e,t,n){let o=n.getInitResult(),{owner:r,politeness:s}=n.getOutput(),i=n.getDependency(yx).output,a=St(null);return Se(Ae(()=>{let l=r.value,c=l?null:i.value,u=l??(c?c.ownerDocument.body:null);if(!u)return;let d=(function(f){let p=f.ownerDocument.createElement("div");return p.setAttribute("aria-atomic","true"),p.setAttribute("role","status"),(function(h){let g=h.style;g.border="0",g.clip="rect(0 0 0 0)",g.height="1px",g.margin="-1px",g.overflow="hidden",g.padding="0",g.position="absolute",g.whiteSpace="nowrap",g.width="1px"})(p),f.appendChild(p),p})(u);return a.value=d,()=>{d.remove(),a.value=null}}),Ae(()=>{let l=a.value;l&&l.setAttribute("aria-live",s.value)}),Ae(()=>{let l=o.value,c=a.peek();c&&(c.textContent=l)}))}},UB={build:(e,t)=>Qe(t),config:{disabled:!1,redone:"Redone",undone:"Undone"},dependencies:[Dc],name:"@lexical/a11y/HistoryAnnounce",register(e,t,n){let{disabled:o,redone:r,undone:s}=n.getOutput(),{announce:i}=n.getDependency(Dc).output;return Ae(()=>o.value?void 0:Se(e.registerCommand(xf,()=>(i(s.peek()),!1),Vo),e.registerCommand(_f,()=>(i(r.peek()),!1),Vo)))}},HB={build:(e,t)=>Qe(t),config:{disabled:!1,editable:"Editor is editable",readOnly:"Editor is read-only"},dependencies:[Dc],name:"@lexical/a11y/EditorModeAnnounce",register(e,t,n){let{disabled:o,editable:r,readOnly:s}=n.getOutput(),{announce:i}=n.getDependency(Dc).output;return Ae(()=>o.value?void 0:e.registerEditableListener(a=>{i(a?r.peek():s.peek())}))}},VB={build:()=>Cf(WB),name:"@lexical/a11y/FocusTrap",register:(e,t,n)=>()=>n.getOutput().dispose()},jB={build:()=>Cf(KB),name:"@lexical/a11y/RovingTabIndex",register:(e,t,n)=>()=>n.getOutput().dispose()},YB={build:e=>Cf((t,n)=>(function(o,r,s={}){let i=s.toolbarItemSelector??':scope > button:not([disabled]), :scope > [tabindex="0"]';return Se(o.registerCommand(xO,a=>{if(!a.altKey||a.key!=="F10")return!1;let l=r.querySelector('[tabindex="0"]')??r.querySelector(i);return l!==null&&(a.preventDefault(),l.focus(),!0)},Vo),Rs(r,"keydown",a=>{if(a.key!=="Escape")return;let l=G_(a);if(me(l)){let u=r.querySelectorAll(i),d=!1;for(let f of u)if(f===l||tp(f,l)){d=!0;break}if(!d)return}let c=o.getRootElement();c!==null&&(a.preventDefault(),a.stopPropagation(),o.focus(),c.focus())}))})(e,t,n)),name:"@lexical/a11y/FocusManager",register:(e,t,n)=>()=>n.getOutput().dispose()};var _a=vx,ya=_a.AriaLiveRegionExtension,_G=_a.EditorModeAnnounceExtension,yG=_a.FocusManagerExtension,xG=_a.FocusTrapExtension,vG=_a.HistoryAnnounceExtension,SG=_a.RovingTabIndexExtension;var Sx={};de(Sx,{NormalizeInlineElementsExtension:()=>GB});function OM(e){W(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var GB={build:(e,t,n)=>Qe(t),config:{disabled:!1},name:"@lexical/NormalizeInlineElements",register:(e,t,n)=>{let o=n.getOutput();return Ae(()=>{if(!o.disabled.value){let r=[];for(let{klass:s,transforms:i}of e._nodes.values())s.prototype instanceof co&&s.prototype.isInline!==co.prototype.isInline&&(i.add(OM),r.push(()=>i.delete(OM)));return()=>r.forEach(s=>s())}})}};var qB=Sx,DM=qB.NormalizeInlineElementsExtension;var Cx={};de(Cx,{NormalizeTripleClickSelectionExtension:()=>JB});var XB=new Set([$O,IO]),JB={build:(e,t,n)=>Qe(t),config:{$fixFocusOverselection:function(){let e=z();if(F(e)&&!e.isCollapsed()){let t=Or(Nr(e),"next"),n=t.focus;for(lo(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=Sn(n.getSiblingCaret())),Ho(n)&&t.anchor.origin!==n.origin&&Dr(n.origin)&&(n=Sn(n));Uo(n)&&t.anchor.origin!==n.origin;)n=Sn(Je(n.origin,"next"));if(Ho(n)&&W(n.origin)&&(n=jn(Qt(n.origin,"previous")).getFlipped()),n=jn(n),!n.isSamePointCaret(t.focus)){let o=Yn(io(t.anchor,n)),r=Ne().getRootElement(),s=r&&Ar(r.ownerDocument.defaultView);s&&WT(Ms(),o,Ne(),s,XB,r)}}},dateNow:()=>Date.now(),disabled:!1,thresholdMsec:100},name:"@lexical/NormalizeTripleClickSelection",register:(e,t,n)=>Ae(()=>{let o=n.getOutput();if(!o.disabled.value)return e.registerRootListener(r=>{if(!r)return;let s=0,i=a=>{if(a?a.detail>2:s>0){let l=o.dateNow.peek()();s=a&&a.type==="mousedown"||l-s<=o.thresholdMsec.peek()?l:0}return s};return Se(e.registerCommand(wO,()=>(i(null)&&(s=0,o.$fixFocusOverselection.peek()()),!1),HT),Mf(r,{mousedown:i,mouseup:i},!0))})})};var QB=Cx,wM=QB.NormalizeTripleClickSelectionExtension;var Ox={};de(Ox,{$createHeadingNode:()=>Ca,$createQuoteNode:()=>wc,$isHeadingNode:()=>UM,$isQuoteNode:()=>lz,DRAG_DROP_PASTE:()=>Ex,HeadingAnnounceExtension:()=>zM,HeadingNode:()=>Ks,QuoteNode:()=>Sa,RichTextExtension:()=>KM,RichTextImportExtension:()=>az,RichTextImportRules:()=>WM,ShadowRootQuoteRule:()=>sz,defaultShouldHandlePasteAsFiles:()=>Tx,eventFiles:()=>Ls,quoteShadowRootState:()=>sp,registerRichText:()=>jM});var ZB=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Nx(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!ZB.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function BM(e,t,n,o,r){let s=Nx(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function ez(e,t){e.__tag=t.__tag}var tz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],tag:r.__tag,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__tag;c!==void 0&&c!=="h1"&&(l.tag=c);let u=r.__dir;u!=null&&(l.direction=u);let d=t[r.__format];d!==void 0&&d!==""&&(l.format=d);let f=r.__indent;return f!==void 0&&f!==0&&(l.indent=f),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=BM(s.indent,0,0,1/0),r.__textFormat=Nx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.tag;return r.__tag=c==="h1"||c==="h2"||c==="h3"||c==="h4"||c==="h5"||c==="h6"?c:"h1",r},afterCloneFrom:ez}},nz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__dir;c!=null&&(l.direction=c);let u=t[r.__format];u!==void 0&&u!==""&&(l.format=u);let d=r.__indent;return d!==void 0&&d!==0&&(l.indent=d),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=BM(s.indent,0,0,1/0),r.__textFormat=Nx(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}};function MM(e){let t=Zi(e);return UM(t)?t.getTag():null}var zM={build:(e,t)=>Qe(t),config:{created:"Heading level %s",destroyed:"Heading level %s removed",disabled:!1},dependencies:[ya],name:"@lexical/rich-text/HeadingAnnounce",register(e,t,n){let{created:o,destroyed:r,disabled:s}=n.getOutput(),{announce:i}=n.getDependency(ya).output;return Ae(()=>s.value?void 0:e.registerMutationListener(Ks,(a,{prevEditorState:l})=>{let c=null,u=null;for(let[d,f]of a)f==="created"&&c===null?c=e.read("latest",()=>MM(d)):f==="destroyed"&&u===null&&(u=l.read(()=>MM(d)));c!==null?i(o.peek().replace("%s",c.slice(1))):u!==null&&i(r.peek().replace("%s",u.slice(1)))},{skipInitialization:!0}))}},oz={$import:(e,t)=>{let n=Ca(t.nodeName.toLowerCase());return $r(t,n),Mr(n,t),wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Fr.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},rz={$import:(e,t)=>{let n=wc();return Mr(n,t),$r(t,n),wr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Fr.tag("blockquote"),name:"@lexical/rich-text/blockquote"},sz={$import:(e,t)=>{let n=wc({shadowRoot:!0});return Mr(n,t),$r(t,n),wr(n,t),[n.splice(0,0,e.$importChildren(t,{schema:oM}))]},match:Fr.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"},WM=[oz,rz,{$import:(e,t,n)=>{let o=t.firstChild;return o&&me(r=o)&&r.nodeName==="SPAN"&&r.style.fontSize==="26pt"?e.$importChildren(t):n();var r},match:Fr.tag("p"),name:"@lexical/rich-text/google-docs-title-p"},{$import:(e,t,n)=>t.style.fontSize!=="26pt"?n():[Ca("h1").splice(0,0,e.$importChildren(t))],match:Fr.tag("span"),name:"@lexical/rich-text/google-docs-title-span"}];function iz(e,t){return e&&t!==null?Bt(e,t):t}var KM={build:(e,t)=>Qe(t),config:{escapeFormatTriggers:{capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}},shouldHandlePasteAsFiles:Tx},conflictsWith:["@lexical/plain-text"],dependencies:[zM,mD,DM,wM,ga,[Xf,{rules:WM}]],mergeConfig:function(e,t){let n=Bt(e,t);return t.escapeFormatTriggers&&(n.escapeFormatTriggers=(function(o,r){let s=Bt(o,r);for(let i of Object.keys(r))s[i]=iz(o[i],r[i]);return s})(e.escapeFormatTriggers,t.escapeFormatTriggers)),n},name:"@lexical/rich-text",nodes:()=>[Ks,Sa],register:(e,t,n)=>Ae(()=>{let{escapeFormatTriggers:o,shouldHandlePasteAsFiles:r}=n.getOutput();return jM(e,o,r)})},az={dependencies:[KM],name:"@lexical/rich-text/Import"},Ex=sa("DRAG_DROP_PASTE_FILE"),sp=bf("shadowRoot",{parse:vf()}),Sa=class extends co{$config(){return this.config("quote",{extends:co,generated:nz,importDOM:{blockquote:()=>({conversion:uz,priority:0})},stateConfigs:[{flat:!0,stateConfig:sp}]})}isShadowRoot(){return ef(this,sp)}setIsShadowRoot(t){return of(this,sp,t)}createDOM(t){let n=Ft().createElement("blockquote");return So(n,t.theme.quote),n}updateDOM(t,n,o){return!1}exportDOM(t){let{element:n}=super.exportDOM(t);if(me(n)){this.isEmpty()&&n.append(Ft().createElement("br"));let o=this.getFormatType();o&&(n.style.textAlign=o);let r=this.getDirection();r&&(n.dir=r)}return{element:n}}static importJSON(t){return wc().updateFromJSON(t)}insertNewAfter(t,n){let o=it();o.setTextFormat(t.format),o.setTextStyle(t.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,n),o}collapseAtStart(){if(this.isShadowRoot()){for(let n of this.getChildren())this.insertBefore(n);return this.remove(),!0}let t=it();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function wc(e){let t=Ji(new Sa);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function lz(e){return e instanceof Sa}var cz=_c()({tag:Rr(PO(["h1","h2","h3","h4","h5","h6"]),{field:"__tag"})}),Ks=class extends co{constructor(n="h1",o){super(o);w(this,"__tag");this.__tag=n}$config(){return this.config("heading",{extends:co,generated:tz,importDOM:{h1:()=>({conversion:xa,priority:0}),h2:()=>({conversion:xa,priority:0}),h3:()=>({conversion:xa,priority:0}),h4:()=>({conversion:xa,priority:0}),h5:()=>({conversion:xa,priority:0}),h6:()=>({conversion:xa,priority:0}),p:n=>{let o=n.firstChild;return o!==null&&kM(o)?{conversion:()=>({node:null}),priority:3}:null},span:n=>kM(n)?{conversion:()=>({node:Ca("h1")}),priority:3}:null},json:cz})}getTag(){return this.getLatest().__tag}setTag(n){let o=this.getWritable();return o.__tag=n,o}createDOM(n){let o=this.__tag,r=Ft().createElement(o),s=n.theme.heading;if(s!==void 0){let i=s[o];So(r,i)}return r}updateDOM(n,o,r){return n.__tag!==this.__tag}exportDOM(n){let{element:o}=super.exportDOM(n);if(me(o)){this.isEmpty()&&o.append(Ft().createElement("br"));let r=this.getFormatType();r&&(o.style.textAlign=r);let s=this.getDirection();s&&(o.dir=s)}return{element:o}}insertNewAfter(n,o=!0){let r=n?n.anchor.offset:0,s=this.getLastDescendant(),i=!s||n&&n.anchor.key===s.getKey()&&r===s.getTextContentSize()||!n?it():Ca(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,o),r===0&&!this.isEmpty()&&n){let l=it();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let n=it();this.getChildren().forEach(o=>n.append(o)),this.replace(n)}return!0}extractWithChild(){return!0}};function kM(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function xa(e){let t=e.nodeName.toLowerCase(),n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Ca(t),$r(e,n),Mr(n,e),wr(n,e)),{node:n}}function uz(e){let t=wc();return Mr(t,e),$r(e,t),wr(t,e),{node:t}}function Ca(e="h1"){return Ji(new Ks(e))}function UM(e){return e instanceof Ks}function AM(e){let t=Ko(e);return vn(t)}function HM(e){let t=e.focus;return t.key==="root"&&t.offset===Ue().getChildrenSize()}function VM(e){let t=e.focus;return t.key==="root"&&t.offset===0}function IM(e,t){if(!e.isCollapsed())return!1;let n=t==="next";if(!(n?HM(e):VM(e)))return!1;let o=e.focus.offset;return L_(Ue().getChildAtIndex(n?o-1:o))}function va(e,t,n,o){let r=!1,s=null;if(e.isCollapsed()&&e.anchor.type==="text"){let a=e.anchor.getNode();if(H(a)){s=a;let l=e.anchor.offset,c=l===a.getTextContentSize()&&a.getNextSibling()===null,u=l===0&&a.getPreviousSibling()===null;r=n==="end"&&c||n==="start"&&u||n==="both"&&(c||u)}}let i=!1;for(let[a,l]of Object.entries(o)){if(l==null||!l[t])continue;let c=a;if(l.onlyAtBoundary){if(!(r&&s&&H(s)&&s.hasFormat(c)))continue;i=!0}e.hasFormat(c)&&e.toggleFormat(c)}i&&e.setStyle("")}var dz={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function np(e,t){return(function(n,o){if(!n.isCollapsed())return!1;let r=xn(n.focus,o),s=Me(r.origin,tf);if(!s)return!1;let i=n.focus.getNode();if(!s.is(i)&&!sc(i,s))return!1;let a=io(r,Je(s,o));if(a.getTextSlices().some(d=>d&&d.getTextContentSize()>0))return!1;let l=io(a.anchor.getSiblingCaret(),a.focus),c=l.anchor.origin;for(let d of l){if(!Ho(d)||!d.origin.is(c.getParent()))return!1;c=d.origin}let u=s;for(let d of qd(Je(s,o))){if(!d.origin.is(u.getParent())){if(L_(d.origin)){let f=Je(u,o);return Yn(io(f,f)),!0}break}if(!tf(d.origin))break;u=d.origin}return!1})(e,t)||(function(n,o){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;let r=xn(n.anchor,o).getNodeAtCaret();return!(!tf(r)||r.isInline()||(Yn(ws(jn(Qt(r,o)))),0))})(e,t)}function $M(e){return vn(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function bx(e){let t=Yd();t.add(e),Cn(t)}function RM(e,t){if(!e.isCollapsed())return!1;let n=e.focus,o=n.getNode(),r=t?"previous":"next",s=xn(n,r);if(n.type==="element"&&W(o)&&ao(o)){let m=s.getNodeAtCaret();return!(m===null||!$M(m)||(bx(m.__key),0))}let i=Me(W(o)?o:o.getParentOrThrow(),m=>W(m)&&!m.isInline()&&ao(m.getParent()));if(i===null)return!1;let a=Je(i,r).getNodeAtCaret();if(a===null||!$M(a))return!1;if(i.getTextContentSize()===0)return bx(a.__key),!0;let l=Ne().getRootElement();if(l===null)return!1;let c=Ar(l.ownerDocument.defaultView);if(c===null||c.rangeCount===0)return!1;let u=c.anchorNode,d=c.anchorOffset,f=c.focusNode,p=c.focusOffset;c.modify("move",t?"backward":"forward","line");let h=c.anchorNode,g=c.anchorOffset;if(h===null)return PM(c,u,d,f,p),!1;let y=Ko(h);return PM(c,u,d,f,p),y!==null&&(h===u&&g===d||!y.is(i)&&!sc(y,i))&&(bx(a.__key),!0)}function PM(e,t,n,o,r){t!==null&&o!==null&&e.setBaseAndExtent(t,n,o,r)}function LM(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),o=Me(W(n)?n:n.getParentOrThrow(),y=>W(y)&&!y.isInline());if(o===null)return!1;let r=Ne(),s=r.getRootElement();if(s===null)return!1;let i=s.ownerDocument.defaultView;if(i===null)return!1;let a=!1;for(let y of o.getChildren())if(W(y)&&y.isInline()){let m=r.getElementByKey(y.getKey());if(m!==null){let _=i.getComputedStyle(m).display;if(_==="inline-grid"||_==="inline-flex"){a=!0;break}}}if(!a)return!1;let l=Je(o,t?"previous":"next").getNodeAtCaret();if(l===null||!W(l)){if(t){let y=o.getFirstDescendant();H(y)?y.select(0,0):o.select(0,0)}else{let y=o.getLastDescendant();if(H(y)){let m=y.getTextContentSize();y.select(m,m)}else{let m=o.getChildrenSize();o.select(m,m)}}return!0}let c=r.getElementByKey(l.getKey());if(c===null)return!1;let u=Ar(i);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=c.getBoundingClientRect(),h=p.top+p.height/2;if(f.height>0){let y=ep(f.left,h,s);if(y!==null&&c.contains(y.node)){let m=s.ownerDocument.createRange();return m.setStart(y.node,y.offset),m.collapse(!0),e.applyDOMRange(m),e.dirty=!0,!0}}let g=t?l.getLastDescendant():l.getFirstDescendant();if(H(g)){let y=t?g.getTextContentSize():0;g.select(y,y)}else{let y=l.getChildrenSize();l.select(t?y:0,t?y:0)}return!0}function op(e,t){let n=Je(e,t),o=n.getAdjacentCaret();o!==null&&W(o.origin)&&!o.origin.isInline()&&o.origin.isShadowRoot()?Yn(ws(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function rp(e,t){let n=e.getNodes().map(s=>Je(s,"next")).sort(Qi),o=n[0],r=n[n.length-1];if(!o||!r)return!1;for(let s=0;s<n.length-1;s++)if(!n[s+1].origin.is(n[s].getNodeAtCaret()))return!1;return Yn(Or(io(Sn(o),r),t)),CT(),!0}function FM(e,t,n){n.preventDefault(),n.stopPropagation();let o=e.getNodes();if(o.length===0)return!0;let r=o.map(l=>Je(l,"next")).sort(Qi),s=(t?r[0]:r[r.length-1]).origin,i=Me(s,l=>l!==s&&W(l)&&!l.isInline())??Ue(),a=t?0:i.getChildrenSize();return i.select(a,a),!0}function Tx(e,t){return e.length>0&&!t}function jM(e,t=St(dz),n=St(Tx)){return Se(e.registerCommand(sf,o=>{let r=z();if(De(r)){let s=o.target;if(me(s))for(let i of r.getNodes()){let a=e.getElementByKey(i.getKey());if(a!==null&&a.contains(s))return!1}return r.clear(),!0}return F(r)&&va(r,"click","both",t.peek()),!1},te),e.registerCommand(lf,o=>{let r=z();return F(r)?(r.deleteCharacter(o),!0):!!De(r)&&(r.deleteNodes(),!0)},te),e.registerCommand(JT,o=>{let r=z();return!!F(r)&&(r.deleteWord(o),!0)},te),e.registerCommand(XT,o=>{let r=z();return!!F(r)&&(r.deleteLine(o),!0)},te),e.registerCommand(GT,o=>{let r=z();if(typeof o=="string")r!==null&&r.insertText(o);else{if(r===null)return!1;let s=o.dataTransfer;if(s!=null)gx(s,r,e);else if(F(r)){let i=o.data;return i&&r.insertText(i),!0}}return!0},te),e.registerCommand(DO,()=>{let o=z();return!!F(o)&&(o.removeText(),!0)},te),e.registerCommand(nO,o=>{let r=z();return!(!F(r)&&!De(r)||(bT(r,o),0))},te),e.registerCommand(AO,o=>{let r=z();return!(!F(r)&&!De(r)||(BT(r,o),0))},te),e.registerCommand(tO,o=>{let r=z();if(!F(r)&&!De(r))return!1;let s=r.getNodes();for(let i of s){let a=Me(i,l=>W(l)&&!l.isInline());a!==null&&a.setFormat(o)}return!0},te),e.registerCommand(W_,o=>{let r=z();return!!F(r)&&(r.insertLineBreak(o),!0)},te),e.registerCommand(K_,()=>{let o=z();return!!F(o)&&(o.insertParagraph(),!0)},te),e.registerCommand(sO,()=>{let o=Gd(),r=z();return F(r)&&(o.setFormat(r.format),o.setStyle(r.style)),MT([o]),!0},te),e.registerCommand(rO,()=>Iy(o=>{let r=o.getIndent();o.setIndent(r+1)}),te),e.registerCommand(Y_,()=>Iy(o=>{let r=o.getIndent();r>0&&o.setIndent(Math.max(0,r-1))}),te),e.registerCommand(mO,o=>{let r=z();if(De(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!rp(r,"previous"))return o.preventDefault(),op(s[0],"previous"),!0;r=z()}}return F(r)&&(VM(r)||!o.shiftKey&&np(r,"previous")||!o.shiftKey&&RM(r,!0)||!o.shiftKey&&LM(r,!0))?(o.preventDefault(),!0):!1},te),e.registerCommand(pO,o=>{let r=z();if(De(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!rp(r,"next"))return o.preventDefault(),op(s[0],"next"),!0;r=z()}}return F(r)&&(HM(r)||!o.shiftKey&&np(r,"next")||!o.shiftKey&&RM(r,!1)||!o.shiftKey&&LM(r,!1))?(o.preventDefault(),!0):!1},te),e.registerCommand(hO,o=>{let r=z();if(De(r)){let i=r.getNodes();if(i.length>0){let a=Sc(i[0])?"next":"previous";if(!o.shiftKey||!rp(r,a))return o.preventDefault(),op(i[0],a),!0;r=z()}}if(!F(r))return!1;let s=Sc(r.anchor.getNode())?"next":"previous";if(IM(r,s)||!o.shiftKey&&np(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","start",t.peek()),Ny(r,!0)){let i=o.shiftKey;return o.preventDefault(),Ey(r,i,!0),!0}return!1},te),e.registerCommand(gO,o=>{let r=z();if(De(r)){let i=r.getNodes();if(i.length>0){let a=Sc(i[0])?"previous":"next";if(!o.shiftKey||!rp(r,a))return o.preventDefault(),op(i[0],a),!0;r=z()}}if(!F(r))return!1;let s=Sc(r.anchor.getNode())?"previous":"next";if(IM(r,s)||!o.shiftKey&&np(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","end",t.peek()),Ny(r,!1)){let i=o.shiftKey;return o.preventDefault(),Ey(r,i,!1),!0}return!1},te),e.registerCommand(_O,o=>{let r=z();if(!De(r)&&AM(o.target))return!1;if(F(r)){if((function(s){if(!s.isCollapsed())return!1;let{anchor:i}=s;if(i.offset!==0)return!1;let a=i.getNode();if(As(a))return!1;let l=GD(a);return l.getIndent()>0&&(l.is(a)||a.is(l.getFirstDescendant()))})(r))return o.preventDefault(),e.dispatchCommand(Y_);if(pc&&uc)return!1}else if(!De(r))return!1;return o.preventDefault(),e.dispatchCommand(lf,!0)},te),e.registerCommand(yO,o=>{let r=z();return!(!De(r)&&AM(o.target))&&!(!F(r)&&!De(r))&&(o.preventDefault(),e.dispatchCommand(lf,!1))},te),e.registerCommand(vO,o=>{let r=z();if(De(r)){let s=r.getNodes();s.length===1&&vn(s[0])&&!s[0].isInline()&&(r=s[0].selectNext())}if(!F(r))return!1;if(va(r,"enter","both",t.peek()),o!==null){if((pc||ff||uf)&&uc)return!1;if(o.preventDefault(),o.shiftKey)return e.dispatchCommand(W_,!1)}return e.dispatchCommand(K_)},te),e.registerCommand(SO,()=>{let o=z();return!!F(o)&&(e.blur(),!0)},te),e.registerCommand(eO,o=>{let[,r]=Ls(o);if(r.length>0){let s=o.clientX,i=o.clientY,a=ep(s,i,e.getRootElement());if(a!==null){let{offset:l,node:c}=a,u=Ko(c);if(u!==null){let d=vT();if(H(u))d.anchor.set(u.getKey(),l,"text"),d.focus.set(u.getKey(),l,"text");else{let p=u.getParentOrThrow().getKey(),h=u.getIndexWithinParent()+1;d.anchor.set(p,h,"element"),d.focus.set(p,h,"element")}let f=oa(d);Cn(f)}}return e.dispatchCommand(Ex,r),o.preventDefault(),!0}return EM(o,e)},te),e.registerCommand(ZT,o=>{let[r]=Ls(o),s=z();return!(r&&!F(s)||(F(s)&&!s.isCollapsed()&&o.dataTransfer!==null&&(TM(o.dataTransfer,bM(s)),NM(o.dataTransfer,e)),0))},te),e.registerCommand(QT,o=>{let[r]=Ls(o),s=z();if(r&&!F(s))return!1;let i=o.clientX,a=o.clientY,l=ep(i,a,e.getRootElement());if(l!==null){let c=Ko(l.node);vn(c)&&o.preventDefault()}return!0},te),e.registerCommand(kO,()=>{let o=z();return nf(F(o)&&Qd(o.anchor.getNode())!==null?o:null),!0},te),e.registerCommand(af,o=>(mx(e,fo(o,ClipboardEvent)?o:null),!0),te),e.registerCommand(qT,o=>((async function(r,s){s.update(()=>{let i=z();F(i)&&!i.isCollapsed()&&iO(i)},{discrete:!0,tag:dc}),await mx(s,fo(r,ClipboardEvent)?r:null),s.update(()=>{let i=z();F(i)?i.removeText():De(i)&&i.getNodes().forEach(a=>a.remove())},{tag:dc})})(o,e),!0),te),e.registerCommand(gf,o=>{let[,r,s]=Ls(o);return!(!n.peek()(r,s)||!e.dispatchCommand(Ex,r))||(!aa(o.target)||!RT(o.target))&&z()!==null&&((function(i,a){i.preventDefault(),a.update(()=>{let l=z(),c=fo(i,InputEvent)||fo(i,KeyboardEvent)?null:i.clipboardData;c!=null&&l!==null&&gx(c,l,a)},{tag:mf})})(o,e),!0)},te),e.registerCommand(CO,()=>{let o=z();return F(o)&&va(o,"space","both",t.peek()),!1},te),e.registerCommand(bO,()=>{let o=z();return F(o)&&va(o,"tab","both",t.peek()),!1},te),e.registerCommand(NO,o=>{let r=z();if(De(r))return FM(r,!1,o);if(!F(r))return!1;let{anchor:s}=r;if(s.type!=="element"||s.offset!==0)return!1;let i=s.getNode();if(!W(i))return!1;let a=i.getFirstChild();if(!vn(a)||!a.isInline())return!1;let l=i.getKey(),c=i.selectEnd();return o.shiftKey&&c.anchor.set(l,0,"element"),o.preventDefault(),o.stopPropagation(),!0},te),e.registerCommand(TO,o=>{let r=z();if(De(r))return FM(r,!0,o);if(!F(r))return!1;let{anchor:s,focus:i}=r,a=Me(i.getNode(),u=>W(u)&&!u.isInline());if(a===null)return!1;let l=a.getFirstChild();if(!vn(l)||!l.isInline()||Me(s.getNode(),u=>W(u)&&!u.isInline())!==a)return!1;let c=a.getKey();return(i.type!=="element"||i.key!==c||i.offset!==0)&&(r.focus.set(c,0,"element"),o.shiftKey||r.anchor.set(c,0,"element"),o.preventDefault(),o.stopPropagation(),!0)},te))}var zt=Ox,HG=zt.$createHeadingNode,VG=zt.$createQuoteNode,jG=zt.$isHeadingNode,YG=zt.$isQuoteNode,GG=zt.DRAG_DROP_PASTE,qG=zt.HeadingAnnounceExtension,XG=zt.HeadingNode,JG=zt.QuoteNode,QG=zt.RichTextExtension,ZG=zt.RichTextImportExtension,e5=zt.RichTextImportRules,t5=zt.ShadowRootQuoteRule,n5=zt.defaultShouldHandlePasteAsFiles,o5=zt.eventFiles,r5=zt.quoteShadowRootState,YM=zt.registerRichText;var Dx={};de(Dx,{RichTextPlugin:()=>gz});function fz(e,...t){throw(function(n,...o){let r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(let i of o)s.append("v",i);return r.search=s.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(e,...t)}function pz({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,s]=Dn(()=>[l=>n.registerDecoratorListener(l),()=>n.getDecorators()],[n]),i=vp(r,s,s),a=(function(l){let[c,u]=Dn(()=>[l.registerRootListener.bind(l),l.getRootElement.bind(l)],[l]);return vp(c,u,u)})(n);return Dn(()=>{let l=u=>n._onError(u),c=[];for(let u in i){let d=n.getElementByKey(u);if(d!==null){let f=Tt(o,{onError:l,children:Tt(Zx,{fallback:null,children:i[u]})});c.push(qx(f,d,u))}}return c},[o,i,n,a])})(e,t)}function hz({editor:e,ErrorBoundary:t}){return(function(n){let o=fa.maybeFromEditor(n);if(o&&o.hasExtensionByName(cD.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&fz(320,r);return!0}return!1})(e)?null:Tt(pz,{editor:e,ErrorBoundary:t})}var qM=bn?po:et;function GM(e){return e.read("latest",Lf(e.isComposing()))}function gz({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=Yt();return(function(r){qM(()=>Se(YM(r),_D(r)),[r])})(o),If(Af,{children:[e,Tt(mz,{content:t}),Tt(hz,{editor:o,ErrorBoundary:n})]})}function mz({content:e}){let[t]=Yt(),n=(function(r){let[s,i]=Ie(()=>GM(r));return qM(()=>{function a(){let l=GM(r);i(l)}return a(),Se(r.registerUpdateListener(()=>{a()}),r.registerEditableListener(()=>{a()}))},[r]),s})(t),o=ZO();return n?typeof e=="function"?e(o):e:null}var _z=Dx,XM=_z.RichTextPlugin;var Mx={};de(Mx,{ContentEditable:()=>xz,ContentEditableElement:()=>QM});var wx=bn?po:et;function yz({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:o,ariaDescribedBy:r,ariaErrorMessage:s,ariaExpanded:i,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:h,id:g,role:y="textbox",spellCheck:m=!0,style:_,tabIndex:x,"data-testid":v,...S},b){let[N,D]=Ie(e.isEditable()),O=tv(A=>{A&&A.ownerDocument&&A.ownerDocument.defaultView?e.setRootElement(A):e.setRootElement(null)},[e]),T=Dn(()=>(function(...A){return $=>{for(let I of A)typeof I=="function"?I($):I!=null&&(I.current=$)}})(b,O),[O,b]);return wx(()=>(D(e.isEditable()),e.registerEditableListener(A=>{D(A)})),[e]),Tt("div",{"aria-activedescendant":N?t:void 0,"aria-autocomplete":N?n:"none","aria-controls":N?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":N&&y==="combobox"?!!i:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":N?d:void 0,"aria-readonly":!N||void 0,"aria-required":f,autoCapitalize:p,className:h,contentEditable:N,"data-testid":v,id:g,ref:T,role:y,spellCheck:m,style:_,tabIndex:x??(N?void 0:-1),...S})}var QM=zr(yz);function JM(e){return e.read("latest",Lf(e.isComposing()))}var xz=zr(vz);function vz(e,t){let{placeholder:n,...o}=e,[r]=Yt();return If(Af,{children:[Tt(QM,{editor:r,...o,ref:t}),n!=null&&Tt(Sz,{editor:r,content:n})]})}function Sz({content:e,editor:t}){let n=(function(i){let[a,l]=Ie(()=>JM(i));return wx(()=>{function c(){let u=JM(i);l(u)}return c(),Se(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a})(t),[o,r]=Ie(t.isEditable());if(wx(()=>(r(t.isEditable()),t.registerEditableListener(i=>{r(i)})),[t]),!n)return null;let s=null;return typeof e=="function"?s=e(o):e!==null&&(s=e),s===null?null:Tt("div",{"aria-hidden":!0,children:s})}var ZM=Mx,ek=ZM.ContentEditable,b5=ZM.ContentEditableElement;var Ax={};de(Ax,{LexicalErrorBoundary:()=>Cz});var kx=class extends Qx{constructor(){super(...arguments);w(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n,o){this.props.onError(n instanceof Error?n:new Error(String(n),{cause:n}),o)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Cz({children:e,fallback:t,onError:n}){return Tt(kx,{fallback:t===void 0?Tt("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}var bz=Ax,tk=bz.LexicalErrorBoundary;var Ix={};de(Ix,{HistoryExtension:()=>ip,SharedHistoryExtension:()=>Nz,createEmptyHistoryState:()=>ik,registerHistory:()=>sk});function Ez(e,t,n){let o=n(),r=0,s=o,i=0,a=null;return(l,c,u,d,f,p)=>{let h=n();if(p.has(YT)&&(s=o,i=r,a=l),p.has(cf))return r=0,o=h,2;p.has(jT)&&a&&(o=s,r=i,l=a);let g=p.has(mf)||p.has(dc)?0:(function(m,_,x,v,S){if(m===null||x.size===0&&v.size===0&&!S)return 0;let b=_._selection,N=m._selection;if(S)return 1;if(!(F(b)&&F(N)&&N.isCollapsed()&&b.isCollapsed()))return 0;let D=(function(ee,Z,ne){let ae=ee._nodeMap,xe=[];for(let ue of Z){let q=ae.get(ue);q!==void 0&&xe.push(q)}for(let[ue,q]of ne){if(!q)continue;let le=ae.get(ue);le===void 0||As(le)||xe.push(le)}return xe})(_,x,v);if(D.length===0)return 0;if(D.length>1){let ee=_._nodeMap,Z=ee.get(b.anchor.key),ne=ee.get(N.anchor.key);return Z&&ne&&!m._nodeMap.has(Z.__key)&&H(Z)&&Z.__text.length===1&&b.anchor.offset===1?2:0}let O=D[0],T=m._nodeMap.get(O.__key);if(!H(T)||!H(O)||T.__mode!==O.__mode)return 0;let A=T.__text,$=O.__text;if(A===$)return 0;let I=b.anchor,L=N.anchor;if(I.key!==L.key||I.type!=="text")return 0;let P=I.offset,Y=L.offset,Q=$.length-A.length;return Q===1&&Y===P-1?2:Q===-1&&Y===P+1?3:Q===-1&&Y===P?4:0})(l,c,d,f,e.isComposing()),y=(()=>{let m=u===null||u.editor===e,_=p.has(oO);if(!_&&m&&p.has(ra))return 0;if(g===1)return 2;if(l===null)return 1;let x=c._selection;if(!(d.size>0||f.size>0))return x!==null?0:2;let v=typeof t=="number"?t:t.peek();return _===!1&&g!==0&&g===r&&h<o+v&&m||d.size===1&&(function(S,b,N){let D=b._nodeMap.get(S),O=N._nodeMap.get(S),T=b._selection,A=N._selection;return!(F(T)&&F(A)&&T.anchor.type==="element"&&T.focus.type==="element"&&A.anchor.type==="text"&&A.focus.type==="text"||!H(D)||!H(O)||D.__parent!==O.__parent)&&JSON.stringify(b.read(()=>D.exportJSON()))===JSON.stringify(N.read(()=>O.exportJSON()))})(Array.from(d)[0],l,c)?0:1})();return o=h,r=g,y}}function nk(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,o=n.getEditorState();return o.isEmpty()?null:{editor:n,editorState:o}}function ok(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function sk(e,t,n,o=Date.now,r,s=null){let i=Ez(e,n,o),a=()=>{r&&r(t)};return a(),Se(e.registerCommand(xf,()=>((function(l,c,u){let d=c.redoStack,f=c.undoStack;if(f.length!==0){let p=c.current,h=f.pop();if(h){let g=nk(h,p);g!==null&&(d.push(g),l.dispatchCommand(lc,!0))}f.length===0&&l.dispatchCommand(cc,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:cf})}})(e,t,r),!0),te),e.registerCommand(_f,()=>((function(l,c,u){let d=c.redoStack,f=c.undoStack;if(d.length!==0){let p=c.current,h=d.pop();if(h){let g=nk(h,p);g!==null&&(f.push(g),l.dispatchCommand(cc,!0))}d.length===0&&l.dispatchCommand(lc,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:cf})}})(e,t,r),!0),te),e.registerCommand(KT,()=>(ok(t,r),!1),te),e.registerCommand(UT,()=>(ok(t,r),e.dispatchCommand(lc,!1),e.dispatchCommand(cc,!1),!0),te),e.registerUpdateListener(({editorState:l,prevEditorState:c,dirtyLeaves:u,dirtyElements:d,tags:f})=>{let p=t.current,h=t.redoStack,g=t.undoStack,y=p===null?null:p.editorState;if(p!==null&&l===y)return;let m=i(c,l,p,u,d,f);if(m===1){h.length!==0&&(t.redoStack=[],e.dispatchCommand(lc,!1));let _=(function(x,v,S){return S===null?null:S.editor===x?{...S}:v.isEmpty()?null:{editor:x,editorState:v}})(e,c,p);if(_!==null){g.push(_);let x=typeof s=="number"||s===null?s:s.peek();x!==null&&g.length>x&&g.splice(0,g.length-x),e.dispatchCommand(cc,!0)}}else if(m===2)return;t.current={editor:e,editorState:l},a()}))}function ik(){return{current:null,redoStack:[],undoStack:[]}}var ip={build:(e,{delay:t,createInitialHistoryState:n,disabled:o,maxDepth:r,now:s},i)=>({...Qe({delay:t,disabled:o,historyState:n(e),maxDepth:r,now:s}),...i.getInitResult()}),config:{createInitialHistoryState:ik,delay:300,disabled:typeof window>"u",maxDepth:null,now:()=>Date.now()},init:()=>({canRedo:St(!1),canUndo:St(!1)}),name:"@lexical/history/History",register:(e,t,n)=>{let{canUndo:o,canRedo:r}=n.getInitResult(),s=n.getOutput(),i=a=>vc(()=>{o.value=a!=null&&a.undoStack.length>0,r.value=a!=null&&a.redoStack.length>0});return Ae(()=>{if(!s.disabled.value)return sk(e,s.historyState.value,s.delay,()=>s.now.peek()(),i,s.maxDepth);i(null)})}};function rk(e){let t=e?uo(e,"@lexical/extension/HMR"):void 0;return t?t.output.restoreCount.value:0}var Nz={build:(e,{disabled:t,parentEditor:n})=>Qe({disabled:t,parentEditor:n||e._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[[ip,{disabled:!0}]],name:"@lexical/history/SharedHistory",register:(e,t,n)=>Ae(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(ip);rk(e),rk(r.value);let i=(function(l){return l?uo(l,ip.name):null})(r.value);if(!i)return;let a=i.output;vc(()=>{s.delay.value=a.delay.value,s.historyState.value=a.historyState.value,s.now.value=a.now.value,s.maxDepth.value=a.maxDepth.value,s.disabled.value=a.disabled.value})}})};var ap=Ix,I5=ap.HistoryExtension,$5=ap.SharedHistoryExtension,lp=ap.createEmptyHistoryState,ak=ap.registerHistory;var $x={};de($x,{HistoryPlugin:()=>Tz,createEmptyHistoryState:()=>lp});function Tz({delay:e,externalHistoryState:t}){let[n]=Yt();return(function(o,r,s=1e3){let i=Dn(()=>r||lp(),[r]);et(()=>ak(o,i,s),[s,o,i])})(n,t,e),null}var lk=$x,ck=lk.HistoryPlugin,z5=lk.createEmptyHistoryState;var Bx={};de(Bx,{$createAutoLinkNode:()=>mk,$createLinkNode:()=>kc,$isAutoLinkNode:()=>Zt,$isLinkNode:()=>Nn,$toggleLink:()=>cp,AutoLinkAnnounceExtension:()=>_k,AutoLinkExtension:()=>Vz,AutoLinkNode:()=>Us,ClickableLinkExtension:()=>Fz,LinkExtension:()=>fp,LinkImportExtension:()=>Lz,LinkImportRules:()=>yk,LinkNode:()=>Yo,TOGGLE_LINK_COMMAND:()=>up,autoLinkEmailMatcher:()=>Wz,autoLinkUrlMatcher:()=>zz,createLinkMatcherWithRegExp:()=>Sk,formatUrl:()=>Rx,registerAutoLink:()=>Ok,registerClickableLink:()=>vk,registerLink:()=>xk});var Oz=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Fx(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!Oz.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function gk(e,t,n,o,r){let s=Fx(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function Dz(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var wz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],rel:r.__rel,target:r.__target,title:r.__title,url:r.__url,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__rel;c!=null&&(l.rel=c);let u=r.__target;u!=null&&(l.target=u);let d=r.__title;d!=null&&(l.title=d);let f=r.__url;f!==void 0&&f!==""&&(l.url=f);let p=r.__dir;p!=null&&(l.direction=p);let h=t[r.__format];h!==void 0&&h!==""&&(l.format=h);let g=r.__indent;return g!==void 0&&g!==0&&(l.indent=g),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=gk(s.indent,0,0,1/0),r.__textFormat=Fx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.rel;r.__rel=typeof c=="string"&&c!==""?c:null;let u=s.target;r.__target=typeof u=="string"&&u!==""?u:null;let d=s.title;r.__title=typeof d=="string"&&d!==""?d:null;let f=s.url;return r.__url=typeof f=="string"?f:"",r},afterCloneFrom:Dz}};function Mz(e,t){e.__isUnlinked=t.__isUnlinked}var kz=e=>{let t=ia(e,"format"),n=da(e,"format"),o=ua(e,"format");return{exportJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles();return{children:[],isUnlinked:r.__isUnlinked,rel:r.__rel,target:r.__target,title:r.__title,url:r.__url,direction:r.__dir,format:t[r.__format],indent:r.__indent,textFormat:s!==0&&a?s:void 0,textStyle:i!==""&&a?i:void 0,type:r.__type,version:1}},exportCompactJSON:function(r){let s=r.__textFormat,i=r.__textStyle,a=(s!==0||i!=="")&&r.shouldSerializeTextStyles(),l={type:r.__type,children:[]},c=r.__isUnlinked;c!==void 0&&c!==!1&&(l.isUnlinked=c);let u=r.__rel;u!=null&&(l.rel=u);let d=r.__target;d!=null&&(l.target=d);let f=r.__title;f!=null&&(l.title=f);let p=r.__url;p!==void 0&&p!==""&&(l.url=p);let h=r.__dir;h!=null&&(l.direction=h);let g=t[r.__format];g!==void 0&&g!==""&&(l.format=g);let y=r.__indent;return y!==void 0&&y!==0&&(l.indent=y),s!==void 0&&s!==0&&a&&(l.textFormat=s),i!==void 0&&i!==""&&a&&(l.textStyle=i),l},updateFromJSON:function(r,s){let i=s.direction;r.__dir=i===null||i==="ltr"||i==="rtl"?i:null;let a=s.format;r.__format=typeof a=="string"&&a in n?n[a]:o,r.__indent=gk(s.indent,0,0,1/0),r.__textFormat=Fx(s.textFormat,0);let l=s.textStyle;r.__textStyle=typeof l=="string"?l:"";let c=s.rel;r.__rel=typeof c=="string"&&c!==""?c:null;let u=s.target;r.__target=typeof u=="string"&&u!==""?u:null;let d=s.title;r.__title=typeof d=="string"&&d!==""?d:null;let f=s.url;r.__url=typeof f=="string"?f:"";let p=s.isUnlinked;return r.__isUnlinked=typeof p=="boolean"&&p,r},afterCloneFrom:Mz}},uk=new Set(["http:","https:","mailto:","sms:","tel:"]),Az=_c()({rel:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__rel"}),target:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__target"}),title:Rr(wf(yc(),{defaultAsNull:!0}),{field:"__title"}),url:Rr(yc(),{field:"__url",getter:"getURL",setter:"setURL"})}),Yo=class extends co{constructor(n="",o={},r){super(r);w(this,"__url");w(this,"__target");w(this,"__rel");w(this,"__title");let{target:s=null,rel:i=null,title:a=null}=o;this.__url=n,this.__target=s,this.__rel=i,this.__title=a}$config(){return this.config("link",{extends:co,generated:wz,importDOM:{a:()=>({conversion:$z,priority:1})},json:Az})}createDOM(n){let o=Ft().createElement("a");return this.updateLinkDOM(null,o,n),So(o,n.theme.link),o}updateLinkDOM(n,o,r){if(la(o)){n&&n.__url===this.__url||(o.href=this.sanitizeUrl(this.__url));for(let s of["target","rel","title"]){let i=`__${s}`,a=this[i];n&&n[i]===a||(a?o[s]=a:o.removeAttribute(s))}}}updateDOM(n,o,r){return this.updateLinkDOM(n,o,r),!1}sanitizeUrl(n){let o=n;n=Rx(n);try{let r=new URL(Rx(n));if(!uk.has(r.protocol))return"about:blank"}catch{let r=o.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(r!=null&&!uk.has(`${r[1].toLowerCase()}:`))return"about:blank"}return n}getURL(){return this.getLatest().__url}setURL(n){let o=this.getWritable();return o.__url=n,o}getTarget(){return this.getLatest().__target}setTarget(n){let o=this.getWritable();return o.__target=n,o}getRel(){return this.getLatest().__rel}setRel(n){let o=this.getWritable();return o.__rel=n,o}getTitle(){return this.getLatest().__title}setTitle(n){let o=this.getWritable();return o.__title=n,o}insertNewAfter(n,o=!0){let r=Vd(this);return this.insertAfter(r,o),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(n,o,r){if(!F(o))return!1;let s=o.anchor.getNode(),i=o.focus.getNode();return(this.is(s)||this.isParentOf(s))&&(this.is(i)||this.isParentOf(i))&&o.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith("mailto:")}isWebSiteURI(){let n=this.getURL();return n.startsWith("https://")||n.startsWith("http://")}shouldMergeAdjacentLink(n){return this.getType()===n.getType()&&this.getURL()===n.getURL()&&this.getTarget()===n.getTarget()&&this.getRel()===n.getRel()&&this.getTitle()===n.getTitle()}};function dk(e){let t=xn(e,"next");return[t,t.getFlipped()]}function fk(e,t){for(let n of t)if(n.origin.isAttached()){let o=jn(n);return void FT(e,o)}}function Iz(e){let t=z(),n=null,o=null;function r(){F(t)&&(fk(t.anchor,n),fk(t.focus,o),oa(t))}F(t)&&(n=dk(t.anchor),o=dk(t.focus));let s=!1;for(let a of Qt(e,"next")){let l=a.origin;if(W(l)&&!l.isInline()){let c=l.getChildren();if(c.length>0){let u=Vd(e);u.append(...c),l.append(u),s=!0}ta(l,Sn(a),{$shouldSplit:()=>!1})}}function i(a,l,c){let[u,d]=a,f=h=>Ho(h)&&h.origin.is(l);if(!f(u)&&!f(d))return a;let p=jn(Qt(c,"next"));return[p,p.getFlipped()]}if(e.isAttached()){let a=e.getPreviousSibling();if(Nn(a)&&a.shouldMergeAdjacentLink(e))return n&&(n=i(n,a,e)),o&&(o=i(o,a,e)),a.append(...e.getChildren()),e.remove(),void r();let l=e.getNextSibling();Nn(l)&&e.shouldMergeAdjacentLink(l)&&(n&&(n=i(n,e,l)),o&&(o=i(o,e,l)),e.append(...l.getChildren()),l.remove(),s=!0)}if(s){if(!e.canBeEmpty()&&e.isEmpty()){let a=e.getParent();e.remove(),a&&a.isEmpty()&&a.remove()}r()}}function $z(e){let t=null;if(la(e)){let n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=kc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function kc(e="",t){return Ji(new Yo(e,t))}function Nn(e){return e instanceof Yo}var Rz=_c()({isUnlinked:Rr(vf(),{field:"__isUnlinked"})}),Us=class extends Yo{constructor(n="",o={},r){super(n,o,r);w(this,"__isUnlinked");this.__isUnlinked=o.isUnlinked!==void 0&&o.isUnlinked!==null&&o.isUnlinked}$config(){return this.config("autolink",{extends:Yo,generated:kz,json:Rz})}shouldMergeAdjacentLink(n){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(n){let o=this.getWritable();return o.__isUnlinked=n,o}createDOM(n){return this.__isUnlinked?Ft().createElement("span"):super.createDOM(n)}updateDOM(n,o,r){return super.updateDOM(n,o,r)||n.__isUnlinked!==this.__isUnlinked}};function mk(e="",t){return Ji(new Us(e,t))}function Zt(e){return e instanceof Us}var up=sa("TOGGLE_LINK_COMMAND");function pk(e,t){if(e.type==="element"){let n=e.getNode();return W(n)||(function(o,...r){throw(function(s,...i){let a=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",s);for(let c of i)l.append("v",c);return a.search=l.toString(),new Error(`Minified Lexical error #${s}; visit ${a.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(o,...r)})(252),n.getChildren()[e.offset+t]||null}return null}function cp(e,t={}){let n;if(e&&typeof e=="object"){let{url:u,...d}=e;n=u,t={...d,...t}}else n=e;let{target:o,title:r}=t,s=t.rel===void 0?"noreferrer":t.rel,i=z();if(i===null||!F(i)&&!De(i))return;if(De(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(n===null){let f=Me(d,p=>!Zt(p)&&Nn(p));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=Me(d,p=>!Zt(p)&&Nn(p));if(f)f.setURL(n),o!==void 0&&f.setTarget(o),s!==void 0&&f.setRel(s),r!==void 0&&f.setTitle(r);else{let p=kc(n,{rel:s,target:o,title:r});d.insertBefore(p),p.append(d)}}})}if(i.isCollapsed()&&n===null)for(let u of i.getNodes()){let d=Me(u,f=>!Zt(f)&&Nn(f));return void(d!==null&&(d.getParentOrThrow().splice(d.getIndexWithinParent(),0,d.getChildren()),d.remove()))}let a=i.extract();if(n===null){let u=new Set;return void a.forEach(d=>{let f=Me(d,p=>!Zt(p)&&Nn(p));if(f!==null){let p=f.getKey();if(u.has(p))return;(function(h,g){let y=new Set(g.filter(D=>h.isParentOf(D)).map(D=>D.getKey())),m=h.getChildren(),_=D=>y.has(D.getKey())||W(D)&&g.some(O=>h.isParentOf(O)&&D.isParentOf(O)),x=m.filter(_);if(x.length===m.length)return m.forEach(D=>h.insertBefore(D)),void h.remove();let v=m.findIndex(_),S=m.findLastIndex(_),b=v===0,N=S===m.length-1;if(b)x.forEach(D=>h.insertBefore(D));else if(N)for(let D=x.length-1;D>=0;D--)h.insertAfter(x[D]);else{for(let O=x.length-1;O>=0;O--)h.insertAfter(x[O]);let D=m.slice(S+1);if(D.length>0){let O=Vd(h);x[x.length-1].insertAfter(O),D.forEach(T=>O.append(T))}}})(f,a),u.add(p)}})}let l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(n),o!==void 0&&u.setTarget(o),s!==void 0&&u.setRel(s),r!==void 0&&u.setTitle(r))};if(a.length===1){let u=a[0],d=Me(u,Nn);if(d!==null)return c(d)}(function(u){let d=z();if(!F(d))return u();let f=oa(d),p=f.isBackward(),h=pk(f.anchor,p?-1:0),g=pk(f.focus,p?0:-1);if(u(),h||g){let y=z();if(F(y)){let m=y.clone();if(h){let _=h.getParent();_&&m.anchor.set(_.getKey(),h.getIndexWithinParent()+(p?1:0),"element")}if(g){let _=g.getParent();_&&m.focus.set(_.getKey(),g.getIndexWithinParent()+(p?0:1),"element")}Cn(oa(m))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let f=Me(d,Nn);if(f){c(f);continue}if(W(d)){if(!d.isInline())continue;if(Nn(d)){if(!(Zt(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let h of d.getChildren())d.insertBefore(h);d.remove();continue}}let p=d.getPreviousSibling();Nn(p)&&p.is(u)?p.append(d):(u=kc(n,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var Pz=/^\+?[0-9\s()-]{5,}$/;function Rx(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Pz.test(e)?`tel:${e}`:`https://${e}`}var _k={build:(e,t)=>Qe(t),config:{created:"Link",createdMany:"%s links",destroyed:"Link removed",destroyedMany:"%s links removed",disabled:!1},dependencies:[ya],name:"@lexical/link/AutoLinkAnnounce",register(e,t,n){let{created:o,createdMany:r,destroyed:s,destroyedMany:i,disabled:a}=n.getOutput(),{announce:l}=n.getDependency(ya).output;return Ae(()=>a.value?void 0:e.registerMutationListener(Us,c=>{let u=0,d=0;for(let[,f]of c)f==="created"?u++:f==="destroyed"&&d++;u>0&&d===0?l(u===1?o.peek():r.peek().replace("%s",String(u))):d>0&&u===0&&l(d===1?s.peek():i.peek().replace("%s",String(d)))},{skipInitialization:!0}))}},yk=[{$import:(e,t)=>{if(!t.textContent&&t.children.length===0)return[];let n=t.getAttribute("href")||"",o={rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")};return tM(e.$importChildren(t),()=>kc(n,o))},match:Fr.tag("a"),name:"@lexical/link/a"}];function xk(e,t){return Se(e.registerNodeTransform(Yo,Iz),e.registerCommand(up,n=>{let o=t.validateUrl.peek(),r=t.attributes.peek();if(n===null)return cp(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n)||(cp(n,r),0));{let{url:s,...i}=n;return!(o!==void 0&&!o(s)||(cp(s,{...r,...i}),0))}},te),Ae(()=>{let n=t.validateUrl.value;if(!n)return;let o=t.attributes.value;return e.registerCommand(gf,r=>{let s=z();if(!F(s)||s.isCollapsed()||!fo(r,ClipboardEvent)||r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!n(i)&&!s.getNodes().some(a=>W(a)||H(a)&&!a.isSimpleText())&&(e.dispatchCommand(up,{...o,url:i}),r.preventDefault(),!0)},Vo)}))}var fp={build:(e,t,n)=>Qe(t),config:{attributes:void 0,validateUrl:void 0},dependencies:[ga,[Xf,{rules:yk}]],mergeConfig(e,t){let n=Bt(e,t);return e.attributes&&(n.attributes=Bt(e.attributes,n.attributes)),n},name:"@lexical/link/Link",nodes:()=>[Yo],register:(e,t,n)=>xk(e,n.getOutput())},Lz={dependencies:[fp],name:"@lexical/link/Import"};function vk(e,t,n={}){let o=r=>{let s=r.button===1;if(r.type==="auxclick"&&!s)return;let i=r.target;if(!aa(i))return;let a=KO(i);if(a===null)return;let l=null,c=null,u=!1;if(a.update(()=>{let f=Ko(i);if(f!==null){let p=Me(f,W);if(!t.disabled.peek())if(Nn(p))u=Zt(p)&&p.getIsUnlinked(),l=p.sanitizeUrl(p.getURL()),c=p.getTarget();else{let h=(function(g,y){let m=g;for(;m!=null;){if(y(m))return m;m=m.parentNode}return null})(i,la);h!==null&&(l=h.href,c=h.target)}}}),l===null||l===""||u)return;let d=e.read("latest",z);(!F(d)||d.isCollapsed())&&window.open(l,t.newTab.peek()||s||r.metaKey||r.ctrlKey||c==="_blank"?"_blank":"_self"),r.preventDefault()};return e.registerRootListener(r=>{if(r)return Mf(r,{auxclick:o,click:o},n)})}var Fz={build:(e,t,n)=>Qe(t),config:{disabled:!1,newTab:!1},dependencies:[fp],name:"@lexical/link/ClickableLink",register:(e,t,n)=>vk(e,n.getOutput())};function Sk(e,t=n=>n){return n=>{let o=e.exec(n);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:t(o[0])}}}var Bz=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,zz=e=>{let t=Bz.exec(e);if(t===null)return null;let n=t[0],o=0;for(let r of n)r==="("?o++:r===")"&&o--;for(;o<0&&n.endsWith(")");)n=n.slice(0,-1),o++;return{index:t.index,length:n.length,text:n,url:n.startsWith("http")?n:`https://${n}`}},Wz=Sk(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,e=>`mailto:${e}`);function Px(e,t){for(let n=0;n<t.length;n++){let o=t[n](e);if(o)return o}return null}var Ck=/[.,;\s]/;function dp(e,t){return t.test(e)}function bk(e,t){return dp(e[e.length-1],t)}function Lx(e,t){return dp(e[0],t)}function Ek(e,t){let n=e.getPreviousSibling();return W(n)&&(n=n.getLastDescendant()),n===null||Dr(n)||H(n)&&bk(n.getTextContent(),t)}function Nk(e,t){let n=e.getNextSibling();return W(n)&&(n=n.getFirstDescendant()),n===null||Dr(n)||H(n)&&Lx(n.getTextContent(),t)}function Kz(e,t,n,o,r){return!!(e>0?dp(o[e-1],n):Ek(r[0],n))&&(t<o.length?dp(o[t],n):Nk(r[r.length-1],n))}function Uz(e,t,n){let o=[],r=[],s=[],i=0,a=0,l=[...e];for(;l.length>0;){let c=l[0],u=c.getTextContent().length,d=a;a+u<=t?(o.push(c),i+=u):d>=n?s.push(c):r.push(c),a+=u,l.shift()}return[i,o,r,s]}function Hz(e,t,n,o){let r=mk(o.url,o.attributes);if(e.length===1){let s,i=e[0];t===0?[s,i]=i.splitText(n):[,s,i]=i.splitText(t,n);let a=Vn(o.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),r.append(a),s.replace(r),i}if(e.length>1){let s=e[0],i,a=s.getTextContent().length;t===0?i=s:[,i]=s.splitText(t);let l=[],c;for(let p=1;p<e.length;p++){let h=e[p],g=h.getTextContent().length,y=a;if(y<n)if(a+g<=n)l.push(h);else{let[m,_]=h.splitText(n-y);l.push(m),c=_}a+=g}let u=z(),d=u?u.getNodes().find(H):void 0,f=Vn(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),r.append(f,...l),d&&d===i&&(F(u)?f.select(u.anchor.offset,u.focus.offset):De(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function hk(e,t,n,o){let r=e.getChildren(),s=r.length;for(let c=0;c<s;c++){let u=r[c];if(!H(u)||!u.isSimpleText())return Mc(e),void n(null,e.getURL())}let i=e.getTextContent(),a=Px(i,t);if(a===null||a.text!==i||!Ek(e,o)||!Nk(e,o))return Mc(e),void n(null,e.getURL());let l=e.getURL();l!==a.url&&(e.setURL(a.url),n(a.url,l)),a.attributes&&(e.getRel()!==a.attributes.rel&&e.setRel(a.attributes.rel||null),e.getTarget()!==a.attributes.target&&e.setTarget(a.attributes.target||null),e.getTitle()!==a.attributes.title&&e.setTitle(a.attributes.title||null))}function Mc(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(n=>n.getLatest())}var Tk={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:Ck};function Ok(e,t=Tk){let{matchers:n,changeHandlers:o,excludeParents:r,separatorRegex:s=Ck}=t,i=(a,l)=>{for(let c of o)c(a,l)};return Se(e.registerNodeTransform(kr,a=>{let l=a.getParentOrThrow(),c=a.getPreviousSibling();if(Zt(l))hk(l,n,i,s);else if(!Nn(l)&&!r.some(u=>u(l))){if(a.isSimpleText()&&(Lx(a.getTextContent(),s)||!Zt(c))){let u=(function(d){let f=[d],p=d.getNextSibling();for(;p!==null&&H(p)&&p.isSimpleText()&&(f.push(p),!/[\s]/.test(p.getTextContent()));)p=p.getNextSibling();return f})(a);(function(d,f,p,h){for(let v of d){let S=v.getParent();if(Zt(S)&&!S.getIsUnlinked())return}let g=[...d],y=g.map(v=>v.getTextContent()).join(""),m,_=y,x=0;for(;(m=Px(_,f))&&m!==null;){let v=m.index,S=v+m.length;if(Kz(x+v,x+S,h,y,g)){let[b,,N,D]=Uz(g,x+v,x+S),O=!1;for(let A of N){let $=A.getParent();if(Zt($)&&!$.getIsUnlinked()){O=!0;break}}if(O){x+=S,_=_.substring(S);continue}let T=Hz(N,x+v-b,x+S-b,m);g=T?[T,...D]:D,p(m.url,null),x=0}else x+=S;_=_.substring(S)}})(u,n,i,s)}(function(u,d,f,p){let h=u.getParent(),g=u.getPreviousSibling(),y=u.getNextSibling(),m=u.getTextContent();if(!Zt(h)||h.getIsUnlinked()){if(Zt(g)&&!g.getIsUnlinked()&&g.is(u.getPreviousSibling())&&u.getParent()===g.getParent()){if(!Lx(m,p))return Mc(g),void f(null,g.getURL());if(_=m,g.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(_):/^\.[a-zA-Z0-9]{1,}/.test(_)){let x=g.getTextContent()+m,v=Px(x,d);v!==null&&v.text===x&&(g.append(u),hk(g,d,f,p),f(null,g.getURL()))}}var _;!Zt(y)||y.getIsUnlinked()||bk(m,p)||y.is(u.getNextSibling())&&u.getParent()===y.getParent()&&(Mc(y),f(null,y.getURL()))}})(a,n,i,s)}}),e.registerCommand(up,a=>{let l=z();return!(a!==null||!F(l))&&(l.extract().forEach(c=>{let u=c.getParent();Zt(u)&&(u.setIsUnlinked(!u.getIsUnlinked()),u.markDirty())}),!1)},Vo))}var Vz={config:Tk,dependencies:[_k,fp],mergeConfig(e,t){let n=Bt(e,t);for(let o of["matchers","changeHandlers","excludeParents"]){let r=t[o];Array.isArray(r)&&(n[o]=[...e[o],...r])}return n},name:"@lexical/link/AutoLink",nodes:[Us],register:Ok};var ot=Bx,q5=ot.$createAutoLinkNode,X5=ot.$createLinkNode,J5=ot.$isAutoLinkNode,zx=ot.$isLinkNode,Q5=ot.$toggleLink,Z5=ot.AutoLinkAnnounceExtension,e6=ot.AutoLinkExtension,t6=ot.AutoLinkNode,n6=ot.ClickableLinkExtension,o6=ot.LinkExtension,r6=ot.LinkImportExtension,s6=ot.LinkImportRules,pp=ot.LinkNode,Wx=ot.TOGGLE_LINK_COMMAND,i6=ot.autoLinkEmailMatcher,a6=ot.autoLinkUrlMatcher,l6=ot.createLinkMatcherWithRegExp,c6=ot.formatUrl,u6=ot.registerAutoLink,d6=ot.registerClickableLink,Dk=ot.registerLink;var Kx={};de(Kx,{LinkPlugin:()=>jz});function jz({validateUrl:e,attributes:t}){let[n]=Yt();return et(()=>{if(!n.hasNodes([pp]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),et(()=>Dk(n,Qe({attributes:t,validateUrl:e})),[n,e,t]),null}var Yz=Kx,wk=Yz.LinkPlugin;var Gz=e=>t=>{let n=Ue();if(e&&typeof e=="object"&&"html"in e){let o=new DOMParser().parseFromString(e.html,"text/html");n.append(...qf(t,o))}else n.append(it().append(Vn(e??"")))},qz=()=>{let e=z();if(!F(e))return null;let t=e.anchor.getNode();return zx(t)?t:zx(t.getParent())?t.getParent():null},Xz=()=>{let[e]=Yt();return et(()=>e.registerNodeTransform(kr,t=>{t.getFormat()!==0&&t.setFormat(0),t.getStyle()!==""&&t.setStyle("")}),[e]),null},Jz=()=>{let[e]=Yt(),[t,n]=Ie(null),o=()=>e.getEditorState().read(()=>n(qz()?.getURL()??"")),r=()=>{e.dispatchCommand(Wx,t||null),n(null)},s=()=>{e.dispatchCommand(Wx,null),n(null)};return t===null?E.createElement(Re,{type:"button",variant:"secondary",onClick:o},"Link"):E.createElement("div",{className:"flex flex-col gap-2"},E.createElement(on,{htmlFor:"ks-pages-link-address"},"Link address"),E.createElement(_t,{id:"ks-pages-link-address",type:"url",value:t,onChange:i=>n(i.target.value)}),E.createElement("div",{className:"flex gap-2"},E.createElement(Re,{type:"button",onClick:r},"Save link"),E.createElement(Re,{type:"button",variant:"secondary",onClick:s},"Remove link")))},Qz=({fieldKey:e,onChange:t,children:n})=>{let[o]=Yt();return E.createElement("div",{"data-rich-text-field":e,onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||o.getEditorState().read(()=>t(e,{html:Gf(o,null)}))},className:"flex flex-col gap-2"},n)};function Ux({field:e,value:t,onChange:n}){let o={namespace:`ks-pages-${e.key}`,nodes:[pp],editorState:Gz(t??e.default),onError:r=>{throw r}};return E.createElement(JO,{initialConfig:o},E.createElement(Qz,{fieldKey:e.key,onChange:n},E.createElement(XM,{contentEditable:E.createElement(ek,{id:`ks-pages-field-${e.key}`,className:"ks-input min-h-24"}),ErrorBoundary:tk}),E.createElement(ck,null),E.createElement(wk,null),E.createElement(Xz,null),E.createElement(Jz,null)))}var Zz=({field:e,value:t,onChange:n})=>{let o=t??e.default??"",r={id:`ks-pages-field-${e.key}`,defaultValue:o,onBlur:s=>s.target.value!==o&&n(e.key,s.target.value)};return e.kind==="yes_or_no"?E.createElement(Pu,{id:r.id,defaultChecked:t==="true",onChange:s=>n(e.key,String(s.target.checked))}):e.kind==="one_of"?E.createElement(yt,{id:r.id,defaultValue:t??e.default??"",onChange:s=>n(e.key,s.target.value)},e.options.map(s=>E.createElement("option",{key:s,value:s},s))):e.kind==="long_text"?E.createElement(gC,{...r,rows:4}):e.kind==="number"?E.createElement(_t,{...r,type:"number"}):e.kind==="address"?E.createElement(_t,{...r,type:"url"}):E.createElement(_t,{...r,type:"text"})},eW=["text","long_text","address","number","list","data",void 0],Ac=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&"value"in e,tW=({field:e,stored:t,valueNames:n,onChange:o,onBind:r})=>{let s=Ac(t)?t:null,i=s?s.fallback??"":t??e.default??"";return E.createElement(yt,{id:`ks-pages-value-${e.key}`,"aria-label":`${e.label} value`,value:s?.value??"",onChange:a=>a.target.value?r(e.key,a.target.value,i):o(e.key,i)},E.createElement("option",{value:""},"Typed text"),Object.entries(n).map(([a,l])=>E.createElement("option",{key:a,value:a},l)))};function Hx({element:e,definition:t,alignments:n,valueNames:o={},onChange:r,onArrange:s,onBind:i,onRemove:a}){return E.createElement("aside",{"data-element-fields":!0,className:"flex flex-col gap-3"},t.fields.map(l=>E.createElement("div",{key:`${e.id}-${l.key}`,className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:`ks-pages-field-${l.key}`},l.label),eW.includes(l.kind)&&Object.keys(o).length>0&&E.createElement(tW,{field:l,stored:e.fields[l.key],valueNames:o,onChange:r,onBind:i}),l.kind==="list"&&!Ac(e.fields[l.key])&&E.createElement(Eg,{field:l,entries:e.fields[l.key]??l.default??[],onChange:r}),l.kind==="data"&&E.createElement("p",{className:"ks-hint"},"Filled with data the host supplies on a template page"),l.kind==="rich_text"&&E.createElement(Ux,{key:JSON.stringify(e.fields[l.key]??null),field:l,value:e.fields[l.key],onChange:r}),l.kind!=="list"&&l.kind!=="data"&&l.kind!=="rich_text"&&E.createElement(Zz,{key:JSON.stringify(e.fields[l.key]??null),field:l,value:Ac(e.fields[l.key])?e.fields[l.key].fallback??"":e.fields[l.key],onChange:(c,u)=>Ac(e.fields[c])?i(c,e.fields[c].value,u):r(c,u)}),Ac(e.fields[l.key])&&E.createElement("p",{className:"ks-hint"},"Shows ",o[e.fields[l.key].value]??e.fields[l.key].value,", or this text when it has no value"))),E.createElement("div",{className:"flex flex-col gap-1"},E.createElement(on,{htmlFor:"ks-pages-element-align"},"Horizontal alignment"),E.createElement(yt,{key:`${e.id}-align`,id:"ks-pages-element-align",defaultValue:e.align??t.align??"stretch",onChange:l=>s(e.id,"align",l.target.value)},n.map(l=>E.createElement("option",{key:l,value:l},l)))),E.createElement(Re,{type:"button",variant:"danger",onClick:()=>a(e.id)},"Remove element"))}var Mk=e=>e.sections.flatMap(t=>t.rows).flatMap(t=>t.columns),hp=(e,t)=>Mk(e).flatMap(n=>n.elements).find(n=>n.id===t),gp=(e,t)=>{let n=e.sections.flatMap(o=>o.rows);return[...e.sections,...n,...Mk(e)].find(o=>o.id===t)};var nW=[{kind:"section",selector:"[data-section-id]",id:e=>e.dataset.sectionId,group:()=>"page"},{kind:"row",selector:"[data-row-id]",id:e=>e.dataset.rowId,group:e=>e.closest("[data-section-id]").dataset.sectionId},{kind:"column",selector:"[data-column-id]",id:e=>e.dataset.columnId,group:e=>e.closest("[data-row-id]").dataset.rowId}],oW=[["[data-element-id]","Element"],["[data-column-id]","Column"],["[data-row-id]","Row"],["[data-section-id]","Section"]],rW=e=>oW.map(([t,n])=>[e.closest(t),n]).filter(([t])=>t).reduce((t,n)=>!t||t[0].contains(n[0])?n:t,null),sW=[eg.configure({preventActivation:()=>!1}),Zh];function iW({name:e,publish_url:t,unpublish_url:n,elements:o,canvas:r,document:s,elements_url:i,sections_url:a,columns_url:l,rows_url:c,nodes_url:u,arrangements:d,defaults:f,shares:p,value_names:h,looks:g=[],samples:y=[],sample:m,samples_url:_,title_url:x,access_exceptions:v=[],access_exception:S,access_exception_url:b,history_url:N,live_url:D,back_url:O,undo_url:T,redo_url:A,undoable:$,redoable:I,sequence:L,token:P}){let[Y,Q]=Ie(r),[ee,Z]=Ie($),[ne,ae]=Ie(I),[xe,ue]=Ie(s),[q,le]=Ie(null),[Fe,Te]=Ie(null),[Ot,Dt]=Ie(null),[Ze,Hs]=Ie("desktop"),bo=Xo(null),lt=Xo(null),[Go,_e]=Ie(null),[Be,pt]=Ie([]),en=Xo(null),Gn=Xo(null),Wt=Xo(null),Ke=({canvas:B,document:X,undoable:V,redoable:ye})=>{Dt(null),Q(B),ue(X),V!==void 0&&Z(V),ye!==void 0&&ae(ye)},wt=({error:B})=>Dt(B),Ic=B=>{Dt(null),Te(B)},mp=B=>{Wt.current.querySelectorAll("[data-hovered]").forEach(Mt=>delete Mt.dataset.hovered);let[X,V]=rW(B.target)??[];if(!X)return;X.dataset.hovered="";let ye=V==="Element"&&hp(xe,X.dataset.elementId);X.dataset.kind=ye?o.find(Mt=>Mt.key===ye.key)?.name??V:V},_p=B=>{let X=B.target.closest("[data-element-id]");if(X)return B.preventDefault(),Te(null),le(X.dataset.elementId);let V=B.target.closest("[data-column-id]");V&&(le(null),Te({kind:"column",id:V.dataset.columnId,rowId:V.closest("[data-row-id]").dataset.rowId,sectionId:V.closest("[data-section-id]").dataset.sectionId}))},Tn=q&&hp(xe,q),On=Tn&&o.find(B=>B.key===Tn.key);po(()=>{Wt.current.innerHTML=Y},[Y]),et(()=>{let B=new w0;en.current=B;let X=[...Gn.current.querySelectorAll("[data-element-key]")].map(ye=>new cs({id:`palette-${ye.dataset.elementKey}`,element:ye,feedback:"clone",data:{key:ye.dataset.elementKey}},B)),V=()=>Wt.current.querySelectorAll("[data-drop-target]").forEach(ye=>delete ye.dataset.dropTarget);return B.monitor.addEventListener("dragover",({operation:ye})=>{V(),ye.target?.element&&(ye.target.element.dataset.dropTarget="")}),B.monitor.addEventListener("dragend",({operation:ye,canceled:Mt})=>{V();let{source:He,target:ht}=ye;if(Mt||!ht)return;if(He.data?.key)return ht.data?.columnId&&Z0(i,P,He.data.key,ht.data.columnId).then(Ke);if(He.type!=="element")return pg(u,P,He.id,He.group==="page"?null:He.group,He.index).then(Ke,wt);let Vs=He.group===He.initialGroup&&ht.data?.columnId&&ht.data.columnId!==He.group?ht.data.columnId:He.group,Ce=Vs===He.group?He.index:0;pg(u,P,He.id,Vs,Ce).then(Ke,wt)}),()=>{X.forEach(ye=>ye.destroy()),B.destroy()}},[]),et(()=>{let B=[...Wt.current.querySelectorAll("[data-column-id]")].map(V=>new xi({id:`drop-${V.dataset.columnId}`,element:V,data:{columnId:V.dataset.columnId},accept:ye=>!ye.type||ye.type==="element"},en.current)),X=[...Wt.current.querySelectorAll("[data-element-id]")].map(V=>{let ye=V.closest("[data-column-id]"),Mt=[...ye.children].indexOf(V);return new bi({id:V.dataset.elementId,element:V,index:Mt,group:ye.dataset.columnId,type:"element",accept:"element",sensors:sW},en.current)});return()=>[...B,...X].forEach(V=>V.destroy())},[Y]);let ba=B=>[["section","[data-section-id]","sectionId","Section"],["row","[data-row-id]","rowId","Row"],["column","[data-column-id]","columnId","Column"],["element","[data-element-id]","elementId",null]].flatMap(([X,V,ye,Mt])=>{let He=B.closest(V);if(!He)return[];let ht=X==="element"&&hp(xe,He.dataset[ye]);return[{kind:X,id:He.dataset[ye],label:Mt??o.find(Vs=>Vs.key===ht?.key)?.name??"Element"}]}),Br=({kind:B,id:X})=>{if(Dt(null),B==="element")return Te(null),le(X);let V=Wt.current.querySelector(`[data-${B}-id="${X}"]`);le(null),Te({kind:B,id:X,rowId:V.closest("[data-row-id]")?.dataset.rowId,sectionId:V.closest("[data-section-id]")?.dataset.sectionId})};et(()=>{let B=Be[Be.length-2],X=V=>{V.key!=="Escape"||!B||V.target.closest("input, textarea, select")||Br(B)};return window.document.addEventListener("keydown",X),()=>window.document.removeEventListener("keydown",X)},[Be]);let ln=q??Fe?.id;et(()=>{Wt.current.querySelectorAll("[data-selected]").forEach(ye=>delete ye.dataset.selected);let B=ln&&Wt.current.querySelector(`[data-element-id="${ln}"], [data-column-id="${ln}"], [data-row-id="${ln}"], [data-section-id="${ln}"]`);if(!B)return pt([]),_e(null);B.dataset.selected="",pt(ba(B));let X=bo.current.getBoundingClientRect(),V=B.getBoundingClientRect();_e({top:V.top-X.top,left:V.left-X.left})},[Y,ln,Ze]),et(()=>{let B=window.document.createElement("span"),X=nW.flatMap(({kind:V,selector:ye,id:Mt,group:He})=>[...Wt.current.querySelectorAll(ye)].map(ht=>new bi({id:Mt(ht),element:ht,index:[...ht.parentElement.children].indexOf(ht),group:He(ht),type:V,accept:V,handle:ln===Mt(ht)?lt.current:B},en.current)));return()=>X.forEach(V=>V.destroy())},[Y,ln]);let $c=B=>{let X=B.kind==="column"&&gp(xe,B.rowId),V=X?{wide:p[X.columns.length]??"1/1"}:{};return{...f[B.kind],...V,...gp(xe,B.id)}},Ea=()=>Iu(u,P,ln).then(B=>{Ke(B),Te(null),le(null)},wt);return E.createElement("div",{"data-builder":!0,className:"fixed inset-0 flex flex-col bg-(--ks-color-surface) text-(--ks-color-text) dark:bg-(--ks-color-surface-dark) dark:text-(--ks-color-text-dark)"},E.createElement("header",{"data-builder-top-bar":!0,className:"flex h-14 shrink-0 items-center justify-between gap-4 border-b border-(--ks-color-border) dark:border-(--ks-color-border-dark) px-4"},E.createElement("div",{className:"flex min-w-0 items-center gap-2"},E.createElement("a",{href:O,className:"text-sm hover:underline"},"Back"),E.createElement("h1",{className:"truncate text-base font-semibold"},e)),E.createElement("div",{className:"flex items-center gap-4 max-lg:hidden"},E.createElement(mg,{chosen:Ze,onChoose:Hs}),E.createElement(Cg,null),E.createElement(bg,{looks:g}),E.createElement(yg,{samples:y,chosen:m,onChoose:B=>aC(_,P,B).then(Ke,wt)}),E.createElement(vg,{exceptions:v,chosen:S,onChoose:B=>lC(b,P,B).then(Ke,wt)})),E.createElement("div",{className:"flex items-center gap-2"},E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:!ee,title:ee?"Undo the last change":"Nothing to undo",onClick:()=>hg(T,P).then(Ke,wt)},"\u21B6 Undo"),E.createElement(Re,{type:"button",size:"sm",variant:"secondary",disabled:!ne,title:ne?"Redo the change you undid":"Nothing to redo",onClick:()=>hg(A,P).then(Ke,wt)},"\u21B7 Redo"),D&&E.createElement("a",{href:D,className:"text-sm whitespace-nowrap hover:underline"},"View live"),E.createElement("a",{href:N,className:"text-sm hover:underline"},"History"),n&&E.createElement("form",{method:"post",action:n},E.createElement("input",{type:"hidden",name:"authenticity_token",value:P}),E.createElement(Re,{type:"submit",size:"sm",variant:"secondary"},"Unpublish")),E.createElement("form",{method:"post",action:t},E.createElement("input",{type:"hidden",name:"authenticity_token",value:P}),E.createElement(Re,{type:"submit",size:"sm"},"Publish")))),E.createElement("div",{className:"relative flex min-h-0 flex-1"},L&&E.createElement(Ru,{sequence:L}),E.createElement(fC,{ref:Gn,elements:o},E.createElement(Re,{type:"button",variant:"secondary",onClick:()=>nC(a,P).then(Ke)},"Add section")),E.createElement("main",{"data-page-frame":!0,className:"min-w-0 flex-1 overflow-auto bg-surface-200 p-8 dark:bg-surface-900"},E.createElement("div",{ref:bo,"data-page-sheet":!0,"data-theme":gl.find(B=>B.key===Ze).theme,style:{width:gl.find(B=>B.key===Ze).width,colorScheme:gl.find(B=>B.key===Ze).theme},className:"relative mx-auto min-h-full max-w-full bg-[Canvas] shadow-lg ring-1 ring-black/5"},E.createElement("div",{ref:Wt,"data-page-canvas":!0,className:"@container min-h-full px-6 [&_[data-hidden]]:opacity-40 bg-(--ks-color-page) text-(--ks-color-on-page) dark:bg-(--ks-color-page-dark) dark:text-(--ks-color-on-page-dark) [&_[data-selected]]:relative [&_[data-selected]]:outline-2 [&_[data-selected]]:outline-(--ks-color-accent) [&_[data-hovered]]:relative [&_[data-hovered]]:outline-1 [&_[data-hovered]]:outline-(--ks-color-accent) [&_[data-hovered]]:before:absolute [&_[data-hovered]]:before:-top-5 [&_[data-hovered]]:before:left-0 [&_[data-hovered]]:before:z-10 [&_[data-hovered]]:before:rounded-t [&_[data-hovered]]:before:bg-(--ks-color-accent) [&_[data-hovered]]:before:px-1.5 [&_[data-hovered]]:before:text-xs [&_[data-hovered]]:before:leading-5 [&_[data-hovered]]:before:text-white [&_[data-hovered]]:before:content-[attr(data-kind)] [&_[data-column-id]:empty]:min-h-16 [&_[data-column-id]:empty]:items-center [&_[data-column-id]:empty]:justify-center [&_[data-column-id]:empty]:rounded-md [&_[data-column-id]:empty]:border-2 [&_[data-column-id]:empty]:border-dashed [&_[data-column-id]:empty]:border-(--ks-color-border-strong) [&_[data-column-id]:empty]:after:text-sm [&_[data-column-id]:empty]:after:text-(--ks-color-icon) [&_[data-column-id]:empty]:after:content-['Drop_an_element_here'] [&_[data-drop-target]]:outline-2 [&_[data-drop-target]]:outline-dashed [&_[data-drop-target]]:outline-(--ks-color-accent)",onClick:_p,onMouseOver:mp,onMouseLeave:()=>Wt.current.querySelectorAll("[data-hovered]").forEach(B=>delete B.dataset.hovered)}),E.createElement(uC,{ref:lt,place:Go,onRemove:Ea,onDuplicate:()=>sC(u,P,ln).then(Ke,wt)}))),E.createElement("aside",{"data-settings-panel":!0,className:"w-72 shrink-0 overflow-y-auto border-l border-(--ks-color-border) bg-(--ks-color-surface) p-4 dark:border-(--ks-color-border-dark) dark:bg-(--ks-color-surface-dark)"},E.createElement(_g,{path:Be,onChoose:Br}),!Fe&&!On&&E.createElement("p",{className:"ks-hint"},"Select something on the page to change it."),!Fe&&!On&&E.createElement(xg,{key:xe.title??"",title:xe.title,onChange:B=>eC(x,P,B).then(Ke,wt)}),Fe&&E.createElement(gg,{node:Fe,values:$c(Fe),arrangements:d,onArrange:(B,X,V)=>fg(u,P,B,X,V).then(Ke,wt),refusal:Ot,onSelect:Ic,onRemove:B=>Iu(u,P,B).then(X=>{Ke(X),Te(null)},wt),onAddColumn:B=>oC(l,P,B).then(Ke),onAddRow:B=>rC(c,P,B).then(Ke)}),On&&E.createElement(Hx,{element:Tn,definition:On,alignments:d.element.align,onRemove:B=>Iu(u,P,B).then(X=>{Ke(X),le(null)}),onArrange:(B,X,V)=>fg(u,P,B,X,V).then(Ke),valueNames:h,onBind:(B,X,V)=>iC(i,P,Tn.id,B,X,V).then(Ke,wt),onChange:(B,X)=>tC(i,P,Tn.id,B,X).then(Ke)}),(Tn||Fe&&Fe.kind!=="column")&&E.createElement(Sg,{key:Tn?.id??Fe.id,condition:(Tn??gp(xe,Fe.id))?.show_when,valueNames:h,onChange:(B,X)=>cC(u,P,Tn?.id??Fe.id,B,X).then(Ke,wt)}))))}function aW({sequence:e,back_url:t}){return E.createElement("div",{"data-builder":!0,className:"fixed inset-0 flex flex-col bg-(--ks-color-surface) text-(--ks-color-text) dark:bg-(--ks-color-surface-dark) dark:text-(--ks-color-text-dark)"},E.createElement("header",{"data-builder-top-bar":!0,className:"flex h-14 shrink-0 items-center gap-2 border-b border-(--ks-color-border) dark:border-(--ks-color-border-dark) px-4"},E.createElement("a",{href:t,className:"text-sm hover:underline"},"Back"),E.createElement("h1",{className:"truncate text-base font-semibold"},e.title)),E.createElement("div",{className:"relative flex min-h-0 flex-1"},E.createElement(Ru,{sequence:e}),E.createElement("main",{"data-page-frame":!0,className:"flex min-w-0 flex-1 items-center justify-center bg-surface-200 p-8 dark:bg-surface-900"},E.createElement("p",{className:"ks-hint"},"No page has been added yet."))))}function Vx(e){return e.document?E.createElement(iW,{...e}):E.createElement(aW,{...e})}rv("keystone_ui_pages/editor",Vx);av(document,Xx);})();