keystone_ui-pages 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/app/assets/builds/keystone_ui_pages/editor.js +35 -22
- data/app/controllers/keystone_ui/pages/manage/elements_controller.rb +4 -1
- data/app/controllers/keystone_ui/pages/manage/titles_controller.rb +15 -0
- data/app/helpers/keystone_ui/pages/drawing_helper.rb +30 -2
- data/app/helpers/keystone_ui/pages/editor_helper.rb +1 -0
- data/app/javascript/keystone_ui_pages/ElementFields.jsx +4 -1
- data/app/javascript/keystone_ui_pages/LayoutPanel.jsx +1 -1
- data/app/javascript/keystone_ui_pages/PageEditor.jsx +4 -2
- data/app/javascript/keystone_ui_pages/PageTitle.jsx +16 -0
- data/app/javascript/keystone_ui_pages/RichTextField.jsx +100 -0
- data/app/javascript/keystone_ui_pages/operations.js +2 -0
- data/app/models/keystone_ui/pages/version.rb +4 -0
- data/app/views/keystone_ui/pages/pages/show.html.erb +1 -0
- data/config/routes.rb +1 -0
- data/lib/keystone_ui/pages/keystone_elements.rb +3 -3
- data/lib/keystone_ui/pages/operations.rb +6 -2
- data/lib/keystone_ui/pages/version.rb +1 -1
- data/the_local/agents/keystone_ui-pages-develop.md +23 -0
- metadata +4 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
(()=>{var pd=globalThis.ReactDOM;var{createPortal:yh,createRoot:Ko,flushSync:bh,hydrateRoot:_h,preconnect:wh,prefetchDNS:xh,preinit:kh,preinitModule:Sh,preload:Eh,preloadModule:Oh,requestFormReset:Ph,unstable_batchedUpdates:Ch,useFormState:Mh,useFormStatus:Ih,version:Dh}=pd;var Go=globalThis.React,f=Go,{Children:Th,Component:Nh,Fragment:Wh,PureComponent:Lh,StrictMode:$h,Suspense:zh,cloneElement:Fh,createContext:Vh,createElement:jh,createRef:Bh,forwardRef:Ar,isValidElement:Rh,lazy:Hh,memo:qh,startTransition:Uh,useCallback:Xh,useContext:Yh,useDebugValue:Kh,useDeferredValue:Gh,useEffect:qe,useId:Jh,useImperativeHandle:Zh,useLayoutEffect:Jo,useMemo:Qh,useReducer:tp,useRef:Ue,useState:ot,useSyncExternalStore:ep,useTransition:np}=Go;var Zo=new Map,Tr=new Map,Qo=(t,e)=>Zo.set(t,e),ta=()=>{Tr.forEach(t=>t.unmount()),Tr.clear()},ea=(t,e)=>t.querySelectorAll("[data-react-ui]").forEach(n=>{if(Tr.has(n))return;let r=Zo.get(n.dataset.reactUi),i=e(n);Tr.set(n,i),i.render(f.createElement(r,JSON.parse(n.dataset.props)))});var na=(t,e)=>{let n=()=>ea(t,e);t.addEventListener("turbo:load",n),t.addEventListener("turbo:frame-load",n),t.addEventListener("turbo:before-cache",ta),t.readyState==="loading"?t.addEventListener("DOMContentLoaded",n):n()};var gd=Symbol.for("preact-signals");function $r(){if(Kt>1)Kt--;else{var t,e=!1;for((function(){var i=Wr;for(Wr=void 0;i!==void 0;){var s=i.S;if(s.v===i.v)for(var a=s.t;a!==void 0;a=a.x)a.i===i.i&&(a.i=s.i);i=i.o}})();Nn!==void 0;){var n=Nn;for(Nn=void 0,Nr++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ia(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(Nr=0,Kt--,e)throw t}}function z(t){if(Kt>0)return t();Vi=++vd,Kt++;try{return t()}finally{$r()}}var Tn,B=void 0;function I(t){var e=B,n=Tn;B=void 0,Tn=void 0;try{return t()}finally{B=e,Tn=n}}var Nn=void 0,Kt=0,Nr=0,vd=0,Vi=0,Wr=void 0,Lr=0;function ra(t){if(B!==void 0){var e=t.n;if(e===void 0||e.t!==B)return e={i:0,S:t,p:B.s,n:void 0,t:B,e:void 0,x:void 0,r:e},B.s!==void 0&&(B.s.n=e),B.s=e,t.n=e,32&B.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=B.s,e.n=void 0,B.s.n=e,B.s=e),e}}function at(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}at.prototype.brand=gd;at.prototype.h=function(){return!0};at.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:I(function(){var r;(r=e.W)==null||r.call(e)}))};at.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,r=t.x;n!==void 0&&(n.x=r,t.e=void 0),r!==void 0&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&I(function(){var i;(i=e.Z)==null||i.call(e)}))}};at.prototype.subscribe=function(t){var e=this;return lt(function(){var n=e.value;I(function(){return t(n)})},{name:"sub"})};at.prototype.valueOf=function(){return this.value};at.prototype.toString=function(){return this.value+""};at.prototype.toJSON=function(){return this.value};at.prototype.peek=function(){var t=this;return I(function(){return t.value})};Object.defineProperty(at.prototype,"value",{get:function(){var t=ra(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Nr>100)throw new Error("Cycle detected");(function(n){Kt!==0&&Nr===0&&n.l!==Vi&&(n.l=Vi,Wr={S:n,v:n.v,i:n.i,o:Wr})})(this),this.v=t,this.i++,Lr++,Kt++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{$r()}}}});function Bt(t,e){return new at(t,e)}function ia(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function sa(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function oa(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function ve(t,e){at.call(this,void 0,e),this.x=t,this.s=void 0,this.g=Lr-1,this.f=4}ve.prototype=new at;ve.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Lr))return!0;if(this.g=Lr,this.f|=1,this.i>0&&!ia(this))return this.f&=-2,!0;var t=B;try{sa(this),B=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return B=t,oa(this),this.f&=-2,!0};ve.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}at.prototype.S.call(this,t)};ve.prototype.U=function(t){if(this.t!==void 0&&(at.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};ve.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(ve.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ra(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function ji(t,e){return new ve(t,e)}function aa(t){var e=t.m;if(t.m=void 0,typeof e=="function"){Kt++;var n=B;B=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,Bi(t),r}finally{B=n,$r()}}}function Bi(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,aa(t)}function md(t){if(B!==this)throw new Error("Out-of-order effect");oa(this),B=t,this.f&=-2,8&this.f&&Bi(this),$r()}function Xe(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name,Tn&&Tn.push(this)}Xe.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}};Xe.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,aa(this),sa(this),Kt++;var t=B;return B=this,md.bind(this,t)};Xe.prototype.N=function(){2&this.f||(this.f|=2,this.u=Nn,Nn=this)};Xe.prototype.d=function(){this.f|=8,1&this.f||Bi(this)};Xe.prototype.dispose=function(){this.d()};function lt(t,e){var n=new Xe(t,e);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var yd=Object.create,Qi=Object.defineProperty,bd=Object.defineProperties,_d=Object.getOwnPropertyDescriptor,wd=Object.getOwnPropertyDescriptors,la=Object.getOwnPropertySymbols,xd=Object.prototype.hasOwnProperty,kd=Object.prototype.propertyIsEnumerable,da=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ye=t=>{throw TypeError(t)},Xi=(t,e,n)=>e in t?Qi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Sd=(t,e)=>{for(var n in e||(e={}))xd.call(e,n)&&Xi(t,n,e[n]);if(la)for(var n of la(e))kd.call(e,n)&&Xi(t,n,e[n]);return t},Ed=(t,e)=>bd(t,wd(e)),ca=(t,e)=>Qi(t,"name",{value:e,configurable:!0}),Od=t=>{var e;return[,,,yd((e=t?.[da("metadata")])!=null?e:null)]},ua=["class","method","getter","setter","accessor","field","value","get","set"],Wn=t=>t!==void 0&&typeof t!="function"?Ye("Function expected"):t,Pd=(t,e,n,r,i)=>({kind:ua[t],name:e,metadata:r,addInitializer:s=>n._?Ye("Already initialized"):i.push(Wn(s||null))}),fa=(t,e)=>Xi(e,da("metadata"),t[3]),me=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Ke=(t,e,n,r,i,s)=>{var a,o,l,d,u,c=e&7,g=!!(e&8),p=!!(e&16),b=c>3?t.length+1:c?g?1:2:0,_=ua[c+5],k=c>3&&(t[b-1]=[]),x=t[b]||(t[b]=[]),h=c&&(!p&&!g&&(i=i.prototype),c<5&&(c>3||!p)&&_d(c<4?i:{get[n](){return Mt(this,s)},set[n](v){return ie(this,s,v)}},n));c?p&&c<4&&ca(s,(c>2?"set ":c>1?"get ":"")+n):ca(i,n);for(var m=r.length-1;m>=0;m--)d=Pd(c,n,l={},t[3],x),c&&(d.static=g,d.private=p,u=d.access={has:p?v=>Cd(i,v):v=>n in v},c^3&&(u.get=p?v=>(c^1?Mt:Md)(v,i,c^4?s:h.get):v=>v[n]),c>2&&(u.set=p?(v,y)=>ie(v,i,y,c^4?s:h.set):(v,y)=>v[n]=y)),o=(0,r[m])(c?c<4?p?s:h[_]:c>4?void 0:{get:h.get,set:h.set}:i,d),l._=1,c^4||o===void 0?Wn(o)&&(c>4?k.unshift(o):c?p?s=o:h[_]=o:i=o):typeof o!="object"||o===null?Ye("Object expected"):(Wn(a=o.get)&&(h.get=a),Wn(a=o.set)&&(h.set=a),Wn(a=o.init)&&k.unshift(a));return c||fa(t,i),h&&Qi(i,n,h),p?c^4?s:h:i},ts=(t,e,n)=>e.has(t)||Ye("Cannot "+n),Cd=(t,e)=>Object(e)!==e?Ye('Cannot use the "in" operator on this value'):t.has(e),Mt=(t,e,n)=>(ts(t,e,"read from private field"),n?n.call(t):e.get(t)),Ln=(t,e,n)=>e.has(t)?Ye("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ie=(t,e,n,r)=>(ts(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Md=(t,e,n)=>(ts(t,e,"access private method"),n);function Fr(t,e){if(e){let n;return ji(()=>{let r=t();return r&&n&&e(n,r)?n:(n=r,r)})}return ji(t)}function zr(t,e){if(Object.is(t,e))return!0;if(t===null||e===null)return!1;if(typeof t=="function"&&typeof e=="function")return t===e;if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}if(Array.isArray(t))return!Array.isArray(e)||t.length!==e.length?!1:!t.some((r,i)=>!zr(r,e[i]));if(typeof t=="object"&&typeof e=="object"){let n=Object.keys(t),r=Object.keys(e);return n.length!==r.length?!1:!n.some(s=>!zr(t[s],e[s]))}return!1}function D({get:t},e){return{init(n){return Bt(n)},get(){return t.call(this).value},set(n){let r=t.call(this);r.peek()!==n&&(r.value=n)}}}function q(t,e){let n=new WeakMap;return function(){let r=n.get(this);return r||(r=Fr(t.bind(this)),n.set(this,r)),r.value}}function Ri(t=!0){return function(e,n){n.addInitializer(function(){let r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,Ed(Sd({},i),{enumerable:t}))})}}function be(...t){let e=t.map(n=>lt(n));return()=>e.forEach(n=>n())}var ha,pa,ga,va,ma,ya,ft,es,Hi,Yi,Ki,ct,ns,qi,ba,Gi,rs,Ui,Ji,Zi;ya=[D],ma=[D],va=[D],ga=[Ri()],pa=[Ri()],ha=[Ri()];var se=class{constructor(t,e=Object.is){this.defaultValue=t,this.equals=e,me(ft,5,this),Ln(this,ct),Ln(this,es,me(ft,8,this)),me(ft,11,this),Ln(this,ns,me(ft,12,this)),me(ft,15,this),Ln(this,rs,me(ft,16,this)),me(ft,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Mt(this,ct,Ji)}get initial(){return Mt(this,ct,Yi)}get previous(){return Mt(this,ct,ba)}set current(t){let e=I(()=>Mt(this,ct,Ji));t&&e&&this.equals(e,t)||z(()=>{Mt(this,ct,Yi)||ie(this,ct,t,Ki),ie(this,ct,e,Gi),ie(this,ct,t,Zi)})}reset(t=this.defaultValue){z(()=>{ie(this,ct,void 0,Gi),ie(this,ct,t,Ki),ie(this,ct,t,Zi)})}};ft=Od(null);es=new WeakMap;ct=new WeakSet;ns=new WeakMap;rs=new WeakMap;Hi=Ke(ft,20,"#initial",ya,ct,es),Yi=Hi.get,Ki=Hi.set;qi=Ke(ft,20,"#previous",ma,ct,ns),ba=qi.get,Gi=qi.set;Ui=Ke(ft,20,"#current",va,ct,rs),Ji=Ui.get,Zi=Ui.set;Ke(ft,2,"current",ga,se);Ke(ft,2,"initial",pa,se);Ke(ft,2,"previous",ha,se);fa(ft,se);function Vr(t){return I(()=>{let e={};for(let n in t)e[n]=t[n];return e})}var ye,_a=class{constructor(){Ln(this,ye,new WeakMap)}get(t,e){var n;return t?(n=Mt(this,ye).get(t))==null?void 0:n.get(e):void 0}set(t,e,n){var r;if(t)return Mt(this,ye).has(t)||Mt(this,ye).set(t,new Map),(r=Mt(this,ye).get(t))==null?void 0:r.set(e,n)}clear(t){var e;return t?(e=Mt(this,ye).get(t))==null?void 0:e.clear():void 0}};ye=new WeakMap;var Id=Object.create,cs=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,wa=Object.getOwnPropertySymbols,Ad=Object.prototype.hasOwnProperty,Td=Object.prototype.propertyIsEnumerable,Sa=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ge=t=>{throw TypeError(t)},xa=Math.pow,is=(t,e,n)=>e in t?cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nd=(t,e)=>{for(var n in e||(e={}))Ad.call(e,n)&&is(t,n,e[n]);if(wa)for(var n of wa(e))Td.call(e,n)&&is(t,n,e[n]);return t},ka=(t,e)=>cs(t,"name",{value:e,configurable:!0}),Wd=t=>{var e;return[,,,Id((e=t?.[Sa("metadata")])!=null?e:null)]},Ea=["class","method","getter","setter","accessor","field","value","get","set"],$n=t=>t!==void 0&&typeof t!="function"?Ge("Function expected"):t,Ld=(t,e,n,r,i)=>({kind:Ea[t],name:e,metadata:r,addInitializer:s=>n._?Ge("Already initialized"):i.push($n(s||null))}),Oa=(t,e)=>is(e,Sa("metadata"),t[3]),$d=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Pa=(t,e,n,r,i,s)=>{var a,o,l,d,u,c=e&7,g=!!(e&8),p=!!(e&16),b=c>3?t.length+1:c?g?1:2:0,_=Ea[c+5],k=c>3&&(t[b-1]=[]),x=t[b]||(t[b]=[]),h=c&&(!p&&!g&&(i=i.prototype),c<5&&(c>3||!p)&&Dd(c<4?i:{get[n](){return ss(this,s)},set[n](v){return os(this,s,v)}},n));c?p&&c<4&&ka(s,(c>2?"set ":c>1?"get ":"")+n):ka(i,n);for(var m=r.length-1;m>=0;m--)d=Ld(c,n,l={},t[3],x),c&&(d.static=g,d.private=p,u=d.access={has:p?v=>zd(i,v):v=>n in v},c^3&&(u.get=p?v=>(c^1?ss:Vd)(v,i,c^4?s:h.get):v=>v[n]),c>2&&(u.set=p?(v,y)=>os(v,i,y,c^4?s:h.set):(v,y)=>v[n]=y)),o=(0,r[m])(c?c<4?p?s:h[_]:c>4?void 0:{get:h.get,set:h.set}:i,d),l._=1,c^4||o===void 0?$n(o)&&(c>4?k.unshift(o):c?p?s=o:h[_]=o:i=o):typeof o!="object"||o===null?Ge("Object expected"):($n(a=o.get)&&(h.get=a),$n(a=o.set)&&(h.set=a),$n(a=o.init)&&k.unshift(a));return c||Oa(t,i),h&&cs(i,n,h),p?c^4?s:h:i},ds=(t,e,n)=>e.has(t)||Ge("Cannot "+n),zd=(t,e)=>Object(e)!==e?Ge('Cannot use the "in" operator on this value'):t.has(e),ss=(t,e,n)=>(ds(t,e,"read from private field"),n?n.call(t):e.get(t)),Fd=(t,e,n)=>e.has(t)?Ge("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),os=(t,e,n,r)=>(ds(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Vd=(t,e,n)=>(ds(t,e,"access private method"),n),dt=class as{constructor(e,n){this.x=e,this.y=n}static delta(e,n){return new as(e.x-n.x,e.y-n.y)}static distance(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}static equals(e,n){return e.x===n.x&&e.y===n.y}static from({x:e,y:n}){return new as(e,n)}},bt=class _e{constructor(e,n,r,i){this.left=e,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(e,n){let{top:r,left:i,width:s,height:a,scale:o}=this,l=new _e(i+e,r+n,s,a);return l.scale=Nd({},o),l}get boundingRectangle(){let{width:e,height:n,left:r,top:i,right:s,bottom:a}=this;return{width:e,height:n,left:r,top:i,right:s,bottom:a}}get center(){let{left:e,top:n,right:r,bottom:i}=this;return new dt((e+r)/2,(n+i)/2)}get area(){let{width:e,height:n}=this;return e*n}equals(e){if(!(e instanceof _e))return!1;let{left:n,top:r,width:i,height:s}=this;return n===e.left&&r===e.top&&i===e.width&&s===e.height}containsPoint(e){let{top:n,left:r,bottom:i,right:s}=this;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=s}intersectionArea(e){return e instanceof _e?jd(this,e):0}intersectionRatio(e){let{area:n}=this,r=this.intersectionArea(e);return r/(e.area+n-r)}get bottom(){let{top:e,height:n}=this;return e+n}get right(){let{left:e,width:n}=this;return e+n}get aspectRatio(){let{width:e,height:n}=this;return e/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:e,left:n,width:r,height:i}){return new _e(n,e,r,i)}static delta(e,n,r={x:"center",y:"center"}){let i=(s,a)=>{let o=r[a],l=a==="x"?s.left:s.top,d=a==="x"?s.width:s.height;return o=="start"?l:o=="end"?l+d:l+d/2};return dt.delta({x:i(e,"x"),y:i(e,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(e,n){return _e.from(e).intersectionRatio(_e.from(n))}};function jd(t,e){let n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-r,o=s-n;return r<i&&n<s?a*o:0}var Ca,Ma,ls,jr,zn,Fn=class extends(ls=se,Ma=[q],Ca=[q],ls){constructor(t){let e=dt.from(t);super(e,(n,r)=>dt.equals(n,r)),$d(zn,5,this),Fd(this,jr,0),this.velocity={x:0,y:0}}get delta(){return dt.delta(this.current,this.initial)}get direction(){let{current:t,previous:e}=this;if(!e)return null;let n={x:t.x-e.x,y:t.y-e.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(t){let{current:e}=this,n=dt.from(t),r={x:n.x-e.x,y:n.y-e.y},i=Date.now(),s=i-ss(this,jr),a=o=>Math.round(o/s*100);z(()=>{os(this,jr,i),this.velocity={x:a(r.x),y:a(r.y)},super.current=n})}reset(t=this.defaultValue){super.reset(dt.from(t)),this.velocity={x:0,y:0}}};zn=Wd(ls);jr=new WeakMap;Pa(zn,2,"delta",Ma,Fn);Pa(zn,2,"direction",Ca,Fn);Oa(zn,Fn);function Br({x:t,y:e},n){let r=Math.abs(t),i=Math.abs(e);return typeof n=="number"?Math.sqrt(xa(r,2)+xa(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var Ia=(t=>(t.Horizontal="x",t.Vertical="y",t))(Ia||{}),us=Object.values(Ia);var Bd=Object.create,vs=Object.defineProperty,Rd=Object.defineProperties,Hd=Object.getOwnPropertyDescriptor,qd=Object.getOwnPropertyDescriptors,Kr=Object.getOwnPropertySymbols,Na=Object.prototype.hasOwnProperty,Wa=Object.prototype.propertyIsEnumerable,La=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),nn=t=>{throw TypeError(t)},hs=(t,e,n)=>e in t?vs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ms=(t,e)=>{for(var n in e||(e={}))Na.call(e,n)&&hs(t,n,e[n]);if(Kr)for(var n of Kr(e))Wa.call(e,n)&&hs(t,n,e[n]);return t},ys=(t,e)=>Rd(t,qd(e)),Da=(t,e)=>vs(t,"name",{value:e,configurable:!0}),$a=(t,e)=>{var n={};for(var r in t)Na.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Kr)for(var r of Kr(t))e.indexOf(r)<0&&Wa.call(t,r)&&(n[r]=t[r]);return n},rn=t=>{var e;return[,,,Bd((e=t?.[La("metadata")])!=null?e:null)]},za=["class","method","getter","setter","accessor","field","value","get","set"],Vn=t=>t!==void 0&&typeof t!="function"?nn("Function expected"):t,Ud=(t,e,n,r,i)=>({kind:za[t],name:e,metadata:r,addInitializer:s=>n._?nn("Already initialized"):i.push(Vn(s||null))}),ke=(t,e)=>hs(e,La("metadata"),t[3]),C=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},T=(t,e,n,r,i,s)=>{var a,o,l,d,u,c=e&7,g=!!(e&8),p=!!(e&16),b=c>3?t.length+1:c?g?1:2:0,_=za[c+5],k=c>3&&(t[b-1]=[]),x=t[b]||(t[b]=[]),h=c&&(!p&&!g&&(i=i.prototype),c<5&&(c>3||!p)&&Hd(c<4?i:{get[n](){return X(this,s)},set[n](v){return St(this,s,v)}},n));c?p&&c<4&&Da(s,(c>2?"set ":c>1?"get ":"")+n):Da(i,n);for(var m=r.length-1;m>=0;m--)d=Ud(c,n,l={},t[3],x),c&&(d.static=g,d.private=p,u=d.access={has:p?v=>Xd(i,v):v=>n in v},c^3&&(u.get=p?v=>(c^1?X:Fa)(v,i,c^4?s:h.get):v=>v[n]),c>2&&(u.set=p?(v,y)=>St(v,i,y,c^4?s:h.set):(v,y)=>v[n]=y)),o=(0,r[m])(c?c<4?p?s:h[_]:c>4?void 0:{get:h.get,set:h.set}:i,d),l._=1,c^4||o===void 0?Vn(o)&&(c>4?k.unshift(o):c?p?s=o:h[_]=o:i=o):typeof o!="object"||o===null?nn("Object expected"):(Vn(a=o.get)&&(h.get=a),Vn(a=o.set)&&(h.set=a),Vn(a=o.init)&&k.unshift(a));return c||ke(t,i),h&&vs(i,n,h),p?c^4?s:h:i},bs=(t,e,n)=>e.has(t)||nn("Cannot "+n),Xd=(t,e)=>Object(e)!==e?nn('Cannot use the "in" operator on this value'):t.has(e),X=(t,e,n)=>(bs(t,e,"read from private field"),n?n.call(t):e.get(t)),L=(t,e,n)=>e.has(t)?nn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),St=(t,e,n,r)=>(bs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Fa=(t,e,n)=>(bs(t,e,"access private method"),n);function Va(t,e){return{plugin:t,options:e}}function sn(t){return e=>Va(t,e)}function en(t){return typeof t=="function"?{plugin:t,options:void 0}:t}var ja,Rn,_s,Hr;ja=[D];var tt=class{constructor(t,e){this.manager=t,this.options=e,L(this,_s,C(Rn,8,this,!1)),C(Rn,11,this),L(this,Hr,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return I(()=>this.disabled)}configure(t){this.options=t}registerEffect(t){let e=lt(t.bind(this));return X(this,Hr).add(e),e}destroy(){X(this,Hr).forEach(t=>t())}static configure(t){return Va(this,t)}};Rn=rn(null);_s=new WeakMap;Hr=new WeakMap;T(Rn,4,"disabled",ja,tt,_s);ke(Rn,tt);var on=class extends tt{},qr,fs=class{constructor(t){this.manager=t,this.instances=new Map,L(this,qr,[])}get values(){return Array.from(this.instances.values())}set values(t){let e=t.map(en).reduce((r,i)=>{let s=r.find(({plugin:a})=>a===i.plugin);return s?(s.options=i.options,r):[...r,i]},[]),n=e.map(({plugin:r})=>r);for(let r of X(this,qr))if(!n.includes(r)){if(r.prototype instanceof on)continue;this.unregister(r)}for(let{plugin:r,options:i}of e)this.register(r,i);St(this,qr,n)}get(t){return this.instances.get(t)}register(t,e){let n=this.instances.get(t);if(n)return n.options!==e&&(n.options=e),n;let r=new t(this.manager,e);return this.instances.set(t,r),r}unregister(t){let e=this.instances.get(t);e&&(e.destroy(),this.instances.delete(t))}destroy(){for(let t of this.instances.values())t.destroy();this.instances.clear()}};qr=new WeakMap;function Yd(t,e){return t.priority===e.priority?t.type===e.type?e.value-t.value:e.type-t.type:e.priority-t.priority}var Rr=[],Je,Ze,Kd=class extends tt{constructor(t){super(t),L(this,Je),L(this,Ze),this.computeCollisions=this.computeCollisions.bind(this),St(this,Ze,Bt(Rr)),this.destroy=be(()=>{let e=this.computeCollisions(),n=I(()=>this.manager.dragOperation.position.current);if(e!==Rr){let r=X(this,Je);if(St(this,Je,n),r&&n.x==r.x&&n.y==r.y)return}else St(this,Je,void 0);X(this,Ze).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(t=!0){I(()=>{t?X(this,Ze).value=this.computeCollisions():St(this,Je,void 0)})}computeCollisions(t,e){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:s,status:a}=r;if(!a.initialized||!s)return Rr;let o=[],l=[];for(let d of t??n.droppables){if(d.disabled||i&&!d.accepts(i))continue;let u=e??d.collisionDetector;if(!u)continue;l.push(d),d.shape;let c=I(()=>u({droppable:d,dragOperation:r}));c&&(d.collisionPriority!=null&&(c.priority=d.collisionPriority),o.push(c))}return l.length===0?Rr:(o.sort(Yd),o)}get collisions(){return X(this,Ze).value}};Je=new WeakMap;Ze=new WeakMap;var Ba,Ra,Ha,ws,qa,Lt,xs,tn,ks,Ss;Ha=[D],Ra=[D],Ba=[D];var Gt=class we{constructor(e,n){L(this,xs,C(Lt,8,this)),C(Lt,11,this),L(this,tn),L(this,ks,C(Lt,12,this)),C(Lt,15,this),L(this,Ss,C(Lt,16,this)),C(Lt,19,this);let{effects:r,id:i,data:s={},disabled:a=!1,register:o=!0}=e,l=i;St(this,tn,Bt(i)),this.manager=n,this.data=s,this.disabled=a,this.effects=()=>{var d;return[()=>{let{id:u,manager:c}=this;if(u!==l)return l=u,c?.registry.register(this),()=>c?.registry.unregister(this)},...(d=r?.())!=null?d:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),n&&o&&queueMicrotask(this.register)}get id(){var e,n;let r=X(this,tn).value;return(n=(e=we.pendingIdChanges)==null?void 0:e.get(this))!=null?n:r}set id(e){var n,r;let i=(r=(n=we.pendingIdChanges)==null?void 0:n.get(this))!=null?r:X(this,tn).peek();e!==i&&(we.pendingIdChanges||(we.pendingIdChanges=new Map,queueMicrotask(()=>{var s;return Fa(s=we,ws,qa).call(s)})),we.pendingIdChanges.set(this,e))}register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};Lt=rn(null);ws=new WeakSet;qa=function(){let t=Gt.pendingIdChanges;Gt.pendingIdChanges=null,t&&z(()=>{for(let[e,n]of t)X(e,tn).value=n})};xs=new WeakMap;tn=new WeakMap;ks=new WeakMap;Ss=new WeakMap;T(Lt,4,"manager",Ha,Gt,xs);T(Lt,4,"data",Ra,Gt,ks);T(Lt,4,"disabled",Ba,Gt,Ss);L(Gt,ws);ke(Lt,Gt);Gt.pendingIdChanges=null;var Gr=Gt,Aa=class{constructor(){this.map=Bt(new Map),this.cleanupFunctions=new WeakMap,this.register=(t,e)=>{let n=this.map.peek(),r=n.get(t),i=()=>this.unregister(t,e);if(r===e)return i;if(r&&r.id===t){let o=this.cleanupFunctions.get(r);o?.(),this.cleanupFunctions.delete(r)}let s=new Map(n);for(let[o,l]of n)if(l===e&&o!==t){s.delete(o);break}s.set(t,e),this.map.value=s;let a=be(...e.effects());return this.cleanupFunctions.set(e,a),i},this.unregister=(t,e)=>{let n=this.map.peek();if(n.get(t)!==e)return;let r=this.cleanupFunctions.get(e);r?.(),this.cleanupFunctions.delete(e);let i=new Map(n);i.delete(t),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(t){return this.map.value.has(t)}get(t){return this.map.value.get(t)}destroy(){for(let t of this){let e=this.cleanupFunctions.get(t);e?.(),t.destroy()}this.map.value=new Map}},Ua,Xa,Ya,Ka,Ga,Ja,ps,ht,Es,Os,Ps,$t=class extends(ps=Gr,Ja=[D],Ga=[D],Ka=[D],Ya=[q],Xa=[q],Ua=[q],ps){constructor(t,e){var n=t,{modifiers:r,type:i,sensors:s,plugins:a,effects:o}=n,l=$a(n,["modifiers","type","sensors","plugins","effects"]);super(ys(ms({},l),{effects:()=>{var d;return[...(d=o?.())!=null?d:[],()=>{let{manager:u,plugins:c}=this;if(!(!u||!c))for(let g of c){let{plugin:p}=en(g);u.registry.plugins.register(p)}}]}}),e),C(ht,5,this),L(this,Es,C(ht,8,this)),C(ht,11,this),L(this,Os,C(ht,12,this)),C(ht,15,this),L(this,Ps,C(ht,16,this,this.isDragSource?"dragging":"idle")),C(ht,19,this),this.type=i,this.sensors=s,this.modifiers=r,this.alignment=l.alignment,this.plugins=a}pluginConfig(t){if(this.plugins)for(let e of this.plugins){let n=en(e);if(n.plugin===t)return n.options}}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,e;return((e=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:e.id)===this.id}};ht=rn(ps);Es=new WeakMap;Os=new WeakMap;Ps=new WeakMap;T(ht,4,"type",Ja,$t,Es);T(ht,4,"modifiers",Ga,$t,Os);T(ht,4,"status",Ka,$t,Ps);T(ht,2,"isDropping",Ya,$t);T(ht,2,"isDragging",Xa,$t);T(ht,2,"isDragSource",Ua,$t);ke(ht,$t);var Za,Qa,tl,el,nl,rl,gs,J,Cs,Ms,Is,Ds,As,zt=class extends(gs=Gr,rl=[D],nl=[D],el=[D],tl=[D],Qa=[D],Za=[q],gs){constructor(t,e){var n=t,{accept:r,collisionDetector:i,collisionPriority:s,type:a}=n,o=$a(n,["accept","collisionDetector","collisionPriority","type"]);super(o,e),C(J,5,this),L(this,Cs,C(J,8,this)),C(J,11,this),L(this,Ms,C(J,12,this)),C(J,15,this),L(this,Is,C(J,16,this)),C(J,19,this),L(this,Ds,C(J,20,this)),C(J,23,this),L(this,As,C(J,24,this)),C(J,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=s,this.type=a}accepts(t){let{accept:e}=this;return e?typeof e=="function"?e(t):t.type?Array.isArray(e)?e.includes(t.type):t.type===e:!1:!0}get isDropTarget(){var t,e;return((e=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:e.id)===this.id}};J=rn(gs);Cs=new WeakMap;Ms=new WeakMap;Is=new WeakMap;Ds=new WeakMap;As=new WeakMap;T(J,4,"accept",rl,zt,Cs);T(J,4,"type",nl,zt,Ms);T(J,4,"collisionDetector",el,zt,Is);T(J,4,"collisionPriority",tl,zt,Ds);T(J,4,"shape",Qa,zt,As);T(J,2,"isDropTarget",Za,zt);ke(J,zt);var Gd=class{constructor(){this.registry=new Map}addEventListener(t,e){let{registry:n}=this,r=new Set(n.get(t));return r.add(e),n.set(t,r),()=>this.removeEventListener(t,e)}removeEventListener(t,e){let{registry:n}=this,r=new Set(n.get(t));r.delete(e),n.set(t,r)}dispatch(t,...e){let{registry:n}=this,r=n.get(t);if(r)for(let i of r)i(...e)}},Jd=class extends Gd{constructor(t){super(),this.manager=t}dispatch(t,e){let n=[e,this.manager];super.dispatch(t,...n)}};function Ur(t,e=!0){let n=!1;return ys(ms({},t),{cancelable:e,get defaultPrevented(){return n},preventDefault(){e&&(n=!0)}})}var Zd=class extends on{constructor(t){super(t);let e=(r,i)=>r.map(({id:s})=>s).join("")===i.map(({id:s})=>s).join(""),n=[];this.destroy=be(()=>{let{dragOperation:r,collisionObserver:i}=t;r.status.initializing&&(n=[],i.enable())},()=>{let{collisionObserver:r,monitor:i}=t,{collisions:s}=r;if(r.isDisabled()||Gr.pendingIdChanges)return;let a=Ur({collisions:s});if(i.dispatch("collision",a),a.defaultPrevented||e(s,n))return;n=s;let[o]=s;I(()=>{var l;o?.id!==((l=t.dragOperation.target)==null?void 0:l.id)&&(r.disable(),t.actions.setDropTarget(o?.id).then(()=>{r.enable()}))})})}},Se=(t=>(t[t.Lowest=0]="Lowest",t[t.Low=1]="Low",t[t.Normal=2]="Normal",t[t.High=3]="High",t[t.Highest=4]="Highest",t))(Se||{}),Ee=(t=>(t[t.Collision=0]="Collision",t[t.ShapeIntersection=1]="ShapeIntersection",t[t.PointerIntersection=2]="PointerIntersection",t))(Ee||{}),il,sl,ol,al,ll,cl,dl,It,Ts;dl=[D],cl=[q],ll=[q],al=[q],ol=[q],sl=[q],il=[q];var Jt=class{constructor(){C(It,5,this),L(this,Ts,C(It,8,this,"idle")),C(It,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){let{value:t}=this;return t!=="idle"&&t!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(t){this.value=t}};It=rn(null);Ts=new WeakMap;T(It,4,"value",dl,Jt,Ts);T(It,2,"current",cl,Jt);T(It,2,"idle",ll,Jt);T(It,2,"initializing",al,Jt);T(It,2,"initialized",ol,Jt);T(It,2,"dragging",sl,Jt);T(It,2,"dropped",il,Jt);ke(It,Jt);var Qd=class{constructor(t){this.manager=t}setDragSource(t){let{dragOperation:e}=this.manager;e.sourceIdentifier=typeof t=="string"||typeof t=="number"?t:t.id}setDropTarget(t){return I(()=>{let{dragOperation:e}=this.manager,n=t??null;if(e.targetIdentifier===n)return Promise.resolve(!1);e.targetIdentifier=n;let r=Ur({operation:e.snapshot()});return e.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(t){return I(()=>{let{dragOperation:e}=this.manager;if(t.source!=null&&this.setDragSource(t.source),!e.source)throw new Error("Cannot start a drag operation without a drag source");if(!e.status.idle)throw new Error("Cannot start a drag operation while another is active");let r=new AbortController,{event:i,coordinates:s}=t;z(()=>{e.status.set("initialization-pending"),e.shape=null,e.canceled=!1,e.activatorEvent=i??null,e.position.reset(s)});let a=Ur({operation:e.snapshot()});return this.manager.monitor.dispatch("beforedragstart",a),a.defaultPrevented?(e.reset(),r.abort(),r):(e.status.set("initializing"),e.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;let{status:o}=e;o.current==="initializing"&&z(()=>{e.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:e.snapshot(),cancelable:!1})})}),r)})}move(t){return I(()=>{var e,n;let{dragOperation:r}=this.manager,{status:i,controller:s}=r;if(!i.dragging||!s||s.signal.aborted)return;let a=Ur({nativeEvent:t.event,operation:r.snapshot(),by:t.by,to:t.to},(e=t.cancelable)!=null?e:!0);((n=t.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var o,l,d,u,c;if(a.defaultPrevented)return;let g=(c=t.to)!=null?c:{x:r.position.current.x+((l=(o=t.by)==null?void 0:o.x)!=null?l:0),y:r.position.current.y+((u=(d=t.by)==null?void 0:d.y)!=null?u:0)};r.position.current=g})})}stop(t={}){return I(()=>{var e,n;let{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let s,a=()=>{let l={resume:()=>{},abort:()=>{}};return s=new Promise((d,u)=>{l.resume=d,l.abort=u}),l};i.abort();let o=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");let l=I(()=>{var u;return((u=r.source)==null?void 0:u.status)==="dropping"}),d=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(l){let{source:u}=r,c=lt(()=>{u?.status==="idle"&&(c(),d())})}else this.manager.renderer.rendering.then(d)})};r.canceled=(e=t.canceled)!=null?e:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:t.event,operation:r.snapshot(),canceled:(n=t.canceled)!=null?n:!1,suspend:a}),s?s.then(o).catch(()=>r.reset()):o()})}},xe=class extends tt{constructor(t,e){super(t,e),this.manager=t,this.options=e}},ul=class extends AbortController{constructor(t,e){super(),this.constraints=t,this.onActivate=e,this.activated=!1;for(let n of t??[])n.controller=this}onEvent(t){var e;if(!this.activated)if((e=this.constraints)!=null&&e.length)for(let n of this.constraints)n.onEvent(t);else this.activate(t)}activate(t){this.activated||(this.activated=!0,this.onActivate(t))}abort(t){this.activated=!1,super.abort(t)}},Xr,Ns=class{constructor(t){this.options=t,L(this,Xr)}set controller(t){St(this,Xr,t),t.signal.addEventListener("abort",()=>this.abort())}activate(t){var e;(e=X(this,Xr))==null||e.activate(t)}};Xr=new WeakMap;var Ta=class extends tt{constructor(t,e){super(t,e),this.manager=t,this.options=e}apply(t){return t.transform}},tu=class{constructor(t){this.draggables=new Aa,this.droppables=new Aa,this.plugins=new fs(t),this.sensors=new fs(t),this.modifiers=new fs(t)}register(t,e){if(t instanceof $t)return this.draggables.register(t.id,t);if(t instanceof zt)return this.droppables.register(t.id,t);if(t.prototype instanceof Ta)return this.modifiers.register(t,e);if(t.prototype instanceof xe)return this.sensors.register(t,e);if(t.prototype instanceof tt)return this.plugins.register(t,e);throw new Error("Invalid instance type")}unregister(t){if(t instanceof Gr)return t instanceof $t?this.draggables.unregister(t.id,t):t instanceof zt?this.droppables.unregister(t.id,t):()=>{};if(t.prototype instanceof Ta)return this.modifiers.unregister(t);if(t.prototype instanceof xe)return this.sensors.unregister(t);if(t.prototype instanceof tt)return this.plugins.unregister(t);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},fl,hl,pl,gl,vl,ml,yl,bl,_l,jn,Yr,Qe,U,Ws,Ls,$s,zs,Fs,Bn;_l=[q],bl=[D],yl=[D],ml=[D],vl=[D],gl=[D],pl=[q],hl=[q],fl=[q];var Ft=class{constructor(t){C(U,5,this),L(this,jn),L(this,Yr),L(this,Qe,new se(void 0,(e,n)=>e&&n?e.equals(n):e===n)),this.status=new Jt,L(this,Ws,C(U,8,this,!1)),C(U,11,this),L(this,Ls,C(U,12,this,null)),C(U,15,this),L(this,$s,C(U,16,this,null)),C(U,19,this),L(this,zs,C(U,20,this,null)),C(U,23,this),L(this,Fs,C(U,24,this,[])),C(U,27,this),this.position=new Fn({x:0,y:0}),L(this,Bn,{x:0,y:0}),St(this,jn,t)}get shape(){let{current:t,initial:e,previous:n}=X(this,Qe);return!t||!e?null:{current:t,initial:e,previous:n}}set shape(t){t?X(this,Qe).current=t:X(this,Qe).reset()}get source(){var t;let e=this.sourceIdentifier;if(e==null)return null;let n=X(this,jn).registry.draggables.get(e);return n&&St(this,Yr,n),(t=n??X(this,Yr))!=null?t:null}get target(){var t;let e=this.targetIdentifier;return e!=null&&(t=X(this,jn).registry.droppables.get(e))!=null?t:null}get transform(){let{x:t,y:e}=this.position.delta,n={x:t,y:e};for(let r of this.modifiers)n=r.apply(ys(ms({},this.snapshot()),{transform:n}));return St(this,Bn,n),n}snapshot(){return I(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:X(this,Bn),shape:this.shape?Vr(this.shape):null,position:Vr(this.position),status:Vr(this.status),canceled:this.canceled}))}reset(){z(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,X(this,Qe).reset(),this.position.reset({x:0,y:0}),St(this,Bn,{x:0,y:0}),this.modifiers=[]})}};U=rn(null);jn=new WeakMap;Yr=new WeakMap;Qe=new WeakMap;Ws=new WeakMap;Ls=new WeakMap;$s=new WeakMap;zs=new WeakMap;Fs=new WeakMap;Bn=new WeakMap;T(U,2,"shape",_l,Ft);T(U,4,"canceled",bl,Ft,Ws);T(U,4,"activatorEvent",yl,Ft,Ls);T(U,4,"sourceIdentifier",ml,Ft,$s);T(U,4,"targetIdentifier",vl,Ft,zs);T(U,4,"modifiers",gl,Ft,Fs);T(U,2,"source",pl,Ft);T(U,2,"target",hl,Ft);T(U,2,"transform",fl,Ft);ke(U,Ft);var eu={get rendering(){return Promise.resolve()}};function Rt(t,e){return typeof t=="function"?t(e):t??e}var wl=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(c=>c.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var e;let n=t??{},r=Rt(n.plugins,[]),i=Rt(n.sensors,[]),s=Rt(n.modifiers,[]),a=(e=n.renderer)!=null?e:eu,o=new Jd(this),l=new tu(this);this.registry=l,this.monitor=o,this.renderer=a,this.actions=new Qd(this),this.dragOperation=new Ft(this),this.collisionObserver=new Kd(this),this.plugins=[Zd,...r],this.modifiers=s,this.sensors=i;let{destroy:d}=this,u=be(()=>{var c,g,p;let b=I(()=>this.dragOperation.modifiers),_=this.modifiers;for(let k of b)_.includes(k)||k.destroy();this.dragOperation.modifiers=(p=(g=(c=this.dragOperation.source)==null?void 0:c.modifiers)==null?void 0:g.map(k=>{let{plugin:x,options:h}=en(k);return new x(this,h)}))!=null?p:_});this.destroy=()=>{u(),d()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}};var Cl=t=>{throw TypeError(t)},Bs=(t,e,n)=>e.has(t)||Cl("Cannot "+n),M=(t,e,n)=>(Bs(t,e,"read from private field"),e.get(t)),_t=(t,e,n)=>e.has(t)?Cl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Et=(t,e,n,r)=>(Bs(t,e,"write to private field"),e.set(t,n),n),Ml=(t,e,n)=>(Bs(t,e,"access private method"),n);function si(t){return t?t instanceof KeyframeEffect?!0:"getKeyframes"in t&&typeof t.getKeyframes=="function":!1}function Rs(t,e){let n=t.getAnimations(),r=null;for(let i of n){if(i.playState!=="running")continue;let{effect:s}=i,o=(si(s)?s.getKeyframes():[]).filter(e);o.length>0&&(r=[o[o.length-1],i])}return r}function oi(t){let{width:e,height:n,top:r,left:i,bottom:s,right:a}=t.getBoundingClientRect();return{width:e,height:n,top:r,left:i,bottom:s,right:a}}function Hs(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Gn(t){return"nodeType"in t}function pt(t){var e,n,r;return t?Hs(t)?t:Gn(t)?"defaultView"in t?(e=t.defaultView)!=null?e:window:(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function ai(t){let{Document:e}=pt(t);return t instanceof e||"nodeType"in t&&t.nodeType===Node.DOCUMENT_NODE}function Zt(t){return!t||Hs(t)?!1:t instanceof pt(t).HTMLElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("html")}function Il(t){return t instanceof pt(t).SVGElement||"namespaceURI"in t&&typeof t.namespaceURI=="string"&&t.namespaceURI.endsWith("svg")}function Me(t){return t?Hs(t)?t.document:Gn(t)?ai(t)?t:Zt(t)||Il(t)?t.ownerDocument:document:document:document}function nu(t){var e,n,r,i;let{documentElement:s}=Me(t),a=pt(t).visualViewport,o=(e=a?.width)!=null?e:s.clientWidth,l=(n=a?.height)!=null?n:s.clientHeight,d=(r=a?.offsetTop)!=null?r:0,u=(i=a?.offsetLeft)!=null?i:0;return{top:d,left:u,right:u+o,bottom:d+l,width:o,height:l}}function ru(t,e){if(iu(t)&&t.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(t);return n==="visible"&&r==="visible"&&i==="visible"}function iu(t){return t.tagName==="DETAILS"}function ln(t,e=t.getBoundingClientRect(),n=0){var r,i,s,a,o;let l=e,{ownerDocument:d}=t,u=(r=d.defaultView)!=null?r:window,c=t.parentElement;for(;c&&c!==d.documentElement;){if(!ru(c)){let m=c.getBoundingClientRect(),v=n*(m.bottom-m.top),y=n*(m.right-m.left),O=n*(m.bottom-m.top),P=n*(m.right-m.left);l={top:Math.max(l.top,m.top-v),right:Math.min(l.right,m.right+y),bottom:Math.min(l.bottom,m.bottom+O),left:Math.max(l.left,m.left-P),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}c=c.parentElement}let g=u.visualViewport,p=(i=g?.offsetTop)!=null?i:0,b=(s=g?.offsetLeft)!=null?s:0,_=(a=g?.width)!=null?a:u.innerWidth,k=(o=g?.height)!=null?o:u.innerHeight,x=n*k,h=n*_;return l={top:Math.max(l.top,p-x),right:Math.min(l.right,b+_+h),bottom:Math.min(l.bottom,p+k+x),left:Math.max(l.left,b-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 Ie(t){return{x:t.clientX,y:t.clientY}}var Dl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ei(t=document,e=new Set){if(e.has(t))return[];e.add(t);let n=[t];for(let r of Array.from(t.querySelectorAll("iframe, frame")))try{let i=r.contentDocument;i&&!e.has(i)&&n.push(...ei(i,e))}catch{}try{let r=t.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==t&&n.push(...ei(i.document,e))}}catch{}return n}function li(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function qs(){var t,e;let n=li()?window.visualViewport:null;return{x:(t=n?.offsetLeft)!=null?t:0,y:(e=n?.offsetTop)!=null?e:0}}function ci(t){return!t||!Gn(t)?!1:t instanceof pt(t).ShadowRoot}function Jn(t){if(t&&Gn(t)){let e=t.getRootNode();if(ci(e))return e;if(e instanceof Document)return e}return Me(t)}function Zn(t){return t.matchMedia("(prefers-reduced-motion: reduce)").matches}function Al(t){let e="input, textarea, select, canvas, [contenteditable]",n=t.cloneNode(!0),r=Array.from(t.querySelectorAll(e));return Array.from(n.querySelectorAll(e)).forEach((s,a)=>{let o=r[a];if(xl(s)&&xl(o)&&(s.type!=="file"&&(s.value=o.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),kl(s)&&kl(o)&&o.width>0&&o.height>0){let l=s.getContext("2d");l?.drawImage(o,0,0)}}),n}function xl(t){return"value"in t}function kl(t){return t.tagName==="CANVAS"}function Us(t,{x:e,y:n}){let r=t.elementFromPoint(e,n);if(su(r)){let{contentDocument:i}=r;if(i){let{left:s,top:a}=r.getBoundingClientRect();return Us(i,{x:e-s,y:n-a})}}return r}function su(t){return t?.tagName==="IFRAME"}var Qn=new WeakMap;function Tl(t){return t.closest(`
|
|
1
|
+
(()=>{var jx=Object.defineProperty;var wk=(e,t,n)=>t in e?jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t)=>{for(var n in t)jx(e,n,{get:t[n],enumerable:!0})};var M=(e,t,n)=>wk(e,typeof t!="symbol"?t+"":t,n);var kk=globalThis.ReactDOM;var{createPortal:Yx,createRoot:Gx,flushSync:rW,hydrateRoot:sW,preconnect:iW,prefetchDNS:aW,preinit:lW,preinitModule:cW,preload:uW,preloadModule:dW,requestFormReset:fW,unstable_batchedUpdates:pW,useFormState:hW,useFormStatus:gW,version:mW}=kk;var qx=globalThis.React,N=qx,{Children:yW,Component:Xx,Fragment:xW,PureComponent:vW,StrictMode:SW,Suspense:Jx,cloneElement:CW,createContext:Qx,createElement:bW,createRef:EW,forwardRef:Wr,isValidElement:NW,lazy:TW,memo:OW,startTransition:DW,useCallback:Zx,useContext:ev,useDebugValue:MW,useDeferredValue:wW,useEffect:Ze,useId:kW,useImperativeHandle:AW,useLayoutEffect:co,useMemo:Tn,useReducer:IW,useRef:qo,useState:ke,useSyncExternalStore:yp,useTransition:$W}=qx;var tv=new Map,Rc=new Map,nv=(e,t)=>tv.set(e,t),ov=()=>{Rc.forEach(e=>e.unmount()),Rc.clear()},rv=(e,t)=>e.querySelectorAll("[data-react-ui]").forEach(n=>{if(Rc.has(n))return;let o=tv.get(n.dataset.reactUi),r=t(n);Rc.set(n,r),r.render(N.createElement(o,JSON.parse(n.dataset.props)))});var sv=(e,t)=>{let n=()=>rv(e,t);e.addEventListener("turbo:load",n),e.addEventListener("turbo:frame-load",n),e.addEventListener("turbo:before-cache",ov),e.readyState==="loading"?e.addEventListener("DOMContentLoaded",n):n()};var Ak=Symbol.for("preact-signals");function Bc(){if(Eo>1)Eo--;else{var e,t=!1;for((function(){var r=Lc;for(Lc=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}})();Ta!==void 0;){var n=Ta;for(Ta=void 0,Pc++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&av(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=o}}if(Pc=0,Eo--,t)throw e}}function Ee(e){if(Eo>0)return e();xp=++Ik,Eo++;try{return e()}finally{Bc()}}var Na,Fe=void 0;function ce(e){var t=Fe,n=Na;Fe=void 0,Na=void 0;try{return e()}finally{Fe=t,Na=n}}var Ta=void 0,Eo=0,Pc=0,Ik=0,xp=0,Lc=void 0,Fc=0;function iv(e){if(Fe!==void 0){var t=e.n;if(t===void 0||t.t!==Fe)return t={i:0,S:e,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:t},Fe.s!==void 0&&(Fe.s.n=t),Fe.s=t,e.n=t,32&Fe.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=Fe.s,t.n=void 0,Fe.s.n=t,Fe.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=Ak;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:ce(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&&ce(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;ce(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 ce(function(){return e.value})};Object.defineProperty(kt.prototype,"value",{get:function(){var e=iv(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Pc>100)throw new Error("Cycle detected");(function(n){Eo!==0&&Pc===0&&n.l!==xp&&(n.l=xp,Lc={S:n,v:n.v,i:n.i,o:Lc})})(this),this.v=e,this.i++,Fc++,Eo++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Bc()}}}});function On(e,t){return new kt(e,t)}function av(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 lv(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 cv(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 Kr(e,t){kt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Fc-1,this.f=4}Kr.prototype=new kt;Kr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Fc))return!0;if(this.g=Fc,this.f|=1,this.i>0&&!av(this))return this.f&=-2,!0;var e=Fe;try{lv(this),Fe=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 Fe=e,cv(this),this.f&=-2,!0};Kr.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)};Kr.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)}};Kr.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(Kr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=iv(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Oa(e,t){return new Kr(e,t)}function uv(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Eo++;var n=Fe;Fe=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,vp(e),o}finally{Fe=n,Bc()}}}function vp(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,uv(e)}function $k(e){if(Fe!==this)throw new Error("Out-of-order effect");cv(this),Fe=e,this.f&=-2,8&this.f&&vp(this),Bc()}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,Na&&Na.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,uv(this),lv(this),Eo++;var e=Fe;return Fe=this,$k.bind(this,e)};Ys.prototype.N=function(){2&this.f||(this.f|=2,this.u=Ta,Ta=this)};Ys.prototype.d=function(){this.f|=8,1&this.f||vp(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 Rk=Object.create,kp=Object.defineProperty,Pk=Object.defineProperties,Lk=Object.getOwnPropertyDescriptor,Fk=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertySymbols,Bk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,pv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Gs=e=>{throw TypeError(e)},Np=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wk=(e,t)=>{for(var n in t||(t={}))Bk.call(t,n)&&Np(e,n,t[n]);if(dv)for(var n of dv(t))zk.call(t,n)&&Np(e,n,t[n]);return e},Kk=(e,t)=>Pk(e,Fk(t)),fv=(e,t)=>kp(e,"name",{value:t,configurable:!0}),Uk=e=>{var t;return[,,,Rk((t=e?.[pv("metadata")])!=null?t:null)]},hv=["class","method","getter","setter","accessor","field","value","get","set"],Da=e=>e!==void 0&&typeof e!="function"?Gs("Function expected"):e,Hk=(e,t,n,o,r)=>({kind:hv[e],name:t,metadata:o,addInitializer:s=>n._?Gs("Already initialized"):r.push(Da(s||null))}),gv=(e,t)=>Np(t,pv("metadata"),e[3]),Ur=(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=hv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&Lk(d<4?r:{get[n](){return Dn(this,s)},set[n](v){return Xo(this,s,v)}},n));d?p&&d<4&&fv(s,(d>2?"set ":d>1?"get ":"")+n):fv(r,n);for(var x=o.length-1;x>=0;x--)c=Hk(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>Vk(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Dn:jk)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Xo(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?Da(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Gs("Object expected"):(Da(i=a.get)&&(_.get=i),Da(i=a.set)&&(_.set=i),Da(i=a.init)&&y.unshift(i));return d||gv(e,r),_&&kp(r,n,_),p?d^4?s:_:r},Ap=(e,t,n)=>t.has(e)||Gs("Cannot "+n),Vk=(e,t)=>Object(t)!==t?Gs('Cannot use the "in" operator on this value'):e.has(t),Dn=(e,t,n)=>(Ap(e,t,"read from private field"),n?n.call(e):t.get(e)),Ma=(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),Xo=(e,t,n,o)=>(Ap(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),jk=(e,t,n)=>(Ap(e,t,"access private method"),n);function Wc(e,t){if(t){let n;return Oa(()=>{let o=e();return o&&n&&t(n,o)?n:(n=o,o)})}return Oa(e)}function zc(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)=>!zc(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=>!zc(e[s],t[s]))}return!1}function pe({get:e},t){return{init(n){return On(n)},get(){return e.call(this).value},set(n){let o=e.call(this);o.peek()!==n&&(o.value=n)}}}function He(e,t){let n=new WeakMap;return function(){let o=n.get(this);return o||(o=Wc(e.bind(this)),n.set(this,o)),o.value}}function Sp(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,Kk(Wk({},r),{enumerable:e}))})}}function Vr(...e){let t=e.map(n=>gt(n));return()=>t.forEach(n=>n())}var mv,_v,yv,xv,vv,Sv,Kt,Ip,Cp,Tp,Op,At,$p,bp,Cv,Dp,Rp,Ep,Mp,wp;Sv=[pe],vv=[pe],xv=[pe],yv=[Sp()],_v=[Sp()],mv=[Sp()];var Jo=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ur(Kt,5,this),Ma(this,At),Ma(this,Ip,Ur(Kt,8,this)),Ur(Kt,11,this),Ma(this,$p,Ur(Kt,12,this)),Ur(Kt,15,this),Ma(this,Rp,Ur(Kt,16,this)),Ur(Kt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Dn(this,At,Mp)}get initial(){return Dn(this,At,Tp)}get previous(){return Dn(this,At,Cv)}set current(e){let t=ce(()=>Dn(this,At,Mp));e&&t&&this.equals(t,e)||Ee(()=>{Dn(this,At,Tp)||Xo(this,At,e,Op),Xo(this,At,t,Dp),Xo(this,At,e,wp)})}reset(e=this.defaultValue){Ee(()=>{Xo(this,At,void 0,Dp),Xo(this,At,e,Op),Xo(this,At,e,wp)})}};Kt=Uk(null);Ip=new WeakMap;At=new WeakSet;$p=new WeakMap;Rp=new WeakMap;Cp=qs(Kt,20,"#initial",Sv,At,Ip),Tp=Cp.get,Op=Cp.set;bp=qs(Kt,20,"#previous",vv,At,$p),Cv=bp.get,Dp=bp.set;Ep=qs(Kt,20,"#current",xv,At,Rp),Mp=Ep.get,wp=Ep.set;qs(Kt,2,"current",yv,Jo);qs(Kt,2,"initial",_v,Jo);qs(Kt,2,"previous",mv,Jo);gv(Kt,Jo);function Kc(e){return ce(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var Hr,bv=class{constructor(){Ma(this,Hr,new WeakMap)}get(e,t){var n;return e?(n=Dn(this,Hr).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var o;if(e)return Dn(this,Hr).has(e)||Dn(this,Hr).set(e,new Map),(o=Dn(this,Hr).get(e))==null?void 0:o.set(t,n)}clear(e){var t;return e?(t=Dn(this,Hr).get(e))==null?void 0:t.clear():void 0}};Hr=new WeakMap;var Yk=Object.create,Wp=Object.defineProperty,Gk=Object.getOwnPropertyDescriptor,Ev=Object.getOwnPropertySymbols,qk=Object.prototype.hasOwnProperty,Xk=Object.prototype.propertyIsEnumerable,Ov=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Xs=e=>{throw TypeError(e)},Nv=Math.pow,Pp=(e,t,n)=>t in e?Wp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jk=(e,t)=>{for(var n in t||(t={}))qk.call(t,n)&&Pp(e,n,t[n]);if(Ev)for(var n of Ev(t))Xk.call(t,n)&&Pp(e,n,t[n]);return e},Tv=(e,t)=>Wp(e,"name",{value:t,configurable:!0}),Qk=e=>{var t;return[,,,Yk((t=e?.[Ov("metadata")])!=null?t:null)]},Dv=["class","method","getter","setter","accessor","field","value","get","set"],wa=e=>e!==void 0&&typeof e!="function"?Xs("Function expected"):e,Zk=(e,t,n,o,r)=>({kind:Dv[e],name:t,metadata:o,addInitializer:s=>n._?Xs("Already initialized"):r.push(wa(s||null))}),Mv=(e,t)=>Pp(t,Ov("metadata"),e[3]),eA=(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},wv=(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=Dv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&Gk(d<4?r:{get[n](){return Lp(this,s)},set[n](v){return Fp(this,s,v)}},n));d?p&&d<4&&Tv(s,(d>2?"set ":d>1?"get ":"")+n):Tv(r,n);for(var x=o.length-1;x>=0;x--)c=Zk(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>tA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Lp:oA)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>Fp(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?wa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?Xs("Object expected"):(wa(i=a.get)&&(_.get=i),wa(i=a.set)&&(_.set=i),wa(i=a.init)&&y.unshift(i));return d||Mv(e,r),_&&Wp(r,n,_),p?d^4?s:_:r},Kp=(e,t,n)=>t.has(e)||Xs("Cannot "+n),tA=(e,t)=>Object(t)!==t?Xs('Cannot use the "in" operator on this value'):e.has(t),Lp=(e,t,n)=>(Kp(e,t,"read from private field"),n?n.call(e):t.get(e)),nA=(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),Fp=(e,t,n,o)=>(Kp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),oA=(e,t,n)=>(Kp(e,t,"access private method"),n),It=class Bp{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new Bp(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 Bp(t,n)}},tn=class jr{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 jr(r+t,o+n,s,i);return l.scale=Jk({},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 jr))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 jr?rA(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 jr(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 jr.from(t).intersectionRatio(jr.from(n))}};function rA(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 kv,Av,zp,Uc,ka,Aa=class extends(zp=Jo,Av=[He],kv=[He],zp){constructor(e){let t=It.from(e);super(t,(n,o)=>It.equals(n,o)),eA(ka,5,this),nA(this,Uc,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-Lp(this,Uc),i=a=>Math.round(a/s*100);Ee(()=>{Fp(this,Uc,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}}};ka=Qk(zp);Uc=new WeakMap;wv(ka,2,"delta",Av,Aa);wv(ka,2,"direction",kv,Aa);Mv(ka,Aa);function Hc({x:e,y:t},n){let o=Math.abs(e),r=Math.abs(t);return typeof n=="number"?Math.sqrt(Nv(o,2)+Nv(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 Iv=(e=>(e.Horizontal="x",e.Vertical="y",e))(Iv||{}),Up=Object.values(Iv);var sA=Object.create,Gp=Object.defineProperty,iA=Object.defineProperties,aA=Object.getOwnPropertyDescriptor,lA=Object.getOwnPropertyDescriptors,Jc=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Fv=Object.prototype.propertyIsEnumerable,Bv=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ni=e=>{throw TypeError(e)},Vp=(e,t,n)=>t in e?Gp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qp=(e,t)=>{for(var n in t||(t={}))Lv.call(t,n)&&Vp(e,n,t[n]);if(Jc)for(var n of Jc(t))Fv.call(t,n)&&Vp(e,n,t[n]);return e},Xp=(e,t)=>iA(e,lA(t)),$v=(e,t)=>Gp(e,"name",{value:t,configurable:!0}),zv=(e,t)=>{var n={};for(var o in e)Lv.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Jc)for(var o of Jc(e))t.indexOf(o)<0&&Fv.call(e,o)&&(n[o]=e[o]);return n},oi=e=>{var t;return[,,,sA((t=e?.[Bv("metadata")])!=null?t:null)]},Wv=["class","method","getter","setter","accessor","field","value","get","set"],Ia=e=>e!==void 0&&typeof e!="function"?ni("Function expected"):e,cA=(e,t,n,o,r)=>({kind:Wv[e],name:t,metadata:o,addInitializer:s=>n._?ni("Already initialized"):r.push(Ia(s||null))}),qr=(e,t)=>Vp(t,Bv("metadata"),e[3]),re=(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},xe=(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=Wv[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&aA(d<4?r:{get[n](){return et(this,s)},set[n](v){return cn(this,s,v)}},n));d?p&&d<4&&$v(s,(d>2?"set ":d>1?"get ":"")+n):$v(r,n);for(var x=o.length-1;x>=0;x--)c=cA(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>uA(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?et:Kv)(v,r,d^4?s:_.get):v=>v[n]),d>2&&(u.set=p?(v,S)=>cn(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?Ia(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?ni("Object expected"):(Ia(i=a.get)&&(_.get=i),Ia(i=a.set)&&(_.set=i),Ia(i=a.init)&&y.unshift(i));return d||qr(e,r),_&&Gp(r,n,_),p?d^4?s:_:r},Jp=(e,t,n)=>t.has(e)||ni("Cannot "+n),uA=(e,t)=>Object(t)!==t?ni('Cannot use the "in" operator on this value'):e.has(t),et=(e,t,n)=>(Jp(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(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),cn=(e,t,n,o)=>(Jp(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Kv=(e,t,n)=>(Jp(e,t,"access private method"),n);function Uv(e,t){return{plugin:e,options:t}}function ri(e){return t=>Uv(e,t)}function ti(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var Hv,Pa,Qp,jc;Hv=[pe];var mt=class{constructor(e,t){this.manager=e,this.options=t,Se(this,Qp,re(Pa,8,this,!1)),re(Pa,11,this),Se(this,jc,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return ce(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=gt(e.bind(this));return et(this,jc).add(t),t}destroy(){et(this,jc).forEach(e=>e())}static configure(e){return Uv(this,e)}};Pa=oi(null);Qp=new WeakMap;jc=new WeakMap;xe(Pa,4,"disabled",Hv,mt,Qp);qr(Pa,mt);var si=class extends mt{},Yc,Hp=class{constructor(e){this.manager=e,this.instances=new Map,Se(this,Yc,[])}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 et(this,Yc))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);cn(this,Yc,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()}};Yc=new WeakMap;function dA(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Vc=[],Js,Qs,fA=class extends mt{constructor(e){super(e),Se(this,Js),Se(this,Qs),this.computeCollisions=this.computeCollisions.bind(this),cn(this,Qs,On(Vc)),this.destroy=Vr(()=>{let t=this.computeCollisions(),n=ce(()=>this.manager.dragOperation.position.current);if(t!==Vc){let o=et(this,Js);if(cn(this,Js,n),o&&n.x==o.x&&n.y==o.y)return}else cn(this,Js,void 0);et(this,Qs).value=t},()=>{let{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){ce(()=>{e?et(this,Qs).value=this.computeCollisions():cn(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 Vc;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=ce(()=>u({droppable:c,dragOperation:o}));d&&(c.collisionPriority!=null&&(d.priority=c.collisionPriority),a.push(d))}return l.length===0?Vc:(a.sort(dA),a)}get collisions(){return et(this,Qs).value}};Js=new WeakMap;Qs=new WeakMap;var Vv,jv,Yv,Zp,Gv,jn,eh,ei,th,nh;Yv=[pe],jv=[pe],Vv=[pe];var No=class Yr{constructor(t,n){Se(this,eh,re(jn,8,this)),re(jn,11,this),Se(this,ei),Se(this,th,re(jn,12,this)),re(jn,15,this),Se(this,nh,re(jn,16,this)),re(jn,19,this);let{effects:o,id:r,data:s={},disabled:i=!1,register:a=!0}=t,l=r;cn(this,ei,On(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=et(this,ei).value;return(n=(t=Yr.pendingIdChanges)==null?void 0:t.get(this))!=null?n:o}set id(t){var n,o;let r=(o=(n=Yr.pendingIdChanges)==null?void 0:n.get(this))!=null?o:et(this,ei).peek();t!==r&&(Yr.pendingIdChanges||(Yr.pendingIdChanges=new Map,queueMicrotask(()=>{var s;return Kv(s=Yr,Zp,Gv).call(s)})),Yr.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)}};jn=oi(null);Zp=new WeakSet;Gv=function(){let e=No.pendingIdChanges;No.pendingIdChanges=null,e&&Ee(()=>{for(let[t,n]of e)et(t,ei).value=n})};eh=new WeakMap;ei=new WeakMap;th=new WeakMap;nh=new WeakMap;xe(jn,4,"manager",Yv,No,eh);xe(jn,4,"data",jv,No,th);xe(jn,4,"disabled",Vv,No,nh);Se(No,Zp);qr(jn,No);No.pendingIdChanges=null;var Qc=No,Rv=class{constructor(){this.map=On(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=Vr(...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}},qv,Xv,Jv,Qv,Zv,eS,jp,Ut,oh,rh,sh,Yn=class extends(jp=Qc,eS=[pe],Zv=[pe],Qv=[pe],Jv=[He],Xv=[He],qv=[He],jp){constructor(e,t){var n=e,{modifiers:o,type:r,sensors:s,plugins:i,effects:a}=n,l=zv(n,["modifiers","type","sensors","plugins","effects"]);super(Xp(qp({},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),re(Ut,5,this),Se(this,oh,re(Ut,8,this)),re(Ut,11,this),Se(this,rh,re(Ut,12,this)),re(Ut,15,this),Se(this,sh,re(Ut,16,this,this.isDragSource?"dragging":"idle")),re(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(jp);oh=new WeakMap;rh=new WeakMap;sh=new WeakMap;xe(Ut,4,"type",eS,Yn,oh);xe(Ut,4,"modifiers",Zv,Yn,rh);xe(Ut,4,"status",Qv,Yn,sh);xe(Ut,2,"isDropping",Jv,Yn);xe(Ut,2,"isDragging",Xv,Yn);xe(Ut,2,"isDragSource",qv,Yn);qr(Ut,Yn);var tS,nS,oS,rS,sS,iS,Yp,ut,ih,ah,lh,ch,uh,Gn=class extends(Yp=Qc,iS=[pe],sS=[pe],rS=[pe],oS=[pe],nS=[pe],tS=[He],Yp){constructor(e,t){var n=e,{accept:o,collisionDetector:r,collisionPriority:s,type:i}=n,a=zv(n,["accept","collisionDetector","collisionPriority","type"]);super(a,t),re(ut,5,this),Se(this,ih,re(ut,8,this)),re(ut,11,this),Se(this,ah,re(ut,12,this)),re(ut,15,this),Se(this,lh,re(ut,16,this)),re(ut,19,this),Se(this,ch,re(ut,20,this)),re(ut,23,this),Se(this,uh,re(ut,24,this)),re(ut,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}};ut=oi(Yp);ih=new WeakMap;ah=new WeakMap;lh=new WeakMap;ch=new WeakMap;uh=new WeakMap;xe(ut,4,"accept",iS,Gn,ih);xe(ut,4,"type",sS,Gn,ah);xe(ut,4,"collisionDetector",rS,Gn,lh);xe(ut,4,"collisionPriority",oS,Gn,ch);xe(ut,4,"shape",nS,Gn,uh);xe(ut,2,"isDropTarget",tS,Gn);qr(ut,Gn);var pA=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)}},hA=class extends pA{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function Gc(e,t=!0){let n=!1;return Xp(qp({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var gA=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=Vr(()=>{let{dragOperation:o,collisionObserver:r}=e;o.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:o,monitor:r}=e,{collisions:s}=o;if(o.isDisabled()||Qc.pendingIdChanges)return;let i=Gc({collisions:s});if(r.dispatch("collision",i),i.defaultPrevented||t(s,n))return;n=s;let[a]=s;ce(()=>{var l;a?.id!==((l=e.dragOperation.target)==null?void 0:l.id)&&(o.disable(),e.actions.setDropTarget(a?.id).then(()=>{o.enable()}))})})}},Xr=(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))(Xr||{}),Jr=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Jr||{}),aS,lS,cS,uS,dS,fS,pS,Mn,dh;pS=[pe],fS=[He],dS=[He],uS=[He],cS=[He],lS=[He],aS=[He];var To=class{constructor(){re(Mn,5,this),Se(this,dh,re(Mn,8,this,"idle")),re(Mn,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}};Mn=oi(null);dh=new WeakMap;xe(Mn,4,"value",pS,To,dh);xe(Mn,2,"current",fS,To);xe(Mn,2,"idle",dS,To);xe(Mn,2,"initializing",uS,To);xe(Mn,2,"initialized",cS,To);xe(Mn,2,"dragging",lS,To);xe(Mn,2,"dropped",aS,To);qr(Mn,To);var mA=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 ce(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let o=Gc({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",o),this.manager.renderer.rendering.then(()=>o.defaultPrevented)})}start(e){return ce(()=>{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;Ee(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(s)});let i=Gc({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"&&Ee(()=>{t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),o)})}move(e){return ce(()=>{var t,n;let{dragOperation:o}=this.manager,{status:r,controller:s}=o;if(!r.dragging||!s||s.signal.aborted)return;let i=Gc({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 ce(()=>{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=ce(()=>{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()})}},Gr=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}},hS=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)}},qc,fh=class{constructor(e){this.options=e,Se(this,qc)}set controller(e){cn(this,qc,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;(t=et(this,qc))==null||t.activate(e)}};qc=new WeakMap;var Pv=class extends mt{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},_A=class{constructor(e){this.draggables=new Rv,this.droppables=new Rv,this.plugins=new Hp(e),this.sensors=new Hp(e),this.modifiers=new Hp(e)}register(e,t){if(e instanceof Yn)return this.draggables.register(e.id,e);if(e instanceof Gn)return this.droppables.register(e.id,e);if(e.prototype instanceof Pv)return this.modifiers.register(e,t);if(e.prototype instanceof Gr)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 Qc)return e instanceof Yn?this.draggables.unregister(e.id,e):e instanceof Gn?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof Pv)return this.modifiers.unregister(e);if(e.prototype instanceof Gr)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()}},gS,mS,_S,yS,xS,vS,SS,CS,bS,$a,Xc,Zs,Ve,ph,hh,gh,mh,_h,Ra;bS=[He],CS=[pe],SS=[pe],vS=[pe],xS=[pe],yS=[pe],_S=[He],mS=[He],gS=[He];var qn=class{constructor(e){re(Ve,5,this),Se(this,$a),Se(this,Xc),Se(this,Zs,new Jo(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new To,Se(this,ph,re(Ve,8,this,!1)),re(Ve,11,this),Se(this,hh,re(Ve,12,this,null)),re(Ve,15,this),Se(this,gh,re(Ve,16,this,null)),re(Ve,19,this),Se(this,mh,re(Ve,20,this,null)),re(Ve,23,this),Se(this,_h,re(Ve,24,this,[])),re(Ve,27,this),this.position=new Aa({x:0,y:0}),Se(this,Ra,{x:0,y:0}),cn(this,$a,e)}get shape(){let{current:e,initial:t,previous:n}=et(this,Zs);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?et(this,Zs).current=e:et(this,Zs).reset()}get source(){var e;let t=this.sourceIdentifier;if(t==null)return null;let n=et(this,$a).registry.draggables.get(t);return n&&cn(this,Xc,n),(e=n??et(this,Xc))!=null?e:null}get target(){var e;let t=this.targetIdentifier;return t!=null&&(e=et(this,$a).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(Xp(qp({},this.snapshot()),{transform:n}));return cn(this,Ra,n),n}snapshot(){return ce(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:et(this,Ra),shape:this.shape?Kc(this.shape):null,position:Kc(this.position),status:Kc(this.status),canceled:this.canceled}))}reset(){Ee(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,et(this,Zs).reset(),this.position.reset({x:0,y:0}),cn(this,Ra,{x:0,y:0}),this.modifiers=[]})}};Ve=oi(null);$a=new WeakMap;Xc=new WeakMap;Zs=new WeakMap;ph=new WeakMap;hh=new WeakMap;gh=new WeakMap;mh=new WeakMap;_h=new WeakMap;Ra=new WeakMap;xe(Ve,2,"shape",bS,qn);xe(Ve,4,"canceled",CS,qn,ph);xe(Ve,4,"activatorEvent",SS,qn,hh);xe(Ve,4,"sourceIdentifier",vS,qn,gh);xe(Ve,4,"targetIdentifier",xS,qn,mh);xe(Ve,4,"modifiers",yS,qn,_h);xe(Ve,2,"source",_S,qn);xe(Ve,2,"target",mS,qn);xe(Ve,2,"transform",gS,qn);qr(Ve,qn);var yA={get rendering(){return Promise.resolve()}};function uo(e,t){return typeof e=="function"?e(t):e??t}var ES=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=uo(n.plugins,[]),r=uo(n.sensors,[]),s=uo(n.modifiers,[]),i=(t=n.renderer)!=null?t:yA,a=new hA(this),l=new _A(this);this.registry=l,this.monitor=a,this.renderer=i,this.actions=new mA(this),this.dragOperation=new qn(this),this.collisionObserver=new fA(this),this.plugins=[gA,...o],this.modifiers=s,this.sensors=r;let{destroy:c}=this,u=Vr(()=>{var d,f,p;let h=ce(()=>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 kS=e=>{throw TypeError(e)},vh=(e,t,n)=>t.has(e)||kS("Cannot "+n),se=(e,t,n)=>(vh(e,t,"read from private field"),t.get(e)),nn=(e,t,n)=>t.has(e)?kS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),un=(e,t,n,o)=>(vh(e,t,"write to private field"),t.set(e,n),n),AS=(e,t,n)=>(vh(e,t,"access private method"),n);function au(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function Sh(e,t){let n=e.getAnimations(),o=null;for(let r of n){if(r.playState!=="running")continue;let{effect:s}=r,a=(au(s)?s.getKeyframes():[]).filter(t);a.length>0&&(o=[a[a.length-1],r])}return o}function lu(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 Ch(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ua(e){return"nodeType"in e}function Ht(e){var t,n,o;return e?Ch(e)?e:Ua(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 cu(e){let{Document:t}=Ht(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function Oo(e){return!e||Ch(e)?!1:e instanceof Ht(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function IS(e){return e instanceof Ht(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function ts(e){return e?Ch(e)?e.document:Ua(e)?cu(e)?e:Oo(e)||IS(e)?e.ownerDocument:document:document:document}function xA(e){var t,n,o,r;let{documentElement:s}=ts(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 vA(e,t){if(SA(e)&&e.open===!1)return!1;let{overflow:n,overflowX:o,overflowY:r}=getComputedStyle(e);return n==="visible"&&o==="visible"&&r==="visible"}function SA(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(!vA(d)){let x=d.getBoundingClientRect(),v=n*(x.bottom-x.top),S=n*(x.right-x.left),b=n*(x.bottom-x.top),E=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-E),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 ns(e){return{x:e.clientX,y:e.clientY}}var $S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ou(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(...ou(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(...ou(r.document,t))}}catch{}return n}function uu(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function bh(){var e,t;let n=uu()?window.visualViewport:null;return{x:(e=n?.offsetLeft)!=null?e:0,y:(t=n?.offsetTop)!=null?t:0}}function du(e){return!e||!Ua(e)?!1:e instanceof Ht(e).ShadowRoot}function Ha(e){if(e&&Ua(e)){let t=e.getRootNode();if(du(t))return t;if(t instanceof Document)return t}return ts(e)}function Va(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function RS(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(NS(s)&&NS(a)&&(s.type!=="file"&&(s.value=a.value),s.type==="radio"&&s.name&&(s.name=`Cloned__${s.name}`)),TS(s)&&TS(a)&&a.width>0&&a.height>0){let l=s.getContext("2d");l?.drawImage(a,0,0)}}),n}function NS(e){return"value"in e}function TS(e){return e.tagName==="CANVAS"}function Eh(e,{x:t,y:n}){let o=e.elementFromPoint(t,n);if(CA(o)){let{contentDocument:r}=o;if(r){let{left:s,top:i}=o.getBoundingClientRect();return Eh(r,{x:t-s,y:n-i})}}return o}function CA(e){return e?.tagName==="IFRAME"}var ja=new WeakMap;function PS(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 Xs=class{constructor(){this.entries=new Set,this.clear=()=>{for(let t of this.entries){let[e,{type:n,listener:r,options:i}]=t;e.removeEventListener(n,r,i)}this.entries.clear()}}bind(t,e){let n=Array.isArray(t)?t:[t],r=Array.isArray(e)?e:[e],i=[];for(let a of n)for(let o of r){let{type:l,listener:d,options:u}=o,c=[a,o];a.addEventListener(l,d,u),this.entries.add(c),i.push(c)}let s=this.entries;return function(){for(let o of i){let[l,{type:d,listener:u,options:c}]=o;l.removeEventListener(d,u,c),s.delete(o)}}}};function Ce(t){let e=t?.ownerDocument.defaultView;if(e&&e.self!==e.parent)return e.frameElement}function ou(t){let e=new Set,n=Ce(t);for(;n;)e.add(n),n=Ce(n);return e}function au(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}function Nl(t,e){let n=()=>performance.now(),r,i;return function(...s){let a=this;i?(r?.(),r=au(()=>{t.apply(a,s),i=n()},e-(n()-i))):(t.apply(a,s),i=n())}}function lu(t,e){return t===e?!0:!t||!e?!1:t.top==e.top&&t.left==e.left&&t.right==e.right&&t.bottom==e.bottom}function cu(t,e=t.getBoundingClientRect()){let{width:n,height:r}=ln(t,e);return n>0&&r>0}var du=Dl?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Qr,uu=class extends du{constructor(t){super(e=>{if(!M(this,Qr)){Et(this,Qr,!0);return}t(e,this)}),_t(this,Qr,!1)}};Qr=new WeakMap;var Sl=Array.from({length:100},(t,e)=>e/100),Wl=75,Oe,ni,oe,Pe,Hn,nt,Yn,qn,ri,Ll,$l,zl=class{constructor(t,e,n={debug:!1,skipInitial:!1}){this.element=t,this.callback=e,_t(this,ri),this.disconnect=()=>{var s,a,o;Et(this,Yn,!0),(s=M(this,oe))==null||s.disconnect(),(a=M(this,Pe))==null||a.disconnect(),M(this,Hn).disconnect(),(o=M(this,nt))==null||o.remove()},_t(this,Oe,!0),_t(this,ni),_t(this,oe),_t(this,Pe),_t(this,Hn),_t(this,nt),_t(this,Yn,!1),_t(this,qn,Nl(()=>{var s,a,o;let{element:l}=this;if((s=M(this,Pe))==null||s.disconnect(),M(this,Yn)||!M(this,Oe)||!l.isConnected)return;let d=(a=l.ownerDocument)!=null?a:document,{innerHeight:u,innerWidth:c}=(o=d.defaultView)!=null?o:window,g=l.getBoundingClientRect(),p=ln(l,g),{top:b,left:_,bottom:k,right:x}=p,h=-Math.floor(b),m=-Math.floor(_),v=-Math.floor(c-x),y=-Math.floor(u-k),O=`${h}px ${v}px ${y}px ${m}px`;this.boundingClientRect=g,Et(this,Pe,new IntersectionObserver(P=>{let[W]=P,{intersectionRect:V}=W;(W.intersectionRatio!==1?W.intersectionRatio:bt.intersectionRatio(V,ln(l)))!==1&&M(this,qn).call(this)},{threshold:Sl,rootMargin:O,root:d})),M(this,Pe).observe(l),Ml(this,ri,Ll).call(this)},Wl)),this.boundingClientRect=t.getBoundingClientRect(),Et(this,Oe,cu(t,this.boundingClientRect));let r=!0;this.callback=s=>{r&&(r=!1,n.skipInitial)||e(s)};let i=t.ownerDocument;n?.debug&&(Et(this,nt,document.createElement("div")),M(this,nt).style.background="rgba(0,0,0,0.15)",M(this,nt).style.position="fixed",M(this,nt).style.pointerEvents="none",i.body.appendChild(M(this,nt))),Et(this,Hn,new IntersectionObserver(s=>{var a,o;let l=s[s.length-1],{boundingClientRect:d,isIntersecting:u}=l,{width:c,height:g}=d,p=M(this,Oe);Et(this,Oe,u),!(!c&&!g)&&(p&&!u?((a=M(this,Pe))==null||a.disconnect(),this.callback(null),(o=M(this,oe))==null||o.disconnect(),Et(this,oe,void 0),M(this,nt)&&(M(this,nt).style.visibility="hidden")):M(this,qn).call(this),u&&!M(this,oe)&&(Et(this,oe,new uu(M(this,qn))),M(this,oe).observe(t)))},{threshold:Sl,root:i})),M(this,Oe)&&!n.skipInitial&&this.callback(this.boundingClientRect),M(this,Hn).observe(t)}};Oe=new WeakMap;ni=new WeakMap;oe=new WeakMap;Pe=new WeakMap;Hn=new WeakMap;nt=new WeakMap;Yn=new WeakMap;qn=new WeakMap;ri=new WeakSet;Ll=function(){M(this,Yn)||(Ml(this,ri,$l).call(this),!lu(this.boundingClientRect,M(this,ni))&&(this.callback(this.boundingClientRect),Et(this,ni,this.boundingClientRect)))};$l=function(){if(M(this,nt)){let{top:t,left:e,width:n,height:r}=ln(this.element);M(this,nt).style.overflow="hidden",M(this,nt).style.visibility="visible",M(this,nt).style.top=`${Math.floor(t)}px`,M(this,nt).style.left=`${Math.floor(e)}px`,M(this,nt).style.width=`${Math.floor(n)}px`,M(this,nt).style.height=`${Math.floor(r)}px`}};var Jr=new WeakMap,Zr=new WeakMap;function fu(t,e){let n=Jr.get(t);return n||(n={disconnect:new zl(t,i=>{let s=Jr.get(t);s&&s.callbacks.forEach(a=>a(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(e),Jr.set(t,n),()=>{n.callbacks.delete(e),n.callbacks.size===0&&(Jr.delete(t),n.disconnect())}}function hu(t,e){let n=new Set;for(let r of t){let i=fu(r,e);n.add(i)}return()=>n.forEach(r=>r())}function pu(t,e){var n;let r=t.ownerDocument;if(!Zr.has(r)){let a=new AbortController,o=new Set;document.addEventListener("scroll",l=>o.forEach(d=>d(l)),{capture:!0,passive:!0,signal:a.signal}),Zr.set(r,{disconnect:()=>a.abort(),listeners:o})}let{listeners:i,disconnect:s}=(n=Zr.get(r))!=null?n:{};return!i||!s?()=>{}:(i.add(e),()=>{i.delete(e),i.size===0&&(s(),Zr.delete(r))})}var Un,Xn,ti,js,Fl=class{constructor(t,e,n){this.callback=e,_t(this,Un),_t(this,Xn,!1),_t(this,ti),_t(this,js,Nl(a=>{if(!M(this,Xn)&&a.target&&"contains"in a.target&&typeof a.target.contains=="function"){for(let o of M(this,ti))if(a.target.contains(o)){this.callback(M(this,Un).boundingClientRect);break}}},Wl));let r=ou(t),i=hu(r,e),s=pu(t,M(this,js));Et(this,ti,r),Et(this,Un,new zl(t,e,n)),this.disconnect=()=>{M(this,Xn)||(Et(this,Xn,!0),i(),s(),M(this,Un).disconnect())}}};Un=new WeakMap;Xn=new WeakMap;ti=new WeakMap;js=new WeakMap;function di(t){return"showPopover"in t&&"hidePopover"in t&&typeof t.showPopover=="function"&&typeof t.hidePopover=="function"}function De(t){try{di(t)&&t.isConnected&&t.hasAttribute("popover")&&!t.matches(":popover-open")&&t.showPopover()}catch{}}function El(t){return!Dl||!t?!1:t===Me(t).scrollingElement}function Vl(t){var e,n;let r=pt(t),i=El(t)?nu(t):oi(t),s=r.visualViewport,a=El(t)?{height:(e=s?.height)!=null?e:r.innerHeight,width:(n=s?.width)!=null?n:r.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={current:{x:t.scrollLeft,y:t.scrollTop},max:{x:t.scrollWidth-a.width,y:t.scrollHeight-a.height}},l=o.current.y<=0,d=o.current.x<=0,u=o.current.y>=o.max.y,c=o.current.x>=o.max.x;return{rect:i,position:o,isTop:l,isLeft:d,isBottom:u,isRight:c}}function jl(t,e){let{isTop:n,isBottom:r,isLeft:i,isRight:s,position:a}=Vl(t),{x:o,y:l}=e??{x:0,y:0},d=!n&&a.current.y+l>0,u=!r&&a.current.y+l<a.max.y,c=!i&&a.current.x+o>0,g=!s&&a.current.x+o<a.max.x;return{top:d,bottom:u,left:c,right:g,x:c||g,y:d||u}}var Ys=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:e,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let r of e)r();for(let r of n)r()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},tr=new Ys(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),gu=new Ys(t=>setTimeout(t,50)),ii=new Map,vu=ii.clear.bind(ii);function Dt(t,e=!1){if(!e)return Ol(t);let n=ii.get(t);return n||(n=Ol(t),ii.set(t,n),gu.schedule(vu),n)}function Ol(t){return pt(t).getComputedStyle(t)}function mu(t,e=Dt(t,!0)){return e.position==="fixed"||e.position==="sticky"}function yu(t,e=Dt(t,!0)){let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{let s=e[i];return typeof s=="string"?n.test(s):!1})}var bu={excludeElement:!0,escapeShadowDOM:!0};function ui(t,e=bu){let{limit:n,excludeElement:r,escapeShadowDOM:i}=e,s=new Set;function a(o){if(n!=null&&s.size>=n||!o)return s;if(ai(o)&&o.scrollingElement!=null&&!s.has(o.scrollingElement))return s.add(o.scrollingElement),s;if(i&&ci(o))return a(o.host);if(!Zt(o))return Il(o)?a(o.parentElement):s;if(s.has(o))return s;let l=Dt(o,!0);if(r&&o===t||yu(o,l)&&s.add(o),mu(o,l)){let{scrollingElement:d}=o.ownerDocument;return d&&s.add(d),s}return a(o.parentNode)}return t?a(t):s}function Ae(t,e=window.frameElement){let n={x:0,y:0,scaleX:1,scaleY:1};if(!t)return n;let r=Ce(t);for(;r;){if(r===e)return n;let i=oi(r),{x:s,y:a}=_u(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*s,n.scaleY=n.scaleY*a,r=Ce(r)}return n}function _u(t,e=oi(t)){let n=Math.round(e.width),r=Math.round(e.height);if(Zt(t))return{x:n/t.offsetWidth,y:r/t.offsetHeight};let i=Dt(t,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function wu(t){if(!t||t==="none")return null;let e=t.split(" "),n=parseFloat(e[0]),r=parseFloat(e[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function cn(t){if(!t||t==="none")return null;let[e,n,r="0"]=t.split(" "),i={x:parseFloat(e),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function er(t){var e,n,r,i,s,a,o,l,d;let{scale:u,transform:c,translate:g}=t,p=wu(u),b=cn(g),_=xu(c);if(!_&&!p&&!b)return null;let k={x:(e=p?.x)!=null?e:1,y:(n=p?.y)!=null?n:1},x={x:(r=b?.x)!=null?r:0,y:(i=b?.y)!=null?i:0},h={x:(s=_?.x)!=null?s:0,y:(a=_?.y)!=null?a:0,scaleX:(o=_?.scaleX)!=null?o:1,scaleY:(l=_?.scaleY)!=null?l:1};return{x:x.x+h.x,y:x.y+h.y,z:(d=b?.z)!=null?d:0,scaleX:k.x*h.scaleX,scaleY:k.y*h.scaleY}}function xu(t){if(t.startsWith("matrix3d(")){let e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){let e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}var Ot=(t=>(t[t.Idle=0]="Idle",t[t.Forward=1]="Forward",t[t.Reverse=-1]="Reverse",t))(Ot||{}),ku={x:.2,y:.2},Su={x:10,y:10};function Bl(t,e,n,r=25,i=ku,s=Su){let{x:a,y:o}=e,{rect:l,isTop:d,isBottom:u,isLeft:c,isRight:g}=Vl(t),p=Ae(t),b=Dt(t,!0),_=er(b),k=_!==null?_?.scaleX<0:!1,x=_!==null?_?.scaleY<0:!1,h=new bt(l.left*p.scaleX+p.x,l.top*p.scaleY+p.y,l.width*p.scaleX,l.height*p.scaleY),m={x:0,y:0},v={x:0,y:0},y={height:h.height*i.y,width:h.width*i.x};return y.height>0&&(!d||x&&!u)&&o<=h.top+y.height&&n?.y!==1&&a>=h.left-s.x&&a<=h.right+s.x?(m.y=x?1:-1,v.y=r*Math.abs((h.top+y.height-o)/y.height)):y.height>0&&(!u||x&&!d)&&o>=h.bottom-y.height&&n?.y!==-1&&a>=h.left-s.x&&a<=h.right+s.x&&(m.y=x?-1:1,v.y=r*Math.abs((h.bottom-y.height-o)/y.height)),y.width>0&&(!g||k&&!c)&&a>=h.right-y.width&&n?.x!==-1&&o>=h.top-s.y&&o<=h.bottom+s.y?(m.x=k?-1:1,v.x=r*Math.abs((h.right-y.width-a)/y.width)):y.width>0&&(!c||k&&!g)&&a<=h.left+y.width&&n?.x!==1&&o>=h.top-s.y&&o<=h.bottom+s.y&&(m.x=k?1:-1,v.x=r*Math.abs((h.left+y.width-a)/y.width)),{direction:m,speed:v}}function fi(t,{block:e="nearest",inline:n="nearest"}={}){if(!Zt(t))return;let r=ui(t),i=[];for(let s of r){if(!Zt(s))continue;let{top:a,left:o}=Eu(t,s),l=a,d=o;for(let u of i)l-=u.scrollTop,d-=u.scrollLeft;if(e!=="none"){let u=l<s.scrollTop,c=l+t.offsetHeight>s.scrollTop+s.clientHeight;u!==c&&(e==="center"?s.scrollTop=l-s.clientHeight/2+t.offsetHeight/2:u?s.scrollTop=l:s.scrollTop=l+t.offsetHeight-s.clientHeight)}if(n!=="none"){let u=d<s.scrollLeft,c=d+t.offsetWidth>s.scrollLeft+s.clientWidth;u!==c&&(n==="center"?s.scrollLeft=d-s.clientWidth/2+t.offsetWidth/2:u?s.scrollLeft=d:s.scrollLeft=d+t.offsetWidth-s.clientWidth)}i.push(s)}}function Pl(t){let e=0,n=0,r=t;for(;r;){e+=r.offsetTop,n+=r.offsetLeft;let i=r.offsetParent;if(!Zt(i))break;e+=i.clientTop,n+=i.clientLeft,r=i}return{top:e,left:n}}function Eu(t,e){let n=Pl(t),r=Pl(e);return{top:n.top-r.top-e.clientTop,left:n.left-r.left-e.clientLeft}}function Ou(t,e,n){let{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left+s+(1-r)*parseFloat(n),l=t.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?t.width*r:t.width,u=i?t.height*i:t.height;return{width:d,height:u,top:l,right:o+d,bottom:l+u,left:o}}function Pu(t,e,n){let{scaleX:r,scaleY:i,x:s,y:a}=e,o=t.left-s-(1-r)*parseFloat(n),l=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?t.width/r:t.width,u=i?t.height/i:t.height;return{width:d,height:u,top:l,right:o+d,bottom:l+u,left:o}}function hi({element:t,keyframes:e,options:n}){return t.animate(e,n).finished}function Ks(t,e=Dt(t).translate,n=!0){if(n){let r=Rs(t,i=>"translate"in i);if(r){let{translate:i=""}=r[0];if(typeof i=="string"){let s=cn(i);if(s)return s}}}if(e){let r=cn(e);if(r)return r}return{x:0,y:0,z:0}}var Cu=new Ys(t=>setTimeout(t,0)),Kn=new Map,Mu=Kn.clear.bind(Kn);function Iu(t){let e=t.ownerDocument,n=Kn.get(e);if(n)return n;n=e.getAnimations(),Kn.set(e,n),Cu.schedule(Mu);let r=n.filter(i=>si(i.effect)&&i.effect.target===t);return Kn.set(t,r),n}function Du(t,e){let n=Iu(t).filter(r=>{var i,s;if(si(r.effect)){let{target:a}=r.effect;if((s=a&&((i=e.isValidTarget)==null?void 0:i.call(e,a)))!=null?s:!0)return r.effect.getKeyframes().some(l=>{for(let d of e.properties)if(l[d])return!0})}}).map(r=>{let{effect:i,currentTime:s}=r,a=i?.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof a=="number"&&typeof s=="number"&&s<a)return r.currentTime=a,()=>{r.currentTime=s}});if(n.length>0)return()=>n.forEach(r=>r?.())}var At=class extends bt{constructor(t,e={}){var n,r,i,s;let{frameTransform:a=Ae(t),ignoreTransforms:o,getBoundingClientRect:l=oi}=e,d=Du(t,{properties:["transform","translate","scale","width","height"],isValidTarget:y=>(y!==t||li())&&y.contains(t)}),u=l(t),{top:c,left:g,width:p,height:b}=u,_,k=Dt(t),x=er(k),h={x:(n=x?.scaleX)!=null?n:1,y:(r=x?.scaleY)!=null?r:1},m=Au(t,k);d?.(),x&&(_=Pu(u,x,k.transformOrigin),(o||m)&&(c=_.top,g=_.left,p=_.width,b=_.height));let v={width:(i=_?.width)!=null?i:p,height:(s=_?.height)!=null?s:b};if(m&&!o&&_){let y=Ou(_,m,k.transformOrigin);c=y.top,g=y.left,p=y.width,b=y.height,h.x=m.scaleX,h.y=m.scaleY}a&&(o||(g*=a.scaleX,p*=a.scaleX,c*=a.scaleY,b*=a.scaleY),g+=a.x,c+=a.y),super(g,c,p,b),this.scale=h,this.intrinsicWidth=v.width,this.intrinsicHeight=v.height}};function Au(t,e){let n=t.getAnimations();if(!n.length)return null;let r,i,s,a=!1;for(let o of n){if(o.playState!=="running")continue;let l=si(o.effect)?o.effect.getKeyframes():[],d=l[l.length-1];if(!d)continue;let{transform:u,translate:c,scale:g}=d;typeof u=="string"&&u&&(r=u,a=!0),typeof c=="string"&&c&&(i=c,a=!0),typeof g=="string"&&g&&(s=g,a=!0)}return a?er({transform:r??e.transform,translate:i??e.translate,scale:s??e.scale}):null}function an(t){return"style"in t&&typeof t.style=="object"&&t.style!==null&&"setProperty"in t.style&&"removeProperty"in t.style&&typeof t.style.setProperty=="function"&&typeof t.style.removeProperty=="function"}var Rl=class{constructor(t){this.element=t,this.initial=new Map}set(t,e=""){let{element:n}=this;if(an(n))for(let[r,i]of Object.entries(t)){let s=`${e}${r}`;this.initial.has(s)||this.initial.set(s,n.style.getPropertyValue(s)),n.style.setProperty(s,typeof i=="string"?i:`${i}px`)}}remove(t,e=""){let{element:n}=this;if(an(n))for(let r of t){let i=`${e}${r}`;n.style.removeProperty(i)}}reset(){let{element:t}=this;if(an(t)){for(let[e,n]of this.initial)t.style.setProperty(e,n);t.getAttribute("style")===""&&t.removeAttribute("style")}}};function ae(t){return t?t instanceof pt(t).Element||Gn(t)&&t.nodeType===Node.ELEMENT_NODE:!1}function Te(t){if(!t)return!1;let{KeyboardEvent:e}=pt(t.target);return t instanceof e}function Hl(t){if(!t)return!1;let{PointerEvent:e}=pt(t.target);return t instanceof e}function ql(t){if(!ae(t))return!1;let{tagName:e}=t;return e==="INPUT"||e==="TEXTAREA"||Tu(t)}function Tu(t){return t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"}var Vs={};function pi(t){let e=Vs[t]==null?0:Vs[t]+1;return Vs[t]=e,`${t}-${e}`}var Nu=({dragOperation:t,droppable:e})=>{let n=t.position.current;if(!n)return null;let{id:r}=e;if(!e.shape)return null;if(e.shape.containsPoint(n)){let i=dt.distance(e.shape.center,n);return{id:r,value:1/i,type:Ee.PointerIntersection,priority:Se.High}}return null},Wu=({dragOperation:t,droppable:e})=>{let{shape:n}=t;if(!e.shape||!n?.current)return null;let r=n.current.intersectionArea(e.shape);if(r){let{position:i}=t,s=dt.distance(e.shape.center,i.current),o=r/(n.current.area+e.shape.area-r)/s;return{id:e.id,value:o,type:Ee.ShapeIntersection,priority:Se.Normal}}return null},gi=t=>{var e;return(e=Nu(t))!=null?e:Wu(t)},Ul=t=>{let{dragOperation:e,droppable:n}=t,{shape:r,position:i}=e;if(!n.shape)return null;let s=r?bt.from(r.current.boundingRectangle).corners:void 0,o=bt.from(n.shape.boundingRectangle).corners.reduce((l,d,u)=>{var c;return l+dt.distance(dt.from(d),(c=s?.[u])!=null?c:i.current)},0)/4;return{id:n.id,value:1/o,type:Ee.Collision,priority:Se.Normal}};var Lu=Object.create,uo=Object.defineProperty,$u=Object.defineProperties,zu=Object.getOwnPropertyDescriptor,Fu=Object.getOwnPropertyDescriptors,yi=Object.getOwnPropertySymbols,ec=Object.prototype.hasOwnProperty,nc=Object.prototype.propertyIsEnumerable,rc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),mn=t=>{throw TypeError(t)},Qs=(t,e,n)=>e in t?uo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,lr=(t,e)=>{for(var n in e||(e={}))ec.call(e,n)&&Qs(t,n,e[n]);if(yi)for(var n of yi(e))nc.call(e,n)&&Qs(t,n,e[n]);return t},fo=(t,e)=>$u(t,Fu(e)),Xl=(t,e)=>uo(t,"name",{value:e,configurable:!0}),ic=(t,e)=>{var n={};for(var r in t)ec.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&yi)for(var r of yi(t))e.indexOf(r)<0&&nc.call(t,r)&&(n[r]=t[r]);return n},yn=t=>{var e;return[,,,Lu((e=t?.[rc("metadata")])!=null?e:null)]},sc=["class","method","getter","setter","accessor","field","value","get","set"],rr=t=>t!==void 0&&typeof t!="function"?mn("Function expected"):t,Vu=(t,e,n,r,i)=>({kind:sc[t],name:e,metadata:r,addInitializer:s=>n._?mn("Already initialized"):i.push(rr(s||null))}),$e=(t,e)=>Qs(e,rc("metadata"),t[3]),Z=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Tt=(t,e,n,r,i,s)=>{var a,o,l,d,u,c=e&7,g=!!(e&8),p=!!(e&16),b=c>3?t.length+1:c?g?1:2:0,_=sc[c+5],k=c>3&&(t[b-1]=[]),x=t[b]||(t[b]=[]),h=c&&(!p&&!g&&(i=i.prototype),c<5&&(c>3||!p)&&zu(c<4?i:{get[n](){return F(this,s)},set[n](v){return gt(this,s,v)}},n));c?p&&c<4&&Xl(s,(c>2?"set ":c>1?"get ":"")+n):Xl(i,n);for(var m=r.length-1;m>=0;m--)d=Vu(c,n,l={},t[3],x),c&&(d.static=g,d.private=p,u=d.access={has:p?v=>ju(i,v):v=>n in v},c^3&&(u.get=p?v=>(c^1?F:Le)(v,i,c^4?s:h.get):v=>v[n]),c>2&&(u.set=p?(v,y)=>gt(v,i,y,c^4?s:h.set):(v,y)=>v[n]=y)),o=(0,r[m])(c?c<4?p?s:h[_]:c>4?void 0:{get:h.get,set:h.set}:i,d),l._=1,c^4||o===void 0?rr(o)&&(c>4?k.unshift(o):c?p?s=o:h[_]=o:i=o):typeof o!="object"||o===null?mn("Object expected"):(rr(a=o.get)&&(h.get=a),rr(a=o.set)&&(h.set=a),rr(a=o.init)&&k.unshift(a));return c||$e(t,i),h&&uo(i,n,h),p?c^4?s:h:i},ho=(t,e,n)=>e.has(t)||mn("Cannot "+n),ju=(t,e)=>Object(e)!==e?mn('Cannot use the "in" operator on this value'):t.has(e),F=(t,e,n)=>(ho(t,e,"read from private field"),n?n.call(t):e.get(t)),Y=(t,e,n)=>e.has(t)?mn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gt=(t,e,n,r)=>(ho(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Le=(t,e,n)=>(ho(t,e,"access private method"),n),Yl={role:"button",roleDescription:"draggable"},Bu="dnd-kit-description",Ru="dnd-kit-announcement",Hu={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."},qu={dragstart({operation:{source:t}}){if(t)return`Picked up draggable item ${t.id}.`},dragover({operation:{source:t,target:e}}){if(!(!t||t.id===e?.id))return e?`Draggable item ${t.id} was moved over droppable target ${e.id}.`:`Draggable item ${t.id} is no longer over a droppable target.`},dragend({operation:{source:t,target:e},canceled:n}){if(t)return n?`Dragging was cancelled. Draggable item ${t.id} was dropped.`:e?`Draggable item ${t.id} was dropped over droppable target ${e.id}`:`Draggable item ${t.id} was dropped.`}};function Uu(t){let e=t.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(e)}function Xu(t,e){let n=document.createElement("div");return n.id=t,n.style.setProperty("display","none"),n.textContent=e,n}function Yu(t){let e=document.createElement("div");return e.id=t,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.setProperty("position","fixed"),e.style.setProperty("width","1px"),e.style.setProperty("height","1px"),e.style.setProperty("margin","-1px"),e.style.setProperty("border","0"),e.style.setProperty("padding","0"),e.style.setProperty("overflow","hidden"),e.style.setProperty("clip","rect(0 0 0 0)"),e.style.setProperty("clip-path","inset(100%)"),e.style.setProperty("white-space","nowrap"),e}var Ku=["dragover","dragmove"],Gu=class extends tt{constructor(t,e){super(t);let{id:n,idPrefix:{description:r=Bu,announcement:i=Ru}={},announcements:s=qu,screenReaderInstructions:a=Hu,debounce:o=500}=e??{},l=n?`${r}-${n}`:pi(r),d=n?`${i}-${n}`:pi(i),u,c,g,p,b=(y=p)=>{!g||!y||g?.nodeValue!==y&&(g.nodeValue=y)},_=()=>tr.schedule(b),k=Ju(_,o),x=Object.entries(s).map(([y,O])=>this.manager.monitor.addEventListener(y,(P,W)=>{let V=g;if(!V)return;let j=O?.(P,W);j&&V.nodeValue!==j&&(p=j,Ku.includes(y)?k():(_(),k.cancel()))})),h=()=>{let y=[];u?.isConnected||(u=Xu(l,a.draggable),y.push(u)),c?.isConnected||(c=Yu(d),g=document.createTextNode(""),c.appendChild(g),y.push(c)),y.length>0&&document.body.append(...y)},m=new Set;function v(){for(let y of m)y()}this.registerEffect(()=>{var y;m.clear();for(let O of this.manager.registry.draggables.value){let P=(y=O.handle)!=null?y:O.element;if(P){(!u||!c)&&m.add(h),(!Uu(P)||li())&&!P.hasAttribute("tabindex")&&m.add(()=>P.setAttribute("tabindex","0")),!P.hasAttribute("role")&&P.tagName.toLowerCase()!=="button"&&m.add(()=>P.setAttribute("role",Yl.role)),P.hasAttribute("aria-roledescription")||m.add(()=>P.setAttribute("aria-roledescription",Yl.roleDescription)),P.hasAttribute("aria-describedby")||m.add(()=>P.setAttribute("aria-describedby",l));for(let V of["aria-pressed","aria-grabbed"]){let j=String(O.isDragging);P.getAttribute(V)!==j&&m.add(()=>P.setAttribute(V,j))}let W=String(O.disabled);P.getAttribute("aria-disabled")!==W&&m.add(()=>P.setAttribute("aria-disabled",W))}}m.size>0&&tr.schedule(v)}),this.destroy=()=>{super.destroy(),u?.remove(),c?.remove(),x.forEach(y=>y())}}};function Ju(t,e){let n,r=()=>{clearTimeout(n),n=setTimeout(t,e)};return r.cancel=()=>clearTimeout(n),r}var bi=new Map,oc,ac,lc,cc,to,or,Qt,po,gn,dc,uc,fc,hc,fe=class extends(to=on,cc=[D],lc=[q],ac=[q],oc=[q],to){constructor(e,n){super(e,n),Z(Qt,5,this),Y(this,gn),Y(this,or,new Set),Y(this,po,Z(Qt,8,this,new Set)),Z(Qt,11,this),this.registerEffect(Le(this,gn,dc))}register(e){return F(this,or).add(e),()=>{F(this,or).delete(e)}}addRoot(e){return I(()=>{let n=new Set(this.additionalRoots);n.add(e),this.additionalRoots=n}),()=>{I(()=>{let n=new Set(this.additionalRoots);n.delete(e),this.additionalRoots=n})}}get sourceRoot(){var e;let{source:n}=this.manager.dragOperation;return Jn((e=n?.element)!=null?e:null)}get targetRoot(){var e;let{target:n}=this.manager.dragOperation;return Jn((e=n?.element)!=null?e:null)}get roots(){let{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){let n=[this.sourceRoot,this.targetRoot].filter(r=>r!=null);return new Set([...n,...this.additionalRoots])}return new Set}};Qt=yn(to);or=new WeakMap;po=new WeakMap;gn=new WeakSet;dc=function(){let{roots:t}=this,e=[];for(let n of t)for(let r of F(this,or))e.push(Le(this,gn,uc).call(this,n,r));return()=>{for(let n of e)n()}};uc=function(t,e){let n=bi.get(t);n||(n=new Map,bi.set(t,n));let r=n.get(e);if(!r){let s=ai(t)?Le(this,gn,fc).call(this,t,n,e):Le(this,gn,hc).call(this,t,n,e);if(!s)return()=>{};r=s,n.set(e,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}};fc=function(t,e,n){var r;let i=t.createElement("style"),{nonce:s}=(r=this.options)!=null?r:{};s&&i.setAttribute("nonce",s),i.textContent=n,t.head.prepend(i);let a=new MutationObserver(o=>{for(let l of o)for(let d of Array.from(l.removedNodes))if(d===i){t.head.prepend(i);return}});return a.observe(t.head,{childList:!0}),{refCount:0,cleanup:()=>{a.disconnect(),i.remove(),e.delete(n),e.size===0&&bi.delete(t)}}};hc=function(t,e,n){"adoptedStyleSheets"in t&&Array.isArray(t.adoptedStyleSheets);let r=t.ownerDocument.defaultView,{CSSStyleSheet:i}=r??{};if(!i)return null;let s=new i;return s.replaceSync(n),t.adoptedStyleSheets.push(s),{refCount:0,cleanup:()=>{var a;if(ci(t)&&((a=t.host)!=null&&a.isConnected)){let o=t.adoptedStyleSheets.indexOf(s);o!==-1&&t.adoptedStyleSheets.splice(o,1)}e.delete(n),e.size===0&&bi.delete(t)}}};Tt(Qt,4,"additionalRoots",cc,fe,po);Tt(Qt,2,"sourceRoot",lc,fe);Tt(Qt,2,"targetRoot",ac,fe);Tt(Qt,2,"roots",oc,fe);$e(Qt,fe);fe.configure=sn(fe);var ki=fe,Zu=class extends tt{constructor(t,e){super(t,e),this.manager=t;let{cursor:n="grabbing"}=e??{},r=t.registry.plugins.get(ki),i=r?.register(`* { cursor: ${n} !important; }`);if(i){let s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}}},fr="data-dnd-",eo=`${fr}dropping`,rt="--dnd-",Ht=`${fr}dragging`,_i=`${fr}placeholder`,Qu=[Ht,_i,"popover","aria-pressed","aria-grabbing"],tf=["view-transition-name"],ef=`
|
|
9
|
-
:is(:root,:host) [${
|
|
8
|
+
`)}var Nh=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 es(e){let t=e?.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function bA(e){let t=new Set,n=es(e);for(;n;)t.add(n),n=es(n);return t}function EA(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)}function LS(e,t){let n=()=>performance.now(),o,r;return function(...s){let i=this;r?(o?.(),o=EA(()=>{e.apply(i,s),r=n()},t-(n()-r))):(e.apply(i,s),r=n())}}function NA(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 TA(e,t=e.getBoundingClientRect()){let{width:n,height:o}=ai(e,t);return n>0&&o>0}var OA=$S?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},tu,DA=class extends OA{constructor(e){super(t=>{if(!se(this,tu)){un(this,tu,!0);return}e(t,this)}),nn(this,tu,!1)}};tu=new WeakMap;var OS=Array.from({length:100},(e,t)=>t/100),FS=75,Qr,ru,Qo,Zr,La,Nt,Wa,Fa,su,BS,zS,WS=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,nn(this,su),this.disconnect=()=>{var s,i,a;un(this,Wa,!0),(s=se(this,Qo))==null||s.disconnect(),(i=se(this,Zr))==null||i.disconnect(),se(this,La).disconnect(),(a=se(this,Nt))==null||a.remove()},nn(this,Qr,!0),nn(this,ru),nn(this,Qo),nn(this,Zr),nn(this,La),nn(this,Nt),nn(this,Wa,!1),nn(this,Fa,LS(()=>{var s,i,a;let{element:l}=this;if((s=se(this,Zr))==null||s.disconnect(),se(this,Wa)||!se(this,Qr)||!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,un(this,Zr,new IntersectionObserver(E=>{let[D]=E,{intersectionRect:O}=D;(D.intersectionRatio!==1?D.intersectionRatio:tn.intersectionRatio(O,ai(l)))!==1&&se(this,Fa).call(this)},{threshold:OS,rootMargin:b,root:c})),se(this,Zr).observe(l),AS(this,su,BS).call(this)},FS)),this.boundingClientRect=e.getBoundingClientRect(),un(this,Qr,TA(e,this.boundingClientRect));let o=!0;this.callback=s=>{o&&(o=!1,n.skipInitial)||t(s)};let r=e.ownerDocument;n?.debug&&(un(this,Nt,document.createElement("div")),se(this,Nt).style.background="rgba(0,0,0,0.15)",se(this,Nt).style.position="fixed",se(this,Nt).style.pointerEvents="none",r.body.appendChild(se(this,Nt))),un(this,La,new IntersectionObserver(s=>{var i,a;let l=s[s.length-1],{boundingClientRect:c,isIntersecting:u}=l,{width:d,height:f}=c,p=se(this,Qr);un(this,Qr,u),!(!d&&!f)&&(p&&!u?((i=se(this,Zr))==null||i.disconnect(),this.callback(null),(a=se(this,Qo))==null||a.disconnect(),un(this,Qo,void 0),se(this,Nt)&&(se(this,Nt).style.visibility="hidden")):se(this,Fa).call(this),u&&!se(this,Qo)&&(un(this,Qo,new DA(se(this,Fa))),se(this,Qo).observe(e)))},{threshold:OS,root:r})),se(this,Qr)&&!n.skipInitial&&this.callback(this.boundingClientRect),se(this,La).observe(e)}};Qr=new WeakMap;ru=new WeakMap;Qo=new WeakMap;Zr=new WeakMap;La=new WeakMap;Nt=new WeakMap;Wa=new WeakMap;Fa=new WeakMap;su=new WeakSet;BS=function(){se(this,Wa)||(AS(this,su,zS).call(this),!NA(this.boundingClientRect,se(this,ru))&&(this.callback(this.boundingClientRect),un(this,ru,this.boundingClientRect)))};zS=function(){if(se(this,Nt)){let{top:e,left:t,width:n,height:o}=ai(this.element);se(this,Nt).style.overflow="hidden",se(this,Nt).style.visibility="visible",se(this,Nt).style.top=`${Math.floor(e)}px`,se(this,Nt).style.left=`${Math.floor(t)}px`,se(this,Nt).style.width=`${Math.floor(n)}px`,se(this,Nt).style.height=`${Math.floor(o)}px`}};var Zc=new WeakMap,eu=new WeakMap;function MA(e,t){let n=Zc.get(e);return n||(n={disconnect:new WS(e,r=>{let s=Zc.get(e);s&&s.callbacks.forEach(i=>i(r))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),Zc.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(Zc.delete(e),n.disconnect())}}function wA(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 kA(e,t){var n;let o=e.ownerDocument;if(!eu.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}),eu.set(o,{disconnect:()=>i.abort(),listeners:a})}let{listeners:r,disconnect:s}=(n=eu.get(o))!=null?n:{};return!r||!s?()=>{}:(r.add(t),()=>{r.delete(t),r.size===0&&(s(),eu.delete(o))})}var Ba,za,nu,xh,KS=class{constructor(e,t,n){this.callback=t,nn(this,Ba),nn(this,za,!1),nn(this,nu),nn(this,xh,LS(i=>{if(!se(this,za)&&i.target&&"contains"in i.target&&typeof i.target.contains=="function"){for(let a of se(this,nu))if(i.target.contains(a)){this.callback(se(this,Ba).boundingClientRect);break}}},FS));let o=bA(e),r=wA(o,t),s=kA(e,se(this,xh));un(this,nu,o),un(this,Ba,new WS(e,t,n)),this.disconnect=()=>{se(this,za)||(un(this,za,!0),r(),s(),se(this,Ba).disconnect())}}};Ba=new WeakMap;za=new WeakMap;nu=new WeakMap;xh=new WeakMap;function fu(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function os(e){try{fu(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function DS(e){return!$S||!e?!1:e===ts(e).scrollingElement}function US(e){var t,n;let o=Ht(e),r=DS(e)?xA(e):lu(e),s=o.visualViewport,i=DS(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 HS(e,t){let{isTop:n,isBottom:o,isLeft:r,isRight:s,position:i}=US(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 Th=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))}},Ya=new Th(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),AA=new Th(e=>setTimeout(e,50)),iu=new Map,IA=iu.clear.bind(iu);function wn(e,t=!1){if(!t)return MS(e);let n=iu.get(e);return n||(n=MS(e),iu.set(e,n),AA.schedule(IA),n)}function MS(e){return Ht(e).getComputedStyle(e)}function $A(e,t=wn(e,!0)){return t.position==="fixed"||t.position==="sticky"}function RA(e,t=wn(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 PA={excludeElement:!0,escapeShadowDOM:!0};function pu(e,t=PA){let{limit:n,excludeElement:o,escapeShadowDOM:r}=t,s=new Set;function i(a){if(n!=null&&s.size>=n||!a)return s;if(cu(a)&&a.scrollingElement!=null&&!s.has(a.scrollingElement))return s.add(a.scrollingElement),s;if(r&&du(a))return i(a.host);if(!Oo(a))return IS(a)?i(a.parentElement):s;if(s.has(a))return s;let l=wn(a,!0);if(o&&a===e||RA(a,l)&&s.add(a),$A(a,l)){let{scrollingElement:c}=a.ownerDocument;return c&&s.add(c),s}return i(a.parentNode)}return e?i(e):s}function rs(e,t=window.frameElement){let n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let o=es(e);for(;o;){if(o===t)return n;let r=lu(o),{x:s,y:i}=LA(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=es(o)}return n}function LA(e,t=lu(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=wn(e,!0);return{x:(parseFloat(r.width)||n)/n,y:(parseFloat(r.height)||o)/o}}function FA(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 Ga(e){var t,n,o,r,s,i,a,l,c;let{scale:u,transform:d,translate:f}=e,p=FA(u),h=li(f),g=BA(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 BA(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 dn=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(dn||{}),zA={x:.2,y:.2},WA={x:10,y:10};function VS(e,t,n,o=25,r=zA,s=WA){let{x:i,y:a}=t,{rect:l,isTop:c,isBottom:u,isLeft:d,isRight:f}=US(e),p=rs(e),h=wn(e,!0),g=Ga(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 hu(e,{block:t="nearest",inline:n="nearest"}={}){if(!Oo(e))return;let o=pu(e),r=[];for(let s of o){if(!Oo(s))continue;let{top:i,left:a}=KA(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 wS(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 KA(e,t){let n=wS(e),o=wS(t);return{top:n.top-o.top-t.clientTop,left:n.left-o.left-t.clientLeft}}function UA(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 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 gu({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function Oh(e,t=wn(e).translate,n=!0){if(n){let o=Sh(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 VA=new Th(e=>setTimeout(e,0)),Ka=new Map,jA=Ka.clear.bind(Ka);function YA(e){let t=e.ownerDocument,n=Ka.get(t);if(n)return n;n=t.getAnimations(),Ka.set(t,n),VA.schedule(jA);let o=n.filter(r=>au(r.effect)&&r.effect.target===e);return Ka.set(e,o),n}function GA(e,t){let n=YA(e).filter(o=>{var r,s;if(au(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 kn=class extends tn{constructor(e,t={}){var n,o,r,s;let{frameTransform:i=rs(e),ignoreTransforms:a,getBoundingClientRect:l=lu}=t,c=GA(e,{properties:["transform","translate","scale","width","height"],isValidTarget:S=>(S!==e||uu())&&S.contains(e)}),u=l(e),{top:d,left:f,width:p,height:h}=u,g,y=wn(e),m=Ga(y),_={x:(n=m?.scaleX)!=null?n:1,y:(o=m?.scaleY)!=null?o:1},x=qA(e,y);c?.(),m&&(g=HA(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=UA(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 qA(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=au(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?Ga({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 jS=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 Zo(e){return e?e instanceof Ht(e).Element||Ua(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function ss(e){if(!e)return!1;let{KeyboardEvent:t}=Ht(e.target);return e instanceof t}function YS(e){if(!e)return!1;let{PointerEvent:t}=Ht(e.target);return e instanceof t}function GS(e){if(!Zo(e))return!1;let{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||XA(e)}function XA(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var yh={};function mu(e){let t=yh[e]==null?0:yh[e]+1;return yh[e]=t,`${e}-${t}`}var JA=({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:Jr.PointerIntersection,priority:Xr.High}}return null},QA=({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:Jr.ShapeIntersection,priority:Xr.Normal}}return null},_u=e=>{var t;return(t=JA(e))!=null?t:QA(e)},qS=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:Jr.Collision,priority:Xr.Normal}};var ZA=Object.create,Kh=Object.defineProperty,eI=Object.defineProperties,tI=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyDescriptors,vu=Object.getOwnPropertySymbols,r0=Object.prototype.hasOwnProperty,s0=Object.prototype.propertyIsEnumerable,i0=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),mi=e=>{throw TypeError(e)},kh=(e,t,n)=>t in e?Kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tl=(e,t)=>{for(var n in t||(t={}))r0.call(t,n)&&kh(e,n,t[n]);if(vu)for(var n of vu(t))s0.call(t,n)&&kh(e,n,t[n]);return e},Uh=(e,t)=>eI(e,nI(t)),XS=(e,t)=>Kh(e,"name",{value:t,configurable:!0}),a0=(e,t)=>{var n={};for(var o in e)r0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&vu)for(var o of vu(e))t.indexOf(o)<0&&s0.call(e,o)&&(n[o]=e[o]);return n},_i=e=>{var t;return[,,,ZA((t=e?.[i0("metadata")])!=null?t:null)]},l0=["class","method","getter","setter","accessor","field","value","get","set"],Xa=e=>e!==void 0&&typeof e!="function"?mi("Function expected"):e,oI=(e,t,n,o,r)=>({kind:l0[e],name:t,metadata:o,addInitializer:s=>n._?mi("Already initialized"):r.push(Xa(s||null))}),cs=(e,t)=>kh(t,i0("metadata"),e[3]),dt=(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},An=(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=l0[d+5],y=d>3&&(e[h-1]=[]),m=e[h]||(e[h]=[]),_=d&&(!p&&!f&&(r=r.prototype),d<5&&(d>3||!p)&&tI(d<4?r:{get[n](){return Ae(this,s)},set[n](v){return Vt(this,s,v)}},n));d?p&&d<4&&XS(s,(d>2?"set ":d>1?"get ":"")+n):XS(r,n);for(var x=o.length-1;x>=0;x--)c=oI(d,n,l={},e[3],m),d&&(c.static=f,c.private=p,u=c.access={has:p?v=>rI(r,v):v=>n in v},d^3&&(u.get=p?v=>(d^1?Ae:ls)(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?Xa(a)&&(d>4?y.unshift(a):d?p?s=a:_[g]=a:r=a):typeof a!="object"||a===null?mi("Object expected"):(Xa(i=a.get)&&(_.get=i),Xa(i=a.set)&&(_.set=i),Xa(i=a.init)&&y.unshift(i));return d||cs(e,r),_&&Kh(r,n,_),p?d^4?s:_:r},Hh=(e,t,n)=>t.has(e)||mi("Cannot "+n),rI=(e,t)=>Object(t)!==t?mi('Cannot use the "in" operator on this value'):e.has(t),Ae=(e,t,n)=>(Hh(e,t,"read from private field"),n?n.call(e):t.get(e)),tt=(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)=>(Hh(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),ls=(e,t,n)=>(Hh(e,t,"access private method"),n),JS={role:"button",roleDescription:"draggable"},sI="dnd-kit-description",iI="dnd-kit-announcement",aI={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."},lI={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 cI(e){let t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function uI(e,t){let n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function dI(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 fI=["dragover","dragmove"],pI=class extends mt{constructor(e,t){super(e);let{id:n,idPrefix:{description:o=sI,announcement:r=iI}={},announcements:s=lI,screenReaderInstructions:i=aI,debounce:a=500}=t??{},l=n?`${o}-${n}`:mu(o),c=n?`${r}-${n}`:mu(r),u,d,f,p,h=(S=p)=>{!f||!S||f?.nodeValue!==S&&(f.nodeValue=S)},g=()=>Ya.schedule(h),y=hI(g,a),m=Object.entries(s).map(([S,b])=>this.manager.monitor.addEventListener(S,(E,D)=>{let O=f;if(!O)return;let T=b?.(E,D);T&&O.nodeValue!==T&&(p=T,fI.includes(S)?y():(g(),y.cancel()))})),_=()=>{let S=[];u?.isConnected||(u=uI(l,i.draggable),S.push(u)),d?.isConnected||(d=dI(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 E=(S=b.handle)!=null?S:b.element;if(E){(!u||!d)&&x.add(_),(!cI(E)||uu())&&!E.hasAttribute("tabindex")&&x.add(()=>E.setAttribute("tabindex","0")),!E.hasAttribute("role")&&E.tagName.toLowerCase()!=="button"&&x.add(()=>E.setAttribute("role",JS.role)),E.hasAttribute("aria-roledescription")||x.add(()=>E.setAttribute("aria-roledescription",JS.roleDescription)),E.hasAttribute("aria-describedby")||x.add(()=>E.setAttribute("aria-describedby",l));for(let O of["aria-pressed","aria-grabbed"]){let T=String(b.isDragging);E.getAttribute(O)!==T&&x.add(()=>E.setAttribute(O,T))}let D=String(b.disabled);E.getAttribute("aria-disabled")!==D&&x.add(()=>E.setAttribute("aria-disabled",D))}}x.size>0&&Ya.schedule(v)}),this.destroy=()=>{super.destroy(),u?.remove(),d?.remove(),m.forEach(S=>S())}}};function hI(e,t){let n,o=()=>{clearTimeout(n),n=setTimeout(e,t)};return o.cancel=()=>clearTimeout(n),o}var Su=new Map,c0,u0,d0,f0,Ah,Za,Do,Vh,hi,p0,h0,g0,m0,rr=class extends(Ah=si,f0=[pe],d0=[He],u0=[He],c0=[He],Ah){constructor(t,n){super(t,n),dt(Do,5,this),tt(this,hi),tt(this,Za,new Set),tt(this,Vh,dt(Do,8,this,new Set)),dt(Do,11,this),this.registerEffect(ls(this,hi,p0))}register(t){return Ae(this,Za).add(t),()=>{Ae(this,Za).delete(t)}}addRoot(t){return ce(()=>{let n=new Set(this.additionalRoots);n.add(t),this.additionalRoots=n}),()=>{ce(()=>{let n=new Set(this.additionalRoots);n.delete(t),this.additionalRoots=n})}}get sourceRoot(){var t;let{source:n}=this.manager.dragOperation;return Ha((t=n?.element)!=null?t:null)}get targetRoot(){var t;let{target:n}=this.manager.dragOperation;return Ha((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(Ah);Za=new WeakMap;Vh=new WeakMap;hi=new WeakSet;p0=function(){let{roots:e}=this,t=[];for(let n of e)for(let o of Ae(this,Za))t.push(ls(this,hi,h0).call(this,n,o));return()=>{for(let n of t)n()}};h0=function(e,t){let n=Su.get(e);n||(n=new Map,Su.set(e,n));let o=n.get(t);if(!o){let s=cu(e)?ls(this,hi,g0).call(this,e,n,t):ls(this,hi,m0).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())}};g0=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&&Su.delete(e)}}};m0=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(du(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&&Su.delete(e)}}};An(Do,4,"additionalRoots",f0,rr,Vh);An(Do,2,"sourceRoot",d0,rr);An(Do,2,"targetRoot",u0,rr);An(Do,2,"roots",c0,rr);cs(Do,rr);rr.configure=ri(rr);var Nu=rr,gI=class extends mt{constructor(e,t){super(e,t),this.manager=e;let{cursor:n="grabbing"}=t??{},o=e.registry.plugins.get(Nu),r=o?.register(`* { cursor: ${n} !important; }`);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}}},sl="data-dnd-",Ih=`${sl}dropping`,Tt="--dnd-",fo=`${sl}dragging`,Cu=`${sl}placeholder`,mI=[fo,Cu,"popover","aria-pressed","aria-grabbing"],_I=["view-transition-name"],yI=`
|
|
9
|
+
:is(:root,:host) [${fo}] {
|
|
10
10
|
position: fixed !important;
|
|
11
11
|
pointer-events: none !important;
|
|
12
12
|
touch-action: none;
|
|
13
13
|
z-index: calc(infinity);
|
|
14
14
|
will-change: translate;
|
|
15
|
-
top: var(${
|
|
16
|
-
left: var(${
|
|
15
|
+
top: var(${Tt}top, 0px) !important;
|
|
16
|
+
left: var(${Tt}left, 0px) !important;
|
|
17
17
|
right: unset !important;
|
|
18
18
|
bottom: unset !important;
|
|
19
|
-
width: var(${
|
|
20
|
-
max-width: var(${
|
|
21
|
-
height: var(${
|
|
22
|
-
max-height: var(${
|
|
23
|
-
transform: var(${
|
|
24
|
-
transition: var(${
|
|
19
|
+
width: var(${Tt}width, auto);
|
|
20
|
+
max-width: var(${Tt}width, auto);
|
|
21
|
+
height: var(${Tt}height, auto);
|
|
22
|
+
max-height: var(${Tt}height, auto);
|
|
23
|
+
transform: var(${Tt}transform, none) !important;
|
|
24
|
+
transition: var(${Tt}transition) !important;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
:is(:root,:host) [${
|
|
27
|
+
:is(:root,:host) [${Cu}] {
|
|
28
28
|
transition: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
:is(:root,:host) [${
|
|
31
|
+
:is(:root,:host) [${Cu}='hidden'] {
|
|
32
32
|
visibility: hidden;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
[${
|
|
35
|
+
[${fo}] * {
|
|
36
36
|
pointer-events: none !important;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
[${
|
|
40
|
-
translate: var(${
|
|
39
|
+
[${fo}]:not([${Ih}]) {
|
|
40
|
+
translate: var(${Tt}translate) !important;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
[${
|
|
44
|
-
scale: var(${
|
|
45
|
-
transform-origin: var(${
|
|
43
|
+
[${fo}][style*='${Tt}scale'] {
|
|
44
|
+
scale: var(${Tt}scale) !important;
|
|
45
|
+
transform-origin: var(${Tt}transform-origin) !important;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
@layer dnd-kit {
|
|
49
|
-
:where([${
|
|
49
|
+
:where([${fo}][popover]) {
|
|
50
50
|
overflow: visible;
|
|
51
51
|
background: unset;
|
|
52
52
|
border: unset;
|
|
@@ -60,8 +60,21 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
[${
|
|
63
|
+
[${fo}]::backdrop, [${sl}overlay]:not([${fo}]) {
|
|
64
64
|
display: none;
|
|
65
65
|
visibility: hidden;
|
|
66
66
|
}
|
|
67
|
-
`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function nf(t,e="hidden"){return I(()=>{let{element:n,manager:r}=t;if(!n||!r)return;let i=rf(n,r.registry.droppables),s=[],a=Al(n),{remove:o}=a;return sf(i,a,s),of(a,e),a.remove=()=>{s.forEach(l=>l()),o.call(a)},a})}function rf(t,e){let n=new Map;for(let r of e)if(r.element&&(t===r.element||t.contains(r.element))){let i=`${fr}${pi("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function sf(t,e,n){for(let[r,i]of t){if(!r.element)continue;let s=`[${i}]`,a=e.matches(s)?e:e.querySelector(s);if(r.element.removeAttribute(i),!a)continue;let o=r.element;r.proxy=a,a.removeAttribute(i),Qn.set(o,a),n.push(()=>{Qn.delete(o),r.proxy=void 0})}}function of(t,e="hidden"){t.setAttribute("inert","true"),t.setAttribute("tab-index","-1"),t.setAttribute("aria-hidden","true"),t.setAttribute(_i,e)}function pc(t,e){return t===e?!0:Ce(t)===Ce(e)}function Kl(t){let{target:e}=t;"newState"in t&&t.newState==="closed"&&ae(e)&&e.hasAttribute("popover")&&requestAnimationFrame(()=>De(e))}function no(t){return t.tagName==="TR"}function af(t,e,n){let r=new MutationObserver(i=>{let s=!1;for(let a of i){if(a.target!==t){s=!0;continue}if(a.type!=="attributes")continue;let o=a.attributeName;if(o.startsWith("aria-")||Qu.includes(o))continue;let l=t.getAttribute(o);if(o==="style"){if(an(t)&&an(e)){let d=t.style;for(let u of Array.from(e.style))d.getPropertyValue(u)===""&&e.style.removeProperty(u);for(let u of Array.from(d)){if(tf.includes(u)||u.startsWith(rt))continue;let c=d.getPropertyValue(u);e.style.setProperty(u,c)}}}else l!==null?e.setAttribute(o,l):e.removeAttribute(o)}s&&n&&e.replaceChildren(...t.cloneNode(!0).childNodes)});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function lf(t,e,n){let r=new MutationObserver(i=>{for(let s of i)if(s.addedNodes.length!==0)for(let a of Array.from(s.addedNodes)){if(a.contains(t)&&t.nextElementSibling!==e){t.insertAdjacentElement("afterend",e),De(n);return}if(a.contains(e)&&e.previousElementSibling!==t){e.insertAdjacentElement("beforebegin",t),De(n);return}}t.isConnected&&e.isConnected&&t.nextElementSibling!==e&&(t.insertAdjacentElement("afterend",e),De(n))});return r.observe(t.ownerDocument.body,{childList:!0,subtree:!0}),r}function cf(t){return new ResizeObserver(()=>{var e,n,r;let i=new At(t.placeholder,{frameTransform:t.frameTransform,ignoreTransforms:!0}),s=(e=t.transformOrigin)!=null?e:{x:1,y:1},a=(t.width-i.width)*s.x+t.delta.x,o=(t.height-i.height)*s.y+t.delta.y,l=qs();if(t.styles.set({width:i.width-t.widthOffset,height:i.height-t.heightOffset,top:t.top+o+l.y,left:t.left+a+l.x},rt),(n=t.getElementMutationObserver())==null||n.takeRecords(),no(t.element)&&no(t.placeholder)){let _=Array.from(t.element.cells),k=Array.from(t.placeholder.cells);t.getSavedCellWidths()||t.setSavedCellWidths(_.map(x=>x.style.width));for(let[x,h]of _.entries()){let m=k[x];h.style.width=`${m.getBoundingClientRect().width}px`}}let d=(r=t.getTranslate())!=null?r:{x:0,y:0},u=t.left+a+l.x+d.x,c=t.top+o+l.y+d.y,g=i.width-t.widthOffset,p=i.height-t.heightOffset,b=t.frameTransform;t.dragOperation.shape=new bt(u*b.scaleX+b.x,c*b.scaleY+b.y,g*b.scaleX,p*b.scaleY)})}var df=250,uf="ease";function ff(t){var e,n,r,i;let{animation:s}=t;if(typeof s=="function"){let h=s({source:t.source,element:t.element,feedbackElement:t.feedbackElement,placeholder:t.placeholder,translate:t.translate,moved:t.moved});Promise.resolve(h).then(()=>{t.cleanup(),requestAnimationFrame(t.restoreFocus)});return}let{duration:a=df,easing:o=uf}=s??{};De(t.feedbackElement);let[,l]=(e=Rs(t.feedbackElement,h=>"translate"in h))!=null?e:[];l?.pause();let d=(n=t.placeholder)!=null?n:t.element,u={frameTransform:pc(t.feedbackElement,d)?null:void 0},c=new At(t.feedbackElement,u),g=(r=cn(Dt(t.feedbackElement).translate))!=null?r:t.translate,p=new At(d,u),b=bt.delta(c,p,t.alignment),_={x:g.x-b.x,y:g.y-b.y},k=Math.round(c.intrinsicHeight)!==Math.round(p.intrinsicHeight)?{minHeight:[`${c.intrinsicHeight}px`,`${p.intrinsicHeight}px`],maxHeight:[`${c.intrinsicHeight}px`,`${p.intrinsicHeight}px`]}:{},x=Math.round(c.intrinsicWidth)!==Math.round(p.intrinsicWidth)?{minWidth:[`${c.intrinsicWidth}px`,`${p.intrinsicWidth}px`],maxWidth:[`${c.intrinsicWidth}px`,`${p.intrinsicWidth}px`]}:{};t.styles.set({transition:t.transition},rt),t.feedbackElement.setAttribute(eo,""),(i=t.getElementMutationObserver())==null||i.takeRecords(),hi({element:t.feedbackElement,keyframes:fo(lr(lr({},k),x),{translate:[`${g.x}px ${g.y}px 0`,`${_.x}px ${_.y}px 0`]}),options:{duration:Zn(pt(t.feedbackElement))?0:t.moved||t.feedbackElement!==t.element?a:0,easing:o}}).then(()=>{t.feedbackElement.removeAttribute(eo),l?.finish(),t.cleanup(),requestAnimationFrame(t.restoreFocus)})}var gc,ro,cr,go,mi,vc,mc,vn=class extends(ro=tt,gc=[D],ro){constructor(e,n){super(e,n),Y(this,mi),Y(this,go,Z(cr,8,this)),Z(cr,11,this),this.state={initial:{},current:{}};let r=e.registry.plugins.get(ki),i=r?.register(ef);if(i){let s=this.destroy.bind(this);this.destroy=()=>{i(),s()}}this.registerEffect(Le(this,mi,vc).bind(this,r)),this.registerEffect(Le(this,mi,mc))}};cr=yn(ro);go=new WeakMap;mi=new WeakSet;vc=function(t){let{overlay:e}=this;if(!e||!t)return;let n=Jn(e);if(n)return t.addRoot(n)};mc=function(){var t,e,n,r,i,s,a;let{state:o,manager:l,options:d}=this,{dragOperation:u}=l,{position:c,source:g,status:p}=u;if(p.idle){o.current={},o.initial={};return}if(!g)return;let{element:b}=g,_=g.pluginConfig(vn),k=(e=(t=_?.feedback)!=null?t:d?.feedback)!=null?e:"default",x=typeof k=="function"?k(g,l):k;if(!b||x==="none"||!p.initialized||p.initializing)return;let{initial:h}=o,m=(n=this.overlay)!=null?n:b,v=Ae(m),y=Ae(b),O=!pc(b,m),P=new At(b,{frameTransform:O?y:null,ignoreTransforms:!O}),W={x:y.scaleX/v.scaleX,y:y.scaleY/v.scaleY},{width:V,height:j,top:vt,left:Vt}=P;O&&(V=V/W.x,j=j/W.y);let N=new Rl(m),Nt=Dt(b),{transition:wr,translate:En,boxSizing:Wi,paddingBlockStart:xr,paddingBlockEnd:Li,paddingInlineStart:te,paddingInlineEnd:$i,borderInlineStartWidth:On,borderInlineEndWidth:ee,borderBlockStartWidth:Pt,borderBlockEndWidth:Xt}=Nt,je=wr.split(",").filter($=>!/^\s*(transform|translate|scale)\b/.test($)).join(","),Ct=er(Nt),pe=Nt.transform,kr=x==="clone",Pn=Wi==="content-box",Cn=Pn?parseInt(te)+parseInt($i)+parseInt(On)+parseInt(ee):0,Sr=Pn?parseInt(xr)+parseInt(Li)+parseInt(Pt)+parseInt(Xt):0,it=x!=="move"&&!this.overlay?nf(g,kr?"clone":"hidden"):null,ne=I(()=>Te(l.dragOperation.activatorEvent));if(!h.translate){if(this.overlay&&Ct)h.translate={x:Ct.x,y:Ct.y};else if(En!=="none"){let $=cn(En);$&&(h.translate=$)}}if(!h.transformOrigin){let $=I(()=>c.current),K=Vt+((r=Ct?.x)!=null?r:0),kt=vt+((i=Ct?.y)!=null?i:0);h.transformOrigin={x:($.x-K*v.scaleX-v.x)/(V*v.scaleX),y:($.y-kt*v.scaleY-v.y)/(j*v.scaleY)}}let{transformOrigin:Yt}=h,ge=vt*v.scaleY+v.y,Mn=Vt*v.scaleX+v.x;if(!h.coordinates&&(h.coordinates={x:Mn,y:ge},W.x!==1||W.y!==1)){let{scaleX:$,scaleY:K}=y,{x:kt,y:re}=Yt;h.coordinates.x+=(V*$-V)*kt,h.coordinates.y+=(j*K-j)*re}h.dimensions||(h.dimensions={width:V,height:j}),h.frameTransform||(h.frameTransform=v);let mt={x:h.coordinates.x-Mn,y:h.coordinates.y-ge},R={width:(h.dimensions.width*h.frameTransform.scaleX-V*v.scaleX)*Yt.x,height:(h.dimensions.height*h.frameTransform.scaleY-j*v.scaleY)*Yt.y},st={x:mt.x/v.scaleX+R.width,y:mt.y/v.scaleY+R.height},Er={left:Vt+st.x,top:vt+st.y};m.setAttribute(Ht,"true");let Or=I(()=>u.transform),Pr=(s=h.translate)!=null?s:{x:0,y:0},Wt=Or.x*v.scaleX+Pr.x,In=Or.y*v.scaleY+Pr.y,Cr=qs();N.set({width:V-Cn,height:j-Sr,top:Er.top+Cr.y,left:Er.left+Cr.x,translate:`${Wt}px ${In}px 0`,transform:this.overlay?"none":pe,transition:je?`${je}, translate 0ms linear`:"translate 0ms linear",scale:O?`${W.x} ${W.y}`:"","transform-origin":`${Yt.x*100}% ${Yt.y*100}%`},rt),it&&(b.insertAdjacentElement("afterend",it),d?.rootElement&&(typeof d.rootElement=="function"?d.rootElement(g):d.rootElement).appendChild(b)),di(m)&&(m.hasAttribute("popover")||m.setAttribute("popover","manual"),De(m),m.addEventListener("beforetoggle",Kl));let jt,yt,Be,Mr=cf({placeholder:it,element:b,feedbackElement:m,frameTransform:v,transformOrigin:Yt,width:V,height:j,top:vt,left:Vt,widthOffset:Cn,heightOffset:Sr,delta:st,styles:N,dragOperation:u,getTranslate:()=>o.current.translate,getElementMutationObserver:()=>jt,getSavedCellWidths:()=>Be,setSavedCellWidths:$=>{Be=$}}),w=new At(m);I(()=>u.shape=w);let E=pt(m),S=$=>{this.manager.actions.stop({event:$})},A=Zn(E);ne&&E.addEventListener("resize",S),I(()=>g.status)==="idle"&&requestAnimationFrame(()=>g.status="dragging"),it&&(Mr.observe(it),jt=af(b,it,kr),yt=lf(b,it,m));let ut=(a=l.dragOperation.source)==null?void 0:a.id,H=()=>{var $;if(!ne||ut==null)return;let K=l.registry.draggables.get(ut),kt=($=K?.handle)!=null?$:K?.element;Zt(kt)&&kt.focus()},G=()=>{jt?.disconnect(),yt?.disconnect(),Mr.disconnect(),E.removeEventListener("resize",S),di(m)&&(m.removeEventListener("beforetoggle",Kl),m.removeAttribute("popover")),m.removeAttribute(Ht),N.reset();let $=()=>{var K;if(Be&&no(b)){let zi=Array.from(b.cells);for(let[Dr,He]of zi.entries())He.style.width=(K=Be[Dr])!=null?K:""}g.status="idle";let kt=o.current.translate!=null,re=u.status.dragging;it&&(!re&&kt||it.parentElement!==m.parentElement)&&m.isConnected&&it.replaceWith(m),it?.remove()};m===this.overlay?setTimeout($,0):$()},Re=d?.dropAnimation,Ir=this,fd=be(()=>{var $,K,kt;let{transform:re,status:zi}=u;if(!(!re.x&&!re.y&&!o.current.translate)&&zi.dragging){let Dr=($=h.translate)!=null?$:{x:0,y:0},He={x:re.x/v.scaleX+Dr.x,y:re.y/v.scaleY+Dr.y},Xo=o.current.translate,hd=I(()=>u.modifiers),Fi=I(()=>{var An;return(An=u.shape)==null?void 0:An.current}),Dn=d?.keyboardTransition,Yo=ne&&!A&&Dn!==null?`${(K=Dn?.duration)!=null?K:250}ms ${(kt=Dn?.easing)!=null?kt:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(N.set({transition:je?`${je}, translate ${Yo}`:`translate ${Yo}`,translate:`${He.x}px ${He.y}px 0`},rt),jt?.takeRecords(),Fi&&Fi!==w&&Xo&&!hd.length){let An=dt.delta(He,Xo);u.shape=bt.from(Fi.boundingRectangle).translate(An.x*v.scaleX,An.y*v.scaleY)}else u.shape=new At(m);o.current.translate=He}},function(){if(u.status.dropped){this.dispose(),g.status="dropping";let $=_?.dropAnimation!==void 0?_.dropAnimation:Ir.dropAnimation!==void 0?Ir.dropAnimation:Re,K=o.current.translate,kt=K!=null;if(!K&&b!==m&&(K={x:0,y:0}),!K||$===null){G();return}l.renderer.rendering.then(()=>{ff({source:g,element:b,feedbackElement:m,placeholder:it,translate:K,moved:kt,transition:wr,alignment:g.alignment,styles:N,animation:$??void 0,getElementMutationObserver:()=>jt,cleanup:G,restoreFocus:H})})}});return()=>{G(),fd()}};Tt(cr,4,"overlay",gc,vn,go);$e(cr,vn);vn.configure=sn(vn);var vo=vn,nr=!0,hf=!1,yc,bc,_c,wc,ce,mo,yo;wc=(_c=[D],Ot.Forward),bc=(yc=[D],Ot.Reverse);var dr=class{constructor(){Y(this,mo,Z(ce,8,this,nr)),Z(ce,11,this),Y(this,yo,Z(ce,12,this,nr)),Z(ce,15,this)}isLocked(t){return t===Ot.Idle?!1:t==null?this[Ot.Forward]===nr&&this[Ot.Reverse]===nr:this[t]===nr}unlock(t){t!==Ot.Idle&&(this[t]=hf)}};ce=yn(null);mo=new WeakMap;yo=new WeakMap;Tt(ce,4,wc,_c,dr,mo);Tt(ce,4,bc,yc,dr,yo);$e(ce,dr);var pf=[Ot.Forward,Ot.Reverse],Gl=class{constructor(){this.x=new dr,this.y=new dr}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},gf=class extends tt{constructor(t){super(t);let e=Bt(new Gl),n=null;this.signal=e,lt(()=>{let{status:r}=t.dragOperation;if(!r.initialized){n=null,e.value=new Gl;return}let{delta:i}=t.dragOperation.position;if(n){let s={x:Jl(i.x,n.x),y:Jl(i.y,n.y)},a=e.peek();z(()=>{for(let o of us)for(let l of pf)s[o]===l&&a[o].unlock(l);e.value=a})}n=i})}get current(){return this.signal.peek()}};function Jl(t,e){return Math.sign(t-e)}var xc,io,ur,bo,le,so,bn=class extends(io=on,xc=[D],io){constructor(t){super(t),Y(this,bo,Z(ur,8,this,!1)),Z(ur,11,this),Y(this,le),Y(this,so,()=>{if(!F(this,le))return;let{element:s,by:a}=F(this,le);a.y&&(s.scrollTop+=a.y),a.x&&(s.scrollLeft+=a.x)}),this.scroll=(s,a)=>{var o;if(this.disabled)return!1;let l=this.getScrollableElements();if(!l)return gt(this,le,void 0),!1;let{position:d}=this.manager.dragOperation,u=d?.current;if(u){let{by:c}=s??{},g=c?{x:Zl(c.x),y:Zl(c.y)}:void 0,p=g?void 0:this.scrollIntentTracker.current;if(p?.isLocked())return!1;for(let b of l){let _=jl(b,c);if(_.x||_.y){let{speed:k,direction:x}=Bl(b,u,g,a?.acceleration,a?.threshold);if(p)for(let h of us)p[h].isLocked(x[h])&&(k[h]=0,x[h]=0);if(x.x||x.y){let{x:h,y:m}=c??x,v=h*k.x,y=m*k.y;if(v||y){let O=(o=F(this,le))==null?void 0:o.by;if(this.autoScrolling&&O&&(O.x&&!v||O.y&&!y))continue;return gt(this,le,{element:b,by:{x:v,y}}),tr.schedule(F(this,so)),!0}}}}}return gt(this,le,void 0),!1};let e=null,n=null,r=Fr(()=>{let{position:s,source:a}=t.dragOperation;if(!s)return null;let o=Us(Jn(a?.element),s.current);return o&&(e=o),o??e}),i=Fr(()=>{let s=r.value,{documentElement:a}=Me(s);if(!s||s===a){let{target:o}=t.dragOperation,l=o?.element;if(l){let d=ui(l,{excludeElement:!1});return n=d,d}}if(s){let o=ui(s,{excludeElement:!1});return this.autoScrolling&&n&&o.size<n?.size?n:(n=o,o)}return n=null,null},zr);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new gf(t),this.destroy=t.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!Te(t.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};ur=yn(io);bo=new WeakMap;le=new WeakMap;so=new WeakMap;Tt(ur,4,"autoScrolling",xc,bn,bo);$e(ur,bn);function Zl(t){return t>0?Ot.Forward:t<0?Ot.Reverse:Ot.Idle}var vf=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:e,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let r of e)r();for(let r of n)r()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},mf=new vf(t=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}),yf=10,oo=class extends tt{constructor(e,n){super(e,n);let r=e.registry.plugins.get(bn);if(!r)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=lt(()=>{var i,s,a;if(this.disabled)return;let{position:o,status:l}=e.dragOperation;if(l.dragging){let d={acceleration:(i=this.options)==null?void 0:i.acceleration,threshold:typeof((s=this.options)==null?void 0:s.threshold)=="number"?{x:this.options.threshold,y:this.options.threshold}:(a=this.options)==null?void 0:a.threshold};if(r.scroll(void 0,d)){r.autoScrolling=!0;let c=setInterval(()=>mf.schedule(()=>r.scroll(void 0,d)),yf);return()=>{clearInterval(c)}}else r.autoScrolling=!1}})}};oo.configure=sn(oo);var kc=oo,Ql={capture:!0,passive:!0},ir,bf=class extends on{constructor(t){super(t),Y(this,ir),this.handleScroll=()=>{F(this,ir)==null&>(this,ir,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),gt(this,ir,void 0)},50))};let{dragOperation:e}=this.manager;this.destroy=lt(()=>{var n,r,i;if(e.status.dragging){let a=(i=(r=(n=e.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return a.addEventListener("scroll",this.handleScroll,Ql),()=>{a.removeEventListener("scroll",this.handleScroll,Ql)}}})}};ir=new WeakMap;var _f="* { user-select: none !important; -webkit-user-select: none !important; }",wf=class extends tt{constructor(t){super(t),this.manager=t;let e=t.registry.plugins.get(ki),n=e?.register(_f);if(this.destroy=lt(()=>{let{dragOperation:r}=this.manager;if(r.status.initialized)return Gs(),document.addEventListener("selectionchange",Gs,{capture:!0}),()=>{document.removeEventListener("selectionchange",Gs,{capture:!0})}}),n){let r=this.destroy.bind(this);this.destroy=()=>{n(),r()}}}};function Gs(){var t;(t=document.getSelection())==null||t.removeAllRanges()}var sr=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(t,e){var n;let r=(n=e.handle)!=null?n:e.element;return t.target!==r}}),un,wi=class extends xe{constructor(e,n){super(e),this.manager=e,this.options=n,Y(this,un,[]),this.listeners=new Xs,this.handleSourceKeyDown=(r,i,s)=>{if(this.disabled||r.defaultPrevented||!ae(r.target)||i.disabled)return;let{keyboardCodes:a=sr.keyboardCodes,preventActivation:o=sr.preventActivation}=s??{};a.start.includes(r.code)&&this.manager.dragOperation.status.idle&&(o?.(r,i)||this.handleStart(r,i,s))}}bind(e,n=this.options){return lt(()=>{var i;let s=(i=e.handle)!=null?i:e.element,a=o=>{Te(o)&&this.handleSourceKeyDown(o,e,n)};if(s)return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}})}handleStart(e,n,r){let{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),fi(i);let{center:s}=new At(i);if(this.manager.actions.start({event:e,coordinates:{x:s.x,y:s.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();let o=Me(i),l=[this.listeners.bind(o,[{type:"keydown",listener:d=>this.handleKeyDown(d,n,r),options:{capture:!0}}])];F(this,un).push(...l)}handleKeyDown(e,n,r){let{keyboardCodes:i=sr.keyboardCodes}=r??{};if(dn(e,[...i.end,...i.cancel])){e.preventDefault();let s=dn(e,i.cancel);this.handleEnd(e,s);return}dn(e,i.up)?this.handleMove("up",e):dn(e,i.down)&&this.handleMove("down",e),dn(e,i.left)?this.handleMove("left",e):dn(e,i.right)&&this.handleMove("right",e)}handleEnd(e,n){this.manager.actions.stop({event:e,canceled:n}),this.cleanup()}handleMove(e,n){var r,i;let{shape:s}=this.manager.dragOperation,a=n.shiftKey?5:1,o={x:0,y:0},l=(i=(r=this.options)==null?void 0:r.offset)!=null?i:sr.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!s){switch(e){case"up":o={x:0,y:-l.y*a};break;case"down":o={x:0,y:l.y*a};break;case"left":o={x:-l.x*a,y:0};break;case"right":o={x:l.x*a,y:0};break}(o.x||o.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:o}))}}sideEffects(){let e=this.manager.registry.plugins.get(kc);e?.disabled===!1&&(e.disable(),F(this,un).push(()=>{e.enable()}))}cleanup(){F(this,un).forEach(e=>e()),gt(this,un,[])}destroy(){this.cleanup(),this.listeners.clear()}};un=new WeakMap;wi.configure=sn(wi);wi.defaults=sr;var _o=wi;function dn(t,e){return e.includes(t.code)}var Ne,xf=class extends Ns{constructor(){super(...arguments),Y(this,Ne)}onEvent(t){switch(t.type){case"pointerdown":gt(this,Ne,Ie(t));break;case"pointermove":if(!F(this,Ne))return;let{x:e,y:n}=Ie(t),r={x:e-F(this,Ne).x,y:n-F(this,Ne).y},{tolerance:i}=this.options;if(i&&Br(r,i)){this.abort();return}Br(r,this.options.value)&&this.activate(t);break;case"pointerup":this.abort();break}}abort(){gt(this,Ne,void 0)}};Ne=new WeakMap;var fn,We,kf=class extends Ns{constructor(){super(...arguments),Y(this,fn),Y(this,We)}onEvent(t){switch(t.type){case"pointerdown":gt(this,We,Ie(t)),gt(this,fn,setTimeout(()=>this.activate(t),this.options.value));break;case"pointermove":if(!F(this,We))return;let{x:e,y:n}=Ie(t),r={x:e-F(this,We).x,y:n-F(this,We).y};Br(r,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){F(this,fn)&&(clearTimeout(F(this,fn)),gt(this,We,void 0),gt(this,fn,void 0))}};fn=new WeakMap;We=new WeakMap;var pn=class{};pn.Delay=kf;pn.Distance=xf;var ao=Object.freeze({activationConstraints(t,e){var n;let{pointerType:r,target:i}=t;if(!(r==="mouse"&&ae(i)&&(e.handle===i||(n=e.handle)!=null&&n.contains(i))))return r==="touch"?[new pn.Delay({value:250,tolerance:5})]:ql(i)&&!t.defaultPrevented?[new pn.Delay({value:200,tolerance:0})]:[new pn.Delay({value:200,tolerance:10}),new pn.Distance({value:5})]},preventActivation(t,e){var n;let{target:r}=t;if(r===e.element||r===e.handle||!ae(r)||(n=e.handle)!=null&&n.contains(r))return!1;let i=Tl(r);return i===e.element?!1:!!i}}),hn,xi=class extends xe{constructor(e,n){super(e),this.manager=e,this.options=n,Y(this,hn,new Set),this.listeners=new Xs,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{let{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,n,r=this.options){let{activationConstraints:i=ao.activationConstraints}=r??{};return typeof i=="function"?i(e,n):i}bind(e,n=this.options){return lt(()=>{var i;let s=new AbortController,{signal:a}=s,o=d=>{Hl(d)&&this.handlePointerDown(d,e,n)},l=[(i=e.handle)!=null?i:e.element];n?.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(e));for(let d of l)d&&(Of(d.ownerDocument.defaultView),d.addEventListener("pointerdown",o,{signal:a}));return()=>s.abort()})}handlePointerDown(e,n,r){if(this.disabled||!e.isPrimary||e.button!==0||!ae(e.target)||n.disabled||Sf(e)||!this.manager.dragOperation.status.idle)return;let{preventActivation:i=ao.preventActivation}=r??{};if(i?.(e,n))return;let{target:s}=e,a=Zt(s)&&s.draggable&&s.getAttribute("draggable")==="true",o=Ae(n.element),{x:l,y:d}=Ie(e);this.initialCoordinates={x:l*o.scaleX+o.x,y:d*o.scaleY+o.y};let u=this.activationConstraints(e,n,r);e.sensor=this;let c=new ul(u,_=>this.handleStart(n,_));c.signal.onabort=()=>this.handleCancel(e),c.onEvent(e),this.controller=c;let g=ei(),p=this.listeners.bind(g,[{type:"pointermove",listener:_=>this.handlePointerMove(_,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:a?this.handleCancel:vi,options:{capture:!0}}]),b=()=>{p(),this.initialCoordinates=void 0};F(this,hn).add(b)}handlePointerMove(e,n){var r,i;if(((r=this.controller)==null?void 0:r.activated)===!1){(i=this.controller)==null||i.onEvent(e);return}if(this.manager.dragOperation.status.dragging){let s=Ie(e),a=Ae(n.element);s.x=s.x*a.scaleX+a.x,s.y=s.y*a.scaleY+a.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=s,tr.schedule(this.handleMove)}}handlePointerUp(e){let{status:n}=this.manager.dragOperation;if(!n.idle){e.preventDefault(),e.stopPropagation();let r=!n.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,n){let{manager:r,initialCoordinates:i}=this;if(!i||!r.dragOperation.status.idle||n.defaultPrevented)return;if(r.actions.start({coordinates:i,event:n,source:e}).signal.aborted)return this.cleanup();n.preventDefault();let o=Me(n.target).body;try{o.setPointerCapture(n.pointerId)}catch{this.handleCancel(n);return}let l=ae(n.target)?[n.target,o]:o,d=this.listeners.bind(l,[{type:"touchmove",listener:vi,options:{passive:!1}},{type:"click",listener:vi},{type:"contextmenu",listener:vi},{type:"keydown",listener:this.handleKeyDown}]);F(this,hn).add(d)}handleCancel(e){let{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){let{controller:e}=this;this.controller=void 0,e&&!e.signal.aborted&&e.abort(),this.latest={event:void 0,coordinates:void 0},F(this,hn).forEach(n=>n()),F(this,hn).clear()}destroy(){this.cleanup(),this.listeners.clear()}};hn=new WeakMap;xi.configure=sn(xi);xi.defaults=ao;var wo=xi;function Sf(t){return"sensor"in t}function vi(t){t.preventDefault()}function Ef(){}var tc=new WeakSet;function Of(t){!t||tc.has(t)||(t.addEventListener("touchmove",Ef,{capture:!1,passive:!1}),tc.add(t))}var Js={modifiers:[],plugins:[Gu,kc,Zu,vo,wf],sensors:[wo,_o]},Sc=class extends wl{constructor(t={}){let e=Rt(t.plugins,Js.plugins),n=Rt(t.sensors,Js.sensors),r=Rt(t.modifiers,Js.modifiers);super(fo(lr({},t),{plugins:[bf,bn,ki,...e],sensors:n,modifiers:r}))}},Ec,Oc,lo,de,xo,ko,ze=class extends(lo=$t,Oc=[D],Ec=[D],lo){constructor(t,e){var n=t,{element:r,effects:i=()=>[],handle:s}=n,a=ic(n,["element","effects","handle"]);super(lr({effects:()=>[...i(),()=>{var o,l;let{manager:d}=this;if(!d)return;let c=((l=(o=this.sensors)==null?void 0:o.map(en))!=null?l:[...d.sensors]).map(g=>{let p=g instanceof xe?g:d.registry.register(g.plugin),b=g instanceof xe?void 0:g.options;return p.bind(this,b)});return function(){c.forEach(p=>p())}}]},a),e),Y(this,xo,Z(de,8,this)),Z(de,11,this),Y(this,ko,Z(de,12,this)),Z(de,15,this),this.element=r,this.handle=s}};de=yn(lo);xo=new WeakMap;ko=new WeakMap;Tt(de,4,"handle",Oc,ze,xo);Tt(de,4,"element",Ec,ze,ko);$e(de,ze);var Pc,Cc,co,ue,So,Zs,Mc,Ic,ar,Eo,_n=class extends(co=zt,Cc=[D],Pc=[D],co){constructor(t,e){var n=t,{element:r,effects:i=()=>[]}=n,s=ic(n,["element","effects"]);let{collisionDetector:a=gi}=s,o=d=>{let{manager:u,element:c}=this;if(!c||d===null){this.shape=void 0;return}if(!u)return;let g=new At(c),p=I(()=>this.shape);return g&&p?.equals(g)?p:(this.shape=g,g)},l=Bt(!1);super(fo(lr({},s),{collisionDetector:a,effects:()=>[...i(),()=>{let{element:d,manager:u}=this;if(!u)return;let{dragOperation:c}=u,{source:g}=c;l.value=!!(g&&c.status.initialized&&d&&!this.disabled&&this.accepts(g))},()=>{let{element:d}=this;if(l.value&&d){let u=new Fl(d,o);return()=>{u.disconnect(),this.shape=void 0}}},()=>{var d;if((d=this.manager)!=null&&d.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),e),Y(this,ar),Y(this,So,Z(ue,8,this)),Z(ue,11,this),Y(this,Eo,Z(ue,12,this)),Z(ue,15,this),this.element=r,this.refreshShape=()=>o()}set element(t){gt(this,ar,t,Ic)}get element(){var t;return(t=this.proxy)!=null?t:F(this,ar,Mc)}};ue=yn(co);So=new WeakMap;ar=new WeakSet;Eo=new WeakMap;Zs=Tt(ue,20,"#element",Cc,ar,So),Mc=Zs.get,Ic=Zs.set;Tt(ue,4,"proxy",Pc,_n,Eo);$e(ue,_n);var Pf=Object.create,Fc=Object.defineProperty,Cf=Object.defineProperties,Mf=Object.getOwnPropertyDescriptor,If=Object.getOwnPropertyDescriptors,Mi=Object.getOwnPropertySymbols,Vc=Object.prototype.hasOwnProperty,jc=Object.prototype.propertyIsEnumerable,Df=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yr=t=>{throw TypeError(t)},Mo=(t,e,n)=>e in t?Fc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Oo=(t,e)=>{for(var n in e||(e={}))Vc.call(e,n)&&Mo(t,n,e[n]);if(Mi)for(var n of Mi(e))jc.call(e,n)&&Mo(t,n,e[n]);return t},Po=(t,e)=>Cf(t,If(e)),Af=(t,e)=>{var n={};for(var r in t)Vc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Mi)for(var r of Mi(t))e.indexOf(r)<0&&jc.call(t,r)&&(n[r]=t[r]);return n},Tf=t=>{var e;return[,,,Pf((e=void 0)!=null?e:null)]},Bc=["class","method","getter","setter","accessor","field","value","get","set"],pr=t=>t!==void 0&&typeof t!="function"?yr("Function expected"):t,Nf=(t,e,n,r,i)=>({kind:Bc[t],name:e,metadata:r,addInitializer:s=>n._?yr("Already initialized"):i.push(pr(s||null))}),Wf=(t,e)=>Mo(e,Df("metadata"),t[3]),Si=(t,e,n,r)=>{for(var i=0,s=t[e>>1],a=s&&s.length;i<a;i++)e&1?s[i].call(n):r=s[i].call(n,r);return r},Rc=(t,e,n,r,i,s)=>{for(var a,o,l,d,u,c=e&7,g=!1,p=!1,b=t.length+1,_=Bc[c+5],k=t[b-1]=[],x=t[b]||(t[b]=[]),h=(i=i.prototype,Mf({get[n](){return gr(this,s)},set[n](v){return Fe(this,s,v)}},n)),m=r.length-1;m>=0;m--)d=Nf(c,n,l={},t[3],x),d.static=g,d.private=p,u=d.access={has:v=>n in v},u.get=v=>v[n],u.set=(v,y)=>v[n]=y,o=(0,r[m])({get:h.get,set:h.set},d),l._=1,o===void 0?pr(o)&&(h[_]=o):typeof o!="object"||o===null?yr("Object expected"):(pr(a=o.get)&&(h.get=a),pr(a=o.set)&&(h.set=a),pr(a=o.init)&&k.unshift(a));return h&&Fc(i,n,h),i},Hc=(t,e,n)=>e.has(t)||yr("Cannot "+n),gr=(t,e,n)=>(Hc(t,e,"read from private field"),e.get(t)),hr=(t,e,n)=>e.has(t)?yr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Fe=(t,e,n,r)=>(Hc(t,e,"write to private field"),e.set(t,n),n);function Ve(t){return t instanceof Ao||t instanceof Xc}var Ei=10,Lf=class extends tt{constructor(t){super(t);let e=lt(()=>{let{dragOperation:r}=t;if(Te(r.activatorEvent)&&Ve(r.source)&&r.status.initialized){let i=t.registry.plugins.get(bn);if(i)return i.disable(),()=>i.enable()}}),n=t.monitor.addEventListener("dragmove",(r,i)=>{queueMicrotask(()=>{if(this.disabled||r.defaultPrevented||!r.nativeEvent)return;let{dragOperation:s}=i;if(!Te(r.nativeEvent)||!Ve(s.source)||!s.shape)return;let{actions:a,collisionObserver:o,registry:l}=i,{by:d}=r;if(!d)return;let u=$f(d),{source:c,target:g}=s,{center:p}=s.shape.current,b=[],_=[];z(()=>{for(let y of l.droppables){let{id:O}=y;if(!y.accepts(c)||O===g?.id&&Ve(y)||!y.element)continue;let P=y.shape,W=new At(y.element,{getBoundingClientRect:V=>ln(V,void 0,.2)});!W.height||!W.width||(u=="down"&&p.y+Ei<W.center.y||u=="up"&&p.y-Ei>W.center.y||u=="left"&&p.x-Ei>W.center.x||u=="right"&&p.x+Ei<W.center.x)&&(b.push(y),y.shape=W,_.push(()=>y.shape=P))}}),r.preventDefault(),o.disable();let k=o.computeCollisions(b,Ul);z(()=>_.forEach(y=>y()));let[x]=k;if(!x)return;let{id:h}=x,{index:m,group:v}=c.sortable;a.setDropTarget(h).then(()=>{let{source:y,target:O,shape:P}=s;if(!y||!Ve(y)||!P)return;let{index:W,group:V,target:j}=y.sortable,vt=m!==W||v!==V,Vt=vt?j:O?.element;if(!Vt)return;fi(Vt);let N=new At(Vt);if(!N)return;let Nt=bt.delta(N,bt.from(P.current.boundingRectangle),y.alignment);a.move({by:Nt}),vt?a.setDropTarget(y.id).then(()=>o.enable()):o.enable()})})});this.destroy=()=>{n(),e()}}};function $f(t){let{x:e,y:n}=t;if(e>0)return"right";if(e<0)return"left";if(n>0)return"down";if(n<0)return"up"}var zf=Object.defineProperty,Ff=Object.defineProperties,Vf=Object.getOwnPropertyDescriptors,Dc=Object.getOwnPropertySymbols,jf=Object.prototype.hasOwnProperty,Bf=Object.prototype.propertyIsEnumerable,Ac=(t,e,n)=>e in t?zf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,wn=(t,e)=>{for(var n in e||(e={}))jf.call(e,n)&&Ac(t,n,e[n]);if(Dc)for(var n of Dc(e))Bf.call(e,n)&&Ac(t,n,e[n]);return t},xn=(t,e)=>Ff(t,Vf(e));function Rf(t,e,n){if(e===n)return t;let r=t.slice();return r.splice(n,0,r.splice(e,1)[0]),r}function Oi(t,e){let n=String(e);return Object.prototype.hasOwnProperty.call(t,n)?n:void 0}function Co(t){return"initialIndex"in t&&typeof t.initialIndex=="number"&&"index"in t&&typeof t.index=="number"}function Hf(t,e,n){var r,i;let{source:s,target:a,canceled:o}=e.operation;if(!s||!a||o)return"preventDefault"in e&&e.preventDefault(),t;let l=(m,v)=>m===v||m!==null&&typeof m=="object"&&"id"in m&&m.id===v;if(Array.isArray(t)){let m=t.findIndex(y=>l(y,s.id)),v=t.findIndex(y=>l(y,a.id));if(m===-1||v===-1){if(Co(s)){let y=s.initialIndex,O=s.index;return y===O||y<0||y>=t.length?("preventDefault"in e&&e.preventDefault(),t):n(t,y,O)}return t}if(!o&&"index"in s&&typeof s.index=="number"){let y=s.index;if(y!==m)return n(t,m,y)}return n(t,m,v)}let d=Object.entries(t),u=-1,c,g=-1,p;for(let[m,v]of d)if(u===-1&&(u=v.findIndex(y=>l(y,s.id)),u!==-1&&(c=m)),g===-1&&(g=v.findIndex(y=>l(y,a.id)),g!==-1&&(p=m)),u!==-1&&g!==-1)break;if(u===-1&&Co(s)){let m=s.initialGroup==null?void 0:Oi(t,s.initialGroup),v=s.initialIndex,y=s.group==null?void 0:Oi(t,s.group),O=s.index;if(m==null||y==null||m===y&&v===O)return"preventDefault"in e&&e.preventDefault(),t;if(m===y)return xn(wn({},t),{[m]:n(t[m],v,O)});let P=t[m][v];return xn(wn({},t),{[m]:[...t[m].slice(0,v),...t[m].slice(v+1)],[y]:[...t[y].slice(0,O),P,...t[y].slice(O)]})}if(!s.manager)return t;let{dragOperation:b}=s.manager,_=(i=(r=b.shape)==null?void 0:r.current.center)!=null?i:b.position.current;if(p==null){let m=Oi(t,a.id);if(m!=null){let v=a.shape&&_.y>a.shape.center.y?t[m].length:0;p=m,g=v}}if(c==null||p==null||c===p&&u===g){if(c!=null&&c===p&&u===g&&Co(s)){let m=s.group==null?void 0:Oi(t,s.group),v=s.group!=null&&m!==c,y=s.index!==u;if(v||y){let O=s.group==null?c:m;if(O!=null){if(c===O)return xn(wn({},t),{[c]:n(t[c],u,s.index)});let P=t[c][u];return xn(wn({},t),{[c]:[...t[c].slice(0,u),...t[c].slice(u+1)],[O]:[...t[O].slice(0,s.index),P,...t[O].slice(s.index)]})}}}return"preventDefault"in e&&e.preventDefault(),t}if(c===p)return xn(wn({},t),{[c]:n(t[c],u,g)});let x=a.shape&&Math.round(_.y)>Math.round(a.shape.center.y)?1:0,h=t[c][u];return xn(wn({},t),{[c]:[...t[c].slice(0,u),...t[c].slice(u+1)],[p]:[...t[p].slice(0,g+x),h,...t[p].slice(g+x)]})}function qf(t,e){return Hf(t,e,Rf)}function Tc(t){let e=new Map;for(let[,n]of t)for(let r of n)e.set(r.id,r.index);return e}function Nc(t,e,n){var r;for(let[i,s]of e)for(let a of s){let o=t.get(a.id);if(a.index!==o||a.group!==i||!((r=n.get(i))!=null&&r.has(a)))return!0}return!1}var Wc="__default__",Uf=class extends tt{constructor(t){super(t);let e=()=>{let r=new Map;for(let i of t.registry.droppables)if(i instanceof Ao){let{sortable:s}=i,{group:a}=s,o=r.get(a);o||(o=new Set,r.set(a,o)),o.add(s)}return r},n=[t.monitor.addEventListener("dragover",(r,i)=>{if(this.disabled)return;let{dragOperation:s}=i,{source:a,target:o}=s;if(!Ve(a)||!Ve(o)||a.sortable===o.sortable)return;let l=e(),d=Tc(l),u=a.sortable.group===o.sortable.group,c=l.get(a.sortable.group),g=u?c:l.get(o.sortable.group);!c||!g||queueMicrotask(()=>{r.defaultPrevented||i.renderer.rendering.then(()=>{var p,b;let _=e();if(Nc(d,l,_))return;let k=a.sortable.element,x=o.sortable.element;if(!x||!k||!u&&o.id===a.sortable.group)return;let h=Pi(c),m=u?h:Pi(g),v=(p=a.sortable.group)!=null?p:Wc,y=(b=o.sortable.group)!=null?b:Wc,O={[v]:h,[y]:m},P=qf(O,r);if(O===P)return;let W=P[y].indexOf(a.sortable),V=P[y].indexOf(o.sortable);i.collisionObserver.disable(),Lc(k,W,x,V),z(()=>{for(let[j,vt]of P[v].entries())vt.index=j;if(!u)for(let[j,vt]of P[y].entries())vt.group=o.sortable.group,vt.index=j}),i.actions.setDropTarget(a.id).then(()=>i.collisionObserver.enable())})})}),t.monitor.addEventListener("dragend",(r,i)=>{if(!r.canceled)return;let{dragOperation:s}=i,{source:a}=s;Ve(a)&&(a.sortable.initialIndex===a.sortable.index&&a.sortable.initialGroup===a.sortable.group||queueMicrotask(()=>{let o=e(),l=Tc(o),d=o.get(a.sortable.initialGroup);d&&i.renderer.rendering.then(()=>{let u=e();if(Nc(l,o,u))return;let c=Pi(d),g=Pi(d,Yf),p=a.sortable.element,b=g.indexOf(a.sortable),_=c[b],k=_?.element;!_||!k||!p||(Lc(p,_.index,k,a.index),z(()=>{for(let x of o.values()){let h=Array.from(x).values();for(let m of h)m.index=m.initialIndex,m.group=m.initialGroup}}))})}))})];this.destroy=()=>{for(let r of n)r()}}};function Lc(t,e,n,r){let i=r<e?"afterend":"beforebegin";n.insertAdjacentElement(i,t)}function Xf(t,e){return t.index-e.index}function Yf(t,e){return t.initialIndex-e.initialIndex}function Pi(t,e=Xf){return Array.from(t).sort(e)}var $c=[Lf,Uf],Kf={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1};function zc(t){var e,n;return typeof t=="boolean"?{draggable:t,droppable:t}:{draggable:(e=t?.draggable)!=null?e:!1,droppable:(n=t?.droppable)!=null?n:!1}}var Ci=new _a,qc,Uc,he,Io,vr,mr,Do,kn;Uc=[D],qc=[D];var Sn=class{constructor(t,e){hr(this,Io,Si(he,8,this)),Si(he,11,this),hr(this,vr),hr(this,mr),hr(this,Do,Si(he,12,this)),Si(he,15,this),hr(this,kn),this.register=()=>(z(()=>{var b,_;(b=this.manager)==null||b.registry.register(this.droppable),(_=this.manager)==null||_.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{z(()=>{var b,_;(b=this.manager)==null||b.registry.unregister(this.droppable),(_=this.manager)==null||_.registry.unregister(this.draggable)})},this.destroy=()=>{z(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=t,{effects:r=()=>[],disabled:i,group:s,index:a,sensors:o,type:l,transition:d=Kf,plugins:u}=n,c=Af(n,["effects","disabled","group","index","sensors","type","transition","plugins"]);let g=Rt(u,$c),p=zc(i);this.droppable=new Ao(Po(Oo({},c),{disabled:p.droppable}),e,this),this.draggable=new Xc(Po(Oo({},c),{disabled:p.draggable,plugins:g,effects:()=>[()=>{var b,_,k;let x=(b=this.manager)==null?void 0:b.dragOperation.status;x?.initializing&&this.id===((k=(_=this.manager)==null?void 0:_.dragOperation.source)==null?void 0:k.id)&&Ci.clear(this.manager),x?.dragging&&Ci.set(this.manager,this.id,I(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:b,group:_,manager:k}=this,x=gr(this,mr),h=gr(this,vr);(b!==x||_!==h)&&(Fe(this,mr,b),Fe(this,vr,_),this.animate())},()=>{var b,_;let{target:k}=this,{isDragSource:x}=this.draggable;((_=(b=this.draggable.pluginConfig(vo))==null?void 0:b.feedback)!=null?_:"default")==="move"&&x&&(this.droppable.disabled=!k)},...r()],type:l,sensors:o}),e,this),Fe(this,kn,c.element),this.manager=e,this.index=a,Fe(this,mr,a),this.group=s,Fe(this,vr,s),this.type=l,this.transition=d}get initialIndex(){var t,e;return(e=(t=Ci.get(this.manager,this.id))==null?void 0:t.initialIndex)!=null?e:this.index}get initialGroup(){var t,e;return(e=(t=Ci.get(this.manager,this.id))==null?void 0:t.initialGroup)!=null?e:this.group}animate(){I(()=>{let{manager:t,transition:e}=this,{shape:n}=this.droppable;if(!t)return;let{idle:r}=t.dragOperation.status;!n||!e||r&&!e.idle||t.renderer.rendering.then(()=>{let{element:i}=this;if(!i)return;for(let u of i.getAnimations())"transitionProperty"in u&&(u.transitionProperty==="transform"||u.transitionProperty==="translate"||u.transitionProperty==="scale")&&u.cancel();let s=this.refreshShape();if(!s)return;let a={x:n.boundingRectangle.left-s.boundingRectangle.left,y:n.boundingRectangle.top-s.boundingRectangle.top},{translate:o}=Dt(i),l=Ks(i,o,!1),d=Ks(i,o);if(a.x||a.y){let u=Zn(pt(i))?Po(Oo({},e),{duration:0}):e;hi({element:i,keyframes:{translate:[`${l.x+a.x}px ${l.y+a.y}px ${l.z}`,`${d.x}px ${d.y}px ${d.z}`]},options:u}).then(()=>{t.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(t){z(()=>{this.draggable.manager=t,this.droppable.manager=t})}set element(t){z(()=>{let e=gr(this,kn),n=this.droppable.element,r=this.draggable.element;(!n||n===e)&&(this.droppable.element=t),(!r||r===e)&&(this.draggable.element=t),Fe(this,kn,t)})}get element(){var t,e;let n=gr(this,kn);if(n)return(e=(t=Qn.get(n))!=null?t:n)!=null?e:this.droppable.element}set target(t){this.droppable.element=t}get target(){return this.droppable.element}set source(t){this.draggable.element=t}get source(){return this.draggable.element}get disabled(){let{disabled:t}=this.draggable,{disabled:e}=this.droppable;return t===e?t:{draggable:t,droppable:e}}set plugins(t){this.draggable.plugins=Rt(t,$c)}set disabled(t){let e=zc(t);z(()=>{this.droppable.disabled=e.droppable,this.draggable.disabled=e.draggable})}set data(t){z(()=>{this.droppable.data=t,this.draggable.data=t})}set handle(t){this.draggable.handle=t}set id(t){this.droppable.id=t,this.draggable.id=t}get id(){return this.droppable.id}set sensors(t){this.draggable.sensors=t}set modifiers(t){this.draggable.modifiers=t}set collisionPriority(t){this.droppable.collisionPriority=t}set collisionDetector(t){this.droppable.collisionDetector=t??gi}set alignment(t){this.draggable.alignment=t}get alignment(){return this.draggable.alignment}set type(t){z(()=>{this.droppable.type=t,this.draggable.type=t})}get type(){return this.draggable.type}set accept(t){this.droppable.accept=t}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(t){return this.droppable.accepts(t)}};he=Tf();Io=new WeakMap;vr=new WeakMap;mr=new WeakMap;Do=new WeakMap;kn=new WeakMap;Rc(he,4,"index",Uc,Sn,Io);Rc(he,4,"group",qc,Sn,Do);Wf(he,Sn);var Xc=class extends ze{constructor(t,e,n){super(t,e),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}},Ao=class extends _n{constructor(t,e,n){super(t,e),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}};var qt=(...t)=>t.filter(Boolean).join(" ");var Gf={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},Jf={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},Zf=({variant:t="primary",size:e="md",className:n,children:r,...i})=>{let s=i.href?"a":"button";return f.createElement(s,{...i,className:qt("ks-button",Gf[t],Jf[e],n)},r)},Q=Zf;var wt=(t,e,n,r={})=>fetch(t,{method:n,headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-Token":e},body:JSON.stringify(r)}).then(i=>i.json().then(s=>i.ok?s:Promise.reject(s))),Yc=(t,e,n,r)=>wt(t,e,"POST",{key:n,column_id:r}),Kc=(t,e,n,r,i)=>wt(`${t}/${n}`,e,"PATCH",{field:r,value:i}),Gc=(t,e)=>wt(t,e,"POST",{}),Jc=(t,e,n)=>wt(t,e,"POST",{row_id:n}),Zc=(t,e,n)=>wt(t,e,"POST",{section_id:n}),To=(t,e,n,r,i)=>wt(`${t}/${n}`,e,"PATCH",{setting:r,value:i}),Ii=(t,e,n)=>wt(`${t}/${n}`,e,"DELETE"),No=(t,e,n,r,i)=>wt(`${t}/${n}/move`,e,"POST",{into:r,position:i}),Qc=(t,e,n)=>wt(`${t}/${n}/duplicate`,e,"POST"),td=(t,e,n,r,i,s)=>wt(`${t}/${n}/bind`,e,"POST",{field:r,name:i,fallback:s}),ed=(t,e,n)=>wt(t,e,"POST",{choice:n}),nd=(t,e,n)=>wt(t,e,"POST",{access_exception:n}),rd=(t,e,n,r,i)=>wt(`${t}/${n}/condition`,e,"POST",{name:r,equals:i}),Wo=(t,e)=>wt(t,e,"POST");var Qf=({as:t="input",disabled:e,className:n,...r})=>f.createElement(t,{...r,disabled:e,className:qt("ks-input",e&&"ks-input-disabled",n)}),xt=Qf;var th=t=>f.createElement(xt,{...t,as:"select"}),et=th;var eh=({type:t="info",title:e,message:n,onDismiss:r,className:i})=>f.createElement("div",{className:qt("ks-alert",`ks-alert-${t}`,i),role:"alert"},f.createElement("div",{className:"ks-alert-body"},f.createElement("div",{className:"ks-alert-content"},e&&f.createElement("p",{className:"ks-alert-title"},e),f.createElement("p",{className:e?"ks-alert-message-titled":"ks-alert-message"},n)),r&&f.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:r},"\xD7"))),id=eh;var Di=(t,e)=>({className:n,children:r,...i})=>f.createElement(t,{...i,className:qt(e,n)},r),Ut=Di("label","ks-label"),ov=Di("p","ks-hint"),av=Di("p","ks-error"),lv=Di("span","ks-required");var nh={section:{spacing:"Section spacing"},row:{gap:"Row gap"},column:{wide:"Width on wide screens",narrow:"Width on narrow screens",align:"Vertical alignment"}};function Lo({node:t,values:e,arrangements:n,refusal:r,onAddColumn:i,onAddRow:s,onArrange:a,onSelect:o,onRemove:l}){let d=nh[t.kind],u=Object.keys(n[t.kind]).filter(c=>d[c]);return f.createElement("aside",{"data-layout-panel":!0,className:"flex flex-col gap-3"},r&&f.createElement("div",{"data-layout-refusal":!0},f.createElement(id,{type:"error",message:r})),u.map(c=>f.createElement("div",{key:`${t.id}-${c}`,className:"flex flex-col gap-1"},f.createElement(Ut,{htmlFor:`ks-pages-${c}`},d[c]),f.createElement(et,{id:`ks-pages-${c}`,defaultValue:e[c]??"",onChange:g=>a(t.id,c,g.target.value)},n[t.kind][c].map(g=>f.createElement("option",{key:g,value:g},g))))),t.kind==="column"&&f.createElement(f.Fragment,null,f.createElement(Q,{type:"button",variant:"secondary",onClick:()=>i(t.rowId)},"Add column"),f.createElement(Q,{type:"button",variant:"secondary",onClick:()=>s(t.sectionId)},"Add row"),f.createElement(Q,{type:"button",variant:"secondary",onClick:()=>o({kind:"row",id:t.rowId,sectionId:t.sectionId})},"Select row")),t.kind==="row"&&f.createElement(Q,{type:"button",variant:"secondary",onClick:()=>o({kind:"section",id:t.sectionId})},"Select section"),f.createElement(Q,{type:"button",variant:"danger",onClick:()=>l(t.id)},"Remove ",t.kind))}var br=[{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 $o({chosen:t,onChoose:e}){return f.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"},br.map(n=>f.createElement("button",{key:n.key,type:"button","aria-pressed":t===n.key,onClick:()=>e(n.key),className:"rounded px-3 py-1 text-sm aria-pressed:bg-(--ks-color-accent) aria-pressed:text-white"},n.label)))}var rh=Ar(function({place:e,onDuplicate:n,onRemove:r},i){return f.createElement("div",{"data-selection-toolbar":!0,hidden:!e,style:e??{},className:"absolute z-20 flex -translate-y-full overflow-hidden rounded-t-md bg-(--ks-color-accent) text-xs text-white shadow"},f.createElement("button",{ref:i,type:"button","data-move-handle":!0,className:"cursor-grab px-2 py-1 hover:bg-black/20"},"Move"),f.createElement("button",{type:"button",onClick:n,className:"px-2 py-1 hover:bg-black/20"},"Duplicate"),f.createElement("button",{type:"button",onClick:r,className:"px-2 py-1 hover:bg-black/20"},"Remove"))}),sd=rh;var od={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"},ih=t=>{let e=new Map;return t.forEach(n=>{let r=n.group??"Other";e.set(r,[...e.get(r)??[],n])}),[...e]},sh=({element:t,shown:e})=>f.createElement("button",{type:"button","data-element-key":t.key,hidden:!e,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"},f.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"},f.createElement("path",{d:od[t.icon]??od.box})),f.createElement("span",null,t.name)),oh=Ar(function({elements:e,children:n},r){let[i,s]=ot(""),a=o=>o.name.toLowerCase().includes(i.trim().toLowerCase());return f.createElement("aside",{ref:r,"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)"},f.createElement(xt,{type:"search","aria-label":"Search elements",placeholder:"Search elements",value:i,onChange:o=>s(o.target.value)}),ih(e).map(([o,l])=>f.createElement("section",{key:o,"data-element-group":o,hidden:!l.some(a),className:"flex flex-col gap-2"},f.createElement("h2",{className:"text-xs font-semibold uppercase tracking-wide text-(--ks-color-icon)"},o),l.map(d=>f.createElement(sh,{key:d.key,element:d,shown:a(d)})))),n)}),ad=oh;function zo({path:t,onChoose:e}){return t.length===0?null:f.createElement("nav",{"data-selection-path":!0,"aria-label":"Selection",className:"mb-4 flex flex-wrap items-center gap-1 text-xs"},t.map((n,r)=>f.createElement(f.Fragment,{key:n.id},r>0&&f.createElement("span",{"aria-hidden":"true",className:"text-(--ks-color-icon)"},"\u203A"),f.createElement("button",{type:"button","aria-current":r===t.length-1?"true":void 0,onClick:()=>e(n),className:"rounded px-1.5 py-0.5 hover:bg-(--ks-color-fill-muted) aria-[current=true]:font-semibold"},n.label))))}function Fo({samples:t,chosen:e,onChoose:n}){return t.length===0?null:f.createElement("label",{className:"flex items-center gap-2 text-sm"},f.createElement("span",{className:"whitespace-nowrap"},"Preview with"),f.createElement(et,{defaultValue:e??"",onChange:r=>n(r.target.value),className:"py-1"},t.map(([r,i])=>f.createElement("option",{key:i,value:i},r))))}function Vo({exceptions:t,chosen:e,onChoose:n}){return t.length===0?null:f.createElement("label",{className:"flex items-center gap-2 text-sm"},f.createElement("span",{className:"whitespace-nowrap"},"Access exception"),f.createElement(et,{defaultValue:e??"",onChange:r=>n(r.target.value),className:"py-1"},f.createElement("option",{value:""},"None"),t.map(([r,i])=>f.createElement("option",{key:i,value:i},r))))}function jo({condition:t,valueNames:e,onChange:n}){let[r,i]=ot(t?.value??""),[s,a]=ot(t?.equals??""),o=Object.entries(e??{});if(o.length===0)return null;let l=d=>{i(d),(d===""||s!=="")&&n(d,s)};return f.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)"},f.createElement(Ut,{htmlFor:"ks-pages-show-when-value"},"Show only when"),f.createElement(et,{id:"ks-pages-show-when-value",value:r,onChange:d=>l(d.target.value)},f.createElement("option",{value:""},"Always shown"),o.map(([d,u])=>f.createElement("option",{key:d,value:d},u))),r!==""&&f.createElement(f.Fragment,null,f.createElement(Ut,{htmlFor:"ks-pages-show-when-equals"},"equals"),f.createElement(xt,{id:"ks-pages-show-when-equals",type:"text",defaultValue:s,onBlur:d=>{a(d.target.value),d.target.value!==t?.equals&&n(r,d.target.value)}})))}var ld=[["light","Light"],["dark","Dark"],["system","System"]],ah=t=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t};function Bo(){let t=document.documentElement.dataset.theme??"system",e=t==="custom"?[...ld,["custom","Custom"]]:ld;return f.createElement("label",{className:"flex items-center gap-2 text-sm"},f.createElement("span",null,"Mode"),f.createElement(et,{"data-theme-mode":!0,defaultValue:t,onChange:n=>ah(n.target.value),className:"py-1"},e.map(([n,r])=>f.createElement("option",{key:n,value:n},r))))}var lh=t=>t.replace(/_/g," ").replace(/^./,e=>e.toUpperCase());function Ro({looks:t}){return t.length===0?null:f.createElement("label",{className:"flex items-center gap-2 text-sm"},f.createElement("span",null,"Look"),f.createElement(et,{"data-look-choice":!0,defaultValue:document.documentElement.dataset.look,onChange:e=>{document.documentElement.dataset.look=e.target.value},className:"py-1"},t.map(e=>f.createElement("option",{key:e,value:e},lh(e)))))}var ch=t=>f.createElement(xt,{...t,as:"textarea"}),cd=ch;var dh=({className:t,...e})=>f.createElement("input",{type:"checkbox",...e,className:qt("ks-checkbox",t)}),Ai=dh;var dd=(t,e,n)=>{let r=[...t];return[r[e],r[n]]=[r[n],r[e]],r};function Ho({field:t,entries:e,onChange:n}){let r=(t.entry??[]).filter(s=>!s.hidden),i=s=>n(t.key,s);return f.createElement("div",{"data-list-field":t.key,className:"flex flex-col gap-2"},e.map((s,a)=>f.createElement("fieldset",{key:`${a}-${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"},r.map(o=>f.createElement("div",{key:o.key,className:"flex flex-col gap-1"},f.createElement(Ut,{htmlFor:`ks-pages-${t.key}-${a}-${o.key}`},o.label),o.kind==="one_of"&&f.createElement(et,{id:`ks-pages-${t.key}-${a}-${o.key}`,defaultValue:s[o.key]??o.default??"",onChange:l=>i(e.map((d,u)=>u===a?{...d,[o.key]:l.target.value}:d))},f.createElement("option",{value:""}),o.options.map(l=>f.createElement("option",{key:l,value:l},l))),o.kind!=="one_of"&&(o.kind==="yes_or_no"?f.createElement(Ai,{id:`ks-pages-${t.key}-${a}-${o.key}`,className:"self-start",defaultChecked:s[o.key]==="true",onChange:l=>i(e.map((d,u)=>u===a?{...d,[o.key]:String(l.target.checked)}:d))}):f.createElement(xt,{id:`ks-pages-${t.key}-${a}-${o.key}`,type:"text",defaultValue:s[o.key]??o.default??"",onBlur:l=>l.target.value!==(s[o.key]??o.default??"")&&i(e.map((d,u)=>u===a?{...d,[o.key]:l.target.value}:d))})))),f.createElement("div",{className:"flex flex-wrap gap-2"},f.createElement(Q,{type:"button",size:"sm",variant:"secondary",disabled:a===0,onClick:()=>i(dd(e,a,a-1))},"Move up"),f.createElement(Q,{type:"button",size:"sm",variant:"secondary",disabled:a===e.length-1,onClick:()=>i(dd(e,a,a+1))},"Move down"),f.createElement(Q,{type:"button",size:"sm",variant:"danger",onClick:()=>i(e.filter((o,l)=>l!==a))},"Remove item")))),f.createElement(Q,{type:"button",size:"sm",variant:"secondary",onClick:()=>i([...e,{}])},"Add item"))}var uh=({field:t,value:e,onChange:n})=>{let r=e??t.default??"",i={id:`ks-pages-field-${t.key}`,defaultValue:r,onBlur:s=>s.target.value!==r&&n(t.key,s.target.value)};return t.kind==="yes_or_no"?f.createElement(Ai,{id:i.id,defaultChecked:e==="true",onChange:s=>n(t.key,String(s.target.checked))}):t.kind==="one_of"?f.createElement(et,{id:i.id,defaultValue:e??t.default??"",onChange:s=>n(t.key,s.target.value)},t.options.map(s=>f.createElement("option",{key:s,value:s},s))):t.kind==="long_text"?f.createElement(cd,{...i,rows:4}):t.kind==="number"?f.createElement(xt,{...i,type:"number"}):t.kind==="address"?f.createElement(xt,{...i,type:"url"}):f.createElement(xt,{...i,type:"text"})},fh=["text","long_text","address","number","list","data",void 0],_r=t=>!!t&&typeof t=="object"&&!Array.isArray(t)&&"value"in t,hh=({field:t,stored:e,valueNames:n,onChange:r,onBind:i})=>{let s=_r(e)?e:null,a=s?s.fallback??"":e??t.default??"";return f.createElement(et,{id:`ks-pages-value-${t.key}`,"aria-label":`${t.label} value`,value:s?.value??"",onChange:o=>o.target.value?i(t.key,o.target.value,a):r(t.key,a)},f.createElement("option",{value:""},"Typed text"),Object.entries(n).map(([o,l])=>f.createElement("option",{key:o,value:o},l)))};function qo({element:t,definition:e,alignments:n,valueNames:r={},onChange:i,onArrange:s,onBind:a,onRemove:o}){return f.createElement("aside",{"data-element-fields":!0,className:"flex flex-col gap-3"},e.fields.map(l=>f.createElement("div",{key:`${t.id}-${l.key}`,className:"flex flex-col gap-1"},f.createElement(Ut,{htmlFor:`ks-pages-field-${l.key}`},l.label),fh.includes(l.kind)&&Object.keys(r).length>0&&f.createElement(hh,{field:l,stored:t.fields[l.key],valueNames:r,onChange:i,onBind:a}),l.kind==="list"&&!_r(t.fields[l.key])&&f.createElement(Ho,{field:l,entries:t.fields[l.key]??l.default??[],onChange:i}),l.kind==="data"&&f.createElement("p",{className:"ks-hint"},"Filled with data the host supplies on a template page"),l.kind!=="list"&&l.kind!=="data"&&f.createElement(uh,{key:JSON.stringify(t.fields[l.key]??null),field:l,value:_r(t.fields[l.key])?t.fields[l.key].fallback??"":t.fields[l.key],onChange:(d,u)=>_r(t.fields[d])?a(d,t.fields[d].value,u):i(d,u)}),_r(t.fields[l.key])&&f.createElement("p",{className:"ks-hint"},"Shows ",r[t.fields[l.key].value]??t.fields[l.key].value,", or this text when it has no value"))),f.createElement("div",{className:"flex flex-col gap-1"},f.createElement(Ut,{htmlFor:"ks-pages-element-align"},"Horizontal alignment"),f.createElement(et,{key:`${t.id}-align`,id:"ks-pages-element-align",defaultValue:t.align??e.align??"stretch",onChange:l=>s(t.id,"align",l.target.value)},n.map(l=>f.createElement("option",{key:l,value:l},l)))),f.createElement(Q,{type:"button",variant:"danger",onClick:()=>o(t.id)},"Remove element"))}var ud=t=>t.sections.flatMap(e=>e.rows).flatMap(e=>e.columns),Ti=(t,e)=>ud(t).flatMap(n=>n.elements).find(n=>n.id===e),Ni=(t,e)=>{let n=t.sections.flatMap(r=>r.rows);return[...t.sections,...n,...ud(t)].find(r=>r.id===e)};var ph=[{kind:"section",selector:"[data-section-id]",id:t=>t.dataset.sectionId,group:()=>"page"},{kind:"row",selector:"[data-row-id]",id:t=>t.dataset.rowId,group:t=>t.closest("[data-section-id]").dataset.sectionId},{kind:"column",selector:"[data-column-id]",id:t=>t.dataset.columnId,group:t=>t.closest("[data-row-id]").dataset.rowId}],gh=[["[data-element-id]","Element"],["[data-column-id]","Column"],["[data-row-id]","Row"],["[data-section-id]","Section"]],vh=t=>gh.map(([e,n])=>[t.closest(e),n]).filter(([e])=>e).reduce((e,n)=>!e||e[0].contains(n[0])?n:e,null),mh=[wo.configure({preventActivation:()=>!1}),_o];function Uo({name:t,publish_url:e,unpublish_url:n,elements:r,canvas:i,document:s,elements_url:a,sections_url:o,columns_url:l,rows_url:d,nodes_url:u,arrangements:c,defaults:g,shares:p,value_names:b,looks:_=[],samples:k=[],sample:x,samples_url:h,access_exceptions:m=[],access_exception:v,access_exception_url:y,history_url:O,live_url:P,back_url:W,undo_url:V,redo_url:j,undoable:vt,redoable:Vt,token:N}){let[Nt,wr]=ot(i),[En,Wi]=ot(vt),[xr,Li]=ot(Vt),[te,$i]=ot(s),[On,ee]=ot(null),[Pt,Xt]=ot(null),[je,Ct]=ot(null),[pe,kr]=ot("desktop"),Pn=Ue(null),Cn=Ue(null),[Sr,it]=ot(null),[ne,Yt]=ot([]),ge=Ue(null),Mn=Ue(null),mt=Ue(null),R=({canvas:w,document:E,undoable:S,redoable:A})=>{Ct(null),wr(w),$i(E),S!==void 0&&Wi(S),A!==void 0&&Li(A)},st=({error:w})=>Ct(w),Er=w=>{Ct(null),Xt(w)},Or=w=>{mt.current.querySelectorAll("[data-hovered]").forEach(ut=>delete ut.dataset.hovered);let[E,S]=vh(w.target)??[];if(!E)return;E.dataset.hovered="";let A=S==="Element"&&Ti(te,E.dataset.elementId);E.dataset.kind=A?r.find(ut=>ut.key===A.key)?.name??S:S},Pr=w=>{let E=w.target.closest("[data-element-id]");if(E)return w.preventDefault(),Xt(null),ee(E.dataset.elementId);let S=w.target.closest("[data-column-id]");S&&(ee(null),Xt({kind:"column",id:S.dataset.columnId,rowId:S.closest("[data-row-id]").dataset.rowId,sectionId:S.closest("[data-section-id]").dataset.sectionId}))},Wt=On&&Ti(te,On),In=Wt&&r.find(w=>w.key===Wt.key);Jo(()=>{mt.current.innerHTML=Nt},[Nt]),qe(()=>{let w=new Sc;ge.current=w;let E=[...Mn.current.querySelectorAll("[data-element-key]")].map(A=>new ze({id:`palette-${A.dataset.elementKey}`,element:A,feedback:"clone",data:{key:A.dataset.elementKey}},w)),S=()=>mt.current.querySelectorAll("[data-drop-target]").forEach(A=>delete A.dataset.dropTarget);return w.monitor.addEventListener("dragover",({operation:A})=>{S(),A.target?.element&&(A.target.element.dataset.dropTarget="")}),w.monitor.addEventListener("dragend",({operation:A,canceled:ut})=>{S();let{source:H,target:G}=A;if(ut||!G)return;if(H.data?.key)return G.data?.columnId&&Yc(a,N,H.data.key,G.data.columnId).then(R);if(H.type!=="element")return No(u,N,H.id,H.group==="page"?null:H.group,H.index).then(R,st);let Re=H.group===H.initialGroup&&G.data?.columnId&&G.data.columnId!==H.group?G.data.columnId:H.group,Ir=Re===H.group?H.index:0;No(u,N,H.id,Re,Ir).then(R,st)}),()=>{E.forEach(A=>A.destroy()),w.destroy()}},[]),qe(()=>{let w=[...mt.current.querySelectorAll("[data-column-id]")].map(S=>new _n({id:`drop-${S.dataset.columnId}`,element:S,data:{columnId:S.dataset.columnId},accept:A=>!A.type||A.type==="element"},ge.current)),E=[...mt.current.querySelectorAll("[data-element-id]")].map(S=>{let A=S.closest("[data-column-id]"),ut=[...A.children].indexOf(S);return new Sn({id:S.dataset.elementId,element:S,index:ut,group:A.dataset.columnId,type:"element",accept:"element",sensors:mh},ge.current)});return()=>[...w,...E].forEach(S=>S.destroy())},[Nt]);let Cr=w=>[["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(([E,S,A,ut])=>{let H=w.closest(S);if(!H)return[];let G=E==="element"&&Ti(te,H.dataset[A]);return[{kind:E,id:H.dataset[A],label:ut??r.find(Re=>Re.key===G?.key)?.name??"Element"}]}),jt=({kind:w,id:E})=>{if(Ct(null),w==="element")return Xt(null),ee(E);let S=mt.current.querySelector(`[data-${w}-id="${E}"]`);ee(null),Xt({kind:w,id:E,rowId:S.closest("[data-row-id]")?.dataset.rowId,sectionId:S.closest("[data-section-id]")?.dataset.sectionId})};qe(()=>{let w=ne[ne.length-2],E=S=>{S.key!=="Escape"||!w||S.target.closest("input, textarea, select")||jt(w)};return window.document.addEventListener("keydown",E),()=>window.document.removeEventListener("keydown",E)},[ne]);let yt=On??Pt?.id;qe(()=>{mt.current.querySelectorAll("[data-selected]").forEach(A=>delete A.dataset.selected);let w=yt&&mt.current.querySelector(`[data-element-id="${yt}"], [data-column-id="${yt}"], [data-row-id="${yt}"], [data-section-id="${yt}"]`);if(!w)return Yt([]),it(null);w.dataset.selected="",Yt(Cr(w));let E=Pn.current.getBoundingClientRect(),S=w.getBoundingClientRect();it({top:S.top-E.top,left:S.left-E.left})},[Nt,yt,pe]),qe(()=>{let w=window.document.createElement("span"),E=ph.flatMap(({kind:S,selector:A,id:ut,group:H})=>[...mt.current.querySelectorAll(A)].map(G=>new Sn({id:ut(G),element:G,index:[...G.parentElement.children].indexOf(G),group:H(G),type:S,accept:S,handle:yt===ut(G)?Cn.current:w},ge.current)));return()=>E.forEach(S=>S.destroy())},[Nt,yt]);let Be=w=>{let E=w.kind==="column"&&Ni(te,w.rowId),S=E?{wide:p[E.columns.length]??"1/1"}:{};return{...g[w.kind],...S,...Ni(te,w.id)}},Mr=()=>Ii(u,N,yt).then(w=>{R(w),Xt(null),ee(null)},st);return f.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)"},f.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"},f.createElement("div",{className:"flex min-w-0 items-center gap-2"},f.createElement("a",{href:W,className:"text-sm hover:underline"},"Back"),f.createElement("h1",{className:"truncate text-base font-semibold"},t)),f.createElement("div",{className:"flex items-center gap-4 max-lg:hidden"},f.createElement($o,{chosen:pe,onChoose:kr}),f.createElement(Bo,null),f.createElement(Ro,{looks:_}),f.createElement(Fo,{samples:k,chosen:x,onChoose:w=>ed(h,N,w).then(R,st)}),f.createElement(Vo,{exceptions:m,chosen:v,onChoose:w=>nd(y,N,w).then(R,st)})),f.createElement("div",{className:"flex items-center gap-2"},f.createElement(Q,{type:"button",size:"sm",variant:"secondary",disabled:!En,title:En?"Undo the last change":"Nothing to undo",onClick:()=>Wo(V,N).then(R,st)},"\u21B6 Undo"),f.createElement(Q,{type:"button",size:"sm",variant:"secondary",disabled:!xr,title:xr?"Redo the change you undid":"Nothing to redo",onClick:()=>Wo(j,N).then(R,st)},"\u21B7 Redo"),P&&f.createElement("a",{href:P,className:"text-sm whitespace-nowrap hover:underline"},"View live"),f.createElement("a",{href:O,className:"text-sm hover:underline"},"History"),n&&f.createElement("form",{method:"post",action:n},f.createElement("input",{type:"hidden",name:"authenticity_token",value:N}),f.createElement(Q,{type:"submit",size:"sm",variant:"secondary"},"Unpublish")),f.createElement("form",{method:"post",action:e},f.createElement("input",{type:"hidden",name:"authenticity_token",value:N}),f.createElement(Q,{type:"submit",size:"sm"},"Publish")))),f.createElement("div",{className:"relative flex min-h-0 flex-1"},f.createElement(ad,{ref:Mn,elements:r},f.createElement(Q,{type:"button",variant:"secondary",onClick:()=>Gc(o,N).then(R)},"Add section")),f.createElement("main",{"data-page-frame":!0,className:"min-w-0 flex-1 overflow-auto bg-surface-200 p-8 dark:bg-surface-900"},f.createElement("div",{ref:Pn,"data-page-sheet":!0,"data-theme":br.find(w=>w.key===pe).theme,style:{width:br.find(w=>w.key===pe).width,colorScheme:br.find(w=>w.key===pe).theme},className:"relative mx-auto min-h-full max-w-full bg-[Canvas] shadow-lg ring-1 ring-black/5"},f.createElement("div",{ref:mt,"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:Pr,onMouseOver:Or,onMouseLeave:()=>mt.current.querySelectorAll("[data-hovered]").forEach(w=>delete w.dataset.hovered)}),f.createElement(sd,{ref:Cn,place:Sr,onRemove:Mr,onDuplicate:()=>Qc(u,N,yt).then(R,st)}))),f.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)"},f.createElement(zo,{path:ne,onChoose:jt}),!Pt&&!In&&f.createElement("p",{className:"ks-hint"},"Select something on the page to change it."),Pt&&f.createElement(Lo,{node:Pt,values:Be(Pt),arrangements:c,onArrange:(w,E,S)=>To(u,N,w,E,S).then(R,st),refusal:je,onSelect:Er,onRemove:w=>Ii(u,N,w).then(E=>{R(E),Xt(null)},st),onAddColumn:w=>Jc(l,N,w).then(R),onAddRow:w=>Zc(d,N,w).then(R)}),In&&f.createElement(qo,{element:Wt,definition:In,alignments:c.element.align,onRemove:w=>Ii(u,N,w).then(E=>{R(E),ee(null)}),onArrange:(w,E,S)=>To(u,N,w,E,S).then(R),valueNames:b,onBind:(w,E,S)=>td(a,N,Wt.id,w,E,S).then(R,st),onChange:(w,E)=>Kc(a,N,Wt.id,w,E).then(R)}),(Wt||Pt&&Pt.kind!=="column")&&f.createElement(jo,{key:Wt?.id??Pt.id,condition:(Wt??Ni(te,Pt.id))?.show_when,valueNames:b,onChange:(w,E)=>rd(u,N,Wt?.id??Pt.id,w,E).then(R,st)}))))}Qo("keystone_ui_pages/editor",Uo);na(document,Ko);})();
|
|
67
|
+
`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function xI(e,t="hidden"){return ce(()=>{let{element:n,manager:o}=e;if(!n||!o)return;let r=vI(n,o.registry.droppables),s=[],i=RS(n),{remove:a}=i;return SI(r,i,s),CI(i,t),i.remove=()=>{s.forEach(l=>l()),a.call(i)},i})}function vI(e,t){let n=new Map;for(let o of t)if(o.element&&(e===o.element||e.contains(o.element))){let r=`${sl}${mu("dom-id")}`;o.element.setAttribute(r,""),n.set(o,r)}return n}function SI(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),ja.set(a,i),n.push(()=>{ja.delete(a),o.proxy=void 0})}}function CI(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(Cu,t)}function _0(e,t){return e===t?!0:es(e)===es(t)}function QS(e){let{target:t}=e;"newState"in e&&e.newState==="closed"&&Zo(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>os(t))}function $h(e){return e.tagName==="TR"}function bI(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-")||mI.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(_I.includes(u)||u.startsWith(Tt))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 EI(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),os(n);return}if(i.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement("beforebegin",e),os(n);return}}e.isConnected&&t.isConnected&&e.nextElementSibling!==t&&(e.insertAdjacentElement("afterend",t),os(n))});return o.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),o}function NI(e){return new ResizeObserver(()=>{var t,n,o;let r=new kn(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=bh();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},Tt),(n=e.getElementMutationObserver())==null||n.takeRecords(),$h(e.element)&&$h(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 TI=250,OI="ease";function DI(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=TI,easing:a=OI}=s??{};os(e.feedbackElement);let[,l]=(t=Sh(e.feedbackElement,_=>"translate"in _))!=null?t:[];l?.pause();let c=(n=e.placeholder)!=null?n:e.element,u={frameTransform:_0(e.feedbackElement,c)?null:void 0},d=new kn(e.feedbackElement,u),f=(o=li(wn(e.feedbackElement).translate))!=null?o:e.translate,p=new kn(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},Tt),e.feedbackElement.setAttribute(Ih,""),(r=e.getElementMutationObserver())==null||r.takeRecords(),gu({element:e.feedbackElement,keyframes:Uh(tl(tl({},y),m),{translate:[`${f.x}px ${f.y}px 0`,`${g.x}px ${g.y}px 0`]}),options:{duration:Va(Ht(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?i:0,easing:a}}).then(()=>{e.feedbackElement.removeAttribute(Ih),l?.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}var y0,Rh,nl,jh,xu,x0,v0,gi=class extends(Rh=mt,y0=[pe],Rh){constructor(t,n){super(t,n),tt(this,xu),tt(this,jh,dt(nl,8,this)),dt(nl,11,this),this.state={initial:{},current:{}};let o=t.registry.plugins.get(Nu),r=o?.register(yI);if(r){let s=this.destroy.bind(this);this.destroy=()=>{r(),s()}}this.registerEffect(ls(this,xu,x0).bind(this,o)),this.registerEffect(ls(this,xu,v0))}};nl=_i(Rh);jh=new WeakMap;xu=new WeakSet;x0=function(e){let{overlay:t}=this;if(!t||!e)return;let n=Ha(t);if(n)return e.addRoot(n)};v0=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=rs(x),S=rs(h),b=!_0(h,x),E=new kn(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:$}=E;b&&(O=O/D.x,T=T/D.y);let I=new jS(x),R=wn(h),{transition:K,translate:J,boxSizing:Q,paddingBlockStart:oe,paddingBlockEnd:Z,paddingInlineStart:ae,paddingInlineEnd:ee,borderInlineStartWidth:Re,borderInlineEndWidth:le,borderBlockStartWidth:V,borderBlockEndWidth:te}=R,Qe=K.split(",").filter(Te=>!/^\s*(transform|translate|scale)\b/.test(Te)).join(","),Ue=Ga(R),ct=R.transform,Ct=m==="clone",bt=Q==="content-box",Fr=bt?parseInt(ae)+parseInt(ee)+parseInt(Re)+parseInt(le):0,So=bt?parseInt(oe)+parseInt(Z)+parseInt(V)+parseInt(te):0,ht=m!=="move"&&!this.overlay?xI(f,Ct?"clone":"hidden"):null,Co=ce(()=>ss(l.dragOperation.activatorEvent));if(!_.translate){if(this.overlay&&Ue)_.translate={x:Ue.x,y:Ue.y};else if(J!=="none"){let Te=li(J);Te&&(_.translate=Te)}}if(!_.transformOrigin){let Te=ce(()=>d.current),st=$+((o=Ue?.x)!=null?o:0),ln=A+((r=Ue?.y)!=null?r:0);_.transformOrigin={x:(Te.x-st*v.scaleX-v.x)/(O*v.scaleX),y:(Te.y-ln*v.scaleY-v.y)/(T*v.scaleY)}}let{transformOrigin:fe}=_,ze=A*v.scaleY+v.y,ot=$*v.scaleX+v.x;if(!_.coordinates&&(_.coordinates={x:ot,y:ze},D.x!==1||D.y!==1)){let{scaleX:Te,scaleY:st}=S,{x:ln,y:Go}=fe;_.coordinates.x+=(O*Te-O)*ln,_.coordinates.y+=(T*st-T)*Go}_.dimensions||(_.dimensions={width:O,height:T}),_.frameTransform||(_.frameTransform=v);let Nn={x:_.coordinates.x-ot,y:_.coordinates.y-ze},rt={width:(_.dimensions.width*_.frameTransform.scaleX-O*v.scaleX)*fe.x,height:(_.dimensions.height*_.frameTransform.scaleY-T*v.scaleY)*fe.y},Pe={x:Nn.x/v.scaleX+rt.width,y:Nn.y/v.scaleY+rt.height},wt={left:$+Pe.x,top:A+Pe.y};x.setAttribute(fo,"true");let wc=ce(()=>u.transform),kc=(s=_.translate)!=null?s:{x:0,y:0},hp=wc.x*v.scaleX+kc.x,Vn=wc.y*v.scaleY+kc.y,Br=bh();I.set({width:O-Fr,height:T-So,top:wt.top+Br.y,left:wt.left+Br.x,translate:`${hp}px ${Vn}px 0`,transform:this.overlay?"none":ct,transition:Qe?`${Qe}, translate 0ms linear`:"translate 0ms linear",scale:b?`${D.x} ${D.y}`:"","transform-origin":`${fe.x*100}% ${fe.y*100}%`},Tt),ht&&(h.insertAdjacentElement("afterend",ht),c?.rootElement&&(typeof c.rootElement=="function"?c.rootElement(f):c.rootElement).appendChild(h)),fu(x)&&(x.hasAttribute("popover")||x.setAttribute("popover","manual"),os(x),x.addEventListener("beforetoggle",QS));let bo,Vs,Wt,Ac=NI({placeholder:ht,element:h,feedbackElement:x,frameTransform:v,transformOrigin:fe,width:O,height:T,top:A,left:$,widthOffset:Fr,heightOffset:So,delta:Pe,styles:I,dragOperation:u,getTranslate:()=>a.current.translate,getElementMutationObserver:()=>bo,getSavedCellWidths:()=>Wt,setSavedCellWidths:Te=>{Wt=Te}}),Ic=new kn(x);ce(()=>u.shape=Ic);let L=Ht(x),q=Te=>{this.manager.actions.stop({event:Te})},j=Va(L);Co&&L.addEventListener("resize",q),ce(()=>f.status)==="idle"&&requestAnimationFrame(()=>f.status="dragging"),ht&&(Ac.observe(ht),bo=bI(h,ht,Ct),Vs=EI(h,ht,x));let ge=(i=l.dragOperation.source)==null?void 0:i.id,en=()=>{var Te;if(!Co||ge==null)return;let st=l.registry.draggables.get(ge),ln=(Te=st?.handle)!=null?Te:st?.element;Oo(ln)&&ln.focus()},Le=()=>{bo?.disconnect(),Vs?.disconnect(),Ac.disconnect(),L.removeEventListener("resize",q),fu(x)&&(x.removeEventListener("beforetoggle",QS),x.removeAttribute("popover")),x.removeAttribute(fo),I.reset();let Te=()=>{var st;if(Wt&&$h(h)){let mp=Array.from(h.cells);for(let[$c,js]of mp.entries())js.style.width=(st=Wt[$c])!=null?st:""}f.status="idle";let ln=a.current.translate!=null,Go=u.status.dragging;ht&&(!Go&&ln||ht.parentElement!==x.parentElement)&&x.isConnected&&ht.replaceWith(x),ht?.remove()};x===this.overlay?setTimeout(Te,0):Te()},Et=c?.dropAnimation,zr=this,gp=Vr(()=>{var Te,st,ln;let{transform:Go,status:mp}=u;if(!(!Go.x&&!Go.y&&!a.current.translate)&&mp.dragging){let $c=(Te=_.translate)!=null?Te:{x:0,y:0},js={x:Go.x/v.scaleX+$c.x,y:Go.y/v.scaleY+$c.y},Hx=a.current.translate,Mk=ce(()=>u.modifiers),_p=ce(()=>{var Ea;return(Ea=u.shape)==null?void 0:Ea.current}),ba=c?.keyboardTransition,Vx=Co&&!j&&ba!==null?`${(st=ba?.duration)!=null?st:250}ms ${(ln=ba?.easing)!=null?ln:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(I.set({transition:Qe?`${Qe}, translate ${Vx}`:`translate ${Vx}`,translate:`${js.x}px ${js.y}px 0`},Tt),bo?.takeRecords(),_p&&_p!==Ic&&Hx&&!Mk.length){let Ea=It.delta(js,Hx);u.shape=tn.from(_p.boundingRectangle).translate(Ea.x*v.scaleX,Ea.y*v.scaleY)}else u.shape=new kn(x);a.current.translate=js}},function(){if(u.status.dropped){this.dispose(),f.status="dropping";let Te=g?.dropAnimation!==void 0?g.dropAnimation:zr.dropAnimation!==void 0?zr.dropAnimation:Et,st=a.current.translate,ln=st!=null;if(!st&&h!==x&&(st={x:0,y:0}),!st||Te===null){Le();return}l.renderer.rendering.then(()=>{DI({source:f,element:h,feedbackElement:x,placeholder:ht,translate:st,moved:ln,transition:K,alignment:f.alignment,styles:I,animation:Te??void 0,getElementMutationObserver:()=>bo,cleanup:Le,restoreFocus:en})})}});return()=>{Le(),gp()}};An(nl,4,"overlay",y0,gi,jh);cs(nl,gi);gi.configure=ri(gi);var Yh=gi,qa=!0,MI=!1,S0,C0,b0,E0,tr,Gh,qh;E0=(b0=[pe],dn.Forward),C0=(S0=[pe],dn.Reverse);var ol=class{constructor(){tt(this,Gh,dt(tr,8,this,qa)),dt(tr,11,this),tt(this,qh,dt(tr,12,this,qa)),dt(tr,15,this)}isLocked(e){return e===dn.Idle?!1:e==null?this[dn.Forward]===qa&&this[dn.Reverse]===qa:this[e]===qa}unlock(e){e!==dn.Idle&&(this[e]=MI)}};tr=_i(null);Gh=new WeakMap;qh=new WeakMap;An(tr,4,E0,b0,ol,Gh);An(tr,4,C0,S0,ol,qh);cs(tr,ol);var wI=[dn.Forward,dn.Reverse],ZS=class{constructor(){this.x=new ol,this.y=new ol}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},kI=class extends mt{constructor(e){super(e);let t=On(new ZS),n=null;this.signal=t,gt(()=>{let{status:o}=e.dragOperation;if(!o.initialized){n=null,t.value=new ZS;return}let{delta:r}=e.dragOperation.position;if(n){let s={x:e0(r.x,n.x),y:e0(r.y,n.y)},i=t.peek();Ee(()=>{for(let a of Up)for(let l of wI)s[a]===l&&i[a].unlock(l);t.value=i})}n=r})}get current(){return this.signal.peek()}};function e0(e,t){return Math.sign(e-t)}var N0,Ph,rl,Xh,er,Lh,yi=class extends(Ph=si,N0=[pe],Ph){constructor(e){super(e),tt(this,Xh,dt(rl,8,this,!1)),dt(rl,11,this),tt(this,er),tt(this,Lh,()=>{if(!Ae(this,er))return;let{element:s,by:i}=Ae(this,er);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,er,void 0),!1;let{position:c}=this.manager.dragOperation,u=c?.current;if(u){let{by:d}=s??{},f=d?{x:t0(d.x),y:t0(d.y)}:void 0,p=f?void 0:this.scrollIntentTracker.current;if(p?.isLocked())return!1;for(let h of l){let g=HS(h,d);if(g.x||g.y){let{speed:y,direction:m}=VS(h,u,f,i?.acceleration,i?.threshold);if(p)for(let _ of Up)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=Ae(this,er))==null?void 0:a.by;if(this.autoScrolling&&b&&(b.x&&!v||b.y&&!S))continue;return Vt(this,er,{element:h,by:{x:v,y:S}}),Ya.schedule(Ae(this,Lh)),!0}}}}}return Vt(this,er,void 0),!1};let t=null,n=null,o=Wc(()=>{let{position:s,source:i}=e.dragOperation;if(!s)return null;let a=Eh(Ha(i?.element),s.current);return a&&(t=a),a??t}),r=Wc(()=>{let s=o.value,{documentElement:i}=ts(s);if(!s||s===i){let{target:a}=e.dragOperation,l=a?.element;if(l){let c=pu(l,{excludeElement:!1});return n=c,c}}if(s){let a=pu(s,{excludeElement:!1});return this.autoScrolling&&n&&a.size<n?.size?n:(n=a,a)}return n=null,null},zc);this.getScrollableElements=()=>r.value,this.scrollIntentTracker=new kI(e),this.destroy=e.monitor.addEventListener("dragmove",s=>{this.disabled||s.defaultPrevented||!ss(e.dragOperation.activatorEvent)||!s.by||this.scroll({by:s.by})&&s.preventDefault()})}};rl=_i(Ph);Xh=new WeakMap;er=new WeakMap;Lh=new WeakMap;An(rl,4,"autoScrolling",N0,yi,Xh);cs(rl,yi);function t0(e){return e>0?dn.Forward:e<0?dn.Reverse:dn.Idle}var AI=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))}},II=new AI(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),$I=10,Fh=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(()=>II.schedule(()=>o.scroll(void 0,c)),$I);return()=>{clearInterval(d)}}else o.autoScrolling=!1}})}};Fh.configure=ri(Fh);var T0=Fh,n0={capture:!0,passive:!0},Ja,RI=class extends si{constructor(e){super(e),tt(this,Ja),this.handleScroll=()=>{Ae(this,Ja)==null&&Vt(this,Ja,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Vt(this,Ja,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,n0),()=>{i.removeEventListener("scroll",this.handleScroll,n0)}}})}};Ja=new WeakMap;var PI="* { user-select: none !important; -webkit-user-select: none !important; }",LI=class extends mt{constructor(e){super(e),this.manager=e;let t=e.registry.plugins.get(Nu),n=t?.register(PI);if(this.destroy=gt(()=>{let{dragOperation:o}=this.manager;if(o.status.initialized)return Dh(),document.addEventListener("selectionchange",Dh,{capture:!0}),()=>{document.removeEventListener("selectionchange",Dh,{capture:!0})}}),n){let o=this.destroy.bind(this);this.destroy=()=>{n(),o()}}}};function Dh(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var Qa=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,bu=class extends Gr{constructor(t,n){super(t),this.manager=t,this.options=n,tt(this,ui,[]),this.listeners=new Nh,this.handleSourceKeyDown=(o,r,s)=>{if(this.disabled||o.defaultPrevented||!Zo(o.target)||r.disabled)return;let{keyboardCodes:i=Qa.keyboardCodes,preventActivation:a=Qa.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=>{ss(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(),hu(r);let{center:s}=new kn(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=ts(r),l=[this.listeners.bind(a,[{type:"keydown",listener:c=>this.handleKeyDown(c,n,o),options:{capture:!0}}])];Ae(this,ui).push(...l)}handleKeyDown(t,n,o){let{keyboardCodes:r=Qa.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:Qa.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(T0);t?.disabled===!1&&(t.disable(),Ae(this,ui).push(()=>{t.enable()}))}cleanup(){Ae(this,ui).forEach(t=>t()),Vt(this,ui,[])}destroy(){this.cleanup(),this.listeners.clear()}};ui=new WeakMap;bu.configure=ri(bu);bu.defaults=Qa;var Jh=bu;function ci(e,t){return t.includes(e.code)}var is,FI=class extends fh{constructor(){super(...arguments),tt(this,is)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,is,ns(e));break;case"pointermove":if(!Ae(this,is))return;let{x:t,y:n}=ns(e),o={x:t-Ae(this,is).x,y:n-Ae(this,is).y},{tolerance:r}=this.options;if(r&&Hc(o,r)){this.abort();return}Hc(o,this.options.value)&&this.activate(e);break;case"pointerup":this.abort();break}}abort(){Vt(this,is,void 0)}};is=new WeakMap;var di,as,BI=class extends fh{constructor(){super(...arguments),tt(this,di),tt(this,as)}onEvent(e){switch(e.type){case"pointerdown":Vt(this,as,ns(e)),Vt(this,di,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!Ae(this,as))return;let{x:t,y:n}=ns(e),o={x:t-Ae(this,as).x,y:n-Ae(this,as).y};Hc(o,this.options.tolerance)&&this.abort();break;case"pointerup":this.abort();break}}abort(){Ae(this,di)&&(clearTimeout(Ae(this,di)),Vt(this,as,void 0),Vt(this,di,void 0))}};di=new WeakMap;as=new WeakMap;var pi=class{};pi.Delay=BI;pi.Distance=FI;var Bh=Object.freeze({activationConstraints(e,t){var n;let{pointerType:o,target:r}=e;if(!(o==="mouse"&&Zo(r)&&(t.handle===r||(n=t.handle)!=null&&n.contains(r))))return o==="touch"?[new pi.Delay({value:250,tolerance:5})]:GS(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||!Zo(o)||(n=t.handle)!=null&&n.contains(o))return!1;let r=PS(o);return r===t.element?!1:!!r}}),fi,Eu=class extends Gr{constructor(t,n){super(t),this.manager=t,this.options=n,tt(this,fi,new Set),this.listeners=new Nh,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=Bh.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=>{YS(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&&(KI(c.ownerDocument.defaultView),c.addEventListener("pointerdown",a,{signal:i}));return()=>s.abort()})}handlePointerDown(t,n,o){if(this.disabled||!t.isPrimary||t.button!==0||!Zo(t.target)||n.disabled||zI(t)||!this.manager.dragOperation.status.idle)return;let{preventActivation:r=Bh.preventActivation}=o??{};if(r?.(t,n))return;let{target:s}=t,i=Oo(s)&&s.draggable&&s.getAttribute("draggable")==="true",a=rs(n.element),{x:l,y:c}=ns(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 hS(u,g=>this.handleStart(n,g));d.signal.onabort=()=>this.handleCancel(t),d.onEvent(t),this.controller=d;let f=ou(),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:yu,options:{capture:!0}}]),h=()=>{p(),this.initialCoordinates=void 0};Ae(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=ns(t),i=rs(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,Ya.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=ts(n.target).body;try{a.setPointerCapture(n.pointerId)}catch{this.handleCancel(n);return}let l=Zo(n.target)?[n.target,a]:a,c=this.listeners.bind(l,[{type:"touchmove",listener:yu,options:{passive:!1}},{type:"click",listener:yu},{type:"contextmenu",listener:yu},{type:"keydown",listener:this.handleKeyDown}]);Ae(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},Ae(this,fi).forEach(n=>n()),Ae(this,fi).clear()}destroy(){this.cleanup(),this.listeners.clear()}};fi=new WeakMap;Eu.configure=ri(Eu);Eu.defaults=Bh;var Qh=Eu;function zI(e){return"sensor"in e}function yu(e){e.preventDefault()}function WI(){}var o0=new WeakSet;function KI(e){!e||o0.has(e)||(e.addEventListener("touchmove",WI,{capture:!1,passive:!1}),o0.add(e))}var Mh={modifiers:[],plugins:[pI,T0,gI,Yh,LI],sensors:[Qh,Jh]},O0=class extends ES{constructor(e={}){let t=uo(e.plugins,Mh.plugins),n=uo(e.sensors,Mh.sensors),o=uo(e.modifiers,Mh.modifiers);super(Uh(tl({},e),{plugins:[RI,yi,Nu,...t],sensors:n,modifiers:o}))}},D0,M0,zh,nr,Zh,eg,us=class extends(zh=Yn,M0=[pe],D0=[pe],zh){constructor(e,t){var n=e,{element:o,effects:r=()=>[],handle:s}=n,i=a0(n,["element","effects","handle"]);super(tl({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 Gr?f:c.registry.register(f.plugin),h=f instanceof Gr?void 0:f.options;return p.bind(this,h)});return function(){d.forEach(p=>p())}}]},i),t),tt(this,Zh,dt(nr,8,this)),dt(nr,11,this),tt(this,eg,dt(nr,12,this)),dt(nr,15,this),this.element=o,this.handle=s}};nr=_i(zh);Zh=new WeakMap;eg=new WeakMap;An(nr,4,"handle",M0,us,Zh);An(nr,4,"element",D0,us,eg);cs(nr,us);var w0,k0,Wh,or,tg,wh,A0,I0,el,ng,xi=class extends(Wh=Gn,k0=[pe],w0=[pe],Wh){constructor(e,t){var n=e,{element:o,effects:r=()=>[]}=n,s=a0(n,["element","effects"]);let{collisionDetector:i=_u}=s,a=c=>{let{manager:u,element:d}=this;if(!d||c===null){this.shape=void 0;return}if(!u)return;let f=new kn(d),p=ce(()=>this.shape);return f&&p?.equals(f)?p:(this.shape=f,f)},l=On(!1);super(Uh(tl({},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 KS(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),tt(this,el),tt(this,tg,dt(or,8,this)),dt(or,11,this),tt(this,ng,dt(or,12,this)),dt(or,15,this),this.element=o,this.refreshShape=()=>a()}set element(e){Vt(this,el,e,I0)}get element(){var e;return(e=this.proxy)!=null?e:Ae(this,el,A0)}};or=_i(Wh);tg=new WeakMap;el=new WeakSet;ng=new WeakMap;wh=An(or,20,"#element",k0,el,tg),A0=wh.get,I0=wh.set;An(or,4,"proxy",w0,xi,ng);cs(or,xi);var UI=Object.create,K0=Object.defineProperty,HI=Object.defineProperties,VI=Object.getOwnPropertyDescriptor,jI=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,U0=Object.prototype.hasOwnProperty,H0=Object.prototype.propertyIsEnumerable,YI=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),dl=e=>{throw TypeError(e)},ig=(e,t,n)=>t in e?K0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,og=(e,t)=>{for(var n in t||(t={}))U0.call(t,n)&&ig(e,n,t[n]);if(ku)for(var n of ku(t))H0.call(t,n)&&ig(e,n,t[n]);return e},rg=(e,t)=>HI(e,jI(t)),GI=(e,t)=>{var n={};for(var o in e)U0.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&ku)for(var o of ku(e))t.indexOf(o)<0&&H0.call(e,o)&&(n[o]=e[o]);return n},qI=e=>{var t;return[,,,UI((t=void 0)!=null?t:null)]},V0=["class","method","getter","setter","accessor","field","value","get","set"],al=e=>e!==void 0&&typeof e!="function"?dl("Function expected"):e,XI=(e,t,n,o,r)=>({kind:V0[e],name:t,metadata:o,addInitializer:s=>n._?dl("Already initialized"):r.push(al(s||null))}),JI=(e,t)=>ig(t,YI("metadata"),e[3]),Tu=(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},j0=(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=V0[d+5],y=e[h-1]=[],m=e[h]||(e[h]=[]),_=(r=r.prototype,VI({get[n](){return ll(this,s)},set[n](v){return ds(this,s,v)}},n)),x=o.length-1;x>=0;x--)c=XI(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?al(a)&&(_[g]=a):typeof a!="object"||a===null?dl("Object expected"):(al(i=a.get)&&(_.get=i),al(i=a.set)&&(_.set=i),al(i=a.init)&&y.unshift(i));return _&&K0(r,n,_),r},Y0=(e,t,n)=>t.has(e)||dl("Cannot "+n),ll=(e,t,n)=>(Y0(e,t,"read from private field"),t.get(e)),il=(e,t,n)=>t.has(e)?dl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ds=(e,t,n,o)=>(Y0(e,t,"write to private field"),t.set(e,n),n);function fs(e){return e instanceof cg||e instanceof X0}var Ou=10,QI=class extends mt{constructor(e){super(e);let t=gt(()=>{let{dragOperation:o}=e;if(ss(o.activatorEvent)&&fs(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(!ss(o.nativeEvent)||!fs(s.source)||!s.shape)return;let{actions:i,collisionObserver:a,registry:l}=r,{by:c}=o;if(!c)return;let u=ZI(c),{source:d,target:f}=s,{center:p}=s.shape.current,h=[],g=[];Ee(()=>{for(let S of l.droppables){let{id:b}=S;if(!S.accepts(d)||b===f?.id&&fs(S)||!S.element)continue;let E=S.shape,D=new kn(S.element,{getBoundingClientRect:O=>ai(O,void 0,.2)});!D.height||!D.width||(u=="down"&&p.y+Ou<D.center.y||u=="up"&&p.y-Ou>D.center.y||u=="left"&&p.x-Ou>D.center.x||u=="right"&&p.x+Ou<D.center.x)&&(h.push(S),S.shape=D,g.push(()=>S.shape=E))}}),o.preventDefault(),a.disable();let y=a.computeCollisions(h,qS);Ee(()=>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:E}=s;if(!S||!fs(S)||!E)return;let{index:D,group:O,target:T}=S.sortable,A=x!==D||v!==O,$=A?T:b?.element;if(!$)return;hu($);let I=new kn($);if(!I)return;let R=tn.delta(I,tn.from(E.current.boundingRectangle),S.alignment);i.move({by:R}),A?i.setDropTarget(S.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function ZI(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 e$=Object.defineProperty,t$=Object.defineProperties,n$=Object.getOwnPropertyDescriptors,$0=Object.getOwnPropertySymbols,o$=Object.prototype.hasOwnProperty,r$=Object.prototype.propertyIsEnumerable,R0=(e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t)=>{for(var n in t||(t={}))o$.call(t,n)&&R0(e,n,t[n]);if($0)for(var n of $0(t))r$.call(t,n)&&R0(e,n,t[n]);return e},Si=(e,t)=>t$(e,n$(t));function s$(e,t,n){if(t===n)return e;let o=e.slice();return o.splice(n,0,o.splice(t,1)[0]),o}function Du(e,t){let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?n:void 0}function sg(e){return"initialIndex"in e&&typeof e.initialIndex=="number"&&"index"in e&&typeof e.index=="number"}function i$(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(sg(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&&sg(s)){let x=s.initialGroup==null?void 0:Du(e,s.initialGroup),v=s.initialIndex,S=s.group==null?void 0:Du(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 E=e[x][v];return Si(vi({},e),{[x]:[...e[x].slice(0,v),...e[x].slice(v+1)],[S]:[...e[S].slice(0,b),E,...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=Du(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&&sg(s)){let x=s.group==null?void 0:Du(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 E=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),E,...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 a$(e,t){return i$(e,t,s$)}function P0(e){let t=new Map;for(let[,n]of e)for(let o of n)t.set(o.id,o.index);return t}function L0(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 F0="__default__",l$=class extends mt{constructor(e){super(e);let t=()=>{let o=new Map;for(let r of e.registry.droppables)if(r instanceof cg){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(!fs(i)||!fs(a)||i.sortable===a.sortable)return;let l=t(),c=P0(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(L0(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:F0,S=(h=a.sortable.group)!=null?h:F0,b={[v]:_,[S]:x},E=a$(b,o);if(b===E)return;let D=E[S].indexOf(i.sortable),O=E[S].indexOf(a.sortable);r.collisionObserver.disable(),B0(y,D,m,O),Ee(()=>{for(let[T,A]of E[v].entries())A.index=T;if(!u)for(let[T,A]of E[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;fs(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{let a=t(),l=P0(a),c=a.get(i.sortable.initialGroup);c&&r.renderer.rendering.then(()=>{let u=t();if(L0(l,a,u))return;let d=Mu(c),f=Mu(c,u$),p=i.sortable.element,h=f.indexOf(i.sortable),g=d[h],y=g?.element;!g||!y||!p||(B0(p,g.index,y,i.index),Ee(()=>{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 B0(e,t,n,o){let r=o<t?"afterend":"beforebegin";n.insertAdjacentElement(r,e)}function c$(e,t){return e.index-t.index}function u$(e,t){return e.initialIndex-t.initialIndex}function Mu(e,t=c$){return Array.from(e).sort(t)}var z0=[QI,l$],d$={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1};function W0(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 wu=new bv,G0,q0,sr,ag,cl,ul,lg,Ci;q0=[pe],G0=[pe];var bi=class{constructor(e,t){il(this,ag,Tu(sr,8,this)),Tu(sr,11,this),il(this,cl),il(this,ul),il(this,lg,Tu(sr,12,this)),Tu(sr,15,this),il(this,Ci),this.register=()=>(Ee(()=>{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=()=>{Ee(()=>{var h,g;(h=this.manager)==null||h.registry.unregister(this.droppable),(g=this.manager)==null||g.registry.unregister(this.draggable)})},this.destroy=()=>{Ee(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:o=()=>[],disabled:r,group:s,index:i,sensors:a,type:l,transition:c=d$,plugins:u}=n,d=GI(n,["effects","disabled","group","index","sensors","type","transition","plugins"]);let f=uo(u,z0),p=W0(r);this.droppable=new cg(rg(og({},d),{disabled:p.droppable}),t,this),this.draggable=new X0(rg(og({},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)&&wu.clear(this.manager),m?.dragging&&wu.set(this.manager,this.id,ce(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:h,group:g,manager:y}=this,m=ll(this,ul),_=ll(this,cl);(h!==m||g!==_)&&(ds(this,ul,h),ds(this,cl,g),this.animate())},()=>{var h,g;let{target:y}=this,{isDragSource:m}=this.draggable;((g=(h=this.draggable.pluginConfig(Yh))==null?void 0:h.feedback)!=null?g:"default")==="move"&&m&&(this.droppable.disabled=!y)},...o()],type:l,sensors:a}),t,this),ds(this,Ci,d.element),this.manager=t,this.index=i,ds(this,ul,i),this.group=s,ds(this,cl,s),this.type=l,this.transition=c}get initialIndex(){var e,t;return(t=(e=wu.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=wu.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){ce(()=>{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}=wn(r),l=Oh(r,a,!1),c=Oh(r,a);if(i.x||i.y){let u=Va(Ht(r))?rg(og({},t),{duration:0}):t;gu({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){Ee(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){Ee(()=>{let t=ll(this,Ci),n=this.droppable.element,o=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!o||o===t)&&(this.draggable.element=e),ds(this,Ci,e)})}get element(){var e,t;let n=ll(this,Ci);if(n)return(t=(e=ja.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=uo(e,z0)}set disabled(e){let t=W0(e);Ee(()=>{this.droppable.disabled=t.droppable,this.draggable.disabled=t.draggable})}set data(e){Ee(()=>{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??_u}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){Ee(()=>{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)}};sr=qI();ag=new WeakMap;cl=new WeakMap;ul=new WeakMap;lg=new WeakMap;Ci=new WeakMap;j0(sr,4,"index",q0,bi,ag);j0(sr,4,"group",G0,bi,lg);JI(sr,bi);var X0=class extends us{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}},cg=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 po=(...e)=>e.filter(Boolean).join(" ");var f$={primary:"ks-button-primary",secondary:"ks-button-secondary",danger:"ks-button-danger"},p$={sm:"ks-button-sm",md:"ks-button-md",lg:"ks-button-lg"},h$=({variant:e="primary",size:t="md",className:n,children:o,...r})=>{let s=r.href?"a":"button";return N.createElement(s,{...r,className:po("ks-button",f$[e],p$[t],n)},o)},We=h$;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))),J0=(e,t,n,o)=>jt(e,t,"POST",{key:n,column_id:o}),Q0=(e,t,n)=>jt(e,t,"POST",{title:n}),Z0=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{field:o,value:r}),eC=(e,t)=>jt(e,t,"POST",{}),tC=(e,t,n)=>jt(e,t,"POST",{row_id:n}),nC=(e,t,n)=>jt(e,t,"POST",{section_id:n}),ug=(e,t,n,o,r)=>jt(`${e}/${n}`,t,"PATCH",{setting:o,value:r}),Au=(e,t,n)=>jt(`${e}/${n}`,t,"DELETE"),dg=(e,t,n,o,r)=>jt(`${e}/${n}/move`,t,"POST",{into:o,position:r}),oC=(e,t,n)=>jt(`${e}/${n}/duplicate`,t,"POST"),rC=(e,t,n,o,r,s)=>jt(`${e}/${n}/bind`,t,"POST",{field:o,name:r,fallback:s}),sC=(e,t,n)=>jt(e,t,"POST",{choice:n}),iC=(e,t,n)=>jt(e,t,"POST",{access_exception:n}),aC=(e,t,n,o,r)=>jt(`${e}/${n}/condition`,t,"POST",{name:o,equals:r}),fg=(e,t)=>jt(e,t,"POST");var g$=({as:e="input",disabled:t,className:n,...o})=>N.createElement(e,{...o,disabled:t,className:po("ks-input",t&&"ks-input-disabled",n)}),_t=g$;var m$=e=>N.createElement(_t,{...e,as:"select"}),yt=m$;var _$=({type:e="info",title:t,message:n,onDismiss:o,className:r})=>N.createElement("div",{className:po("ks-alert",`ks-alert-${e}`,r),role:"alert"},N.createElement("div",{className:"ks-alert-body"},N.createElement("div",{className:"ks-alert-content"},t&&N.createElement("p",{className:"ks-alert-title"},t),N.createElement("p",{className:t?"ks-alert-message-titled":"ks-alert-message"},n)),o&&N.createElement("button",{type:"button",className:"ks-alert-dismiss","aria-label":"Dismiss",onClick:o},"\xD7"))),lC=_$;var Iu=(e,t)=>({className:n,children:o,...r})=>N.createElement(e,{...r,className:po(t,n)},o),on=Iu("label","ks-label"),F2=Iu("p","ks-hint"),B2=Iu("p","ks-error"),z2=Iu("span","ks-required");var y$={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 pg({node:e,values:t,arrangements:n,refusal:o,onAddColumn:r,onAddRow:s,onArrange:i,onSelect:a,onRemove:l}){let c=y$[e.kind],u=Object.keys(n[e.kind]).filter(d=>c[d]);return N.createElement("aside",{"data-layout-panel":!0,className:"flex flex-col gap-3"},o&&N.createElement("div",{"data-layout-refusal":!0},N.createElement(lC,{type:"error",message:o})),u.map(d=>N.createElement("div",{key:`${e.id}-${d}`,className:"flex flex-col gap-1"},N.createElement(on,{htmlFor:`ks-pages-${d}`},c[d]),N.createElement(yt,{id:`ks-pages-${d}`,defaultValue:t[d]??"",onChange:f=>i(e.id,d,f.target.value)},n[e.kind][d].map(f=>N.createElement("option",{key:f,value:f},f))))),e.kind==="column"&&N.createElement(N.Fragment,null,N.createElement(We,{type:"button",variant:"secondary",onClick:()=>r(e.rowId)},"Add column"),N.createElement(We,{type:"button",variant:"secondary",onClick:()=>s(e.sectionId)},"Add row"),N.createElement(We,{type:"button",variant:"secondary",onClick:()=>a({kind:"row",id:e.rowId,sectionId:e.sectionId})},"Select row")),e.kind==="row"&&N.createElement(We,{type:"button",variant:"secondary",onClick:()=>a({kind:"section",id:e.sectionId})},"Select section"),N.createElement(We,{type:"button",variant:"danger",onClick:()=>l(e.id)},"Remove ",e.kind))}var fl=[{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 hg({chosen:e,onChoose:t}){return N.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"},fl.map(n=>N.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 x$=Wr(function({place:t,onDuplicate:n,onRemove:o},r){return N.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"},N.createElement("button",{ref:r,type:"button","data-move-handle":!0,className:"cursor-grab px-2 py-1 hover:bg-black/20"},"Move"),N.createElement("button",{type:"button",onClick:n,className:"px-2 py-1 hover:bg-black/20"},"Duplicate"),N.createElement("button",{type:"button",onClick:o,className:"px-2 py-1 hover:bg-black/20"},"Remove"))}),cC=x$;var uC={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"},v$=e=>{let t=new Map;return e.forEach(n=>{let o=n.group??"Other";t.set(o,[...t.get(o)??[],n])}),[...t]},S$=({element:e,shown:t})=>N.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"},N.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"},N.createElement("path",{d:uC[e.icon]??uC.box})),N.createElement("span",null,e.name)),C$=Wr(function({elements:t,children:n},o){let[r,s]=ke(""),i=a=>a.name.toLowerCase().includes(r.trim().toLowerCase());return N.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)"},N.createElement(_t,{type:"search","aria-label":"Search elements",placeholder:"Search elements",value:r,onChange:a=>s(a.target.value)}),v$(t).map(([a,l])=>N.createElement("section",{key:a,"data-element-group":a,hidden:!l.some(i),className:"flex flex-col gap-2"},N.createElement("h2",{className:"text-xs font-semibold uppercase tracking-wide text-(--ks-color-icon)"},a),l.map(c=>N.createElement(S$,{key:c.key,element:c,shown:i(c)})))),n)}),dC=C$;function gg({path:e,onChoose:t}){return e.length===0?null:N.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)=>N.createElement(N.Fragment,{key:n.id},o>0&&N.createElement("span",{"aria-hidden":"true",className:"text-(--ks-color-icon)"},"\u203A"),N.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 mg({samples:e,chosen:t,onChoose:n}){return e.length===0?null:N.createElement("label",{className:"flex items-center gap-2 text-sm"},N.createElement("span",{className:"whitespace-nowrap"},"Preview with"),N.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},e.map(([o,r])=>N.createElement("option",{key:r,value:r},o))))}function _g({title:e,onChange:t}){let n=e??"";return N.createElement("div",{className:"flex flex-col gap-1"},N.createElement(on,{htmlFor:"ks-pages-page-title"},"Page title"),N.createElement(_t,{id:"ks-pages-page-title",type:"text",defaultValue:n,onBlur:o=>o.target.value!==n&&t(o.target.value)}),N.createElement("p",{className:"ks-hint"},"Shown in the browser tab once the page is published"))}function yg({exceptions:e,chosen:t,onChoose:n}){return e.length===0?null:N.createElement("label",{className:"flex items-center gap-2 text-sm"},N.createElement("span",{className:"whitespace-nowrap"},"Access exception"),N.createElement(yt,{defaultValue:t??"",onChange:o=>n(o.target.value),className:"py-1"},N.createElement("option",{value:""},"None"),e.map(([o,r])=>N.createElement("option",{key:r,value:r},o))))}function xg({condition:e,valueNames:t,onChange:n}){let[o,r]=ke(e?.value??""),[s,i]=ke(e?.equals??""),a=Object.entries(t??{});if(a.length===0)return null;let l=c=>{r(c),(c===""||s!=="")&&n(c,s)};return N.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)"},N.createElement(on,{htmlFor:"ks-pages-show-when-value"},"Show only when"),N.createElement(yt,{id:"ks-pages-show-when-value",value:o,onChange:c=>l(c.target.value)},N.createElement("option",{value:""},"Always shown"),a.map(([c,u])=>N.createElement("option",{key:c,value:c},u))),o!==""&&N.createElement(N.Fragment,null,N.createElement(on,{htmlFor:"ks-pages-show-when-equals"},"equals"),N.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 fC=[["light","Light"],["dark","Dark"],["system","System"]],b$=e=>{e==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e};function vg(){let e=document.documentElement.dataset.theme??"system",t=e==="custom"?[...fC,["custom","Custom"]]:fC;return N.createElement("label",{className:"flex items-center gap-2 text-sm"},N.createElement("span",null,"Mode"),N.createElement(yt,{"data-theme-mode":!0,defaultValue:e,onChange:n=>b$(n.target.value),className:"py-1"},t.map(([n,o])=>N.createElement("option",{key:n,value:n},o))))}var E$=e=>e.replace(/_/g," ").replace(/^./,t=>t.toUpperCase());function Sg({looks:e}){return e.length===0?null:N.createElement("label",{className:"flex items-center gap-2 text-sm"},N.createElement("span",null,"Look"),N.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=>N.createElement("option",{key:t,value:t},E$(t)))))}var N$=e=>N.createElement(_t,{...e,as:"textarea"}),pC=N$;var T$=({className:e,...t})=>N.createElement("input",{type:"checkbox",...t,className:po("ks-checkbox",e)}),$u=T$;var hC=(e,t,n)=>{let o=[...e];return[o[t],o[n]]=[o[n],o[t]],o};function Cg({field:e,entries:t,onChange:n}){let o=(e.entry??[]).filter(s=>!s.hidden),r=s=>n(e.key,s);return N.createElement("div",{"data-list-field":e.key,className:"flex flex-col gap-2"},t.map((s,i)=>N.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=>N.createElement("div",{key:a.key,className:"flex flex-col gap-1"},N.createElement(on,{htmlFor:`ks-pages-${e.key}-${i}-${a.key}`},a.label),a.kind==="one_of"&&N.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))},N.createElement("option",{value:""}),a.options.map(l=>N.createElement("option",{key:l,value:l},l))),a.kind!=="one_of"&&(a.kind==="yes_or_no"?N.createElement($u,{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))}):N.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))})))),N.createElement("div",{className:"flex flex-wrap gap-2"},N.createElement(We,{type:"button",size:"sm",variant:"secondary",disabled:i===0,onClick:()=>r(hC(t,i,i-1))},"Move up"),N.createElement(We,{type:"button",size:"sm",variant:"secondary",disabled:i===t.length-1,onClick:()=>r(hC(t,i,i+1))},"Move down"),N.createElement(We,{type:"button",size:"sm",variant:"danger",onClick:()=>r(t.filter((a,l)=>l!==i))},"Remove item")))),N.createElement(We,{type:"button",size:"sm",variant:"secondary",onClick:()=>r([...t,{}])},"Add item"))}var bg={};de(bg,{LexicalComposerContext:()=>gC,createLexicalComposerContext:()=>O$,useLexicalComposerContext:()=>D$});var gC=Qx(null);function O$(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n!=null?n.getTheme():null)}}}function D$(){let e=ev(gC);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 Eg=bg,mC=Eg.LexicalComposerContext,_C=Eg.createLexicalComposerContext,Yt=Eg.useLexicalComposerContext;var O_={};de(O_,{$addUpdateTag:()=>Ns,$applyNodeReplacement:()=>Gi,$assumeActiveEditor:()=>u1,$caretFromPoint:()=>$o,$caretRangeFromSelection:()=>_d,$cloneWithProperties:()=>x_,$cloneWithPropertiesEphemeral:()=>aP,$comparePointCaretNext:()=>Yl,$copyNode:()=>m_,$create:()=>rT,$createChildrenArray:()=>Hl,$createLineBreakNode:()=>$d,$createNodeSelection:()=>e_,$createParagraphNode:()=>qt,$createPoint:()=>eo,$createRangeSelection:()=>sN,$createRangeSelectionFromDom:()=>i1,$createTabNode:()=>YE,$createTextNode:()=>rn,$exportNodeJSON:()=>Hb,$extendCaretToRange:()=>C_,$findMatchingParent:()=>lr,$flushSyncAfterUpdate:()=>f1,$formatText:()=>XE,$fullReconcile:()=>cN,$generateNodesFromRawText:()=>t_,$getAdjacentChildCaret:()=>Vi,$getAdjacentNode:()=>RN,$getAdjacentSiblingOrParentSiblingCaret:()=>S1,$getCaretInDirection:()=>Bn,$getCaretRange:()=>Cr,$getCaretRangeInDirection:()=>Rd,$getCharacterOffsets:()=>ym,$getChildCaret:()=>Fn,$getChildCaretAtIndex:()=>vN,$getChildCaretOrSelf:()=>pT,$getCollapsedCaretRange:()=>hT,$getCommonAncestor:()=>N_,$getCommonAncestorResultBranchOrder:()=>E_,$getDOMSlot:()=>Jt,$getDOMTextNode:()=>Po,$getDocument:()=>Xt,$getEditor:()=>yo,$getEditorDOMRenderConfig:()=>zd,$getNearestNodeFromDOMNode:()=>l_,$getNearestRootOrShadowRoot:()=>h_,$getNodeByKey:()=>Ce,$getNodeByKeyOrThrow:()=>BN,$getNodeFromDOMNode:()=>a_,$getPreviousSelection:()=>Os,$getRoot:()=>Lt,$getSelection:()=>ue,$getSelectionSlotFrame:()=>lT,$getSiblingCaret:()=>qe,$getSlot:()=>Ts,$getSlotFrame:()=>Vl,$getSlotHost:()=>hn,$getSlotNameWithinHost:()=>aT,$getSlotNames:()=>mo,$getState:()=>nd,$getStateChange:()=>lR,$getTextContent:()=>l1,$getTextNodeOffset:()=>Zn,$getTextPointCaret:()=>Sr,$getTextPointCaretSlice:()=>Om,$getWritableNodeState:()=>Bm,$hasAncestor:()=>Kl,$hasUpdateTag:()=>q1,$insertNodeToNearestRootAtCaret:()=>CN,$insertNodes:()=>a1,$isBlockElementNode:()=>oN,$isBlockFullySelected:()=>o_,$isChildCaret:()=>Ln,$isCompactExport:()=>Ub,$isDecoratorNode:()=>me,$isEditorState:()=>x1,$isElementDOMSlot:()=>XN,$isElementNode:()=>k,$isExtendableTextPointCaret:()=>xN,$isInlineElementOrDecoratorNode:()=>FN,$isInlineFormattable:()=>cd,$isLeafNode:()=>K1,$isLexicalNode:()=>Jm,$isLineBreakNode:()=>fn,$isNodeCaret:()=>NP,$isNodeSelection:()=>ji,$isParagraphNode:()=>bN,$isRangeSelection:()=>W,$isRootNode:()=>Ge,$isRootOrShadowRoot:()=>Be,$isSelectionCapturedInDecoratorInput:()=>Ld,$isShadowRootNode:()=>g_,$isSiblingCaret:()=>vr,$isSlotChild:()=>xr,$isSlotHost:()=>gr,$isTabNode:()=>Zm,$isTextNode:()=>P,$isTextPointCaret:()=>Qn,$isTextPointCaretSlice:()=>MP,$isTokenOrSegmented:()=>Pn,$isTokenOrTab:()=>zl,$markSlotEditable:()=>tT,$needsBlockCursorBeside:()=>vd,$nodesOfType:()=>Y1,$normalizeCaret:()=>pn,$normalizeSelection__EXPERIMENTAL:()=>zm,$onUpdate:()=>LN,$parseSerializedNode:()=>d1,$removeFromParent:()=>Jn,$removeSlot:()=>CP,$removeTextFromCaretRange:()=>yN,$rewindSiblingCaret:()=>Ds,$selectAll:()=>j1,$setCompositionKey:()=>pt,$setDirectionFromDOM:()=>QN,$setFormatFromDOM:()=>ZN,$setPointFromCaret:()=>Es,$setSelection:()=>Pt,$setSelectionFromCaretRange:()=>_N,$setSlot:()=>dT,$setState:()=>tE,$setTextFormat:()=>o1,$splitAtPointCaretNext:()=>SN,$splitNode:()=>Q1,$updateDOMSelection:()=>iN,$updateRangeSelectionFromCaretRange:()=>Cl,$withCompactExport:()=>Kb,ArtificialNode__DO_NOT_USE:()=>gd,BEFORE_INPUT_COMMAND:()=>Wm,BLUR_COMMAND:()=>ME,CAN_REDO_COMMAND:()=>CR,CAN_UNDO_COMMAND:()=>bR,CAN_USE_BEFORE_INPUT:()=>bl,CAN_USE_DOM:()=>br,CLEAR_EDITOR_COMMAND:()=>vR,CLEAR_HISTORY_COMMAND:()=>SR,CLICK_COMMAND:()=>pE,COLLABORATION_TAG:()=>BE,COMMAND_PRIORITY_BEFORE_CRITICAL:()=>R1,COMMAND_PRIORITY_BEFORE_EDITOR:()=>k1,COMMAND_PRIORITY_BEFORE_HIGH:()=>$1,COMMAND_PRIORITY_BEFORE_LOW:()=>A1,COMMAND_PRIORITY_BEFORE_NORMAL:()=>I1,COMMAND_PRIORITY_CRITICAL:()=>w1,COMMAND_PRIORITY_EDITOR:()=>T1,COMMAND_PRIORITY_HIGH:()=>M1,COMMAND_PRIORITY_LOW:()=>O1,COMMAND_PRIORITY_NORMAL:()=>D1,COMPOSITION_END_COMMAND:()=>Hm,COMPOSITION_END_TAG:()=>ld,COMPOSITION_START_COMMAND:()=>Um,COMPOSITION_START_TAG:()=>KE,CONTROLLED_TEXT_INSERTION_COMMAND:()=>Ti,CONTROL_OR_ALT:()=>dm,CONTROL_OR_META:()=>ar,CONTROL_OR_OTHER_KEY:()=>Im,COPY_COMMAND:()=>Gm,CUT_COMMAND:()=>qm,CUT_TAG:()=>zR,DEFAULT_EDITOR_DOM_CONFIG:()=>Bl,DELETE_CHARACTER_COMMAND:()=>Al,DELETE_LINE_COMMAND:()=>Oi,DELETE_WORD_COMMAND:()=>Il,DRAGEND_COMMAND:()=>TE,DRAGOVER_COMMAND:()=>NE,DRAGSTART_COMMAND:()=>EE,DROP_COMMAND:()=>bE,DecoratorNode:()=>Ll,ElementNode:()=>to,FOCUS_COMMAND:()=>DE,FORMAT_ELEMENT_COMMAND:()=>xR,FORMAT_TEXT_COMMAND:()=>dr,HISTORIC_TAG:()=>LR,HISTORY_MERGE_TAG:()=>Yu,HISTORY_PUSH_TAG:()=>FR,INDENT_CONTENT_COMMAND:()=>_R,INPUT_COMMAND:()=>Km,INSERT_LINE_BREAK_COMMAND:()=>vl,INSERT_PARAGRAPH_COMMAND:()=>lm,INSERT_TAB_COMMAND:()=>mR,INTERNAL_$expandSelectionToWholeDocument:()=>Gu,INTERNAL_$isBlock:()=>Rt,IS_ALL_FORMATTING:()=>Ab,IS_ANDROID:()=>wm,IS_ANDROID_CHROME:()=>El,IS_APPLE:()=>Lo,IS_APPLE_WEBKIT:()=>Xl,IS_BOLD:()=>R$,IS_CHROME:()=>Nd,IS_CODE:()=>B$,IS_FIREFOX:()=>_o,IS_HIGHLIGHT:()=>K$,IS_IOS:()=>no,IS_ITALIC:()=>P$,IS_SAFARI:()=>ql,IS_STRIKETHROUGH:()=>L$,IS_SUBSCRIPT:()=>z$,IS_SUPERSCRIPT:()=>W$,IS_UNDERLINE:()=>F$,KEY_ARROW_DOWN_COMMAND:()=>_E,KEY_ARROW_LEFT_COMMAND:()=>gE,KEY_ARROW_RIGHT_COMMAND:()=>hE,KEY_ARROW_UP_COMMAND:()=>mE,KEY_BACKSPACE_COMMAND:()=>xE,KEY_DELETE_COMMAND:()=>SE,KEY_DOWN_COMMAND:()=>jm,KEY_ENTER_COMMAND:()=>Ym,KEY_ESCAPE_COMMAND:()=>vE,KEY_MODIFIER_COMMAND:()=>wE,KEY_SPACE_COMMAND:()=>yE,KEY_TAB_COMMAND:()=>CE,LineBreakNode:()=>Fi,MOVE_TO_END:()=>cm,MOVE_TO_START:()=>um,NODE_STATE_DIRECT:()=>Jg,NODE_STATE_KEY:()=>Td,NODE_STATE_LATEST:()=>Qg,OUTDENT_CONTENT_COMMAND:()=>yR,PASTE_COMMAND:()=>Vm,PASTE_TAG:()=>BR,ParagraphNode:()=>Bi,REDO_COMMAND:()=>$l,REMOVE_TEXT_COMMAND:()=>Uu,RootNode:()=>Li,SELECTION_CHANGE_COMMAND:()=>Id,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>hR,SELECT_ALL_COMMAND:()=>OE,SET_TEXT_FORMAT_COMMAND:()=>gR,SKIP_COLLAB_TAG:()=>WR,SKIP_DOM_SELECTION_TAG:()=>WE,SKIP_SCROLL_INTO_VIEW_TAG:()=>zE,SKIP_SELECTION_FOCUS_TAG:()=>ad,TEXT_TYPE_TO_FORMAT:()=>xt,TabNode:()=>Ri,TextNode:()=>mr,UNDO_COMMAND:()=>rd,addClassNamesToElement:()=>RP,aliasTableOf:()=>td,aliasedValue:()=>Xg,arrayValue:()=>sR,booleanValue:()=>Z$,buildImportMap:()=>PR,compileKeyboardShortcuts:()=>AE,configExtension:()=>kP,createCommand:()=>Y,createEditor:()=>P1,createRefCountedRegistry:()=>IE,createSharedNodeState:()=>nE,createState:()=>aR,declarePeerDependency:()=>AP,declaredAccepts:()=>Lm,defineExtension:()=>wP,enumValue:()=>Dl,findAllLexicalElementsDeep:()=>KN,flipDirection:()=>Wo,getActiveElement:()=>Cd,getActiveElementDeep:()=>zi,getComposedEventTarget:()=>__,getComposedSchemaFields:()=>uP,getComposedStaticRange:()=>qi,getDOMOwnerDocument:()=>Bd,getDOMSelection:()=>Wn,getDOMSelectionFromTarget:()=>zN,getDOMSelectionPoints:()=>sn,getDOMSelectionRange:()=>HN,getDOMSelectionRangeAndPoints:()=>J1,getDOMShadowRoots:()=>WN,getDOMTextNode:()=>ON,getDeclaredSlots:()=>cT,getEditorPropertyFromDOMNode:()=>Zl,getNearestEditorFromDOMNode:()=>hr,getParentElement:()=>Ro,getRegisteredNode:()=>Pd,getRegisteredNodeOrThrow:()=>i_,getRegisteredSubtypeMap:()=>xP,getRootOwnerDocument:()=>UN,getStaticNodeConfig:()=>ec,getStyleObjectFromCSS:()=>gm,getTextDirection:()=>W1,getTransformSetFromKlass:()=>NN,getterTableOf:()=>Jl,isBlockDomNode:()=>y_,isCurrentlyReadOnlyMode:()=>_r,isDOMCapturingSelection:()=>Ul,isDOMDocumentNode:()=>Yi,isDOMNode:()=>Xi,isDOMShadowRoot:()=>Bo,isDOMTextNode:()=>mn,isDOMUnmanaged:()=>v_,isDocumentFragment:()=>GN,isExactShortcutMatch:()=>V1,isHTMLAnchorElement:()=>Z1,isHTMLElement:()=>Oe,isHTMLTableCellElement:()=>tP,isHTMLTableRowElement:()=>eP,isInlineDomNode:()=>qN,isLastChildInBlockNode:()=>mN,isLexicalEditor:()=>Fd,isModifierMatch:()=>$N,isOnlyChildInBlockNode:()=>gN,isSchemaField:()=>Fo,isSelectionCapturedInDecoratorInput:()=>z1,isSelectionWithinEditor:()=>Ql,iterStaticNodeConfigChain:()=>zo,keyboardEventMaskForPlatform:()=>H1,makeStepwiseIterator:()=>b_,mergeRegister:()=>T_,mountSlotContainer:()=>rP,nodeSchema:()=>kd,normalizeClassNames:()=>tc,nullable:()=>eR,numberValue:()=>Ii,objectValue:()=>iR,optional:()=>tR,rawValue:()=>rR,registerEventListener:()=>Xm,registerEventListeners:()=>LP,removeClassNamesFromElement:()=>PP,removeFromParent:()=>U1,resetRandomKey:()=>F1,safeCast:()=>IP,setDOMStyleFromCSS:()=>mm,setDOMStyleObject:()=>qR,setDOMUnmanaged:()=>eT,setNodeIndentFromDOM:()=>JN,setterDefaultOf:()=>Md,setterTableOf:()=>Dd,shallowMergeConfig:()=>$P,stopLexicalPropagation:()=>pm,stringValue:()=>Ol,toggleTextFormatType:()=>yr,tokenizeRawText:()=>aN,transformValue:()=>oR,unionValue:()=>nR,unmountSlotContainer:()=>sP,withAccessors:()=>Ni,withField:()=>Io});function jg(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 w(e,...t){throw jg(e,...t)}function Mm(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 br=M$();function w$(){return br&&"documentMode"in document?document.documentMode:null}var k$=w$();function A$(e){return br&&e.test(navigator.platform)}function Gl(e){return br&&e.test(navigator.userAgent)}var Lo=A$(/Mac|iPod|iPhone|iPad/),_o=Gl(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function I$(){return!(!br||!("InputEvent"in window)||k$)&&"getTargetRanges"in new window.InputEvent("input")}var bl=I$();function $$(){return br&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var no=$$(),wm=Gl(/Android/),ql=Gl(/Version\/[\d.]+.*Safari/)&&!wm,Nd=Gl(/^(?=.*Chrome).*/i),El=br&&wm&&Nd,Xl=Gl(/AppleWebKit\/[\d.]+/)&&Lo&&!Nd,R$=1,P$=2,L$=4,F$=8,B$=16,z$=32,W$=64,K$=128;function U$(){return 2047}var Ab=U$(),Nl=ql||no||Xl?"\xA0":"\u200B",ys=`
|
|
68
|
+
|
|
69
|
+
`,km=_o?"\xA0":Nl,Ib="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",$b="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF";function Rb(e,t){return new RegExp("^[^"+e+"]*["+t+"]")}var H$=Rb($b,Ib),V$=Rb(Ib,$b),xt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Pb={directionless:1,unmergeable:2},Ai={center:2,end:6,justify:4,left:1,right:3,start:5};function Lb(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Fb=Lb(Ai),Am={normal:0,segmented:2,token:1},Bb=Lb(Am),Td="$",Im=Symbol.for("@lexical/ctrlOrOtherKey"),Ng="$config";function Tg(){return yo()._blockCursorElement}function Og(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}var j$=Xl||no||ql;function yC(){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 Ju(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-decorator-boundary")}var Qu=class e{constructor(t,n,o){M(this,"element");M(this,"before");M(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&&w(357),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&w(358),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&w(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=xC(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=xC(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 xC(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Zu=class e extends Qu{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(;Og(n);)t=n,n=n.nextSibling;Ju(n)&&(t=n,n=n.nextSibling);let o=t?t.nextSibling:this.element.firstChild;return o!==null&&o===Tg()?o:t}getDecoratorBoundaryAnchor(t){let n;if(t==="leading"){let o=super.getFirstChildAnchor();for(n=o?o.nextSibling:this.element.firstChild;Og(n);)n=n.nextSibling}else n=this.before?this.before.previousSibling:this.element.lastChild,n!==null&&n===Tg()&&(n=n.previousSibling);return Ju(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(yC(),r?r.nextSibling:this.element.firstChild)}else this.element.insertBefore(yC(),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"&&Og(o)?null:t;if(n.__lexicalLastChildKind!==r)if(n.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let s=r==="decorator"&&j$;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=Tg(),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=vC(n,o);s.push(r);let i=vC(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 vC(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&&w(225),n.reverse()}function Y$(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var zb=Y$(),gs=class{constructor(){M(this,"_front",new Set);M(this,"_back",new Set);M(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]()}},ps=null;function Wb(e,t=1e3){return e instanceof Tl?e.clone():e.size<t?new Map(e):new Tl().init(new Map(e),void 0,e.size)}var Tl=class e{constructor(){M(this,"_mutable",!1);M(this,"_old");M(this,"_nursery");M(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===ps?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!==ps?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!==ps&&o!==void 0||(this._size++,o===ps&&r.delete(t)),r.set(t,n),this}delete(t){let n=this.has(t);return n&&(this.getNursery().set(t,ps),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!==ps&&(s!==void 0&&(o[1]=s),yield o)}for(let o of t)o[1]===ps||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()}},_l=!1;function Kb(e,t,...n){let o=_l,r;try{_l=e,r=t()}finally{_l=o}var s;return(s=r)===null||typeof s!="object"&&typeof s!="function"||typeof s.then!="function"||w(421),r}function Ub(){return _l}function Hb(e){let t=e.exportJSON(_l),n=e.constructor;return t.type!==n.getType()&&w(130,n.name),k(e)&&!Array.isArray(t.children)&&w(59,n.name),t}function ed(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)||gr(i)&&i.__slots!==null)&&ed(i,a,n,o,r,s),n.has(a)||s.delete(a),r.push(a)),i=i.getNextSibling()}}for(let i of gr(e)&&e.__slots!==null?e.__slots.values():[]){let a=o.get(i);a!==void 0&&xr(a)&&a.__slotHost===t&&((k(a)||gr(a)&&a.__slots!==null)&&ed(a,i,n,o,r,s),n.has(i)||s.delete(i),r.push(i))}}var Yg=!1,$m=0;function G$(e){$m=e.timeStamp}function Dg(e,t,n){let o=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||o&&e.previousSibling===r)||o&&Ms(e,n)!==void 0}function q$(e,t,n){let o=Wn(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&&d_(t,a,s,i,!1)}function X$(e,t,n){if(W(e)){let o=e.anchor.getNode();if(o.is(n)&&e.format!==o.getFormat())return!1}return mn(t)&&n.isAttached()}function J$(e,t,n){for(let o=e;o&&!v_(o);o=Ro(o)){let r=Ms(o,t);if(r!==void 0){let s=Ce(r,n);if(s)return me(s)||!Oe(o)?void 0:[o,s]}}}function Vb(e,t,n){Yg=!0;let o=performance.now()-$m>100;try{gn(e,()=>{let r=ue()||(function(d){return d.read("latest",()=>{let f=ue();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=J$(h,e,i);if(!g)continue;let[y,m]=g;if(p==="characterData")o&&P(m)&&mn(h)&&X$(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],E=a_(b),D=b.parentNode;if(!(D==null||b===a||E!==null||Dg(b,D,e)||Ju(b)||e._slotsUsed&&Oe(b)&&b.hasAttribute("data-lexical-slot")||v_(b))){if(_o){let O=(Oe(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 E=x[b];Dg(E,h,e)||a===E?(h.appendChild(E),S++):Ju(E)&&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"||Dg(y,h,e)||m.removeChild(y)}}n.takeRecords()}r!==null&&(l&&Pt(r),_o&&PN(e)&&r.insertRawText(c))})}finally{Yg=!1}}function jb(e){let t=e._observer;t!==null&&Vb(e,t.takeRecords(),t)}function Yb(e){(function(t){$m===0&&an(t).addEventListener("textInput",G$,!0)})(e),e._observer=new MutationObserver((t,n)=>{Vb(e,t,n)})}function Od(e,t,n){let{isEqual:o}=e;return t===n||o!==void 0&&o(t,n)}function Rm(e,t){return Od(e,t,e.defaultValue)}function Fo(e){return typeof e=="object"&&e!==null}function Jl(e,t){let n=wd(e,t).getter;return Fo(n)&&n.getterTable!==void 0||w(405,t),Pm(n.getterTable)}function Dd(e,t){let n=wd(e,t).setter;return Fo(n)&&n.setterTable!==void 0||w(406,t),Pm(n.setterTable)}function td(e,t,n){let{meta:o}=wd(e,t);for(let r=0;;)if(o.kind==="aliased"){if(r===n)return Pm(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:w(407,t,String(n))}function Md(e,t){let n=wd(e,t),{setter:o}=n;Fo(o)&&o.setterTable!==void 0||w(408,t);let r=String(n.defaultValue);return Rn(o.setterTable,r)||w(409,t,r),o.setterTable[r]}function Pm(e){return Object.assign(Object.create(null),e)}function wd(e,t){let n=e.get(t);return n===void 0&&w(410,t),n}function zn(e,t,n,o,r){r!==void 0&&Gb.add(r);let s=n===void 0,i=s?e(void 0):n;return s&&Xb(i),Object.assign(e,{accepts:r,defaultValue:i,isEqual:o,meta:t})}var Gb=new WeakSet;function Lm(e){let{accepts:t}=e;return t===void 0||Gb.has(t)?void 0:t}var qb=new WeakSet;function Fm(e){return e!==null&&typeof e=="object"&&qb.add(e),e}function Xb(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)&&!qb.has(e)){Object.freeze(e);for(let t of Object.values(e))Xb(t)}}function Jb(e){let{isEqual:t}=e;return t===void 0?void 0:(n,o)=>n==null||o==null?n===o:t(n,o)}function Qb(e,t){return n=>t(n)||vs(e,n)}function vs(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 vs(o,r)?{parsed:o(r)}:void 0;let i=o(r);return Rm(o,i)&&r!==o.defaultValue?void 0:{parsed:i}})(e,t)!==void 0}var SC=new WeakMap;function Gg(e){let t=SC.get(e);if(t!==void 0)return t;let n=(function(o){let r=o.meta;if(r==null||Lm(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=>Gg(s));case"nullable":case"optional":case"transform":case"aliased":return r.inner!=null&&Gg(r.inner);default:return!1}})(e);return SC.set(e,n),n}function zu(e,t){let n=e.meta;if(n==null)return vs(e,t)?1:4;let o=Lm(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=zu(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&&Wu(l,u))return 4;let d=1;for(let f of Object.keys(l))if(Rn(u,f)){let p=zu(u[f],l[f]);p>d&&(d=p)}return d>=3?3:d}case"union":return a.members==null?1:Zb(a.members,l).fit;case"aliased":case"nullable":case"optional":case"transform":return(a.kind==="aliased"?typeof l=="string"&&a.aliases!=null&&Rn(a.aliases,l):a.kind==="nullable"?l==null:a.kind==="optional"&&l===void 0)||a.inner==null?1:zu(a.inner,l);default:return c||vs(i,l)?1:4}})(e,n,t,r);return r&&s===4?3:s}function Zb(e,t){let n,o=4,r=4;for(let s=0;s<e.length;s++){let i=e[s],a=zu(i,t),l=a<3&&Gg(i)?3:a;if(l<o&&(n=i,o=l,r=a,l===1))break}return{fit:r,member:n}}function Rn(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 Wu(e,t){for(let n of Object.keys(e))if(!Rn(t,n))return!0;return!1}function Ol(e=""){return zn(t=>typeof t=="string"?t:e,{kind:"string"},void 0,void 0,t=>typeof t=="string")}var Q$=/^-?(?: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"&&Q$.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 zn(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 Z$(e=!1){return zn(t=>typeof t=="boolean"?t:e,{kind:"boolean"},void 0,void 0,t=>typeof t=="boolean")}function Dl(e,...t){let n=Fm(t.length!==0?t[0]:e[0]),o=new Set(e);return zn(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 eR(e,t={}){let{defaultAsNull:n}=t;return zn(o=>{if(o==null)return null;let r=e(o);return n&&Rm(e,r)?null:r},{defaultAsNull:n,inner:e,kind:"nullable"},void 0,Jb(e),Qb(e,o=>o==null))}function tR(e,t={}){let{omitDefault:n}=t;return zn(o=>{if(o===void 0)return;let r=e(o);return n&&Rm(e,r)?void 0:r},{inner:e,kind:"optional",omitDefault:n},void 0,Jb(e),Qb(e,o=>o===void 0))}function qg(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(!qg(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=>Rn(t,o)&&qg(e[o],t[o]))}function nR(e,...t){let n=t.length!==0?Fm(t[0]):e[0].defaultValue;return zn(o=>{if(o===void 0)return n;let r=(s=>{let i=(function(a,l){return Zb(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,qg,o=>(o!==void 0||n===void 0)&&e.some(r=>vs(r,o)))}function kd(){return e=>(function(t){return{meta:{fields:t,kind:"node"}}})(e)}function Xg(e,t){let n=o=>typeof o=="string"&&Rn(t,o);return zn(o=>n(o)?t[o]:e(o),{aliases:t,inner:e,kind:"aliased"},e.defaultValue,e.isEqual,o=>n(o)||vs(e,o))}function oR(e,t,n={}){return zn(o=>t(e(o)),{inner:e,kind:"transform"},Fm(t(e.defaultValue)),n.isEqual,o=>vs(e,o))}function rR(){return zn(e=>e===void 0?void 0:e,{kind:"raw"},void 0,void 0,()=>!0)}function sR(e){return zn(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(!Od(e,t[o],n[o]))return!1;return!0},t=>Array.isArray(t))}function iR(e){return(function(n,o){let r=Object.entries(o);return zn(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)&&!Wu(s,o)&&!Wu(i,o)&&r.every(([a,l])=>Od(l,s[a],i[a])),s=>Ei(s)&&!Wu(s,o))})(0,e)}function Io(e,t){return eE(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 eE(0,e,t)}function eE(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 Jg="direct",Qg="latest",Zg=class{constructor(t,n){M(this,"key");M(this,"parse");M(this,"unparse");M(this,"isEqual");M(this,"defaultValue");M(this,"resetOnCopyNode");M(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||cR).bind(n),this.isEqual=n.isEqual?n.isEqual.bind(n):o!==void 0&&o.isEqual!==void 0?(s,i)=>Od(o,s,i):Object.is,this.defaultValue=o!==void 0?o.defaultValue:this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function aR(e,t){return new Zg(e,t)}function nd(e,t,n=Qg){let o=(n===Qg?e.getLatest():e).__state;return o?o.getValue(t):t.defaultValue}function lR(e,t,n){let o=nd(e,n,Jg),r=nd(t,n,Jg);return n.isEqual(o,r)?null:[o,r]}function tE(e,t,n){let o;if(ft(),typeof n=="function"){let s=e.getLatest(),i=nd(s,t);if(o=n(i),t.isEqual(i,o))return s}else o=n;let r=e.getWritable();return Bm(r).updateFromKnown(t,o),r}function nE(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 CC=new Set(["__proto__","constructor","prototype"]),em=class e{constructor(t,n,o=void 0,r=new Map,s=void 0){M(this,"node");M(this,"knownState");M(this,"unknownState");M(this,"sharedNodeState");M(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 bC(t)&&(n[Td]=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(CC.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=bC(s)),this.size++),r.set(t,n)}updateFromUnknown(t,n){if(CC.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 Bm(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new em(t,(function(o){return o.__state?o.__state.sharedNodeState:i_(yo(),o.getType()).sharedNodeState})(t));return t.__state=n,n}function oE(e,t){let n=e.getWritable(),o=t[Td];return(n.__state||o)&&Bm(e).updateFromJSON(o),n}function bC(e){if(e)for(let t in e)return e}function cR(e){return e}function EC(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 NC(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 TC(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function OC(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&&EC(f,u,d)||d&&EC(f,d,u)||u&&NC(f,u,d)||d&&NC(f,d,u))})(l,c))}function DC(e,t){let n=e.mergeWithSibling(t),o=_e()._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&&P(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(OC(t,o)){o=DC(t,o);break}break}t.remove()}for(;(n=o.getNextSibling())!==null&&P(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(OC(o,n)){o=DC(o,n);break}break}n.remove()}}else o.remove()}function zm(e){return wC(e.anchor),wC(e.focus),e}function wC(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),P(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 od=Symbol.for("@lexical/CachedTextSize");function kC(e,t){return tm.read(()=>{let n=0,o=e;for(let r=0;r<t&&o!==null;r++){let s=Xn.get(o);if(s===void 0&&w(345,o),k(s)){let i=Ie.get(o);if(i!==void 0&&k(i)&&i.__parent!==s.__parent)n+=s.getTextContentSize();else{let a=Ss.get(o),l=a&&a.__lexicalTextContent;typeof l!="string"&&w(346,s.getType()),n+=l.length}r<t-1&&!s.isInline()&&(n+=2)}else{let i=s[od];i===void 0&&w(347,s.getType(),o),n+=i}o=s.__next}return n},{editor:he})}function rE(e){k(e)||e[od]===void 0&&(e[od]=P(e)?e.__text.length:e.getTextContentSize())}var uR=4,Ml,he,wl,ie="",je=null,$t=null,Ot=null;function ho(){return{firstTextKey:Ot,format:je,style:$t}}function $n(e){e.firstTextKey!==null&&(je=e.format,$t=e.style,Ot=e.firstTextKey)}function Mg(e){if(Ot!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&w(348),t===null)return;let n=Ie.get(t);P(n)&&(je=n.getFormat(),$t=n.getStyle(),Ot=t)}var Ad,yl,xl,Xn,tm,Ie,Ss,nm,kl,Cs,ko=!1,Ku=!1;function cr(e,t){let n=Xn.get(e),o=Ie.has(e);if(t!==null){let r=am(e);r.parentNode===t&&t.removeChild(r)}if(!o){if(he._keyToDOMMap.delete(e),k(n)){let r=Hl(n,Xn);om(r,0,r.length-1,null)}if(n!==void 0){for(let r of In(n).values()){let s=sm(r);cr(r,null),s!==null&&s.remove()}f_(kl,wl,Ad,n,"destroyed")}}}function om(e,t,n,o){for(let r=t;r<=n;++r){let s=e[r];s!==void 0&&cr(s,o)}}function hs(e,t){e.setProperty("text-align",t)}var dR="40px";function sE(e,t){let n=Ml.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, ${dR}))`),Wl(e,"class"),Wl(e,"style")}function iE(e,t){let n=e.style;t===0?hs(n,""):t===1?hs(n,"left"):t===2?hs(n,"center"):t===3?hs(n,"right"):t===4?hs(n,"justify"):t===5?hs(n,"start"):t===6&&hs(n,"end"),Wl(e,"style")}function rm(e,t){let n=(function(o){let r=o.__dir;if(r!==null)return r;if(Ge(o))return null;let s=o.getParent();return s===null||Be(s)&&s.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function aE(e){let t=Xt().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function lE(e,t,n){t||e.contentEditable==="false"?tT(n,he):n.removeAttribute("contenteditable")}function AC(e,t,n){let o=ie,r=ho();ie="";let s="",i=me(e);for(let[a,l]of n){let c=aE(a);lE(t,i,c),t.appendChild(c),ie="";let u=ho();ur(l,Jt(e,c,he)),$n(u),cE(e,a,t,c),s+=ie}return $n(r),ie=o,s}function In(e){return gr(e)&&e.__slots!==null?e.__slots:iT}function cE(e,t,n,o){let r=Cs.$getSlotTargetElement(e,t,n,he);r!==null&&(o.parentElement!==r&&r.appendChild(o),o.style.display="")}function sm(e){let t=Ss.get(e);return t!==void 0?t.parentElement:null}function IC(e,t,n){let o=In(e),r=In(t);for(let[u,d]of o)if(!r.has(u)){let f=sm(d);cr(d,null),f!==null&&f.remove()}let s=ie,i=ho(),a="",l=null,c=me(t);for(let[u,d]of r){let f=o.get(u),p=f!==void 0?sm(f):null;ie="";let h=ho();if(p===null){p=aE(u);let g=null;for(let y of n.children)if(!y.hasAttribute("data-lexical-slot")){g=y;break}n.insertBefore(p,g),ur(d,Jt(t,p,he))}else f===d?Ao(d,p):(f!==void 0&&cr(f,p),ur(d,Jt(t,p,he)));if($n(h),lE(n,c,p),cE(t,u,n,p),a+=ie,p.parentElement===n){let g=l===null?n.firstChild:l.nextSibling;g!==p&&n.insertBefore(p,g),l=p}}return $n(i),ie=s,a}function ur(e,t){let n=Ie.get(e);if(n===void 0&&w(60),t!==null){let r=Xn.get(e);if(r!==void 0){let s=Ss.get(e);if(s!==void 0){let i=xr(r)?r.__slotHost:null,a=xr(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=Cs.$createDOM(n,he);if((function(r,s,i){let a=i._keyToDOMMap;MN(s,i,r),a.set(r,s)})(e,o,he),P(n)?o.setAttribute("data-lexical-text","true"):me(n)&&(o.setAttribute("data-lexical-decorator","true"),eT(o,{captureSelection:!0})),k(n)){let r=n.__indent,s=n.__size;rm(o,n),r!==0&&sE(o,r);let i=In(n),a=i.size>0?AC(n,o,i):"";if(s===0)o.__lexicalTextContent=a,o.__lexicalFirstTextKey=null,ie+=a,i.size>0&&(o.__lexicalSlotTextLength=a.length);else{let c=ie,u=s-1;if(im(Hl(n,Ie),n,0,u,Jt(n,o,he)),a!==""){let d=o.__lexicalTextContent||"";o.__lexicalTextContent=a+d,ie=c+a+d}i.size>0&&(o.__lexicalSlotTextLength=a.length)}let l=n.__format;l!==0&&iE(o,l),n.isInline()||(dE(0,n,o),uE(n,o))}else{let r=n.getTextContent();if(me(n)){let s=n.decorate(he,Ml);s!==null&&fE(e,s),o.contentEditable="false";let i=In(n);i.size>0&&AC(n,o,i)}ie+=r}return t!==null&&t.insertChild(o),Cs.$decorateDOM(n,null,o,he),rE(n),f_(kl,wl,Ad,n,"created"),o}function im(e,t,n,o,r){let s=ie,i=ho();ie="",je=null,$t=null,Ot=null;let a=n;for(;a<=o;++a){let c=ho();ur(e[a],r);let u=Ie.get(e[a]);u!==null&&P(u)?je===null&&(je=u.getFormat(),$t=u.getStyle(),Ot=u.__key):k(u)&&a<o&&!u.isInline()&&(ie+=ys),$n(c)}let l=he._keyToDOMMap.get(t.__key);l===void 0&&w(349,t.__key),l.__lexicalTextContent=ie,l.__lexicalFirstTextKey=Ot,ie=s+ie,$n(i)}function $C(e,t){if(!e)return!1;let n=t.get(e);return me(n)&&!n.isInline()}function uE(e,t){let n=Jt(e,t,he);n.setDecoratorBoundaryAnchor("leading",$C(e.__first,Ie)),n.setDecoratorBoundaryAnchor("trailing",$C(e.__last,Ie))}function dE(e,t,n){let o=Jt(t,n,he),r=(function(s,i){if(s){let a=s.__last;if(a){let l=i.get(a);if(l)return fn(l)?"line-break":me(l)&&l.isInline()?"decorator":null}return"empty"}return null})(t,Ie);o.setManagedLineBreak(r)}function RC(e,t,n){let o=t.__lexicalFirstTextKey;if(o!=null){let r=e.__key,s=o;for(;s!==null;){let i=Ie.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=Ie.get(o);if(P(i))return je=i.getFormat(),void($t=i.getStyle())}}t.__lexicalFirstTextKey=Ot}function Ao(e,t){let n=Xn.get(e),o=Ie.get(e);n!==void 0&&o!==void 0||w(61);let r=ko||xl.has(e)||yl.has(e),s=wi(he,e);if(n===o&&!r){let i;if(k(n)){let a=s.__lexicalTextContent;typeof a!="string"&&w(355,n.getType()),i=a,Mg(s)}else i=n.getTextContent();return ie+=i,s}if(n!==o&&r&&f_(kl,wl,Ad,o,"updated"),Cs.$updateDOM(o,n,s,he)){let i=ur(e,null);return t===null&&w(62),t.replaceChild(i,s),cr(e,null),i}if(k(n)){k(o)||w(334,e);let i=o.__indent;(ko||i!==n.__indent)&&sE(s,i);let a=o.__format;(ko||a!==n.__format)&&iE(s,a);let l=r&&(In(o).size>0||In(n).size>0)?IC(n,o,s):"";if(r){let c=ie;if((function(u,d,f){var p;je=null,$t=null,Ot=null,(function(h,g,y){let m=ie,_=h.__size,x=g.__size;ie="";let v=y.element,S=he._keyToDOMMap.get(g.__key);S===void 0&&w(351,g.__key);let b=x-_;if(!ko&&Math.abs(b)<=1&&_>=uR&&h.__first===g.__first&&(b!==0||!he._cloneNotNeeded.has(h.__key))){let E=S.__lexicalTextContent,D=nm.get(h.__key);if(!ko&&typeof E=="string"&&D!==void 0){let O=(function(T,A){let $=A.size;if($===0||$>=T.__size)return null;let I=T.__last,R=null,K=0;for(;I!==null&&K<$;){if(!A.has(I))return null;R=I;let J=Ie.get(I);if(J===void 0)return null;I=J.__prev,K++}return K!==$||I!==null&&A.has(I)?null:R})(g,D);if(O!==null){let T=D.size;if(b===0){let A=kC(O,T),$=O,I=0;for(;$!==null&&I<T;){let oe=Ie.get($);if(oe===void 0)break;let Z=ho();Ao($,v),P(oe)&&je===null&&(je=oe.getFormat(),$t=oe.getStyle(),Ot=oe.__key),$n(Z),$=oe.__next,I++}let R="";for($=O,I=0;$!==null&&I<T;){let oe=Ie.get($);if(oe===void 0)break;let Z;if(k(oe)){let ae=he._keyToDOMMap.get($),ee=ae&&ae.__lexicalTextContent;typeof ee!="string"&&w(352,oe.getType()),Z=ee}else Z=oe.getTextContent();R+=Z,I<T-1&&k(oe)&&!oe.isInline()&&(R+=ys),$=oe.__next,I++}let K=S.__lexicalSlotTextLength||0,J=K>0?E.slice(K):E,Q=J.slice(0,J.length-A)+R;return S.__lexicalTextContent=Q,ie=m+Q,void RC(g,S,D)}if((function(A,$,I,R,K,J,Q,oe){if(oe!==1&&oe!==-1||Q!==(oe===1?2:1))return!1;let Z=Q-oe,ae=A.__last;for(let fe=0;fe<Z-1;fe++){if(ae===null)return!1;let ze=Xn.get(ae);if(ze===void 0)return!1;ae=ze.__prev}if(ae===null)return!1;let ee=Ie.get(J),Re=Xn.get(ae);if(ee===void 0||Re===void 0||ee.__prev!==Re.__prev)return!1;let le=[],V=J;for(let fe=0;fe<Q;fe++){if(V===null)return!1;le.push(V);let ze=Ie.get(V);V=ze?ze.__next:null}let te=[];V=ae;for(let fe=0;fe<Z;fe++){if(V===null)return!1;te.push(V);let ze=Xn.get(V);V=ze?ze.__next:null}let Qe=new Set(te),Ue=new Set(le),ct=[],Ct=0,bt=0;for(;Ct<Z&&bt<Q;)if(le[bt]===te[Ct])ct.push({key:le[bt],kind:"reconcile"}),Ct++,bt++;else if(Ue.has(te[Ct])){if(Qe.has(le[bt]))return!1;ct.push({key:le[bt],kind:"create",nextIndex:bt}),bt++}else ct.push({key:te[Ct],kind:"destroy"}),Ct++;for(;Ct<Z;)ct.push({key:te[Ct++],kind:"destroy"});for(;bt<Q;)ct.push({key:le[bt],kind:"create",nextIndex:bt}),bt++;let Fr=kC(ae,Z);for(let fe of ct){let ze=ho();if(fe.kind==="reconcile")Ao(fe.key,I.element);else if(fe.kind==="destroy")cr(fe.key,I.element);else{let ot=null;for(let Nn=fe.nextIndex+1;Nn<Q;Nn++){let rt=he._keyToDOMMap.get(le[Nn]);if(rt!==void 0){ot=rt;break}}ur(fe.key,I.withBefore(ot??I.before))}if(fe.kind!=="destroy"){let ot=Ie.get(fe.key);ot&&P(ot)&&je===null&&(je=ot.getFormat(),$t=ot.getStyle(),Ot=ot.__key)}$n(ze)}let So="";for(let fe=0;fe<Q;fe++){let ze=Ie.get(le[fe]);if(ze===void 0)return!1;let ot;if(k(ze)){let Nn=he._keyToDOMMap.get(le[fe]),rt=Nn&&Nn.__lexicalTextContent;typeof rt!="string"&&w(350,ze.getType()),ot=rt}else ot=ze.getTextContent();So+=ot,fe<Q-1&&k(ze)&&!ze.isInline()&&(So+=ys)}let ht=R.__lexicalSlotTextLength||0,Co=ht>0?K.slice(ht):K;return R.__lexicalTextContent=Co.slice(0,Co.length-Fr)+So,!0})(h,0,y,S,E,O,T,b)){let A=S.__lexicalTextContent;return typeof A!="string"&&w(353),ie=m+A,void RC(g,S,D)}}}if(b===0){let O=h.__first,T=0;for(;O!==null;){let A=Ie.get(O);if(A===void 0)break;let $=ko||xl.has(O)||yl.has(O),I=ho();if($)Ao(O,v);else{let R,K;if(k(A)){K=Ss.get(O);let J=K&&K.__lexicalTextContent;typeof J!="string"&&w(354,A.getType()),R=J}else R=A.getTextContent();ie+=R,K!==void 0&&Mg(K)}P(A)?je===null&&(je=A.getFormat(),$t=A.getStyle(),Ot=A.__key):k(A)&&T<x-1&&!A.isInline()&&(ie+=ys),$n(I),O=A.__next,T++}return S.__lexicalTextContent=ie,S.__lexicalFirstTextKey=Ot,void(ie=m+ie)}}if(_===1&&x===1){let E=h.__first,D=g.__first;if(E===D)Ao(E,v);else{let T=am(E),A=ur(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: ${E}}.`;throw new Error(I)}throw $}cr(E,null)}let O=Ie.get(D);P(O)&&je===null&&(je=O.getFormat(),$t=O.getStyle(),Ot=O.__key)}else{let E=Hl(h,Xn),D=Hl(g,Ie);if(E.length!==_&&w(227),D.length!==x&&w(228),_===0)x!==0&&im(D,g,0,x-1,y);else if(x===0){if(_!==0){let O=y.after==null&&y.before==null&&In(g).size===0&&y.element.__lexicalLineBreak==null;om(E,0,_-1,O?null:v),O&&(v.textContent="")}}else(function(O,T,A,$,I,R){let K=$-1,J=I-1,Q,oe,Z=R.getFirstChild(),ae=0,ee=0;for(;ae<=K&&ee<=J;){let V=T[ae],te=A[ee],Qe=ho();if(V===te)Z=wg(Ao(te,R.element)),ae++,ee++;else{if(oe===void 0&&(oe=PC(A,ee)),Q===void 0)Q=PC(T,ae);else if(!Q.has(V)){ae++,$n(Qe);continue}if(!oe.has(V)){Z=wg(am(V)),cr(V,R.element),ae++,Q.delete(V),$n(Qe);continue}if(Q.has(te)){let ct=wi(he,te);ct!==Z&&R.withBefore(Z??R.before).insertChild(ct),Z=wg(Ao(te,R.element)),ae++,ee++}else ur(te,R.withBefore(Z??R.before)),ee++}let Ue=Ie.get(te);Ue!==null&&P(Ue)?je===null&&(je=Ue.getFormat(),$t=Ue.getStyle(),Ot=Ue.__key):k(Ue)&&ee<=J&&!Ue.isInline()&&(ie+=ys),$n(Qe)}let Re=ae>K,le=ee>J;if(Re&&!le){let V=A[J+1],te=V===void 0?null:he.getElementByKey(V);im(A,O,ee,J,R.withBefore(te??R.before))}else le&&!Re&&om(T,ae,K,R.element)})(g,E,D,_,x,y)}S.__lexicalTextContent=ie,S.__lexicalFirstTextKey=Ot,ie=m+ie})(u,d,Jt(d,f,he)),Be(d)||(p=d,je==null||je===p.__textFormat||Ku||p.setTextFormat(je),(function(h){$t==null||$t===h.__textStyle||Ku||h.setTextStyle($t)})(d))})(n,o,s),o.isInline()||(Ge(o)||dE(0,o,s),uE(o,s)),l!==""){let u=s.__lexicalTextContent||"";s.__lexicalTextContent=l+u,ie=c+l+u,s.__lexicalSlotTextLength=l.length}else(In(o).size>0||In(n).size>0)&&(s.__lexicalSlotTextLength=0)}else{let c=s.__lexicalTextContent;typeof c!="string"&&w(356,n.getType()),ie+=c,Mg(s)}if((ko||o.__dir!==n.__dir||o.__parent!==n.__parent)&&(rm(s,o),Ge(o)&&!ko))for(let c of o.getChildren())k(c)&&rm(wi(he,c.getKey()),c)}else{let i=o.getTextContent();if(me(o)){let a=o.decorate(he,Ml);a!==null&&fE(e,a),r&&(In(o).size>0||In(n).size>0)&&IC(n,o,s)}ie+=i}if(!Ku&&Ge(o)){let i=o.getLatest();if(i.__cachedText!==ie){let a=i.getWritable();a.__cachedText=ie,o=a}}return Cs.$decorateDOM(o,n,s,he),rE(o),s}function fE(e,t){let n=he._pendingDecorators,o=he._decorators;if(n===null){if(o[e]===t)return;n=wN(he)}n[e]=t}function wg(e){let t=e.nextSibling;return t!==null&&t===he._blockCursorElement&&(t=t.nextSibling),t}function PC(e,t){let n=new Set;for(let o=t;o<e.length;o++)n.add(e[o]);return n}function fR(e,t,n,o,r,s){ie="",je=null,$t=null,Ot=null,ko=o===2,he=n,Ml=n._config,Cs=n._config.dom||Bl,wl=n._nodes,Ad=he._listeners.mutation,yl=r,xl=s,Xn=e._nodeMap,tm=e,Ie=t._nodeMap,Ku=t._readOnly,Ss=Wb(n._keyToDOMMap),nm=(function(){let a=new Map,l=c=>{for(let u of c){let d=Ie.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(yl.keys()),l(xl),a})();let i=new Map;return kl=i,Ao("root",null),he=void 0,wl=void 0,yl=void 0,xl=void 0,Xn=void 0,tm=void 0,Ie=void 0,Ml=void 0,Ss=void 0,nm=void 0,kl=void 0,Cs=Bl,i}function am(e){let t=Ss.get(e);return t===void 0&&w(75,e),t}function pR(e){return()=>{}}function Y(e){return{type:e}}var Id=Y("SELECTION_CHANGE_COMMAND"),hR=Y("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),pE=Y("CLICK_COMMAND"),Wm=Y("BEFORE_INPUT_COMMAND"),Km=Y("INPUT_COMMAND"),Um=Y("COMPOSITION_START_COMMAND"),Hm=Y("COMPOSITION_END_COMMAND"),Al=Y("DELETE_CHARACTER_COMMAND"),vl=Y("INSERT_LINE_BREAK_COMMAND"),lm=Y("INSERT_PARAGRAPH_COMMAND"),Ti=Y("CONTROLLED_TEXT_INSERTION_COMMAND"),Vm=Y("PASTE_COMMAND"),Uu=Y("REMOVE_TEXT_COMMAND"),Il=Y("DELETE_WORD_COMMAND"),Oi=Y("DELETE_LINE_COMMAND"),dr=Y("FORMAT_TEXT_COMMAND"),gR=Y("SET_TEXT_FORMAT_COMMAND"),rd=Y("UNDO_COMMAND"),$l=Y("REDO_COMMAND"),jm=Y("KEYDOWN_COMMAND"),hE=Y("KEY_ARROW_RIGHT_COMMAND"),cm=Y("MOVE_TO_END"),gE=Y("KEY_ARROW_LEFT_COMMAND"),um=Y("MOVE_TO_START"),mE=Y("KEY_ARROW_UP_COMMAND"),_E=Y("KEY_ARROW_DOWN_COMMAND"),Ym=Y("KEY_ENTER_COMMAND"),yE=Y("KEY_SPACE_COMMAND"),xE=Y("KEY_BACKSPACE_COMMAND"),vE=Y("KEY_ESCAPE_COMMAND"),SE=Y("KEY_DELETE_COMMAND"),CE=Y("KEY_TAB_COMMAND"),mR=Y("INSERT_TAB_COMMAND"),_R=Y("INDENT_CONTENT_COMMAND"),yR=Y("OUTDENT_CONTENT_COMMAND"),bE=Y("DROP_COMMAND"),xR=Y("FORMAT_ELEMENT_COMMAND"),EE=Y("DRAGSTART_COMMAND"),NE=Y("DRAGOVER_COMMAND"),TE=Y("DRAGEND_COMMAND"),Gm=Y("COPY_COMMAND"),qm=Y("CUT_COMMAND"),OE=Y("SELECT_ALL_COMMAND"),vR=Y("CLEAR_EDITOR_COMMAND"),SR=Y("CLEAR_HISTORY_COMMAND"),CR=Y("CAN_REDO_COMMAND"),bR=Y("CAN_UNDO_COMMAND"),DE=Y("FOCUS_COMMAND"),ME=Y("BLUR_COMMAND"),wE=Y("KEY_MODIFIER_COMMAND");function kE(e,t){return{...t,[Im]:e}}var ar=kE("metaKey",{ctrlKey:!Lo,metaKey:Lo}),dm=kE("altKey",{altKey:Lo,ctrlKey:!Lo}),LC=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function kg(e,t,n){let o=e.get(t);o?o.push(n):e.set(t,[n])}var fm=class{constructor(){M(this,"byKey",new Map);M(this,"byCode",new Map)}add(t){let{key:n,modifiers:o={}}=t;n.length>0||w(399);let r=n.toLowerCase();for(let s of(function(i){let a=[0];for(let[l,c]of LC){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))kg(this.byKey,`${s}:${r}`,t),n.length===1&&(/[0-9]/.test(n)?kg(this.byCode,`${s}:Digit${n}`,t):/[a-z]/.test(r)&&kg(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 LC)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 AE(e){let t=new fm;for(let n of e)t.add(n);return t}function IE(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 Xm(e,t,n,o){return e.addEventListener(t,n,o),e.removeEventListener.bind(e,t,n,o)}var Mo=Object.freeze({}),Ag,Ig=new WeakMap,Hu=new WeakMap,ER=IE(e=>(e.addEventListener("selectionchange",VC),()=>e.removeEventListener("selectionchange",VC)));function $E(e,t,n,o,r,s){let i=e.anchor,a=e.focus,l=i.getNode(),c=_e(),u;if(s!==void 0)u=s;else{let g=Wn(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||!P(l)||(!r&&(!bl||c._inputState.lastBeforeInputInsertTextTimeStamp<o+50)||l.isDirty()&&h<2||kN(n))&&i.offset!==a.offset&&!l.isComposing()||Pn(l)||l.isDirty()&&h>1||(r||!bl)&&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=zl(y);return m===0?!y.canInsertTextBefore()||!_.canInsertTextBefore()&&!y.isComposing()||x||(function(v){let S=v.getPreviousSibling();return(P(S)||k(S)&&S.isInline())&&!S.canInsertTextAfter()})(y):m===y.getTextContentSize()&&(!y.canInsertTextAfter()||!_.canInsertTextAfter()&&!y.isComposing()||x)})(e,l)}function FC(e,t){return mn(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function BC(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,FC(o,r)&&FC(s,i)&&!a.postDeleteSelectionToRestore&&(l===null||l.anchorNode===o&&l.anchorOffset===r&&l.focusNode===s&&l.focusOffset===i))return}gn(t,()=>{if(!n)return void Pt(null);if(!Ql(t,o,s))return;let l=ue();if(a.postDeleteSelectionToRestore&&W(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,W(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)Vu(l,p,h);else if(c.type==="text")P(u)||w(141),RE(l,u);else if(c.type==="element"&&!x){k(u)||w(259);let v=c.getNode();v.isEmpty()?(function(S,b){Vu(S,b.getTextFormat(),b.getTextStyle())})(l,v):Vu(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=Ab,S=!1;for(let b=0;b<h;b++){let E=p[b],D=E.getTextContentSize();if(P(E)&&D!==0&&!(b===0&&E.__key===_&&y===D||b===h-1&&E.__key===x&&m===0)&&(S=!0,v&=E.getFormat(),v===0))break}l.format=S?v:0}}(function(c,u,d=!1){(d||pN(c,u))&&c.dispatchCommand(Id)})(t,l,l!==null&&(l.dirty||!W(l)))})}function Vu(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function RE(e,t){Vu(e,t.getFormat(),t.getStyle())}function NR(e,t){gn(t,()=>{let n=ue(),o=Wn(an(t)),r=Os();if(o){if(W(n)){let s=n.anchor,i=s.getNode();s.type==="element"&&s.offset===0&&n.isCollapsed()&&!Ge(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;(Oe(s)||mn(s))&&Pt(Pl(r,o,t,e))}}if(_o&&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(Oe(u)){let d=u.getBoundingClientRect();if(i<=(d.top+d.bottom)/2){a=c;break}}}o.setBaseAndExtent(s,a,s,a);let l=Pl(r,o,t,e);l!==null?Pt(l):o.removeAllRanges()}}G(t,pE,e)})}function TR(e,t){let n=__(e),o=e.pointerType;Xi(n)&&o!=="touch"&&o!=="pen"&&e.button===0&&gn(t,()=>{Ul(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function PE(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function zC(e){let{lastKeyCode:t}=_e()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t==="Enter"?`
|
|
70
|
+
`:t==="Tab"?" ":null;if(!n)return;let o=ue();if(!W(o)||!o.isCollapsed())return;let r=o.anchor.getNode();if(!P(r))return;let{offset:s}=o.anchor;if(r.getTextContentSize()===s){let i=r.getNextSibling();if(n===`
|
|
71
|
+
`){if(no)return;if(fn(i))i.selectEnd();else if(!i){let a=lr(r,oN),l=a&&a.getNextSibling();k(l)&&l.selectStart()}}else n===" "?Zm(i)&&i.selectEnd():P(i)&&i.getTextContent()[0]===n&&i.select(1,1)}else r.getTextContent()[s]===n&&r.select(s+1,s+1)}function Rl(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function WC(e){Lo&&!no&&Nd&&(Rl(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Rl(e),0))}function LE(e,t){let n=__(e);if(Oe(n)&&Ul(n,t))return!0;let o=t.getRootElement();if(o===null)return!1;let r=zi(o.ownerDocument);return r!==null&&o.contains(r)&&Ul(r,t)}function OR(e){let t=e.inputType,n=PE(e),o=_e(),r=o._inputState,s=ue();if(t==="insertText"&&e.data&&r.isInsertTextAfterHandledSelectionCommand){if(Rl(r),e.preventDefault(),W(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=Os();if(!W(d))return!0;Pt(d.clone())}if(W(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(pt(null),r.lastKeyDownTimeStamp=0,setTimeout(()=>{gn(o,()=>{pt(null)})},30),W(s)){let f=s.anchor.getNode();f.markDirty(),P(f)||w(142),RE(s,f)}}else{if(pt(null),no&&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=El&&d&&!g&&h;if(y&&s.isCollapsed()&&(y=!me(RN(s.anchor,!0))),!y){G(o,Al,!0);let m=ue();El&&W(m)&&m.isCollapsed()&&(r.postDeleteSelectionToRestore=m,setTimeout(()=>r.postDeleteSelectionToRestore=null))}}return!0}}if(!W(s))return t!=="historyUndo"&&t!=="historyRedo"||(e.preventDefault(),G(o,t==="historyUndo"?rd:$l)),!0;let i=e.data;r.unprocessedBeforeInputData!==null&&u_(!1,o,r.unprocessedBeforeInputData),s.dirty&&r.unprocessedBeforeInputData===null||!s.isCollapsed()||Ge(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,vl,!1);else if(i===ys)e.preventDefault(),G(o,lm);else if(i==null&&e.dataTransfer){let d=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(d)}else i!=null&&$E(s,n,i,e.timeStamp,!0)?(e.preventDefault(),G(o,Ti,i),zC(i)):r.unprocessedBeforeInputData=i;return r.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":G(o,Ti,e),zC((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let d=r.hadOrphanedCompositionEvents;r.hadOrphanedCompositionEvents=!1;let f=o._compositionKey;pt(null),d||G(o,Ti,e),ju(f);break}case"insertLineBreak":pt(null),r.isInsertLineBreak=!1,G(o,vl,!1);break;case"insertParagraph":pt(null),r.isInsertLineBreak?(r.isInsertLineBreak=!1,G(o,vl,!1)):G(o,lm);break;case"insertFromPaste":case"insertFromPasteAsQuotation":G(o,Vm,e);break;case"deleteByComposition":(function(d,f){return d!==f||k(d)||k(f)||!zl(d)||!zl(f)})(c,u)&&G(o,Uu,e);break;case"deleteByDrag":Ns(ad),G(o,Uu,e);break;case"deleteByCut":G(o,Uu,e);break;case"deleteContent":G(o,Al,!1);break;case"deleteWordBackward":G(o,Il,!0);break;case"deleteWordForward":G(o,Il,!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,dr,"strikethrough");break;case"formatBold":G(o,dr,"bold");break;case"formatItalic":G(o,dr,"italic");break;case"formatUnderline":G(o,dr,"underline");break;case"historyUndo":G(o,rd);break;case"historyRedo":G(o,$l)}return!0}function DR(e,t){e.stopPropagation();let n=t._inputState;Rl(n),gn(t,()=>{LE(e,t)||t.dispatchCommand(Km,e)},{event:e}),n.unprocessedBeforeInputData=null}function MR(e){let t=_e(),n=t._inputState,o=ue(),r=e.data,s=PE(e),i=!1;if(r!=null&&W(o)){let a=Wn(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()&&P(u)&&Pn(u);if(!c&&!d&&$E(o,s,r,e.timeStamp,!1,l)){if(i=!0,n.compositionPhase==="ending-firefox"){let m=sd(t,r);if(n.compositionPhase="idle",m)return Ns(ld),yb(),!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;bl&&!o.isCollapsed()&&P(f)&&l.anchorNode!==null&&f.getTextContent().slice(0,h)+r+f.getTextContent().slice(h+g)===IN(l.anchorNode)||G(t,Ti,r);let y=r.length;_o&&y>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(o.anchor.offset-=y,o._cachedNodes=null,o._cachedIsBackward=null),El&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,pt(null))}}return i||(u_(!1,t,r!==null?r:void 0),n.compositionPhase==="ending-firefox"&&(sd(t,r||void 0),Ns(ld),n.compositionPhase="idle")),yb(),!0}function wR(e,t){G(t,Um,e)}function kR(e){let t=_e(),n=t._inputState,o=ue();if(W(o)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let r=o.anchor,s=o.anchor.getNode();if(pt(r.key),Ns(KE),e.timeStamp<n.lastKeyDownTimeStamp+30||r.type==="element"||!o.isCollapsed()||!El&&(s.getFormat()!==o.format||P(s)&&s.getStyle()!==o.style)||P(s)&&(Pn(s)||r.offset===0&&!s.canInsertTextBefore()||r.offset===s.getTextContentSize()&&!s.canInsertTextAfter())){G(t,Ti,km);let i=ue();W(i)&&pt(i.anchor.key)}}return!0}function AR(e){let t=_e();return t._inputState.compositionPhase="idle",sd(t,e.data),Ns(ld),!0}function ju(e){if(e===null)return;let t=Ce(e);if(!P(t)||t.getType()==="text"||Pn(t)||!t.isAttached())return;let n=ue(),o=W(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 sd(e,t){let n=e._compositionKey;if(pt(null),n!==null&&t!=null){if(t===""){let r=Ce(n),s=e.getElementByKey(n),i=s!==null&&P(r)?Po(r,s,e):null;if(i!==null&&i.nodeValue!==null&&P(r)){let a=Wn(an(e)),l=a&&sn(a,e._rootElement),c=null,u=null;l!==null&&l.anchorNode===i&&(c=l.anchorOffset,u=l.focusOffset),d_(r,i.nodeValue,c,u,!0)}return ju(n),!1}if(t[t.length-1]===`
|
|
73
|
+
`){let r=ue();if(W(r)||ji(r)){if(W(r)){let s=r.focus;r.anchor.set(s.key,s.offset,s.type)}return G(e,Ym,null),ju(n),!1}}let o=Ce(n);if(o!==null&&P(o)&&Pn(o)){o.markDirty();let r=ue(),s=o.getTextContentSize(),i=W(r)&&r.anchor.key===n?r.anchor.offset:s;return o.select(i,i).insertText(t),!0}}return u_(!0,e,t),ju(n),!1}function IR(e,t){let n=t._inputState;_o?n.compositionPhase="ending-firefox":no||!ql&&!Xl?G(t,Hm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}function $R(e,t){let n=t._inputState;no&&(n.isShiftKeyDown=e.key==="Shift"||n.isShiftKeyDown&&e.shiftKey&&e.key!=="CapsLock"),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Rl(n),t.isComposing()||G(t,jm,e)}var Ru={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},pl={ctrlKey:!0},KC={metaKey:!0},ir={shiftKey:"any"},UC={altKey:"any",shiftKey:"any"};function RR(e){let t=_e(),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&&gn(t,()=>{sd(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",s)return!0}let o=t._keyDownShortcuts;o===null&&(o=AE((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&&(!no||p.isShiftKeyDown),G(f,Ym,d),d.defaultPrevented&&(p.isInsertLineBreak=!1)}}),l=(c,u)=>({key:c,modifiers:ar,onMatch:(d,f)=>{let p=f._editorState._selection;p===null||W(p)||(d.preventDefault(),G(f,u,d))}});return[s("ArrowRight",ir,hE),s("ArrowLeft",ir,gE),s("ArrowUp",UC,mE),s("ArrowDown",UC,_E),a({...Ru,shiftKey:!0},!0),a({...Ru,shiftKey:!1},!1),s(" ",Ru,yE),{key:"Backspace",modifiers:ir,onMatch:(c,u)=>{G(u,xE,c)&&WC(u._inputState)}},s("Escape",Ru,vE),s("Delete",{},SE),i("Backspace",dm,Il,!0),i("Delete",dm,Il,!1),i("b",ar,dr,"bold"),i("u",ar,dr,"underline"),i("i",ar,dr,"italic"),s("Tab",ir,CE),i("z",ar,rd,void 0),i("z",{...ar,shiftKey:!0},$l,void 0),...Lo?[{key:"o",modifiers:pl,onMatch:(c,u)=>{c.preventDefault(),G(u,vl,!0)}},s("ArrowLeft",{metaKey:!0,...ir},um),s("ArrowRight",{metaKey:!0,...ir},cm),i("h",pl,Al,!0),i("d",pl,Al,!1),i("Backspace",KC,Oi,!0),i("Delete",KC,Oi,!1),i("k",pl,Oi,!1)]:[s("Home",ir,um),s("End",ir,cm),i("y",pl,$l,void 0)],{key:"a",modifiers:ar,onMatch:(c,u)=>{c.preventDefault(),G(u,OE,c)&&WC(u._inputState)}},l("c",Gm),l("x",qm)]})()),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(wE,e),!0}function HC(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Di=new Map;function VC(e){let t=zN(e.target);if(t===null)return;let n=Bd(e.target),o=null,r=null,s=n!==null?Hu.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&&hr(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||Oe(p)&&p.shadowRoot!==null||(o=hr(p),o!==null&&(r=p))}}if(o===null){let d=zi(n);o=d!==null?hr(d):null}}if(o===null)return;if(o._inputState.isSelectionChangeFromMouseDown){if(s!==void 0)for(let d of s.editors)d._inputState.isSelectionChangeFromMouseDown=!1;gn(o,()=>{let d=Os(),f=r??sn(t,o._rootElement).anchorNode;(Oe(f)||mn(f))&&Pt(Pl(d,t,o,e))})}let i=c_(o),a=i[i.length-1],l=a._key,c=Di.get(l),u=c||a;u!==o&&BC(t,u,!1),BC(t,o,!0),o!==a?Di.set(l,o):c&&Di.delete(l)}function pm(e){e._lexicalHandled=!0}function jC(e){return e._lexicalHandled===!0}var YC=pR();function hm(e,t,n){ft();let o=e.__key,r=e.getParent();if(r===null)return void(Dt(e)!==null&&w(367,o,String(Dt(e))));let s=(function(a){let l=ue();if(!W(l)||!k(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return Kl(d,a)&&c.set(a.__key,0,"element"),Kl(f,a)&&u.set(a.__key,0,"element"),l})(e),i=!1;if(W(s)&&t){let a=s.anchor,l=s.focus;a.key===o&&(dd(a,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0),l.key===o&&(dd(l,e,r,e.getPreviousSibling(),e.getNextSibling()),i=!0)}else ji(s)&&t&&e.isSelected()&&e.selectPrevious();if(W(s)&&t&&!i&&ms(s,r)){let a=e.getIndexWithinParent();Jn(e),_s(s,r,a,-1)}else Jn(e);n||Be(r)||r.canBeEmpty()||!r.isEmpty()||hm(r,t),t&&s&&Ge(r)&&r.isEmpty()&&r.selectEnd()}function PR(e){return e}var FE=Symbol.for("ephemeral");function id(e){return e[FE]||!1}var GC={configurable:!0,enumerable:!1,value:void 0,writable:!0},it=class{constructor(t){M(this,"__type");M(this,"__key");M(this,"__parent");M(this,"__prev");M(this,"__next");M(this,"__state");this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",GC),Object.defineProperty(this,od,GC),DN(this,t)}static getType(){let{ownNodeType:t}=ec(this);return t===void 0&&w(64,this.name),t}static clone(t){w(65,this.name)}$config(){return{}}config(t,n){let o=n.extends||sT(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(){w(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;let n=Ce(t);if(n===null)break;t=n.__parent!==null?n.__parent:Dt(n)}return!1}isSelected(t){let n=t||ue();if(n==null)return!1;let o=n.getNodes().some(r=>r.__key===this.__key);if(P(this))return o;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let r=this.getParent();if(me(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:Ce(t)}getParentOrThrow(){let t=this.getParent();return t===null&&w(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){let n=t.getParent();if(Be(n)||Dt(t)!==null)return k(t)||t===this&&me(t)||w(194),t;t=n}return null}getTopLevelElementOrThrow(){let t=this.getTopLevelElement();return t===null&&w(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:Ce(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:Ce(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=N_(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?E_(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&w(279),!1)))}isParentOf(t){return Kl(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&&w(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=_e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(id(this))return this;let t=Ce(this.__key);return t===null&&w(113),t}getWritable(){if(id(this))return this;ft();let t=_n(),n=_e(),o=this.__key,r=n._cloneNotNeeded,s=r.get(o),i=t._selection;if(i!==null&&i.setCachedNodes(null),s!==void 0)return yd(s),s;let a=t._nodeMap,l=a.get(o);l===void 0&&w(113);let c=x_(l);return r.set(o,c),a.set(o,c),yd(c),c}getTextContent(){return uT(this)}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){w(70)}updateDOM(t,n,o){w(71)}getDOMSlot(t){return new Qu(t)}exportDOM(t){return{element:zd(t).$createDOM(this,t)}}exportJSON(t=!1){let n=(function(r,s){let i=bd(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:Rn(x.getterTable,S)?x.getterTable[S]:void 0}else v=x.getter.call(h);x.kind==="ownField"&&x.when!==void 0&&(!Nm(x,v)&&x.when.call(h)||(v=void 0)),m&&Nm(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){w(18,this.name)}updateFromJSON(t){return oT(oE(this,t),t)}static transform(){return null}remove(t){hm(this,!0,t)}replace(t,n){ft();let o=ue();o!==null&&(o=o.clone()),Hg(this,t);let r=this.getLatest(),s=this.__key,i=hn(r);i!==null&&w(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&&W(o)&&ms(o,d),p=f?l.getIndexWithinParent():-1;Jn(l),f&&d!==null&&W(o)&&_s(o,d,p,-1);let h=r.getPreviousSibling(),g=r.getNextSibling(),y=r.__prev,m=r.__next,_=r.__parent;hm(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)||w(139),x=l.getChildrenSize(),l.splice(x,0,this.getChildren())),W(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"):QC(v,l)),S.key===s&&(n&&S.type==="element"?S.set(l.__key,x+S.offset,"element"):QC(S,l))}return go()===s&&pt(a),l}insertAfter(t,n=!0){ft(),Hg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.getParent(),i=ue(),a=!1,l=!1,c=-1;if(s!==null&&n&&W(i)&&ms(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}Jn(r),c!==-1&&s!==null&&W(i)&&_s(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&&W(i)){let h=d.__key;if(a||l||ms(i,d)){let g=this.getIndexWithinParent();_s(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){ft(),Hg(this,t);let o=this.getWritable(),r=t.getWritable();this.getParentOrThrow();let s=r.__key,i=ue(),a=r.getParent(),l=a!==null&&n&&W(i)&&ms(i,a),c=l?r.getIndexWithinParent():-1;Jn(r),l&&a!==null&&W(i)&&_s(i,a,c,-1);let u=this.getPreviousSibling(),d=this.getParentOrThrow().getWritable(),f=o.__prev,p=n&&W(i)&&ms(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&&W(i)&&_s(i,d,h),t}isParentRequired(){return!1}createParentElementNode(){return qt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ft();let o=hn(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(!P(r)){let i=r.getIndexWithinParent()+1;return s.select(i,i)}return r.select(t,n)}selectNext(t,n){ft();let o=hn(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(!P(r)){let i=r.getIndexWithinParent();return s.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}};M(it,"importDOM");function Jm(e){return e instanceof it}var LR="historic",FR="history-push",Yu="history-merge",BR="paste",zR="cut",BE="collaboration",WR="skip-collab",zE="skip-scroll-into-view",WE="skip-dom-selection",ad="skip-selection-focus",KE="composition-start",ld="composition-end",KR=/^-?(?: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"||!KR.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function UE(e,t,n,o,r){let s=$i(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}var UR=e=>{let t=Jl(e,"format"),n=Dd(e,"format"),o=Md(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=UE(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 HR(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var VR=e=>{let t=Jl(e,"mode"),n=td(e,"detail",0),o=td(e,"format",0),r=Dd(e,"mode"),s=Md(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:HR}},jR=e=>{let t=Jl(e,"format"),n=Dd(e,"format"),o=Md(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=UE(s.indent,0,0,1/0),r.__textFormat=$i(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}},YR=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),GR=e=>{let t=Jl(e,"mode"),n=td(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 gm(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 HE(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):HE(e,n,o)}}function mm(e,t,n=""){if(t===n)return;let o=gm(n),r=gm(t);for(let s in r)delete o[s],HE(e,s,r[s]);for(let s in o)e.removeProperty(s)}var XR=kd()({detail:Io(Xg(Ii(),Pb),{field:"__detail"}),format:Io(Xg(Ii(),xt),{field:"__format"}),mode:Io(Dl(["normal","token","segmented"]),{field:"__mode",getterTable:Bb,setterTable:Am}),style:Io(Ol(),{field:"__style"}),text:Io(Ol(),{field:"__text",getter:"getTextContent",setter:"setTextContent"})});function $g(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Rg(e,t){return 1&t?"strong":2&t?"em":"span"}function VE(e,t,n,o,r){let s=o.classList,i=Mi(r,"base");i!==void 0&&s.add(...i),i=Mi(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=Mi(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)}Wl(o,"class")}function jE(e,t,n){let o=n.isComposing(),r=e+(o?Nl:""),s=yo(),i=zd(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||_o){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 qC(e,t,n,o,r,s){jE(r,e,t);let i=s.theme.text;i!==void 0&&VE(0,0,o,e,i)}function Pu(e,t){let n=Xt().createElement(t);return n.appendChild(e),n}function cd(e){return e!=null&&e.__isInlineFormattable===!0}var mr=class extends it{constructor(n="",o){super(o);M(this,"__text");M(this,"__format");M(this,"__style");M(this,"__mode");M(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:it,generated:VR,importDOM:{"#text":()=>({conversion:e1,priority:0}),b:()=>({conversion:QR,priority:0}),code:()=>({conversion:wo,priority:0}),em:()=>({conversion:wo,priority:0}),i:()=>({conversion:wo,priority:0}),mark:()=>({conversion:wo,priority:0}),s:()=>({conversion:wo,priority:0}),span:()=>({conversion:JR,priority:0}),strong:()=>({conversion:wo,priority:0}),sub:()=>({conversion:wo,priority:0}),sup:()=>({conversion:wo,priority:0}),u:()=>({conversion:wo,priority:0})},json:XR})}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let n=this.getLatest();return Bb[n.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===go()}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 yr(this.getLatest().__format,n,o)}canHaveFormat(){return!0}isInline(){return!0}createDOM(n,o){let r=this.__format,s=$g(0,r),i=Rg(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)),qC(c,this,0,r,this.__text,n);let u=this.__style;return u!==""&&mm(l.style,u),l}updateDOM(n,o,r){let s=this.__text,i=n.__format,a=this.__format,l=$g(0,i),c=$g(0,a),u=Rg(0,i),d=Rg(0,a);if((l===null?u:l)!==(c===null?d:c))return!0;if(l===c&&u!==d){let y=o.firstChild;y==null&&w(48);let m=Xt().createElement(d);return qC(m,this,0,a,s,r),o.replaceChild(m,y),!1}let f=o;c!==null&&l!==null&&(f=o.firstChild,f==null&&w(49)),jE(s,f,this);let p=r.theme.text;p!==void 0&&i!==a&&VE(0,i,a,f,p);let h=n.__style,g=this.__style;return h!==g&&(mm(o.style,g,h),Wl(o,"style")),!1}exportDOM(n){let{element:o}=super.exportDOM(n);return Oe(o)||w(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=Pu(o,"b")),this.hasFormat("italic")&&(o=Pu(o,"i")),this.hasFormat("strikethrough")&&(o=Pu(o,"s")),this.hasFormat("underline")&&(o=Pu(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"?Pb[n]:n,o}setStyle(n){let o=this.getWritable();return o.__style=n,o}toggleFormat(n){let o=yr(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=Am[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){ft();let r=n,s=o,i=ue(),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(!W(i))return rN(l,r,l,s,"text","text");{let c=go();c!==i.anchor.key&&c!==i.focus.key||pt(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=ue();if(s&&W(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){ft();let o=this.getLatest(),r=o.getTextContent();if(r==="")return[];let s=o.__key,i=go(),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=ue();if(W(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=TC(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=TC(o,T);let A=T.__key;i===s&&pt(A),S.push(T)}let b=_?_.offset:null,E=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&&E!==null&&E<=T&&E>=D){x.set(O.getKey(),E-D,"text");break}D=T}if(f!==null){(function(A){let $=A.getPreviousSibling(),I=A.getNextSibling();$!==null&&yd($),I!==null&&yd(I)})(this);let O=f.getWritable(),T=this.getIndexWithinParent();m?(O.splice(T,0,S),this.remove()):O.splice(T,1,S),W(v)&&_s(v,f,T,u-1)}return S}mergeWithSibling(n){let o=n===this.getPreviousSibling();o||n===this.getNextSibling()||w(50);let r=this.__key,s=n.__key,i=this.__text,a=i.length;go()===s&&pt(r);let l=ue();if(W(l)){let f=l.anchor,p=l.focus;f!==null&&f.key===s&&ib(f,o,r,n,a),p!==null&&p.key===s&&ib(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 JR(e){return{forChild:Qm(e.style),node:null}}function QR(e){let t=e,n=t.style.fontWeight==="normal";return{forChild:Qm(t.style,n?void 0:"bold"),node:null}}var XC=new WeakMap;function ZR(e){if(!Oe(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function e1(e){let t=e;e.parentElement===null&&w(129);let n=t.textContent||"";if((function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=XC.get(s))===void 0&&!ZR(s);)i.push(s),s=s.parentNode;let a=r===void 0?s:r;for(let l=0;l<i.length;l++)XC.set(i[l],a);return a})(t)!==null)return{node:t_(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=JC(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=JC(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 JC(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,Oe(n)){let s=n.style.display;if(s===""&&!qN(n)||s!==""&&!s.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(mn(n))return n;if(n.nodeName==="BR")return null}}var t1={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function wo(e){let t=t1[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Qm(e.style,t),node:null}}function rn(e=""){return Gi(new mr(e))}function P(e){return e instanceof mr}function Qm(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=>((P(u)||cd(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 n1=kd()({detail:Ni(Ii(2),{getter:{field:"__detail"},setter:null}),mode:Ni(Dl(["normal"]),{getter:{field:"__mode",getterTable:{0:"normal"}},setter:null}),text:Ni(Ol(" "),{getter:{field:"__text",method:"getTextContent"},setter:null})}),Ri=class extends mr{$config(){return this.config("tab",{extends:mr,generated:GR,json:n1})}constructor(t=void 0){super(" ",t),this.__detail=2}createDOM(t){let n=super.createDOM(t),o=Mi(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||w(286),this}setDetail(t){return t!==2&&w(127),this}setMode(t){return t!=="normal"&&w(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function YE(){return Gi(new Ri)}function Zm(e){return e instanceof Ri}var _m=class{constructor(t,n,o){M(this,"key");M(this,"offset");M(this,"type");M(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:Yl(pn($o(this,"next")),pn($o(t,"next")))<0}getNode(){let t=Ce(this.key);return t===null&&w(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,_r()||(go()===i&&pt(t),s!==null&&(s.setCachedNodes(null),W(s)&&(s._cachedIsBackward=null),s.dirty=!0)))}};function eo(e,t,n){return new _m(e,t,n)}function Pg(e,t){let n=t.__key,o=e.offset,r="element";if(P(t)){r="text";let s=t.getTextContentSize();o>s&&(o=s)}else if(!k(t)){let s=t.getNextSibling();if(P(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 QC(e,t){if(k(t)){let n=t.getLastDescendant();k(n)||P(n)?Pg(e,n):Pg(e,t)}else Pg(e,t)}function ZC(e,t,n,o){let r=e.getNode(),s=r.getChildAtIndex(e.offset),i=rn();if(i.setFormat(n),i.setStyle(o),bN(s))s.splice(0,0,[i]);else if(s!==null){let a=Be(r)?qt().append(i):i;s.insertBefore(a)}else if(Be(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 eb(e,t,n,o){let r=e.anchor.getNode();P(r)||w(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 ud=class e{constructor(t){M(this,"_nodes");M(this,"_cachedNodes");M(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=>Dt(i)===null),o=n.length;if(o===0)return;let r=n[o-1],s;if(P(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=Ce(r);s!==null&&o.push(s)}return _r()||(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=>Dt(n)===null);if((ue()||Os())===this&&t[0]){let n=qe(t[0],"next");_N(Cr(n,n))}for(let n of t)n.remove();GE()}};function GE(){let e=Lt();if(e.getChildrenSize()===0&&lT(ue())===null){let t=qt();e.append(t),t.select()}}function W(e){return e instanceof bs}var bs=class e{constructor(t,n,o,r){M(this,"format");M(this,"style");M(this,"anchor");M(this,"focus");M(this,"_cachedNodes");M(this,"_cachedIsBackward");M(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!!W(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(Ln(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),vr(o.focus)&&k(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let c=Fn(o.focus.origin,"previous");Ln(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=pn(o.anchor),u=pn(o.anchor.getFlipped()),d=p=>Qn(p)?p.origin:p.getNodeAtCaret(),f=d(c)||d(u)||(o.anchor.getNodeAtCaret()?c.origin:u.origin);r.push(f)}return r})(Rd(_d(this),"next"));return _r()||(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]=ym(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 mo(f)){let g=Ts(f,h);g!==null&&(p+=g.getTextContent())}p!==""?(c+=p,u=!1):u=!f.isEmpty()}else if(u=!1,P(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!me(f)&&!fn(f)||f===o&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(t){let n=_e(),o=n.getEditorState()._selection,r=nN(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),zm(this)}clone(){let t=this.anchor,n=this.focus;return new e(eo(t.key,t.offset,t.type),eo(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=yr(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(t_(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(P(d)&&(n=d.getFormat(),o=d.getStyle()),this.removeText(),this.format=n,this.style=o,t==="")return;if(go()===null)return this.anchor.type==="element"&&ZC(this.anchor,this.focus,n,o),void eb(this,t,n,o)}this.anchor.type==="element"&&ZC(this.anchor,this.focus,n,o);let r=this.anchor.getNode();P(r)||w(398);let s=this.anchor.offset,i=r.getParentOrThrow(),a=r.getTextContentSize();if(Pn(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(go()!==null)r.setMode("normal").setFormat(n).setStyle(o);else{let f=rn(r.getTextContent());f.setFormat(n),f.setStyle(o);let p=ue()===this;r.replace(f),this.setTextNodeRange(f,s,f,s),p&&ue()!==this&&Pt(this)}return void(t!==""&&this.insertText(t))}if(t==="")return;if(s===0){let f=r.getPreviousSibling();if(P(f)&&f.canInsertTextAfter()&&!Pn(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(P(f)&&f.canInsertTextBefore()&&!Pn(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 eb(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=ue()===this,n=this.anchor.key;Cl(this,yN(_d(this))),this.isCollapsed()&&(function(o,r){let s=o.anchor;if(s.key===r)return;let i=s.getNode(),a=0,l="";P(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&&ue()!==this&&Pt(this)}formatText(t,n=null){XE(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()&&Dt(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=ue();return W(v)||w(369),v.insertNodes(t)}}if(this.anchor.type==="element"&&Be(n)){let x=Fg(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=lr(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]=hl(this);s.splice(x,0,t),i.selectEnd()}return}if(!t.some(x=>(k(x)||me(x))&&!x.isInline())){k(s)||w(211,r.constructor.name,r.getType());let[x,v]=hl(this,!0);return(k(x)?x:s).splice(v,0,t),void i.selectEnd()}if(k(s)&&Dt(s)!==null){let[,x]=hl(this),v=vm(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=Fg(t),v=x.getLastDescendant(),S=$o(this.anchor,"next");for(let b of x.getChildren())S=CN(b,S);return void(v!==null&&v.selectEnd())}if(k(s)&&!s.isParentRequired()&&!Be(s.getParentOrThrow())){let[,x]=hl(this),v=vm(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=Fg(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 E=b;E!==null&&!Rt(E)&&!Be(E);E=E.getParent()){let D=E.getPreviousSibling();if(D!==null)return D}return null})(x);return fn(v)&&fn(v.getPreviousSibling())})(o),d=k(s)&&s.isEmpty()?null:this.insertParagraph();d&&!s.isAttached()&&(r=this.anchor.getNode(),s=lr(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)||w(211,r.constructor.name,r.getType()),s.append(...p.getChildren()),p=c[1]),p&&(s===null&&w(212,r.constructor.name,r.getType()),(function(x,v){let S=v.getParentOrThrow().getLastChild(),b=v,E=[v];for(;b!==S;)b.getNextSibling()||w(140),b=b.getNextSibling(),E.push(b);let D=x;for(let O of E)D=D.insertAfter(O)})(s,p));let g=lr(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;fn(m)&&g!==s&&m.remove();let _=pn($o(y.anchor,"next"));Es(y.anchor,_),Es(y.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type==="element"&&Be(t)){let a=qt();return t.splice(this.anchor.offset,0,[a]),a.select(),a}let[,n]=hl(this),o=lr(this.anchor.getNode(),Rt);if(o!==null&&Dt(o)!==null)return null;k(o)||w(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=$d();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]=ym(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(P(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(P(o)&&(u===o.getTextContentSize()?t.shift():u!==0&&([,o]=o.splitText(u),t[0]=o,l.set(o.getKey(),0,"text"))),P(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(pd(this,t,n,o))return;let r=t==="move",s=_e(),i=Wn(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()||Sd(a,s,l);let u=wi(s,this.focus.key),d=u;if(this.focus.type==="text"&&(d=P(c)?Po(c,u,s):null),this.dirty){let f=wi(s,this.anchor.key),p=f;if(this.anchor.type==="text"){let h=this.anchor.getNode();p=P(h)?Po(h,f,s):null}p&&d&&fd(i,p,this.anchor.offset,d,this.focus.offset)}if(o==="character"&&P(c)&&c.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let f=qe(c,n?"previous":"next").getNodeAtCaret();if(P(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;fd(i,h,g,h,g)}}}}if(QE(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=Ge(h)?h:h_(h);this.applyDOMRange(p),this.dirty=!0,r||(ZE(this,n,g),(f?i.direction!=="backward":i.anchorNode===p.startContainer&&i.anchorOffset===p.startOffset)||JE(this))}o==="lineboundary"&&pd(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=C_(s);if(i.getTextSlices().every(l=>l===null||l.distance===0)){if(o.type==="element"){let c=s.getNodeAtCaret();if(k(c)&&vd(c)){let u=c.getParent();c.remove();let d=xd(u,c);return void(d!==null&&d.selectStart())}}let l={type:"initial"};for(let c of i.iterNodeCarets("shadowRoot"))if(Ln(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=pn(c);Cl(this,Cr(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(vr(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(me(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=e_();u.add(c.origin.getKey()),Pt(u)}else{let u=c.origin,d=u.getParent();u.remove();let f=xd(d,u);f!==null&&f.selectStart()}return}if(fn(c.origin))return void c.origin.remove();break}}if(l.type==="merge-block"){let{caret:c,block:u}=l;return mo(u).length>0?void 0:c.origin.isEmpty()&&!u.isEmpty()&&c.origin.getParent()===u.getParent()?void c.origin.remove(!0):(Cl(this,Cr(!c.origin.isEmpty()&&u.isEmpty()?Ds(qe(u,c.direction)):i.anchor,c)),this.removeText())}for(let c=o.getNode();c!==null;){if(Dt(c)!==null)return;if(k(c)&&c.isShadowRoot())break;c=c.getParent()}}let a=this.focus;if(Lg(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(Be(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 nb(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 nb(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&&!kN(h=p.getTextContent().slice(_,x))&&!s1(h)&&(u?f.set(f.key,v,f.type):d.set(d.key,v,d.type))}var h})(this,t)}}n||Gu(this),this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&GE()}deleteLine(t){let n=this.isCollapsed(),o=xm(this.anchor);if(o!==null&&me(hn(o)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(t);this.isCollapsed()&&Lg(this,t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):lr(this.anchor.getNode(),Rt)!==lr(this.focus.getNode(),Rt)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(t)):(n||Gu(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;Lg(this,t,"word")}this.isCollapsed()?this.deleteCharacter(t):(n||Gu(this),this.removeText())}isBackward(){let t=this._cachedIsBackward;if(t!==null)return t;let n=this.focus.isBefore(this.anchor);return _r()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}};function ji(e){return e instanceof ud}function qE(e,t){if(ji(e)){for(let m of e.getNodes())cd(m)&&m.setFormat(t(m.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void pt(null);let n=[];for(let m of e.getNodes())P(m)?n.push(m):k(m)?m.setTextFormat(t(m.getTextFormat())):cd(m)&&m.setFormat(t(m.getFormat()));let o=n.length;if(o===0)return e.setFormat(t(e.format)),void pt(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(Pn(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||Pn(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()||Pn(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 o1(e,t){let n=[];for(let[o,r]of Object.entries(t))typeof r=="boolean"&&n.push([o,r]);n.length!==0&&qE(e,o=>{for(let[r,s]of n)o=yr(o,r,s?xt[r]:0);return o})}function XE(e,t,n=null){let o=n===null&&W(e)?yr(e.format,t,null):n;qE(e,r=>yr(r,t,o))}function tb(e){let t=e.offset;if(e.type==="text")return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ym(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]:[tb(n),tb(o)]}function Gu(e){let t=Lt();!t.isEmpty()&&o_(t,e)&&(e.anchor.set(t.getKey(),0,"element"),e.focus.set(t.getKey(),t.getChildrenSize(),"element"))}function JE(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 QE(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 ZE(e,t,n){let o=e.getNodes(),r=o.filter(a=>Kl(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 Lg(e,t,n){if(pd(e,"extend",t,n))return;let o=_e(),r=Wn(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()||Sd(s,o,i);let c=O=>{let T=O.getNode(),A=o.getElementByKey(O.key);return A!==null&&O.type==="text"&&P(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(fd(r,g,y,g,y),QE(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"&&mn(_)&&hr(_)===o){let O=xs(_);if(me(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"&&P(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let O=qe(u,t?"previous":"next").getNodeAtCaret();if(P(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,E]=t?[_,x,d,f]:[d,f,_,x],D=Ge(u)?u:h_(u);e.applyDOMRange({collapsed:!1,endContainer:b,endOffset:E,startContainer:v,startOffset:S}),e.dirty=!0,!ZE(e,t,D)&&t&&JE(e),n==="lineboundary"&&pd(e,"extend",t,n,"decorators")}function r1(){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 s1=r1();function nb(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 ob(e,t,n,o){let r,s=t,i=!1;if(Oe(e)){let a=!1,l=e.childNodes,c=l.length,u=o._blockCursorElement;s===c&&c>0&&(a=!0,s=c-1),Ms(e,o)!==void 0||Ul(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=xs(d),P(r))s=Zn(r,a?"next":"previous");else{let p=xs(e);if(p===null)return null;if(k(p)){let h=o.getElementByKey(p.getKey());h===null&&w(214),[p,s]=Jt(p,h,o).resolveChildIndex(p,h,e,t),k(p)||w(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}P(y)?(r=y,p=null,s=Zn(y,a?"next":"previous")):y!==p&&a&&!f&&(k(p)||w(216),s=Math.min(p.getChildrenSize(),s+1))}else{let h=hn(p),g=h!==null?h:p,y=g.getIndexWithinParent(),m=o.getElementByKey(p.getKey()),_="after";if(m!==null&&xs(e)===p){let x=Jt(p,m,o);x.element!==m?_=x.resolveLeafPosition(m,e,t):t===0&&me(p)&&(_="before")}s=_==="before"?y:y+1,p=g.getParentOrThrow()}if(k(p))return[eo(p.__key,s,"element"),i]}}else r=xs(e);return P(r)?[eo(r.__key,Zn(r,s,"clamp"),"text"),i]:null}function rb(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();P(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else k(s)&&!n&&s.isInline()?e.set(s.__key,s.getChildrenSize(),"element"):P(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();P(a)&&e.set(a.__key,0,"text")}}}function xm(e){let t=Ce(e.key);return t===null?null:Vl(t)}function eN(e,t,n){let o=xm(e),r=xm(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=hn(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 tN(e){let t=eN(e.anchor,e.focus,(n,o)=>(function(r,s,i,a){if(i!==null&&a!==null){let u=hn(i),d=hn(a);if(u!==null&&u.is(d)){for(let f of Wd(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=hn(i),d=Ce(s.key);return u===null||d===null||!(!u.is(d)&&!u.isParentOf(d))||u.isBefore(d)}let l=hn(a),c=Ce(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 nN(e,t,n,o,r,s){if(e===null||n===null||!Ql(r,e,n))return null;let i=ob(e,t,W(s)?s.anchor:null,r);if(i===null)return null;let a=ob(n,o,W(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=xs(e),h=xs(n);if(me(p)&&me(h))return null}let f=r._slotsUsed&&eN(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);rb(p,g,y),rb(h,!g,y),y&&h.set(p.key,p.offset,p.type)}})(l,u),[l,u,c||d||f]}function oN(e){return k(e)&&!e.isInline()}function rN(e,t,n,o,r,s){let i=_n(),a=new bs(eo(e,t,r),eo(n,o,s),0,"");return a.dirty=!0,i._selection=a,a}function sN(){let e=eo("root",0,"element"),t=eo("root",0,"element");return new bs(e,t,0,"")}function e_(){return new ud(new Set)}function i1(e,t){return Pl(null,e,t,null)}function Pl(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=!Yg&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(W(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)&&W(e)&&!Ql(n,c,u))return e.clone()}let p=nN(c,d,u,f,n,e);if(p===null)return null;let[h,g,y]=p,m=0,_="";if(W(e)){let v=e.anchor;if(h.key===v.key)m=e.format,_=e.style;else{let S=h.getNode();P(S)?(m=S.getFormat(),_=S.getStyle()):k(S)&&(m=S.getTextFormat(),_=S.getTextStyle())}}let x=new bs(h,g,m,_);return y&&(x.dirty=!0),x}function ue(){return _n()._selection}function Os(){return _e()._editorState._selection}function ms(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function _s(e,t,n,o=1){if(!ms(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"),sb(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")}}sb(e)}function sb(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(P(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(P(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(P(c)){let u=0;l&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function dd(e,t,n,o,r){let s=null,i=0,a=null;o!==null?(s=o.__key,P(o)?(i=o.getTextContentSize(),a="text"):k(o)&&(i=o.getChildrenSize(),a="element")):r!==null&&(s=r.__key,P(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 ib(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 fd(e,t,n,o,r){try{e.setBaseAndExtent(t,n,o,r)}catch{}}function ab(e,t,n){let o=wi(e,t.getKey());if(k(t)){let r=Jt(t,o,e);return[r.element,n+r.getFirstChildOffset()]}return[o,n]}function iN(e,t,n,o,r,s){let i=s.getRootNode(),a=Yi(i)||Bo(i)?zi(i):null;if(r.has(BE)&&a!==s||a!==null&&Ld(a,a))return;let l=sn(o,s),c;if(!W(t))return void(e!==null&&Ql(n,l.anchorNode,l.focusNode)&&o.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[h,g]=ab(n,f,u.offset),[y,m]=ab(n,p,d.offset),_=t.format,x=t.style,v=t.isCollapsed(),S=h,b=y,E=!1;if(u.type==="text"?(S=P(f)?Po(f,h,n):null,E=f.getFormat()!==_||f.getStyle()!==x):W(e)&&e.anchor.type==="text"&&(E=!0),d.type==="text"&&(b=P(p)?Po(p,y,n):null),S!==null&&b!==null){if(v&&(e===null||E||W(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?hr(a):null;D!==null&&D!==n||r.has(ad)||s.focus({preventScroll:!0})}if(u.type!=="element")return}if(fd(o,S,g,b,m),_o&&t.isCollapsed()&&s!==null&&!r.has(ad)){let D=Cd(s);if(D===null||!s.contains(D)){let O=zi(s.ownerDocument),T=O!==null?hr(O):null;T!==null&&T!==n||s.focus({preventScroll:!0})}}if(!r.has(zE)&&t.isCollapsed()&&s!==null&&s===Cd(s)){let D=W(t)&&t.anchor.type==="element"?(function(O,T,A){let $=T.childNodes[A];if(!Oe($))return $||null;let I=Ms($,O),R=I!==void 0?Ce(I):null;return R===null||k(R)?$:Jt(R,$,O).element})(n,S,g):(c===void 0&&(c=HN(o,s)),c);if(D!==null){let O;if(mn(D)){let T=D.ownerDocument.createRange();T.selectNode(D),O=T.getBoundingClientRect()}else O=Oe(D)?D.getBoundingClientRect():(function(T){let A=T.getBoundingClientRect(),{startContainer:$,startOffset:I}=T;if(!T.collapsed||A.width!==0||A.height!==0||!mn($)||$.length===0)return A;let R=T.cloneRange();return I>0?R.setStart($,I-1):R.setEnd($,1),R.getBoundingClientRect()})(D);(function(T,A,$,I=null){let R=Bd($),K=p_(R);if(R===null||K===null)return;let J=$.getBoundingClientRect();if(A.bottom<J.top)return;if(I!==null&&A.height>0){let{left:Re,right:le}=A,V=Oe(I)?I:Ro(I);for(;V!==null&&$.contains(V);){let te=G1(K,V,Re,le);Re-=te,le-=te,V=V===$?null:Ro(V)}}let{top:Q,bottom:oe}=A,Z=0,ae=0,ee=$;for(;ee!==null;){let Re=ee===R.body;if(Re){let V=K.visualViewport;if(V){let ct=V.offsetTop;Z=ct,ae=ct+V.height}else Z=0,ae=an(T).innerHeight;let te=K.getComputedStyle(R.documentElement),Qe=parseFloat(te.scrollPaddingTop),Ue=parseFloat(te.scrollPaddingBottom);isFinite(Qe)&&(Z+=Qe),isFinite(Ue)&&(ae-=Ue)}else{let V=ee===$?J:ee.getBoundingClientRect();Z=V.top,ae=V.bottom}let le=0;if(Q<Z?le=-(Z-Q):oe>ae&&(le=oe-ae),le!==0)if(Re)K.scrollBy(0,le);else{let V=ee.scrollTop;ee.scrollTop+=le;let te=ee.scrollTop-V;Q-=te,oe-=te}if(Re)break;ee=Ro(ee)}})(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 a1(e){let t=ue()||Os();t===null&&(t=Lt().selectEnd()),t.insertNodes(e)}function aN(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
75
|
+
`||n===`\r
|
|
76
|
+
`?t.linebreak():n===" "?t.tab():n!==""&&t.text(n)}function t_(e){let t=[];return aN(e,{linebreak:()=>t.push($d()),tab:()=>t.push(YE()),text:n=>t.push(rn(n))}),t}function l1(){let e=ue();return e===null?"":e.getTextContent()}function vm(e){let t=[];for(let n of e)fn(n)||(!k(n)&&!me(n)||n.isInline()?t.push(n):k(n)&&t.push(...vm(n.getChildren())));return t}function hl(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let o=ue();W(o)&&(n=o),W(n)||w(161);let r=n.anchor,s=r.getNode(),i=r.offset;for(;!Rt(s)&&Dt(s)===null;){let a=s;if([s,i]=c1(s,i,t),a.is(s))break}return[s,i]}function c1(e,t,n=!1){let o=e.getParent();if(!o){let s=qt();return Lt().append(s),s.select(),[Lt(),0]}if(P(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 bs(eo(e.__key,t,"element"),eo(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 lb(e){return fn(e)||FN(e)||P(e)||e.isParentRequired()}function Fg(e){let t=qt(),n=null;for(let o=0;o<e.length;o++){let r=e[o];if(lb(r)){if(n===null){n=r.createParentElementNode(),t.append(n);let s=e[o+1];if(fn(r)&&(s===void 0||!lb(s)))continue}n.append(r)}else t.append(r),n=null}return t}function pd(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(!xN(l)){for(let d of l){c=!1;let{origin:f}=d;if(me(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 C_(s).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Ln(d))d.origin.isInline()||(l=d);else{if(k(d.origin))continue;me(d.origin)&&!d.origin.isInline()&&(l=d)}break}}if(l===s)return!1;if(a&&!i&&me(l.origin)&&l.origin.isKeyboardSelectable()){let d=e_();return d.add(l.origin.getKey()),Pt(d),!0}return l=pn(l),a&&Es(e.anchor,l),Es(e.focus,l),c||!i}var vt=null,Ye=null,Gt=!1,Bg=!1,qu=!1,zg=new Set,Wg=new Set,Xu=0,cb={characterData:!0,childList:!0,subtree:!0};function _r(){return Gt||vt!==null&&vt._readOnly}function ft(){Gt&&w(13)}function lN(){Xu>99&&w(14)}function _n(){return vt===null&&w(195,uN()),vt}function u1(e){_n()!==null&&Ye===null&&(Ye=e),Ye!==e&&Mm(378)}function _e(){return Ye===null&&w(337,uN()),Ye}function cN(){_e()._dirtyType=2}function uN(){let e=0,t=new Set,n=pr.version;if(typeof window<"u")for(let r of KN(document)){let s=Zl(r);if(Fd(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 dN(){return Ye}function ub(e,t,n){let o=t.__type,r=i_(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 db(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function fN(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 d1(e){return hd(e,_e()._nodes)}function hd(e,t){let n=e.type,o=t.get(n);o===void 0&&w(17,n);let r=o.klass;e.type!==r.getType()&&w(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=hd(i[l],t);s.append(c)}let a=e.$slots;if(a){gr(s)||w(379,r.name);for(let l in a)dT(s,l,hd(a[l],t))}return s}function fb(e,t,n){let o=vt,r=Gt,s=Ye;vt=t,Gt=!0,Ye=e;try{return n()}finally{vt=o,Gt=r,Ye=s}}function fr(e,t){let n=qu;qu=!0;try{let o=(function(r){if(Wg.has(r))return!1;Wg.add(r);try{for(let s=0;r._pendingEditorState!==null;s++){let i=r._pendingEditorState._selection,a=r._rootElement;if(!pN(r,i))return!1;let l=(i===null||W(i))&&(r._headless||a===null||!a.isConnected);if(l||s===100)return r._lastNotifiedSelection=i===null?null:i.clone(),!l;Pi(r,()=>r.dispatchCommand(Id),void 0,!0)}return!1}finally{Wg.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&&pb(r,r._deferred));let c=r._editorState,u=c._selection,d=i._selection,f=r._dirtyType!==0,p=vt,h=Gt,g=Ye,y=r._updating,m=r._observer,_=null;if(r._pendingEditorState=null,r._editorState=i,!l&&f&&m!==null){Ye=r,vt=i,Gt=!1,r._updating=!0;try{let T=r._dirtyType,A=r._dirtyElements,$=r._dirtyLeaves;m.disconnect(),_=fR(c,i,r,T,A,$)}catch(T){if(T instanceof Error&&r._onError(T),Bg)throw T;return EN(r,null,a,i),Yb(r),r._dirtyType=2,Bg=!0,fr(r,c),void(Bg=!1)}finally{m.observe(a,cb),r._updating=y,vt=p,Gt=h,Ye=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 E=r._deferred;y||(r._deferred=[]),(function(T,A){let $=T._decorators,I=T._pendingDecorators||$,R=A._nodeMap,K;for(K in I)R.has(K)||(I===$&&(I=wN(T)),delete I[K])})(r,i);let D=l?null:Wn(an(r));if(r._editable&&D!==null&&(f||d===null||d.dirty||!d.is(u))&&a!==null&&!b.has(WE)){Ye=r,vt=i;try{if(m!==null&&m.disconnect(),f||d===null||d.dirty){let T=r._blockCursorElement;T!==null&&Sd(T,r,a),iN(u,d,r,D,b,a)}(function(T,A,$){let I=T._blockCursorElement;if(W($)&&$.isCollapsed()&&$.anchor.type==="element"&&A.contains(Cd(A))){let R=$.anchor,K=R.getNode(),J=R.offset,Q=!1,oe=null;if(J===K.getChildrenSize())vd(K.getChildAtIndex(J-1))&&(Q=!0);else{let Z=K.getChildAtIndex(J);Z!==null&&vd(Z)&&(Q=!0,oe=T.getElementByKey(Z.__key))}if(Q){let Z=Jt(K,T.getElementByKey(K.__key),T).element;return I===null&&(T._blockCursorElement=I=(function(ae){let ee=ae.theme,Re=Xt().createElement("div");Re.contentEditable="false",Re.setAttribute("data-lexical-cursor","true");let le=ee.blockCursor;if(le!==void 0){if(typeof le=="string"){let V=tc(le);le=ee.blockCursor=V}le!==void 0&&Re.classList.add(...le)}return Re})(T._config)),A.style.caretColor="transparent",void(oe===null?Z.appendChild(I):Z.insertBefore(I,oe))}}I!==null&&Sd(I,T,A)})(r,a,d)}finally{m!==null&&m.observe(a,cb),Ye=g,vt=p}}_!==null&&(function(T,A,$,I,R){let K=Array.from(T._listeners.mutation),J=K.length;for(let Q=0;Q<J;Q++){let[oe,Z]=K[Q];for(let ae of Z){let ee=A.get(ae);ee!==void 0&&oe(ee,{dirtyLeaves:I,prevEditorState:R,updateTags:$})}}})(r,_,b,x,c);let O=r._pendingDecorators;O!==null&&(r._decorators=O,r._pendingDecorators=null,Sl("decorator",r,!0,O)),(function(T,A,$){let I=_b(A),R=_b($);I!==R&&Sl("textcontent",T,!0,R)})(r,s||c,i),Sl("update",r,!0,{dirtyElements:v,dirtyLeaves:x,editorState:i,mutatedNodes:_,normalizedNodes:S,prevEditorState:s||c,tags:b}),y||pb(r,E),(function(T){let A=T._updates;if(A.length===0)return void(T._cascadeCount=0);if((function(I){zg.has(I)||(zg.add(I),setTimeout(()=>{zg.delete(I),I._cascadeCount=0},0))})(T),T._cascadeCount++>99)return T._updates=[],T._cascadeCount=0,void T._onWarn(jg(437,T._config.namespace));let $=A.shift();if($){let[I,R]=$;Pi(T,I,R)}})(r)})(e,t),o&&e._onWarn(jg(436))}finally{qu=n}}function Sl(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 pN(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Sm(e,t,n,o){let r=c_(e),s;if(!qu)for(let i=0;i<r.length;i++)r[i]._updating||(r[i]._cascadeCount=0);if(t===Id){if(Ye!==e||Gt){let a=!1;return gn(e,()=>{a=Sm(e,t,n,o)}),a}let i=_n()._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(gn(l,()=>{for(let f of u)if(f(n,o))return void(d=!0)}),d)return d}}}return s&&s.update(()=>{Sm(s,t,n,o)}),!1}function pb(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 hb(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&&w(191),a._flushSync=!0),l&&e._deferred.push(l),fN(e,i.tag)),a==null?Pi(e,s,i):s()}}return o}function f1(){let e=_n();ft(),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,fN(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=hN(c||l),u=!0),c._flushSync=a;let d=vt,f=Gt,p=Ye,h=e._updating;vt=c,Gt=!1,e._updating=!0,Ye=e;let g=e._headless||e.getRootElement()===null;r_(null);try{u&&(g?l._selection!==null&&(c._selection=l._selection.clone()):c._selection=(function(x,v){let S=x.getEditorState()._selection,b=Wn(an(x));return W(S)||S==null?Pl(S,b,x,v):S.clone()})(e,n&&n.event||null));let m=e._compositionKey;t(),i=hb(e,i),(function(x,v){let S=v.getEditorState()._selection,b=x._selection;if(W(b)){let E=b.anchor,D=b.focus,O;if(E.type==="text"&&(O=E.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 E of S){let D=b.get(E);P(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&MC(D)}})(c,e):(function(x,v){let S=v._dirtyLeaves,b=v._dirtyElements,E=x._nodeMap,D=go(),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 R of T){let K=E.get(R);P(K)&&K.isAttached()&&K.isSimpleText()&&!K.isUnmergeable()&&MC(K),K!==void 0&&db(K,D)&&ub(v,K,O),S.add(R)}if(T=v._dirtyLeaves,A=T.size,A>0){Xu++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,$.delete("root")&&$.set("root",!0);for(let R of $){let K=R[0],J=R[1];if(b.set(K,J),!J)continue;let Q=E.get(K);Q!==void 0&&db(Q,D)&&ub(v,Q,O)}T=v._dirtyLeaves,A=T.size,$=v._dirtyElements,I=$.size,Xu++}v._dirtyLeaves=S,v._dirtyElements=b})(c,e),hb(e),(function(x,v,S,b){let E=x._nodeMap,D=v._nodeMap,O=[];for(let[I]of b){let R=D.get(I);R!==void 0&&(R.isAttached()||(k(R)&&ed(R,I,E,D,O,b),E.has(I)||b.delete(I),O.push(I)))}for(let I of S){let R=D.get(I);R===void 0||R.isAttached()||(gr(R)&&R.__slots!==null&&ed(R,I,E,D,O,S),E.has(I)||S.delete(I),O.push(I))}let T=_e(),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(W(_)){e._slotsUsed&&tN(_);let x=c._nodeMap,v=_.anchor.key,S=_.focus.key;x.get(v)!==void 0&&x.get(S)!==void 0||w(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 fr(e)}finally{vt=d,Gt=f,Ye=p,e._updating=h,Xu=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,fr(e)):u&&B1(()=>{fr(e)}):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function gn(e,t,n){Ye===e&&n===void 0?_r()?Pi(e,t,n):t():Pi(e,t,n)}function p1(){return{...Fb,0:""}}function h1(){return{...Ai,"":0}}var g1=p1(),m1=h1(),_1=kd()({direction:Io(Dl([null,"ltr","rtl"]),{field:"__dir"}),format:Io(Dl(["","left","start","center","right","end","justify"]),{field:"__format",getter:"getFormatType",getterTable:g1,setter:"setFormat",setterTable:m1}),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(Ol(),{getter:{field:"__textStyle",method:"getSerializedTextStyle",when:"shouldSerializeTextStyles"},setter:{field:"__textStyle"}})});function y1(e){if(Be(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var to=class extends it{constructor(n){super(n);M(this,"__first");M(this,"__last");M(this,"__size");M(this,"__format");M(this,"__style");M(this,"__indent");M(this,"__dir");M(this,"__textFormat");M(this,"__textStyle");M(this,"__slotHost");M(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:y1,extends:it,generated:UR,json:_1})}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&&w(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 Fb[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&&mo(this).length===0}isDirty(){let n=_e()._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 mo(this)){let s=Ts(this,r);if(k(s))for(let i of s.getAllTextNodes())n.push(i)}let o=this.getFirstChild();for(;o!==null;){if(P(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:Ce(n)}getFirstChildOrThrow(){let n=this.getFirstChild();return n===null&&w(45,this.__key),n}getLastChild(){let n=this.getLatest().__last;return n===null?null:Ce(n)}getLastChildOrThrow(){let n=this.getLastChild();return n===null&&w(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=uT(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+=ys)}return n}getTextContentSize(){let n=(function(s){let i=0;for(let a of mo(s)){let l=Ts(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 yr(this.getLatest().__textFormat,n,o)}getTextStyle(){return this.getLatest().__textStyle}select(n,o){ft();let r=ue(),s=n,i=o,a=this.getChildrenSize();if(!this.canBeEmpty()){if(n===0&&o===0){let c=this.getFirstChild();if(P(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(P(c)||k(c))return c.select()}}s===void 0&&(s=a),i===void 0&&(i=a);let l=this.__key;return W(r)?(r.anchor.set(l,s,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):rN(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){id(this)&&w(324,this.__key,this.__type);let s=this.getChildrenSize(),i=this.getWritable();n+o<=s||w(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&&w(100);let y=h.getNextSibling(),m=h.__key;Jn(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--,Jn(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&&w(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=ue();if(W(h)){let g=new Set(c),y=new Set(l),{anchor:m,focus:_}=h;gb(m,g,y)&&dd(m,m.getNode(),this,d,u),gb(_,g,y)&&dd(_,_.getNode(),this,d,u),f!==0||this.canBeEmpty()||Be(this)||this.remove()}}return i}getDOMSlot(n){return new Zu(n)}exportDOM(n){let{element:o}=super.exportDOM(n);if(Oe(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(Be(this))return!1;for(let n=this.getFirstChild();n!==null;n=n.getNextSibling())if(P(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 to}function gb(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 Ll=class extends it{constructor(n){super(n);M(this,"__slotHost");M(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&&w(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 me(e){return e instanceof Ll}var Li=class extends to{constructor(){super("root");M(this,"__cachedText");this.__cachedText=null}$config(){return this.config("root",{extends:to})}getTopLevelElementOrThrow(){w(51)}getTextContent(){let n=this.__cachedText;return n===null||!_r()&&_e()._dirtyType!==0?super.getTextContent():n}remove(){w(52)}replace(n){w(53)}insertBefore(n){w(54)}insertAfter(n){w(55)}updateDOM(n,o){return!1}splice(n,o,r){for(let s of r)k(s)||me(s)||w(282);return super.splice(n,o,r)}static importJSON(n){return Lt().updateFromJSON(n)}collapseAtStart(){return!0}};function Ge(e){return e instanceof Li}function hN(e){return new Fl(Wb(e._nodeMap),null,e._slotsUsed)}function n_(){return new Fl(new Map([["root",new Li]]),null,!1)}function Cm(e){let t=e.constructor,n=Hb(e);if(k(e)){let r=n.children,s=e.getChildren();for(let i=0;i<s.length;i++)r.push(Cm(s[i]))}let o=mo(e);if(o.length>0){let r={};for(let s of o){let i=Ts(e,s);i===null&&w(366,t.name,s),r[s]=Cm(i)}n.$slots=r}return n}function x1(e){return e instanceof Fl}var Fl=class e{constructor(t,n=null,o=!1){M(this,"_nodeMap");M(this,"_selection");M(this,"_flushSync");M(this,"_readOnly");M(this,"_parsed");M(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 fb(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 Kb(typeof t=="boolean"&&t,()=>fb(null,this,()=>({root:Cm(Lt())})))}},gd=class extends to{$config(){return this.config("artificial",{extends:to})}createDOM(t){return Xt().createElement("div")}},Fi=class extends it{$config(){return this.config("linebreak",{extends:it,generated:YR,importDOM:{br:t=>gN(t)||mN(t)?null:{conversion:v1,priority:0}}})}getTextContent(){return`
|
|
77
|
+
`}createDOM(){return Xt().createElement("br")}updateDOM(){return!1}isInline(){return!0}};function v1(e){return{node:$d()}}function $d(){return Gi(new Fi)}function fn(e){return e instanceof Fi}function gN(e){let t=e.parentElement;if(t!==null&&y_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&md(n)){let o=t.lastChild;if(o===e||o.previousSibling===e&&md(o))return!0}}return!1}function mN(e){let t=e.parentElement;if(t!==null&&y_(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&md(n))return!1;let o=t.lastChild;if(o===e||o.previousSibling===e&&md(o))return!0}return!1}function md(e){return mn(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function $o(e,t){let{type:n,key:o,offset:r}=e,s=BN(e.key);return n==="text"?(P(s)||w(266,s.getType(),o),Sr(s,t,r)):(k(s)||w(267,s.getType(),o),vN(s,e.offset,t))}function Es(e,t){let{origin:n,direction:o}=t,r=o==="next";Qn(t)?e.set(n.getKey(),t.offset,"text"):vr(t)?P(n)?e.set(n.getKey(),Zn(n,o),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(Ln(t)&&k(n)||w(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function _N(e){let t=ue(),n=W(t)?t:sN();return Cl(n,e),Pt(n),n}function Cl(e,t){Es(e.anchor,t.anchor),Es(e.focus,t.focus)}function _d(e){let{anchor:t,focus:n}=e,o=$o(t,"next"),r=$o(n,"next"),s=Yl(o,r)<=0?"next":"previous";return Cr(Bn(o,s),Bn(r,s))}function Ds(e){let{direction:t,origin:n}=e,o=qe(n,Wo(t)).getNodeAtCaret();return o?qe(o,t):Fn(n.getParentOrThrow(),t)}function mb(e,t="root"){let n=[e];for(let o=Ln(e)?e.getParentCaret(t):e.getSiblingCaret();o!==null;o=o.getParentCaret(t))n.push(Ds(o));return n}function Kg(e){return!!e&&e.origin.isAttached()}function yN(e,t="removeEmptySlices"){if(e.isCollapsed())return e;let n="root",o="next",r=t,s=Rd(e,o),i=s.anchor.origin;for(;i!==null&&!Be(i);)i=i.getParent();let a=k(i)?i.getFirstChild():null,l=mb(s.anchor,n),c=mb(s.focus.getFlipped(),n),u=new Set,d=[];for(let m of s.iterNodeCarets(n))if(Ln(m))u.add(m.origin.getKey());else if(vr(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(_),Jn(m)}for(let m of f)!m.canBeEmpty()&&!Be(m)&&m.isEmpty()&&m.isAttached()&&m.remove();for(let m of s.getTextSlices()){if(!m)continue;let{origin:_}=m.caret,x=_.getTextContentSize(),v=Ds(qe(_,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(),E=m.caret.origin;if(S==="segmented"){let D=b.origin,O=rn(D.getTextContent()).setStyle(D.getStyle()).setFormat(D.getFormat());v.replaceOrInsert(O),b=Sr(O,o,b.offset)}E.is(l[0].origin)&&(l[0]=b),E.is(c[0].origin)&&(c[0]=b.getFlipped())}}let p,h;for(let m of l)if(Kg(m)){p=pn(m);break}for(let m of c)if(Kg(m)){h=pn(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 E=S.getParents().reverse();E.push(S);let D=Math.min(b.length,E.length),O;for(O=0;O<D&&b[O]===E[O];O++);let T=(I,R)=>{let K;for(let J=O;J<I.length;J++){let Q=I[J];if(Be(Q))return;!K&&R(Q)&&(K=Q)}return K},A=T(b,Rt),$=A&&T(E,I=>x.has(I.getKey())&&Rt(I));return $&&mo($).length>0?null:A&&$?[A,$]:null})(p,h,u);if(g){let[m,_]=g;Fn(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(Ln(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(g_);if(m&&_&&!Ge(_)&&m.isEmpty()&&u.has(m.getKey())&&mo(m).length===0&&(!x||u.has(x.getKey()))){m.remove(!0);let v=_;for(;v&&!Ge(v)&&v.isEmpty();){let S=v.getParent();if(S&&Ge(S)&&S.getChildrenSize()<=1&&v.canBeEmpty())break;let b=v;v=S,b.remove(!0)}}}xd(i,a)!==null||i===null||i.isAttached()||xd(Lt(),null);let y=[p,h,...l,...c].find(Kg);if(y)return hT(Bn(pn(y),e.direction));w(269,JSON.stringify(l.map(m=>m.origin.__key)))}function pn(e){let t=(function(r){let s=r;for(;Ln(s);){let i=Vi(s);if(!Ln(i))break;s=i}return s})(e.getLatest()),{direction:n}=t;if(P(t.origin))return Qn(t)?t:Sr(t.origin,n,n);let o=t.getAdjacentCaret();return vr(o)&&P(o.origin)?Sr(o.origin,n,Wo(n)):t}function xN(e){return Qn(e)&&e.offset!==Zn(e.origin,e.direction)}function Rd(e,t){return e.direction===t?e:Cr(Bn(e.focus,t),Bn(e.anchor,t))}function vN(e,t,n){let o=Fn(e,"next");for(let r=0;r<t;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return Bn(o,n)}function S1(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 C1(e){let{origin:t,offset:n,direction:o}=e;if(n===Zn(t,o))return e.getSiblingCaret();if(n===Zn(t,Wo(o)))return Ds(e.getSiblingCaret());let[r]=t.splitText(n);return P(r)||w(281),Bn(qe(r,"next"),o)}function b1(e,t){return!0}function SN(e,{$copyElementNode:t=m_,$splitTextPointCaretNext:n=C1,rootMode:o="shadowRoot",$shouldSplit:r=b1,removeEmptyDestination:s=!1}={}){if(Qn(e))return n(e);let i=e.getParentCaret(o);if(i){let{origin:a}=i;if(Ln(e)){let c=Ds(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 CN(e,t,n){let o=Bn(t,"next");Qn(o)&&(o.offset===0?o=qe(o.origin,"previous").getFlipped():o.offset===o.origin.getTextContentSize()&&(o=qe(o.origin,"next"))),o.origin.is(e)&&(vr(o)||w(342,e.getKey(),e.getType()),o=Ds(o)),(e.is(o.getNodeAtCaret())||e.is(o.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let r=o;r;r=SN(r,n))o=r;return Qn(o)&&w(283),o.insert(e.isInline()?qt().append(e):e),Bn(qe(e.getLatest(),"next"),t.direction)}function o_(e,t){let n=Rd(W(t)?_d(t):t,"next"),o=Vl(n.anchor.origin),r=Vl(e.getLatest());if(o===null?r!==null:!o.is(r))return!1;let s=pn(Fn(e,"next")),i=Bn(pn(Fn(e,"previous")),"next");return Yl(n.anchor,s)<=0&&Yl(n.focus,i)>=0}var Bi=class extends to{$config(){return this.config("paragraph",{extends:to,generated:jR,importDOM:{p:()=>({conversion:E1,priority:0})}})}createDOM(t){let n=Xt().createElement("p"),o=Mi(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(Oe(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(P),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(!W(n)||this.getFormatType()===""&&this.getIndent()===0&&this.getStyle()==="")return!1;if(o_(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=>P(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 E1(e){let t=qt();if(ZN(t,e),JN(e,t),t.getFormatType()===""){let n=e.getAttribute("align");n&&n&&n in Ai&&t.setFormat(n)}return QN(t,e),{node:t}}function qt(){return Gi(new Bi)}function bN(e){return e instanceof Bi}function N1(e){console.warn(e)}var T1=0,O1=1,D1=2,M1=3,w1=4,k1=-8,A1=-7,I1=-6,$1=-5,R1=-4;function EN(e,t,n,o,r){let s=e._keyToDOMMap;s.clear(),e._editorState=n_(),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 NN(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 Bl={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,o)=>{},$exportDOM:(e,t)=>{let n=Pd(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 P1(e){let t=e||{},n=dN(),o=t.theme||{},r=e===void 0?n:t.parentEditor||null,s=t.disableEvents||!1,i=n_(),a=t.namespace||(r!==null?r._config.namespace:AN()),l=t.editorState,c=[Li,mr,Fi,Ri,Bi,gd,...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===it||m.prototype instanceof it)){let b="<unknown>";try{b=JSON.parse(zb)}catch{}w(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))}ec(m);let v=m.getType(),S=NN(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:_,replaceWithKlass:x,sharedNodeState:nE(c[y]),transforms:S})}}let g=new pr(i,r,h,{disableEvents:s,dom:{...Bl,...e&&e.dom},namespace:a,theme:o},u||console.error,d||N1,(function(y,m){let _=new Map,x=new Set,v=S=>{Object.keys(S).forEach(b=>{let E=_.get(b);E===void 0&&(E=[],_.set(b,E)),E.push(S[b])})};return y.forEach(S=>{let b=S.klass.importDOM;if(b==null||x.has(b))return;x.add(b);let E=b.call(S.klass);E!==null&&v(E)}),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(Wm,OR,0),y.registerCommand(Km,MR,0),y.registerCommand(Um,kR,0),y.registerCommand(Hm,AR,0),y.registerCommand(jm,RR,0)})(g),g}function L1(e,t){let n=e.get(t);e.delete(t),n&&n()}function gl(e,t,n){return e.set(t,n),L1.bind(null,e,t)}var pr=class{constructor(t,n,o,r,s,i,a,l,c){M(this,"_headless");M(this,"_parentEditor");M(this,"_rootElement");M(this,"_editorState");M(this,"_pendingEditorState");M(this,"_compositionKey");M(this,"_deferred");M(this,"_keyToDOMMap");M(this,"_updates");M(this,"_updating");M(this,"_cascadeCount");M(this,"_listeners");M(this,"_commands");M(this,"_nodes");M(this,"_decorators");M(this,"_pendingDecorators");M(this,"_config");M(this,"_dirtyType");M(this,"_cloneNotNeeded");M(this,"_dirtyLeaves");M(this,"_dirtyElements");M(this,"_normalizedNodes");M(this,"_updateTags");M(this,"_observer");M(this,"_key");M(this,"_onError");M(this,"_onWarn");M(this,"_htmlConversions");M(this,"_window");M(this,"_editable");M(this,"_blockCursorElement");M(this,"_slotsUsed");M(this,"_keyDownShortcuts");M(this,"_inputState");M(this,"_lastNotifiedSelection");M(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 Tl,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=AN(),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 gl(this._listeners.update,t)}registerEditableListener(t){return gl(this._listeners.editable,t)}registerDecoratorListener(t){return gl(this._listeners.decorator,t)}registerTextContentListener(t){return gl(this._listeners.textcontent,t)}registerRootListener(t){let n=this._listeners.root;return T_(gl(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&&w(35);let r=this._commands;r.has(t)||r.set(t,[new gs,new gs,new gs,new gs,new gs]);let s=r.get(t);s===void 0&&w(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&&w(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){let o=this._editorState,r=Em(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=Em(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=Ce(d);f&&f.markDirty()}},i._pendingEditorState===null?{tag:Yu}: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=Mi(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,EN(this,n,t,r,{preserveUpdateQueue:!0}),n!==null&&(this._config.disableEvents||(function(s){let i=Ig.get(s);if(i===void 0)return void YC();let a=Hu.get(i);if(a===void 0)return void YC();Ig.delete(s);let l=Zl(s);Fd(l)?((function(u){if(u._parentEditor!==null){let d=c_(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&&w(198);let c=HC(s);for(let u=0;u<c.length;u++)c[u]();s.__lexicalEventHandles=[]})(n),o!=null&&n.classList.remove(...o)),t!==null){let s=p_(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,Yb(this),this._updateTags.add(Yu),fr(this),this._config.disableEvents||(function(a,l){let c=a.ownerDocument;Ig.set(a,c);let u=Hu.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},Hu.set(c,u)),u.editors.add(l),u.hasShadowEditor=void 0,a.__lexicalEditor=l;let d=HC(a);d.push(ER.register(c));let f=(function(){if(Ag!==void 0)return Ag;let p=[["keydown",$R],["pointerdown",TR],["compositionstart",wR],["compositionend",IR],["input",DR],["click",NR],["cut",Mo],["copy",Mo],["dragstart",Mo],["dragover",Mo],["dragend",Mo],["paste",Mo],["focus",Mo],["blur",Mo],["drop",Mo]];return bl&&p.push(["beforeinput",(h,g)=>(function(y,m){let _=y.inputType;_==="deleteCompositionText"||_o&&PN(m)||_!=="insertCompositionText"&&gn(m,()=>{LE(y,m)||G(m,Wm,y)},{event:y})})(h,g)]),no&&p.push(["keyup",(h,g)=>(function(y,m){y.shiftKey&&y.key!=="CapsLock"||(m._inputState.isShiftKeyDown=!1)})(h,g)]),Ag=p,p})();for(let p=0;p<f.length;p++){let[h,g]=f[p],y=typeof g=="function"?m=>{jC(m)||(pm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(jC(m))return;pm(m);let _=l.isEditable();switch(h){case"cut":return _&&G(l,qm,m);case"copy":return G(l,Gm,m);case"paste":return _&&G(l,Vm,m);case"dragstart":return _&&G(l,EE,m);case"dragover":return _&&G(l,NE,m);case"dragend":return _&&G(l,TE,m);case"focus":return _&&G(l,DE,m);case"blur":return l._inputState.isShiftKeyDown=!1,l._inputState.isInsertLineBreak=!1,_&&G(l,ME,m);case"drop":return _&&G(l,bE,m)}};d.push(Xm(a,h,y))}})(t,this),o!=null&&t.classList.add(...o)}else this._window=null,this._updateTags.add(Yu),fr(this);Sl("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=hN(t),r._selection=t._selection?t._selection.clone():null),jb(this);let s=this._pendingEditorState,i=n!==void 0?n.tag:null;s===null||s.isEmpty()||(i!=null&&this._updateTags.add(i),fr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||t._slotsUsed,gn(this,()=>{if(i&&this._updateTags.add(i),o&&(Mm(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=n_(),a=vt,l=Gt,c=Ye,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,Ye=r,r_(null);try{let h=r._nodes;hd(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,Ye=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"&&fr(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"),gn(this,()=>{let r=ue(),s=Lt();r!==null?r.dirty||Pt(r.clone()):s.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Ns("focus"),LN(()=>{o.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let t=this._rootElement;t!==null&&t.blur();let n=Wn(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Sl("editable",this,!0,t),this._slotsUsed&&this.update(()=>cN()))}toJSON(){return{editorState:this._editorState.toJSON(Ub())}}};M(pr,"version",zb);var bm=null;function r_(e){bm=e}var s_=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),TN=1;function F1(){TN=1}function i_(e,t){let n=Pd(e,t);return n===void 0&&w(30,t),n}function Pd(e,t){return e._nodes.get(t)}var B1=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Ld(e,t){let n=t!==void 0?t:(()=>{let s=e.getRootNode();return Yi(s)||Bo(s)?zi(s):null})();if(!Oe(n)||n.hasAttribute("data-lexical-slot"))return!1;let o=l_(n),r=n.nodeName;return Jm(o)&&(r==="INPUT"||r==="TEXTAREA"||n.contentEditable==="true"&&Zl(n)==null)}var z1=Ld;function Ql(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 hr(t)===e&&e.read("latest",()=>!Ld(t))}function Fd(e){return e instanceof pr}function hr(e){let t=e;for(;t!=null;){let n=Zl(t);if(Fd(n))return n;t=Ro(t)}return null}function Zl(e){return e?e.__lexicalEditor:null}function W1(e){return H$.test(e)?"rtl":V$.test(e)?"ltr":null}function zl(e){return Zm(e)||e.isToken()}function Pn(e){return zl(e)||e.isSegmented()}function mn(e){return Xi(e)&&e.nodeType===3}function Yi(e){return Xi(e)&&e.nodeType===9}function ON(e){let t=e;for(;t!=null;){if(mn(t))return t;t=t.firstChild}return null}function yr(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 K1(e){return P(e)||fn(e)||me(e)}function DN(e,t){let n=(function(){let i=bm;return bm=null,i})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ft(),lN();let o=_e(),r=_n(),s=""+TN++;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 Jn(e){Dt(e)!==null&&w(380,e.__key,String(Dt(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 U1=Jn;function yd(e){lN(),id(e)&&w(323,e.__key,e.__type);let t=e.__parent!==null?e.__parent:xr(e)?e.__slotHost:null,n=_n(),o=_e(),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:xr(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 pt(e){ft();let t=_e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let o=Ce(n);o!==null&&o.getWritable()}if(e!==null){let o=Ce(e);o!==null&&o.getWritable()}}}function go(){return _r()?null:_e()._compositionKey}function Ce(e,t){let n=(t||_n())._nodeMap.get(e);return n===void 0?null:n}function a_(e,t){let n=Ms(e,_e());return n!==void 0?Ce(n,t):null}function MN(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Ms(e,t){return e[`__lexicalKey_${t._key}`]}function l_(e,t){let n=e;for(;n!=null;){let o=a_(n,t);if(o!==null)return o;n=Ro(n)}return null}function wN(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function _b(e){return e.read(()=>Lt().getTextContent())}function Lt(){return _n()._nodeMap.get("root")}function xd(e,t){if(!(Be(e)&&e.isAttached()&&(Ge(e)?e.getChildrenSize()===0:e.isEmpty())&&(Ge(e)||t!==null&&Rt(t))))return null;let n=qt();return e.append(n),n}function Pt(e){ft();let t=_n();e!==null&&(e.dirty=!0,e.setCachedNodes(null),W(e)&&_e()._slotsUsed&&tN(e)),t._selection=e}function yb(){ft(),jb(_e())}function xs(e){let t=(function(n,o){let r=n;for(;r!=null;){let s=Ms(r,o);if(s!==void 0)return s;r=Ro(r)}return null})(e,_e());return t===null?null:Ce(t)}function kN(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function c_(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function AN(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function IN(e){return mn(e)?e.nodeValue:null}function u_(e,t,n){let o=Wn(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=IN(s),c=l_(s);if(l!==null&&P(c)){if((l===Nl||l===km)&&n){let u=n.length;l=n,i=u,a=u}l!==null&&d_(c,l,i,a,e)}}}function d_(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(Nl)&&(a=t.slice(0,-Nl.length)),r)){let c=km,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=ue();if(a===""){if(pt(null),ql||no||Xl)s.remove();else{let g=_e();Ug(s,"",c),setTimeout(()=>{g.update(()=>{s.isAttached()&&s.getTextContent()===""&&s.remove()})},20)}return}let u=s.getParent(),d=Os(),f=s.getTextContentSize(),p=go(),h=s.getKey();if(s.isToken()&&!i||p!==null&&h===p&&!i||W(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(!W(c)||n===null||o===null)return void Ug(s,a,c);if(c.setTextNodeRange(s,n,s,o),s.isSegmented()){let g=rn(s.getTextContent());s.replace(g),s=g}Ug(s,a,c)}}}function Ug(e,t,n){if(e.setTextContent(t),W(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=Zn(e,i.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function H1(e,t){let n=e[Im];return n&&t!==Lo?{...e,ctrlKey:e[n],[n]:e.ctrlKey}:e}function Lu(e,t,n){let o=t[n]||!1;return o==="any"||o===e[n]}function $N(e,t){return Lu(e,t,"altKey")&&Lu(e,t,"ctrlKey")&&Lu(e,t,"shiftKey")&&Lu(e,t,"metaKey")}function V1(e,t,n){if(!$N(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 xb(e){let t=e;for(;t!==null;){let n=t.getParent();if(n===null)return null;if(Ge(n))return t;t=n}return null}function Fu(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(zm(e),!Ge(t))return e;let u=xb(n.getNode());return k(u)&&u.isShadowRoot()&&u.is(xb(o.getNode()))&&(n.set(r,s,i),o.set(a,l,c)),e}function j1(e){let t=Lt();if(W(e)){let n=e.anchor,o=e.focus,r=n.getNode();if(Ge(r))return n.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),Fu(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"),Fu(e,s)),e):(n.set(i.getKey(),0,"element"),o.set(i.getKey(),i.getChildrenSize(),"element"),Fu(e,i),e)}{let n=t.select(0,t.getChildrenSize());return Pt(Fu(n,t)),n}}function Wl(e,t){e.getAttribute(t)===""&&e.removeAttribute(t)}function Mi(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=tc(r);return n[t]=s,s}return r}function f_(e,t,n,o,r){if(n.size===0)return;let s=o.__type,i=o.__key,a=t.get(s);a===void 0&&w(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 Y1(e){let t=e.getType(),n=_n();if(n._readOnly){let s=Em(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 vb(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 RN(e,t){let n=e.offset;if(e.type==="element")return vb(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?vb(o.getParentOrThrow(),t,o.getIndexWithinParent()+(t?0:1)):r}}return null}function PN(e){let t=an(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function G(e,t,...n){return Sm(e,t,n[0],e)}function wi(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&w(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 Bd(e){return Yi(e)?e:Oe(e)?e.ownerDocument:null}function Sb(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith("%")?n*t/100:n:0}function G1(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+Sb(i.scrollPaddingLeft,r)*c,p=d+(r-Sb(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 _e()._updateTags.has(e)}function Ns(e){ft(),_e()._updateTags.add(e)}function LN(e){ft(),_e()._deferred.push(e)}function Kl(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function p_(e){let t=Bd(e);return t?t.defaultView:null}function an(e){let t=e._window;return t===null&&w(78),t}function FN(e){return k(e)&&e.isInline()||me(e)&&e.isInline()}function h_(e){let t=e.getLatest();for(;t!==null;){if(Dt(t)!==null&&k(t))return t;let n=t.getParentOrThrow();if(Be(n))return n;t=n}return t}function g_(e){return k(e)&&e.isShadowRoot()}function Be(e){return Ge(e)||g_(e)}function m_(e,t=!1){let n=e.constructor.clone(e,s_);return DN(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Gi(e){let t=_e(),n=e.getType(),o=Pd(t,n);o===void 0&&w(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||w(201,s.name,s.getType(),a.name,a.getType(),e.constructor.name,n):i instanceof e.constructor&&a!==e.constructor||w(202,a.name,a.getType(),e.constructor.name,n),i.__key===e.__key&&w(203,e.constructor.name,n,a.name,a.getType()),i}return e}function Hg(e,t){!Ge(e.getParent())||k(t)||me(t)||w(99)}function BN(e){let t=Ce(e);return t===null&&w(63,e),t}function vd(e){if(!e||e.isInline())return!1;if(me(e))return!0;if(k(e)){if(e.isShadowRoot()){let t=e.getParent();return!(k(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Sd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let o=e.parentElement;o!==null&&o.removeChild(e)}function Wn(e){return br?(e||window).getSelection():null}function zN(e){let t=p_(e);return t?t.getSelection():null}function Bo(e){return GN(e)&&"host"in e}var X1=[];function WN(e){let t=e.getRootNode();if(t===e||!Bo(t))return X1;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*KN(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 UN(e){return e!==null?e.ownerDocument:document}function Xt(){let e=dN();return UN(e!==null?e._rootElement:null)}function qi(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;let n=WN(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 HN(e,t){let n=qi(e,t);if(n!==null){let o=VN(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:jN(n,YN(e))}function J1(e,t){let n=qi(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};let o=VN(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:jN(n,YN(e)),range:o}}function VN(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 jN(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 YN(e){return e.direction}function Cd(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 __(e){let t=e.target;if(t!==null&&Oe(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){let n=e.composedPath();if(n.length>0)return n[0]}return t}function Q1(e,t){let n=e.getChildAtIndex(t);n==null&&(n=e),Be(e)&&w(102);let o=i=>{let a=i.getParentOrThrow(),l=Be(a),c=i!==n||l?m_(i):i;if(l)return k(i)&&k(c)||w(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 Z1(e){return Oe(e)&&e.tagName==="A"}function eP(e){return Oe(e)&&e.tagName==="TR"}function tP(e){return Oe(e)&&(e.tagName==="TD"||e.tagName==="TH")}function Oe(e){return Xi(e)&&e.nodeType===1}function Xi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function GN(e){return Xi(e)&&e.nodeType===11}var nP=/^(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 qN(e){return!(!Oe(e)||!e.style.display.startsWith("inline"))||nP.test(e.nodeName)}var oP=/^(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 y_(e){return(!Oe(e)||!e.style.display.startsWith("inline"))&&oP.test(e.nodeName)}function Rt(e){if(me(e)&&!e.isInline())return!0;if(!k(e)||Be(e))return!1;let t=e.getFirstChild(),n=t===null||fn(t)||P(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function yo(){return _e()}function zd(e=yo()){return e._config.dom||Bl}function Jt(e,t,n=yo()){let o=zd(n).$getDOMSlot(e,t,n);return k(e)&&(XN(o)||w(344,e.getKey(),e.getType())),o}function rP(e,t,n,o){let r=e.read("latest",()=>{let s=Ce(t);return s!==null?(function(i,a,l=yo()){let c=Ts(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 sP(e,t,n){n.style.display="none";let o=e.getElementByKey(t);o!==null&&n.parentElement!==o&&o.insertBefore(n,o.firstChild)}function XN(e){return e instanceof Zu}function Po(e,t,n=yo()){return ON(Jt(e,t,n).element)}var Cb=new WeakMap,iP=new Map;function Em(e){if(!e._readOnly&&e.isEmpty())return iP;e._readOnly||w(192);let t=Cb.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),Cb.set(e,t)),t}function x_(e){let t=e.constructor.clone(e,s_);return t.afterCloneFrom(e),t}function aP(e){return(t=x_(e))[FE]=!0,t;var t}function JN(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 QN(e,t){let n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}function ZN(e,t){let n=t.style.textAlign;return n&&n in Ai?e.setFormat(n):e}function eT(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function v_(e){return e.__lexicalUnmanaged===!0}function tT(e,t=yo()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Ul(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(Oe(n)&&n.hasAttribute("data-lexical-slot")||Ms(n,t)!==void 0)return!1;n=Ro(n)}return!1}function ml(e,t){return Rn(e,t)&&e[t]!==it[t]}var Vg=new WeakMap;function Wi(e){let t=Vg.get(e);return t!==void 0?t:(function(n){let o=n.prototype!=null&&Ng in n.prototype?n.prototype[Ng]():void 0,r=(function(u){if(!(u===it||u.prototype instanceof it)){let d="<unknown>",f="<unknown>";try{d=u.getType()}catch{}try{pr.version&&(f=JSON.parse(pr.version))}catch{}w(290,u.name,d,f)}return u===Ll||u===to||u===it})(n),s=!r&&ml(n,"getType")?n.getType:void 0,i=s&&!(bb 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:Rn(n.prototype,Ng),klass:n,ownNodeConfig:a,ownNodeType:l},ownFieldsValidated:!1};Vg.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=pP(h,_,x);if(v===null)continue;if(Fo(v)){let b=v.field;if(b==="__proto__"&&w(430,h.name,_),v.setterTable!==void 0){let{setterTable:E}=v,{meta:D}=x;for(let O of D.kind==="enum"?D.values:[x.defaultValue])Rn(E,String(O))||w(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"&&w(432,h.name,_,v),y.set(_,{key:_,kind:"field",schema:x,setter:S})}return y.size===0?lP:[...y.values()]})(n),d=(function(h){let g=h.prototype,y=new Map;for(let[m,_]of ki(h).fieldsDerivedFirst){let x=fP(h,m,_);if(x===null)continue;if(Fo(x)){let S=x.field;S==="__proto__"&&w(426,h.name,m);let b=x.when,E;if(b!==void 0){let D=g[b];typeof D!="function"&&w(427,h.name,m,b),E=D}y.set(m,{defaultValue:_.defaultValue,derived:_.setter===null,field:S,getterTable:x.getterTable,isEqual:_.isEqual,key:m,kind:"ownField",schema:_,when:E});continue}let v=g[x];typeof v!="function"&&w(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?dP:[...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],E=v.getters[S];if(b.kind!==E.kind||b.key!==E.key||b.schema!==E.schema||b.derived!==E.derived||b.isEqual!==E.isEqual||!Object.is(b.defaultValue,E.defaultValue)||b.kind==="ownField"&&E.kind==="ownField"&&(b.field!==E.field||b.getterTable===void 0!=(E.getterTable===void 0)))return!1}for(let S=0;S<x.setters.length;S++){let b=x.setters[S],E=v.setters[S];if(b.kind!==E.kind||b.key!==E.key||b.schema!==E.schema||b.kind==="ownField"&&E.kind==="ownField"&&(b.field!==E.field||b.setterTable===void 0!=(E.setterTable===void 0)))return!1}return!0})(y,bd(Wi(_)))?m:null})(n,0,{getters:d,setters:u});c.compiled={flatStates:f.flatStates,generated:p===null?null:p(f.fields),getters:d,isCompactDefault:hP(d),setters:u},(function(h,g,y,m){if(!g&&y){if(!ml(h,"getType")){let _=h,x=function(){return this!==_?it.getType.call(this):y};x[bb]=!0,h.getType=x}if(ml(h,"clone")||(h.clone=(_,x)=>{r_(_);let v=new h;return x!==s_&&v.afterCloneFrom(_),v}),ml(h,"importJSON")||(h.importJSON=m&&m.$importJSON||(function(_){return x=>{let v=rT(_);return v.updateFromJSON===it.prototype.updateFromJSON?(function(S,b){return oT(S.__state||b[Td]!==void 0?oE(S,b):S,b)})(v,x):v.updateFromJSON(x)}})(h)),!ml(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(Rn(m,"afterCloneFrom"))continue;let _=yP(g);if(_.length===0)continue;let x=Object.getPrototypeOf(m),v=y&&y.generated!==void 0?bd(Wi(g)).generated:null,S=v!==null&&v.afterCloneFrom||((b,E)=>{let D=b,O=E;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[_P]=!0}})(n)}catch(u){throw Vg.delete(n),u}return c})(e)}function bd(e){let{compiled:t}=e;return t===void 0&&w(422,e.config.klass.name),t}var bb=Symbol("lexical.synthesizedGetType"),lP=[];function nT(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 Eb(i,a,r)&&Eb(i,a,o)?n:r}function Eb(e,t,n){return e[n]===t[n]}function Nb(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Tb(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var cP={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?cP:{declaredBy:l,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...c.values()]}})(e)),t.composed}function uP(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 dP=[];function fP(e,t,n){let o=n.getter;if(o===null)return null;let r=o===void 0?Tb(t):o;return Fo(r)?nT(e,t,r,Tb(t)):r}function pP(e,t,n){let o=n.setter;if(o===null)return null;let r=o===void 0?Nb(t):o;return Fo(r)?nT(e,t,r,Nb(t)):r}function Nm(e,t){let{defaultValue:n,isEqual:o}=e;return t===void 0||t===n||o!==void 0&&o(t,n)}function hP(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&&Nm(r,o)}}function gP(e){let{setterTable:t,schema:n}=e,{defaultValue:o}=n;return t===void 0?o:t[String(o)]}function oT(e,t){let n=Wi(e.constructor),{flatStates:o,generated:r,setters:s}=bd(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=tE(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:Rn(d.setterTable,f)?d.setterTable[f]:gP(d):d.setter.call(a,f)}return a})(i,t,s)}function ec(e){return Wi(e).config}function mP(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 _P="__lexicalSynthesizedAfterCloneFrom";function Ob(e){let{declaredBy:t,fieldsBaseFirst:n}=ki(e),o=[];for(let[r,s]of n)if(t.get(r)===e)for(let i of mP(s))o.includes(i)||o.push(i);return o}function yP(e){let t=Ob(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 Ob(o))n.add(r);return n.size===0?t:t.filter(o=>!n.has(o))}function*zo(e){for(let t=e;t&&(t===it||Jm(t.prototype));){let n=ec(t),o=n.declaresOwnConfig;yield o?n:{...n,ownNodeConfig:void 0},t=o&&n.ownNodeConfig&&n.ownNodeConfig.extends||sT(t)}}function xP(e){let t=new Map,n=new Map;for(let o of e){let{ownNodeType:r}=ec(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 rT(e){let t=yo();ft();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),o=new n.klass;return n.replace===null?o:Gi(o)}var lr=(e,t)=>{let n=e;for(;n!=null&&!Ge(n);){if(t(n))return n;n=n.getParent()}return null};function Hl(e,t){let n=[],o=e.__first;for(;o!==null;){let r=t===null?Ce(o):t.get(o);r==null&&w(174),n.push(o),o=r.__next}return n}function sT(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 iT=new Map;function gr(e){return k(e)||me(e)}function xr(e){return k(e)||me(e)}function Dt(e){let t=e.getLatest();return xr(t)?t.__slotHost:null}function hn(e){let t=Dt(e);if(t===null)return null;let n=Ce(t);return k(n)||me(n)||w(370),n}function aT(e){let t=hn(e);if(t===null)return null;let n=e.getLatest().__key;for(let[o,r]of Wd(t))if(r===n)return o;return null}function Vl(e){let t=e.getLatest();for(;t!==null;){if(Dt(t)!==null)return t;t=t.getParent()}return null}function lT(e){if(e===null)return null;let t=W(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Vl(t)}function Wd(e){let t=e.getLatest();return gr(t)&&t.__slots!==null?t.__slots:iT}function mo(e){return Array.from(Wd(e).keys())}function Ts(e,t){let n=Wd(e).get(t);return n===void 0?null:Ce(n)}var vP=["__proto__","constructor","prototype"],Db=Symbol("slotMapOwner");function Tm(e){let t=e.__slots;return t!==null&&t[Db]===e||(t=new Map(t),t[Db]=e,e.__slots=t),t}var Mb=new WeakMap,SP=[];function cT(e){for(let{ownNodeConfig:t}of zo(e)){let n=t&&t.slots;if(n)return n}return SP}function uT(e){let t="";for(let n of mo(e)){let o=Ts(e,n);o!==null&&(t+=o.getTextContent())}return t}function wb(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 dT(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||w(373,t);let o=e.getLatest();if(o.__slots!==null&&o.__slots.get(t)===n.getLatest().__key)return o;(!k(n)&&!me(n)||n.isInline())&&w(374,n.__key);let r=e.getWritable(),s=Tm(r),i=s.get(t);i!==void 0&&fT(i);let a=n.getWritable(),l=hn(a);if(l!==null){let c=aT(a);c!==null&&Tm(l.getWritable()).delete(c),a.__slotHost=null}return Jn(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=cT(g),_=new Map;for(let x of m)vP.includes(x)&&w(371,g.name,x),_.has(x)&&w(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&&wb(f,g,d)>0){p=!1;break}f=g}if(p)return;let h=Array.from(u).sort(([g],[y])=>wb(g,y,d));u.clear();for(let[g,y]of h)u.set(g,y)})(r),_e()._slotsUsed=!0,_n()._slotsUsed=!0,r}function CP(e,t){let n=e.getWritable();if(n.__slots===null)return n;let o=n.__slots.get(t);return o!==void 0&&(fT(o),Tm(n).delete(t)),n}function fT(e){let t=Ce(e);if(t===null)return;let n=t.getWritable();xr(n)||w(377,e),n.__slotHost=null,n.remove()}var bP={next:"previous",previous:"next"},Ki=class{constructor(t){M(this,"origin");this.origin=t}[Symbol.iterator](){return b_({hasNext:vr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return qe(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return qe(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&&w(263,Array.from(a).join(" "))}else s.insert(l);s=qe(l,this.direction)}for(let l of a.values())l.remove();return this}},jl=class e extends Ki{constructor(){super(...arguments);M(this,"type","child")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Fn(n,this.direction)}getParentCaret(n="root"){return qe(S_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return qe(this.getNodeAtCaret(),n)||Fn(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)}},EP={root:Ge,shadowRoot:Be};function Wo(e){return bP[e]}function S_(e,t="root"){return e===null||EP[t](e)?null:Dt(e)===null?e:null}var Ui=class e extends Ki{constructor(){super(...arguments);M(this,"type","sibling")}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:qe(n,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return k(this.origin)?Fn(this.origin,this.direction):null}getParentCaret(n="root"){return qe(S_(this.getParentAtCaret(),n),this.direction)}getFlipped(){let n=Wo(this.direction);return qe(this.getNodeAtCaret(),n)||Fn(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);M(this,"type","text");M(this,"offset");this.offset=o}getLatest(){let n=this.origin.getLatest();return n===this.origin?this:Sr(n,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(n="root"){return qe(S_(this.getParentAtCaret(),n),this.direction)}getFlipped(){return Sr(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 qe(this.origin,this.direction)}};function Qn(e){return e instanceof Hi}function NP(e){return e instanceof Ki}function vr(e){return e instanceof Ui}function Ln(e){return e instanceof jl}var TP={next:class extends Hi{constructor(){super(...arguments);M(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Hi{constructor(){super(...arguments);M(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},OP={next:class extends Ui{constructor(){super(...arguments);M(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Ui{constructor(){super(...arguments);M(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},DP={next:class extends jl{constructor(){super(...arguments);M(this,"direction","next")}getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends jl{constructor(){super(...arguments);M(this,"direction","previous")}getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function qe(e,t){return e?new OP[t](e):null}function Sr(e,t,n){return e?new TP[t](e,Zn(e,n)):null}function Zn(e,t,n="error"){let o=e.getTextContentSize(),r=t==="next"?o:t==="previous"?0:t;return(r<0||r>o)&&(n!=="clamp"&&Mm(284,String(t),String(o),e.getKey()),r=r<0?0:o),r}function Om(e,t){return new Ed(e,t)}function Fn(e,t){return k(e)?new DP[t](e):null}function pT(e){return e&&e.getChildCaret()||e}function Vi(e){return e&&pT(e.getAdjacentCaret())}var Dm=class e{constructor(t,n,o){M(this,"type","node-caret-range");M(this,"direction");M(this,"anchor");M(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 Qn(s)?(function(i,a){let{direction:l,origin:c}=i;return Om(i,Zn(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[Om(r,s.offset-r.offset),null]}return[n,o]}iterNodeCarets(t="root"){let n=Qn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=Qn(o),s=i=>i.isSameNodeCaret(o)?null:Vi(i)||i.getParentCaret(t);return b_({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")}},Ed=class{constructor(t,n){M(this,"type","slice");M(this,"caret");M(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 Sr(t.setTextContent(s.slice(0,o)+s.slice(r)),n,o)}};function MP(e){return e instanceof Ed}function Bn(e,t){return e.direction===t?e:e.getFlipped()}function C_(e){return Cr(e,Bn(Fn(Lt(),Wo(e.direction)),e.direction))}function hT(e){return Cr(e,e)}function Cr(e,t){return e.direction!==t.direction&&w(265),new Dm(e,t,e.direction)}function b_(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 Yl(e,t){let n=N_(e.origin,t.origin);switch(n===null&&w(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 E_(n)}}function E_(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 Bu(e,t){return t.is(e)}function kb(e){return k(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function N_(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[o,r]=kb(e);o;r=o,o=o.getParent())n.set(o,r);for(let[o,r]=kb(t);o;r=o,o=o.getParent()){let s=n.get(o);if(s!==void 0)return s===null?(Bu(e,o)||w(276),{commonAncestor:o,type:"ancestor"}):r===null?(Bu(t,o)||w(277),{commonAncestor:o,type:"descendant"}):((k(s)||Bu(e,s))&&(k(r)||Bu(t,r))&&o.is(s.getParent())&&o.is(r.getParent())||w(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function wP(e){return e}function kP(...e){return e}function AP(...e){return e}function IP(e){return e}function $P(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function tc(...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 RP(e,...t){let n=tc(...t);n.length>0&&e.classList.add(...n)}function PP(e,...t){let n=tc(...t);n.length>0&&e.classList.remove(...n)}function T_(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function LP(e,t,n){return T_(...Object.entries(t).map(([o,r])=>Xm(e,o,r,n)))}var C=O_,jU=C.$addUpdateTag,Ji=C.$applyNodeReplacement,gT=C.$assumeActiveEditor,yn=C.$caretFromPoint,Er=C.$caretRangeFromSelection,Kd=C.$cloneWithProperties,mT=C.$cloneWithPropertiesEphemeral,Qi=C.$comparePointCaretNext,Ud=C.$copyNode,_T=C.$create,YU=C.$createChildrenArray,Hd=C.$createLineBreakNode,Vd=C.$createNodeSelection,at=C.$createParagraphNode,GU=C.$createPoint,yT=C.$createRangeSelection,qU=C.$createRangeSelectionFromDom,jd=C.$createTabNode,Kn=C.$createTextNode,xT=C.$exportNodeJSON,Yd=C.$extendCaretToRange,De=C.$findMatchingParent,vT=C.$flushSyncAfterUpdate,ST=C.$formatText,Gd=C.$fullReconcile,CT=C.$generateNodesFromRawText,D_=C.$getAdjacentChildCaret,XU=C.$getAdjacentNode,Nr=C.$getAdjacentSiblingOrParentSiblingCaret,JU=C.$getCaretInDirection,oo=C.$getCaretRange,Tr=C.$getCaretRangeInDirection,bT=C.$getCharacterOffsets,Qt=C.$getChildCaret,M_=C.$getChildCaretAtIndex,w_=C.$getChildCaretOrSelf,ws=C.$getCollapsedCaretRange,QU=C.$getCommonAncestor,ZU=C.$getCommonAncestorResultBranchOrder,ET=C.$getDOMSlot,NT=C.$getDOMTextNode,Ft=C.$getDocument,be=C.$getEditor,k_=C.$getEditorDOMRenderConfig,Ko=C.$getNearestNodeFromDOMNode,eH=C.$getNearestRootOrShadowRoot,Zi=C.$getNodeByKey,tH=C.$getNodeByKeyOrThrow,TT=C.$getNodeFromDOMNode,ks=C.$getPreviousSelection,Ke=C.$getRoot,B=C.$getSelection,qd=C.$getSelectionSlotFrame,Xe=C.$getSiblingCaret,ea=C.$getSlot,Xd=C.$getSlotFrame,Jd=C.$getSlotHost,nH=C.$getSlotNameWithinHost,As=C.$getSlotNames,Qd=C.$getState,oH=C.$getStateChange,rH=C.$getTextContent,sH=C.$getTextNodeOffset,OT=C.$getTextPointCaret,iH=C.$getTextPointCaretSlice,aH=C.$getWritableNodeState,nc=C.$hasAncestor,lH=C.$hasUpdateTag,ta=C.$insertNodeToNearestRootAtCaret,DT=C.$insertNodes,na=C.$isBlockElementNode,MT=C.$isBlockFullySelected,Uo=C.$isChildCaret,cH=C.$isCompactExport,xn=C.$isDecoratorNode,wT=C.$isEditorState,uH=C.$isElementDOMSlot,z=C.$isElementNode,oc=C.$isExtendableTextPointCaret,dH=C.$isInlineElementOrDecoratorNode,fH=C.$isInlineFormattable,kT=C.$isLeafNode,A_=C.$isLexicalNode,Or=C.$isLineBreakNode,pH=C.$isNodeCaret,Ne=C.$isNodeSelection,AT=C.$isParagraphNode,F=C.$isRangeSelection,Is=C.$isRootNode,ro=C.$isRootOrShadowRoot,IT=C.$isSelectionCapturedInDecoratorInput,Zd=C.$isShadowRootNode,Ho=C.$isSiblingCaret,hH=C.$isSlotChild,rc=C.$isSlotHost,I_=C.$isTabNode,H=C.$isTextNode,so=C.$isTextPointCaret,gH=C.$isTextPointCaretSlice,$_=C.$isTokenOrSegmented,mH=C.$isTokenOrTab,_H=C.$markSlotEditable,R_=C.$needsBlockCursorBeside,yH=C.$nodesOfType,Un=C.$normalizeCaret,oa=C.$normalizeSelection__EXPERIMENTAL,xH=C.$onUpdate,$T=C.$parseSerializedNode,vH=C.$removeFromParent,SH=C.$removeSlot,RT=C.$removeTextFromCaretRange,vn=C.$rewindSiblingCaret,ef=C.$selectAll,CH=C.$setCompositionKey,Dr=C.$setDirectionFromDOM,Mr=C.$setFormatFromDOM,PT=C.$setPointFromCaret,Sn=C.$setSelection,Hn=C.$setSelectionFromCaretRange,bH=C.$setSlot,tf=C.$setState,LT=C.$setTextFormat,nf=C.$splitAtPointCaretNext,FT=C.$splitNode,BT=C.$updateDOMSelection,EH=C.$updateRangeSelectionFromCaretRange,NH=C.$withCompactExport,P_=C.ArtificialNode__DO_NOT_USE,TH=C.BEFORE_INPUT_COMMAND,OH=C.BLUR_COMMAND,sc=C.CAN_REDO_COMMAND,ic=C.CAN_UNDO_COMMAND,ac=C.CAN_USE_BEFORE_INPUT,Cn=C.CAN_USE_DOM,zT=C.CLEAR_EDITOR_COMMAND,WT=C.CLEAR_HISTORY_COMMAND,of=C.CLICK_COMMAND,DH=C.COLLABORATION_TAG,KT=C.COMMAND_PRIORITY_BEFORE_CRITICAL,MH=C.COMMAND_PRIORITY_BEFORE_EDITOR,wH=C.COMMAND_PRIORITY_BEFORE_HIGH,kH=C.COMMAND_PRIORITY_BEFORE_LOW,AH=C.COMMAND_PRIORITY_BEFORE_NORMAL,UT=C.COMMAND_PRIORITY_CRITICAL,ne=C.COMMAND_PRIORITY_EDITOR,IH=C.COMMAND_PRIORITY_HIGH,Vo=C.COMMAND_PRIORITY_LOW,$H=C.COMMAND_PRIORITY_NORMAL,RH=C.COMPOSITION_END_COMMAND,HT=C.COMPOSITION_END_TAG,PH=C.COMPOSITION_START_COMMAND,VT=C.COMPOSITION_START_TAG,jT=C.CONTROLLED_TEXT_INSERTION_COMMAND,LH=C.CONTROL_OR_ALT,FH=C.CONTROL_OR_META,BH=C.CONTROL_OR_OTHER_KEY,rf=C.COPY_COMMAND,YT=C.CUT_COMMAND,lc=C.CUT_TAG,L_=C.DEFAULT_EDITOR_DOM_CONFIG,sf=C.DELETE_CHARACTER_COMMAND,GT=C.DELETE_LINE_COMMAND,qT=C.DELETE_WORD_COMMAND,zH=C.DRAGEND_COMMAND,XT=C.DRAGOVER_COMMAND,JT=C.DRAGSTART_COMMAND,QT=C.DROP_COMMAND,F_=C.DecoratorNode,io=C.ElementNode,WH=C.FOCUS_COMMAND,ZT=C.FORMAT_ELEMENT_COMMAND,eO=C.FORMAT_TEXT_COMMAND,af=C.HISTORIC_TAG,ra=C.HISTORY_MERGE_TAG,tO=C.HISTORY_PUSH_TAG,nO=C.INDENT_CONTENT_COMMAND,KH=C.INPUT_COMMAND,B_=C.INSERT_LINE_BREAK_COMMAND,z_=C.INSERT_PARAGRAPH_COMMAND,oO=C.INSERT_TAB_COMMAND,rO=C.INTERNAL_$expandSelectionToWholeDocument,cc=C.INTERNAL_$isBlock,UH=C.IS_ALL_FORMATTING,sO=C.IS_ANDROID,iO=C.IS_ANDROID_CHROME,aO=C.IS_APPLE,lf=C.IS_APPLE_WEBKIT,W_=C.IS_BOLD,lO=C.IS_CHROME,cO=C.IS_CODE,cf=C.IS_FIREFOX,uO=C.IS_HIGHLIGHT,uc=C.IS_IOS,K_=C.IS_ITALIC,uf=C.IS_SAFARI,U_=C.IS_STRIKETHROUGH,df=C.IS_SUBSCRIPT,ff=C.IS_SUPERSCRIPT,H_=C.IS_UNDERLINE,dO=C.KEY_ARROW_DOWN_COMMAND,fO=C.KEY_ARROW_LEFT_COMMAND,pO=C.KEY_ARROW_RIGHT_COMMAND,hO=C.KEY_ARROW_UP_COMMAND,gO=C.KEY_BACKSPACE_COMMAND,mO=C.KEY_DELETE_COMMAND,_O=C.KEY_DOWN_COMMAND,yO=C.KEY_ENTER_COMMAND,xO=C.KEY_ESCAPE_COMMAND,HH=C.KEY_MODIFIER_COMMAND,vO=C.KEY_SPACE_COMMAND,SO=C.KEY_TAB_COMMAND,CO=C.LineBreakNode,bO=C.MOVE_TO_END,EO=C.MOVE_TO_START,VH=C.NODE_STATE_DIRECT,jH=C.NODE_STATE_KEY,YH=C.NODE_STATE_LATEST,V_=C.OUTDENT_CONTENT_COMMAND,pf=C.PASTE_COMMAND,hf=C.PASTE_TAG,NO=C.ParagraphNode,gf=C.REDO_COMMAND,TO=C.REMOVE_TEXT_COMMAND,mf=C.RootNode,OO=C.SELECTION_CHANGE_COMMAND,DO=C.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,MO=C.SELECT_ALL_COMMAND,wO=C.SET_TEXT_FORMAT_COMMAND,GH=C.SKIP_COLLAB_TAG,qH=C.SKIP_DOM_SELECTION_TAG,kO=C.SKIP_SCROLL_INTO_VIEW_TAG,AO=C.SKIP_SELECTION_FOCUS_TAG,bn=C.TEXT_TYPE_TO_FORMAT,IO=C.TabNode,wr=C.TextNode,_f=C.UNDO_COMMAND,xo=C.addClassNamesToElement,XH=C.aliasTableOf,JH=C.aliasedValue,QH=C.arrayValue,yf=C.booleanValue,ZH=C.buildImportMap,eV=C.compileKeyboardShortcuts,tV=C.configExtension,sa=C.createCommand,xf=C.createEditor,vf=C.createRefCountedRegistry,nV=C.createSharedNodeState,Sf=C.createState,oV=C.declarePeerDependency,rV=C.declaredAccepts,sV=C.defineExtension,$O=C.enumValue,RO=C.findAllLexicalElementsDeep,PO=C.flipDirection,LO=C.getActiveElement,$s=C.getActiveElementDeep,j_=C.getComposedEventTarget,iV=C.getComposedSchemaFields,aV=C.getComposedStaticRange,lV=C.getDOMOwnerDocument,kr=C.getDOMSelection,cV=C.getDOMSelectionFromTarget,Cf=C.getDOMSelectionPoints,uV=C.getDOMSelectionRange,dV=C.getDOMSelectionRangeAndPoints,FO=C.getDOMShadowRoots,BO=C.getDOMTextNode,fV=C.getDeclaredSlots,bf=C.getEditorPropertyFromDOMNode,zO=C.getNearestEditorFromDOMNode,dc=C.getParentElement,pV=C.getRegisteredNode,hV=C.getRegisteredNodeOrThrow,WO=C.getRegisteredSubtypeMap,Rs=C.getRootOwnerDocument,KO=C.getStaticNodeConfig,fc=C.getStyleObjectFromCSS,gV=C.getTextDirection,mV=C.getTransformSetFromKlass,ia=C.getterTableOf,Ar=C.isBlockDomNode,_V=C.isCurrentlyReadOnlyMode,yV=C.isDOMCapturingSelection,Ef=C.isDOMDocumentNode,aa=C.isDOMNode,Nf=C.isDOMShadowRoot,pc=C.isDOMTextNode,xV=C.isDOMUnmanaged,Y_=C.isDocumentFragment,vV=C.isExactShortcutMatch,la=C.isHTMLAnchorElement,ye=C.isHTMLElement,SV=C.isHTMLTableCellElement,CV=C.isHTMLTableRowElement,ca=C.isInlineDomNode,UO=C.isLastChildInBlockNode,Tf=C.isLexicalEditor,bV=C.isModifierMatch,HO=C.isOnlyChildInBlockNode,EV=C.isSchemaField,NV=C.isSelectionCapturedInDecoratorInput,VO=C.isSelectionWithinEditor,jO=C.iterStaticNodeConfigChain,TV=C.keyboardEventMaskForPlatform,G_=C.makeStepwiseIterator,ve=C.mergeRegister,OV=C.mountSlotContainer,hc=C.nodeSchema,DV=C.normalizeClassNames,Of=C.nullable,MV=C.numberValue,wV=C.objectValue,kV=C.optional,AV=C.rawValue,Ps=C.registerEventListener,Df=C.registerEventListeners,Mf=C.removeClassNamesFromElement,IV=C.removeFromParent,$V=C.resetRandomKey,RV=C.safeCast,PV=C.setDOMStyleFromCSS,LV=C.setDOMStyleObject,FV=C.setDOMUnmanaged,Ir=C.setNodeIndentFromDOM,ua=C.setterDefaultOf,da=C.setterTableOf,Bt=C.shallowMergeConfig,BV=C.stopLexicalPropagation,gc=C.stringValue,zV=C.toggleTextFormatType,YO=C.tokenizeRawText,WV=C.transformValue,KV=C.unionValue,UV=C.unmountSlotContainer,HV=C.withAccessors,$r=C.withField;var GO=globalThis.React,wf=GO.Fragment,Mt=(e,t,n)=>GO.createElement(e,n===void 0?t:{...t,key:n}),kf=Mt;var q_={};de(q_,{LexicalComposer:()=>BP});var FP=Cn?co:Ze,Af={tag:ra};function BP({initialConfig:e,children:t}){let n=Tn(()=>{let{theme:o,namespace:r,nodes:s,onError:i,onWarn:a,editorState:l,html:c}=e,u=_C(null,o),d=xf({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=Ke();if(h.isEmpty()){let g=at();h.append(g);let y=f.getRootElement(),m=Cn&&y!==null?LO(y):null;(B()!==null||m!==null&&m===y)&&g.select()}},Af);else if(p!==null)switch(typeof p){case"string":{let h=f.parseEditorState(p);f.setEditorState(h,Af);break}case"object":f.setEditorState(p,Af);break;case"function":f.update(()=>{Ke().isEmpty()&&p(f)},Af)}}})(d,l),[d,u]},[]);return FP(()=>{let o=e.editable,[r]=n;r.setEditable(o===void 0||o)},[]),Mt(mC.Provider,{value:n,children:t})}var zP=q_,qO=zP.LexicalComposer;var X_={};de(X_,{useLexicalSubscription:()=>KP});var WP=Cn?co:Ze;function KP(e){let[t]=Yt(),n=Tn(()=>e(t),[t,e]),[o,r]=ke(()=>n.initialValueFn()),s=qo(o);return WP(()=>{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 UP=X_,XO=UP.useLexicalSubscription;var J_={};de(J_,{useLexicalEditable:()=>VP});function HP(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function VP(){return XO(HP)}var jP=J_,JO=jP.useLexicalEditable;var Q_={};de(Q_,{getKnownTypesAndNodes:()=>YP,getNodeConfig:()=>QO});function YP(e){let t=new Set,n=new Set;for(let o of QO(e)){let r=typeof o=="function"?o:o.replace;KO(r),t.add(r.getType()),n.add(r)}return{nodes:n,types:t}}function QO(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var ZO=Q_,eD=ZO.getKnownTypesAndNodes,tD=ZO.getNodeConfig;var Z_={};de(Z_,{InitialStateExtension:()=>qP});var nD={tag:ra};function GP(){let e=Ke();e.isEmpty()&&e.append(at())}var qP={config:{setOptions:nD,updateOptions:nD},init:({$initialEditorState:e=GP})=>({$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(wT(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:[mf,wr,CO,IO,NO]};var XP=Z_,oD=XP.InitialStateExtension;var ry={};de(ry,{LexicalBuilder:()=>$f,buildEditorFromExtensions:()=>tL,builderSymbol:()=>oy});function Me(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 JP(){let e;try{e="0.52.0+prod.esm"}catch{}return e??'"<unknown>+source"'}var QP=JP(),ZP=new Set(["__proto__","constructor","prototype"]);function sD(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,o=t;for(let r in o)!ZP.has(r)&&Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=sD(n[r],o[r]));return e}return t}function ey(e){return e.id===0}function iD(e){return e.id===2}var eL=new Set,ny=class{constructor(t,n){M(this,"builder");M(this,"configs");M(this,"_dependency");M(this,"_peerNameSet");M(this,"extension");M(this,"state");M(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;iD(n)||Me(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&&Me(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&&Me(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&&Me(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&&Me(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&&Me(311),this._signal}getInitResult(){this.extension.init===void 0&&Me(312,this.extension.name);let t=this.state;return(function(n){return n.id>=4})(t)||Me(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)||Me(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&&Me(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&Me(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=7})(t)||Me(316,String(t.id),String(7)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||eL}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)||Me(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},oy=Symbol.for("@lexical/extension/LexicalBuilder");function tL(...e){return $f.fromExtensions(e).buildEditor()}function rD(){}function nL(e){throw e}function If(e){return Array.isArray(e)?e:[e]}var ty=QP,$f=class e{constructor(t){M(this,"roots");M(this,"extensionNameMap");M(this,"outgoingConfigEdges");M(this,"incomingEdges");M(this,"conflicts");M(this,"_sortedExtensionReps");M(this,"PACKAGE_VERSION");this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ty,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[If(oD)];for(let o of t)n.push(If(o));return new e(n)}static maybeFromEditor(t){let n=t[oy];return n&&(n.PACKAGE_VERSION!==ty&&Me(292,n.PACKAGE_VERSION,ty),n instanceof e||Me(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Me(294),n}constructEditor(){let{$initialEditorState:t,onError:n,onWarn:o,...r}=this.buildCreateEditorArgs(),s=Object.assign(xf({...r,...n?{onError:i=>{n(i,s)}}:{},...o?{onWarn:i=>{o(i,s)}}:{}}),{[oy]:this});for(let i of this.sortedExtensionReps())i.build(s);return s}buildEditor(){let t=rD;function n(){try{t()}finally{t=rD}}let o=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=ve(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&&Me(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&&Me(296);let n=If(t),[o]=n;typeof o.name!="string"&&Me(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&Me(298,o.name),!r){r=new ny(this,o),this.extensionNameMap.set(o.name,r);let s=this.conflicts.get(o.name);typeof s=="string"&&Me(299,o.name,s);for(let i of o.conflictsWith||[])this.extensionNameMap.has(i)&&Me(299,o.name,i),this.conflicts.set(i,o.name);for(let i of o.dependencies||[]){let a=If(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(iD(s))return;let i=o.extension.name;var a;ey(s)||Me(300,i,r||"[unknown]"),ey(a=s)||Me(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)||Me(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())ey(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&&Me(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 ve(...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 tD(d)){if(typeof f!="function"){let p=o.get(f.replace);p&&Me(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&&sD(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=nL),t}};var sy=ry,fa=sy.LexicalBuilder,fj=sy.buildEditorFromExtensions,pj=sy.builderSymbol;var iy={};de(iy,{ReactProviderExtension:()=>oL});var oL={name:"@lexical/react/ReactProvider"};var rL=iy,aD=rL.ReactProviderExtension;var ly={};de(ly,{$canShowPlaceholder:()=>cD,$canShowPlaceholderCurry:()=>iL,$findTextIntersectionFromCharacters:()=>aL,$isRootTextContentEmpty:()=>ay,$isRootTextContentEmptyCurry:()=>sL,$rootTextContent:()=>lD,registerLexicalTextEntity:()=>cL});function lD(){return Ke().getTextContent()}function ay(e,t=!0){if(e)return!1;let n=lD();return t&&(n=n.trim()),n===""}function sL(e,t){return()=>ay(e,t)}function cD(e){if(!ay(e,!1))return!1;let t=Ke().getChildren(),n=t.length;if(n>1)return!1;for(let o=0;o<n;o++){let r=t[o];if(xn(r))return!1;if(z(r)){if(!AT(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 iL(e){return()=>cD(e)}function aL(e,t){let n=e.getFirstChild(),o=0;e:for(;n!==null;){if(z(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 lL(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 cL(e,t,n,o){let r=i=>i instanceof n,s=i=>{let a=Kn(i.getTextContent()).setFormat(i.getFormat()).setStyle(i.getStyle()).setDetail(i.getDetail());i.replace(a)};return[e.registerNodeTransform(wr,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&&lL(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 Ls=ly,_j=Ls.$canShowPlaceholder,Rf=Ls.$canShowPlaceholderCurry,yj=Ls.$findTextIntersectionFromCharacters,xj=Ls.$isRootTextContentEmpty,vj=Ls.$isRootTextContentEmptyCurry,Sj=Ls.$rootTextContent,Cj=Ls.registerLexicalTextEntity;var cy={};de(cy,{batch:()=>Ee,computed:()=>Oa,effect:()=>gt,signal:()=>On,untracked:()=>ce});var mc=cy,_c=mc.batch,uD=mc.computed,we=mc.effect,St=mc.signal,Nj=mc.untracked;var uy={};de(uy,{namedSignals:()=>uL});function uL(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 dL=uy,Je=dL.namedSignals;var dy={};de(dy,{watchedSignal:()=>fL});function fL(e,t){let n;return St(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var pL=dy,Rr=pL.watchedSignal;var fy={};de(fy,{DragonExtension:()=>yL,installDragonSupport:()=>gL,registerDragonSupport:()=>pD});var hL={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},Pf=Symbol.for("@lexical/dragon/WindowState");function gL(e=(function(){return typeof window<"u"?window:void 0})()){return e?fD(e,Symbol("@lexical/dragon/globalInstall"),void 0):()=>{}}function fD(e,t,n){let o=(function(r){let s=r[Pf];return s===void 0&&(s={dispose:()=>{},editors:new Map,installs:new Set},r[Pf]=s),s})(e);if(o.installs.size===0){let r=_L.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 mL.bind(null,e,o,t,n)}function mL(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[Pf])}function dD(e){return e&&e.ownerDocument.defaultView}function pD(e){let t=Rr(()=>dD(e.getRootElement()),n=>e.registerRootListener(o=>{n.value=dD(o)}));return we(()=>{let n=t.value;if(n)return fD(n,Symbol("@lexical/dragon/editorInstall"),e)})}function _L(e){if(e.origin!==this.location.origin)return;let t=(function(o){let r=o[Pf];if(r===void 0)return null;let s=bf($s(o.document));return Tf(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=B();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=hL[d];m!==void 0&&f.formatText(m)}e.stopImmediatePropagation()}})}}}}}var yL={build:(e,t,n)=>Je(t),config:{disabled:typeof window>"u"},name:"@lexical/dragon",register:(e,t,n)=>we(()=>n.getOutput().disabled.value?void 0:pD(e))};var py=fy,hD=py.DragonExtension,Rj=py.installDragonSupport,gD=py.registerDragonSupport;var hy={};de(hy,{getPeerDependencyFromEditor:()=>mD,getPeerDependencyFromEditorOrThrow:()=>xL});function mD(e,t){let n=fa.maybeFromEditor(e);if(!n)return;let o=n.extensionNameMap.get(t);return o?o.getExtensionDependency():void 0}function xL(e,t){let n=mD(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 _D=hy,ao=_D.getPeerDependencyFromEditor,Fj=_D.getPeerDependencyFromEditorOrThrow;var vy={};de(vy,{$addNodeStyle:()=>TL,$cloneWithProperties:()=>Kd,$copyBlockFormatIndent:()=>ND,$ensureForwardRangeSelection:()=>ED,$forEachSelectedTextNode:()=>bD,$getComputedStyleForElement:()=>_y,$getComputedStyleForParent:()=>yy,$getSelectionStyleValueForProperty:()=>$L,$isAtEdgeOfElement:()=>TD,$isAtNodeEnd:()=>NL,$isParentElementRTL:()=>xy,$isParentRTL:()=>bL,$moveCaretSelection:()=>MD,$moveCharacter:()=>AL,$patchStyleText:()=>OL,$selectAll:()=>ef,$setBlocksType:()=>DL,$shouldOverrideDefaultCharacterSelection:()=>kL,$sliceSelectedTextNodeContent:()=>EL,$trimTextContentFromAnchor:()=>CD,$wrapNodes:()=>wL,createDOMRange:()=>SL,createRectsFromDOMRange:()=>CL,getCSSFromStyleObject:()=>SD,getStyleObjectFromCSS:()=>RL,trimTextContentFromAnchor:()=>PL});function my(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 vL(e){return()=>{}}function yD(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function xD(e){let t=e.parentNode;if(t==null)throw new Error("Should never happen");return[t,Array.from(t.childNodes).indexOf(e)]}function SL(e,t,n,o,r){let s=t.getKey(),i=o.getKey(),a=Rs(e.getRootElement()).createRange(),l=e.getElementByKey(s),c=e.getElementByKey(i),u=n,d=r;if(H(t)&&(l=yD(l)),H(o)&&(c=yD(c)),t===void 0||o===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=xD(l)),c.nodeName==="BR"&&([c,d]=xD(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 CL(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 SD(e){let t="";for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function _y(e){let t=be().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function yy(e){let t=Is(e)?e:e.getParent();return t&&_y(t)}function bL(e){let t=yy(e);return t!==null&&t.direction==="rtl"}function EL(e,t,n="self"){let o=e.getStartEndPoints();if(t.isSelected(e)&&!$_(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]=bT(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=mT(t)),t.__text=_)}}return t}function NL(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return z(t)||my(177),e.offset===t.getChildrenSize()}function CD(e,t,n){let o=t.getNode(),r=n;if(z(o)){let s=o.getDescendantByIndex(t.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if(z(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===""&&z(o)&&!o.isInline()&&(a=`
|
|
78
|
+
|
|
79
|
+
`);let l=a.length;if(!H(o)||r>=l){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||Is(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=ks(),h=o;if(o.isSimpleText())o.setTextContent(u);else{let g=Kn(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=Kn(f);o.replace(p)}r=0}}}var TL=vL();function Lf(e,t){(F(e)?e.isCollapsed():H(e)||z(e))||my(280);let n=fc(F(e)?e.style:H(e)?e.getStyle():e.getTextStyle()),o=SD(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 OL(e,t){let n=new Set;if(F(e)&&e.isCollapsed()){Lf(e,t);let r=e.anchor.getNode();z(r)&&r.isEmpty()&&(n.add(r.getKey()),Lf(r,t))}bD(r=>{Lf(r,t)});let o=e.getNodes();if(o.length>0)for(let r of o){if(!z(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();n.has(s)||(n.add(s),Lf(r,t))}}function bD(e){let t=B();if(!t)return;let n=new Map,o=s=>n.get(s.getKey())||[0,s.getTextContentSize()];if(F(t))for(let s of Er(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&&($_(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&&ED(t)}function ED(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 ND(e,t){let n=e.getFormatType(),o=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),o!==t.getIndent()&&t.setIndent(o)}function TD(e,t,n){let o=yn(e,n);if(oc(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 DL(e,t,n=ND){if(!e)return;let o=e.getStartEndPoints(),r=!1,s=null,i=new Map;if(o){let[a,l]=o,c=De(a.getNode(),cc);s=De(l.getNode(),cc);let u=e.isBackward()?"previous":"next";r=z(s)&&!s.is(c)&&(function(d,f,p){let h=d.getNode();return(!z(h)||!h.isEmpty())&&TD(d,f,p)})(l,s,PO(u)),z(c)&&i.set(c.getKey(),c),z(s)&&!r&&i.set(s.getKey(),s)}for(let a of e.getNodes())if(z(a)&&cc(a)){if(r&&a.is(s))continue;i.set(a.getKey(),a)}else if(!o){let l=De(a,cc);z(l)&&i.set(l.getKey(),l)}for(let a of i.values()){if(Jd(a)!==null)continue;let l=t();n(a,l),a.replace(l,!0)}}function vD(e){return e.getNode().isAttached()}function ML(e){let t=e;for(;t!==null&&!ro(t);){let n=t.getLatest(),o=t.getParent();n.getChildrenSize()===0&&t.remove(!0),t=o}}function wL(e,t,n=null){let o=e.getStartEndPoints(),r=o?o[0]:null,s=e.getNodes(),i=s.length;if(r!==null){let c=Xd(r.getNode());if(c!==null&&!ro(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];ro(u)?(gy(e,l,l.length,t,n),l=[],a=u):a===null||a!==null&&nc(u,a)?l.push(u):(gy(e,l,l.length,t,n),l=[u])}gy(e,l,l.length,t,n)}function gy(e,t,n,o,r=null){if(t.length===0)return;let s=t[0],i=new Map,a=[],l=z(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(),ro(c))break}let d=new Set;for(let g=0;g<n;g++){let y=t[g];z(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&&kT(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()),z(S))for(let b of S.getChildrenKeys())f.add(b);ML(m)}}else if(d.has(y.getKey())){z(y)||my(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(ro(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(z(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=ks();F(h)&&vD(h.anchor)&&vD(h.focus)?Sn(h.clone()):p!==null?p.selectEnd():e.dirty=!0}function OD(e){let t=DD(e);return t!==null&&t.writingMode==="vertical-rl"}function DD(e){let t=e.anchor.getNode();return z(t)?_y(t):yy(t)}function kL(e,t){let n=OD(e)?!t:t;xy(e)&&(n=!n);let o=yn(e.focus,n?"previous":"next");if(oc(o))return!1;if(so(o)&&!I_(o.origin)&&o.origin.isUnmergeable()){let r=o.getNodeAtCaret();if(H(r)&&!I_(r))return!0}for(let r of Yd(o)){if(Uo(r))return!r.origin.isInline();if(!z(r.origin)){if(xn(r.origin))return!0;break}}return!1}function MD(e,t,n,o){e.modify(t?"extend":"move",n,o)}function xy(e){let t=DD(e);return t!==null&&t.direction==="rtl"}function AL(e,t,n){let o=xy(e),r;r=OD(e)||o?!n:n,MD(e,t,r,"character")}function IL(e,t,n){let o=e.getStyle(),r=fc(o);return r!==null&&r[t]||n}function $L(e,t,n=""){let o=null,r=e.getNodes(),s,i;if(F(e)){if(e.isCollapsed()&&e.style!==""){let h=fc(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=IL(l,t,n);if(o===null)o=c;else if(o!==c){o="";break}}}return o===null?n:o}var RL=fc,PL=CD;var $e=vy,Kj=$e.$addNodeStyle,Uj=$e.$cloneWithProperties,Hj=$e.$copyBlockFormatIndent,Vj=$e.$ensureForwardRangeSelection,jj=$e.$forEachSelectedTextNode,Yj=$e.$getComputedStyleForElement,Gj=$e.$getComputedStyleForParent,qj=$e.$getSelectionStyleValueForProperty,Sy=$e.$isAtEdgeOfElement,Xj=$e.$isAtNodeEnd,Jj=$e.$isParentElementRTL,yc=$e.$isParentRTL,Qj=$e.$moveCaretSelection,Cy=$e.$moveCharacter,Zj=$e.$patchStyleText,e3=$e.$selectAll,t3=$e.$setBlocksType,by=$e.$shouldOverrideDefaultCharacterSelection,Ff=$e.$sliceSelectedTextNodeContent,n3=$e.$trimTextContentFromAnchor,o3=$e.$wrapNodes,r3=$e.createDOMRange,wD=$e.createRectsFromDOMRange,s3=$e.getCSSFromStyleObject,i3=$e.getStyleObjectFromCSS,a3=$e.trimTextContentFromAnchor;var wy={};de(wy,{$descendantsMatching:()=>uF,$dfs:()=>UL,$dfsIterator:()=>PD,$dfsWithSlots:()=>jL,$dfsWithSlotsIterator:()=>LD,$filter:()=>rF,$findMatchingParent:()=>De,$firstToLastIterator:()=>dF,$getAdjacentCaret:()=>HL,$getAdjacentSiblingOrParentSiblingCaret:()=>Nr,$getDepth:()=>FD,$getNearestBlockElementAncestorOrThrow:()=>JL,$getNearestNodeOfType:()=>XL,$getNextRightPreorderNode:()=>GL,$getNextSiblingOrParentSibling:()=>YL,$handleIndentAndOutdent:()=>sF,$insertFirst:()=>iF,$insertNodeIntoLeaf:()=>tF,$insertNodeToNearestRoot:()=>eF,$insertNodeToNearestRootAtCaret:()=>ta,$isAtEndOfNode:()=>VD,$isAtStartOfNode:()=>HD,$isBlockFullySelected:()=>MT,$isEditorIsNestedEditor:()=>lF,$lastToFirstIterator:()=>My,$onEscapeDown:()=>gF,$onEscapeUp:()=>hF,$restoreEditorState:()=>ZL,$reverseDfs:()=>VL,$reverseDfsIterator:()=>BD,$reverseDfsWithSlots:()=>qL,$reverseDfsWithSlotsIterator:()=>zD,$splitNode:()=>FT,$unwrapAndFilterDescendants:()=>cF,$unwrapNode:()=>fF,$wrapNodeInElement:()=>nF,CAN_USE_BEFORE_INPUT:()=>ac,CAN_USE_DOM:()=>Cn,IS_ANDROID:()=>sO,IS_ANDROID_CHROME:()=>iO,IS_APPLE:()=>aO,IS_APPLE_WEBKIT:()=>lf,IS_CHROME:()=>lO,IS_FIREFOX:()=>cf,IS_IOS:()=>uc,IS_SAFARI:()=>uf,addClassNamesToElement:()=>xo,calculateZoomLevel:()=>aF,dedupeSelectionRects:()=>LL,eventFiles:()=>oF,getScrollParent:()=>WL,isBlockDomNode:()=>Ar,isHTMLAnchorElement:()=>la,isHTMLElement:()=>ye,isInlineDomNode:()=>ca,isMimeType:()=>RD,makeStateWrapper:()=>pF,markSelection:()=>$D,mediaFileReader:()=>KL,mergeRegister:()=>ve,objectKlassEquals:()=>Dy,positionNodeOnRange:()=>ID,registerNestedElementResolver:()=>QL,removeClassNamesFromElement:()=>Mf,selectionAlwaysOnDisplay:()=>zL});function Ny(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 LL(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 vo(e){return`${e}px`}var FL={attributes:!0,characterData:!0,childList:!0,subtree:!0};function ID(e,t,n){let o=null,r=null,s=null,i=[],a=Rs(e.getRootElement()).createElement("div");function l(){o===null&&Ny(182),r===null&&Ny(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})(wD(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[_]||Rs(o).createElement("div"),S=v.style;S.position!=="absolute"&&(S.position="absolute",m=!0);let b=vo(x.left-f);S.left!==b&&(S.left=b,m=!0);let E=vo(x.top-p);S.top!==E&&(v.style.top=E,m=!0);let D=vo(x.width);S.width!==D&&(v.style.width=D,m=!0);let O=vo(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(!ye(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,FL),l()}a.style.position="relative";let d=e.registerRootListener(()=>(u(),c));return()=>{d(),c()}}function kD(e,t,n,o){if(t.type!=="text"&&z(n)){let r=ET(n,o,e);return[r.element,r.getFirstChildOffset()+t.offset]}return[(H(n)?NT(n,o,e):BO(o))||o,t.offset]}function BL(e){for(let t of e){let n=t.style;n.background!=="Highlight"&&(n.background="Highlight"),n.color!=="HighlightText"&&(n.color="HighlightText"),n.marginTop!==vo(-1.5)&&(n.marginTop=vo(-1.5)),n.paddingTop!==vo(4)&&(n.paddingTop=vo(4)),n.paddingBottom!==vo(0)&&(n.paddingBottom=vo(0))}}function $D(e,t=BL){let n=null,o=null,r=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=B();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(),E=s===null||S!==i||x!==a||_!==s.getKey();if((b||E)&&v!==null&&S!==null){let D=(function(O,T,A,$,I,R,K){let J=(O._window?O._window.document:document).createRange();return J.setStart(...kD(O,T,A,$)),J.setEnd(...kD(O,I,R,K)),J})(e,f,h,v,p,m,S);l(),l=ID(e,D,t)}n=h,o=v,r=y,s=m,i=S,a=x},{editor:e})}return c(e.getEditorState()),ve(e.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function zL(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?Cf(i,r).anchorNode:null;a!==null&&r!==null&&r.contains(a)?n!==null&&(n(),n=null):n===null&&(n=$D(e,t))};return e.registerRootListener(r=>{if(r){let s=r.ownerDocument,i=ve(Ps(s,"selectionchange",o),()=>{n!==null&&n()});return o(),i}})}function WL(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=dc(a);)if(r=o.getComputedStyle(a),(!s||r.position!=="static")&&i.test(r.overflow+r.overflowY+r.overflowX))return a;return n.body}function RD(e,t){for(let n of t)if(e.type.startsWith(n))return!0;return!1}function KL(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()}),RD(l,t)?c.readAsDataURL(l):i()};i()})}function UL(e,t){return Array.from(PD(e,t))}function HL(e){return e?e.getAdjacentCaret():null}function VL(e,t){return Array.from(BD(e,t))}function PD(e,t){return Bf("next",e,t)}function jL(e,t){return Array.from(LD(e,t))}function*LD(e,t){for(let n of Bf("next",e,t)){yield n;let{node:o,depth:r}=n;if(rc(o)&&!o.is(t))for(let s of As(o)){let i=ea(o,s);i!==null&&(yield*Ty(i,r+1))}}}function*Ty(e,t){yield{depth:t,node:e};let n=t+1;if(rc(e))for(let o of As(e)){let r=ea(e,o);r!==null&&(yield*Ty(r,n))}if(z(e))for(let o of e.getChildren())yield*Ty(o,n)}function AD(e,t){let n=Nr(Xe(e,t));return n&&n[0]}function Bf(e,t,n){let o=Ke(),r=t||o,s=z(r)?Qt(r,e):Xe(r,e),i=FD(r),a=n?D_(w_(Xe(n,e)))||AD(n,e):AD(r,e),l=i;return G_({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=Nr(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function YL(e){let t=Nr(Xe(e,"next"));return t&&[t[0].origin,t[1]]}function FD(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Jd(n))t++;return t}function GL(e){let t=w_(Xe(e,"previous")),n=Nr(t,"root");return n&&n[0].origin}function BD(e,t){return Bf("previous",e,t)}function qL(e,t){return Array.from(zD(e,t))}function*zD(e,t){let n=[];for(let o of Bf("previous",e,t)){for(;n.length>0&&o.depth<=n[n.length-1].depth;){let i=n.pop();yield*Oy(i.node,i.depth+1)}yield o;let{node:r,depth:s}=o;rc(r)&&As(r).length>0&&!r.is(t)&&n.push({depth:s,node:r})}for(;n.length>0;){let o=n.pop();yield*Oy(o.node,o.depth+1)}}function*Oy(e,t){let n=As(e);for(let o=n.length-1;o>=0;o--){let r=ea(e,n[o]);r!==null&&(yield*WD(r,t))}}function*WD(e,t){yield{depth:t,node:e};let n=t+1;if(z(e)){let o=e.getChildren();for(let r=o.length-1;r>=0;r--)yield*WD(o[r],n)}rc(e)&&(yield*Oy(e,n))}function XL(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function JL(e){let t=De(e,n=>z(n)&&!n.isInline());return z(t)||Ny(4,e.__key),t}function QL(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 ZL(e,t){let n=new Map,o=e._pendingEditorState;for(let[s,i]of t._nodeMap)n.set(s,Kd(i));o&&(o._nodeMap=n),Gd();let r=t._selection;Sn(r===null?null:r.clone())}function eF(e){let t=B()||ks(),n;if(F(t))n=yn(t.focus,"next");else{if(t!=null){let a=t.getNodes(),l=a[a.length-1];l&&(n=Xe(l,"next"))}n=n||Qt(Ke(),"previous").getFlipped().insert(at())}let o=ta(e,n,oc(r=n)||Nr(so(r)?r.getSiblingCaret():r,"shadowRoot")!==null?{$shouldSplit:(a,l)=>l!=="last"}:void 0);var r;let s=D_(o),i=Uo(s)?Un(s):o;return Hn(ws(i)),e.getLatest()}function tF(e){let t=B();if(!F(t))return void(t&&t.insertNodes([e]));let n=Er(t),o=Tr(RT(n),"next").anchor;if(so(o)){let s=nf(o);if(!s)return;o=s}let r=o.getFlipped();r.insert(e),Hn(oo(r,r))}function nF(e,t){let n=t();return e.replace(n),n.append(e),n}function Dy(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function oF(e){let t=null;if(Dy(e,DragEvent)?t=e.dataTransfer:Dy(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 rF(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 sF(e){let t=B();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=De(s,c=>z(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 iF(e,t){Qt(e,"next").insert(t)}var Ey=!(cf||!Cn)&&void 0;function aF(e,t=!1){let n=1;if((function(){if(Ey===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"),Ey=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Ey})()||t){let o=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(o.getComputedStyle(e).getPropertyValue("zoom")),e=dc(e)}return n}function lF(e){return e._parentEditor!==null}function cF(e,t){return KD(e,t,null)}function KD(e,t,n){let o=!1;for(let r of My(e))t(r)?n!==null&&n(r):(o=!0,z(r)&&KD(r,t,n||(s=>r.insertAfter(s))),r.remove());return o}function uF(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(z(r))for(let s of My(r))o.push(s);return n}function dF(e){return UD(Qt(e,"next"))}function My(e){return UD(Qt(e,"previous"))}function UD(e){return G_({hasNext:Ho,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function fF(e){vn(Xe(e,"next")).splice(1,e.getChildren())}function pF(e){let t=o=>Qd(o,e),n=(o,r)=>tf(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 hF(e,t){let n=B();if(F(n)&&n.isCollapsed()){let o=De(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getFirstChild()===o&&HD(n.anchor,o))return o.insertBefore(at()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function gF(e,t){let n=B();if(F(n)&&n.isCollapsed()){let o=De(n.anchor.getNode(),e);if(o){let r=o.getParent();if(r!==null&&r.getLastChild()===o&&VD(n.anchor,o))return o.insertAfter(at()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function HD(e,t){return Sy(e,t,"previous")}function VD(e,t){return Sy(e,t,"next")}var U=wy,f3=U.$descendantsMatching,p3=U.$dfs,h3=U.$dfsIterator,g3=U.$dfsWithSlots,m3=U.$dfsWithSlotsIterator,_3=U.$filter,y3=U.$findMatchingParent,x3=U.$firstToLastIterator,v3=U.$getAdjacentCaret,S3=U.$getAdjacentSiblingOrParentSiblingCaret,C3=U.$getDepth,jD=U.$getNearestBlockElementAncestorOrThrow,b3=U.$getNearestNodeOfType,E3=U.$getNextRightPreorderNode,N3=U.$getNextSiblingOrParentSibling,ky=U.$handleIndentAndOutdent,T3=U.$insertFirst,O3=U.$insertNodeIntoLeaf,YD=U.$insertNodeToNearestRoot,D3=U.$insertNodeToNearestRootAtCaret,M3=U.$isAtEndOfNode,w3=U.$isAtStartOfNode,k3=U.$isBlockFullySelected,A3=U.$isEditorIsNestedEditor,I3=U.$lastToFirstIterator,$3=U.$onEscapeDown,R3=U.$onEscapeUp,P3=U.$restoreEditorState,L3=U.$reverseDfs,F3=U.$reverseDfsIterator,B3=U.$reverseDfsWithSlots,z3=U.$reverseDfsWithSlotsIterator,W3=U.$splitNode,K3=U.$unwrapAndFilterDescendants,U3=U.$unwrapNode,H3=U.$wrapNodeInElement,V3=U.CAN_USE_BEFORE_INPUT,j3=U.CAN_USE_DOM,Y3=U.IS_ANDROID,G3=U.IS_ANDROID_CHROME,q3=U.IS_APPLE,X3=U.IS_APPLE_WEBKIT,J3=U.IS_CHROME,Q3=U.IS_FIREFOX,Z3=U.IS_IOS,eY=U.IS_SAFARI,tY=U.addClassNamesToElement,nY=U.calculateZoomLevel,oY=U.dedupeSelectionRects,Fs=U.eventFiles,rY=U.getScrollParent,sY=U.isBlockDomNode,iY=U.isHTMLAnchorElement,aY=U.isHTMLElement,lY=U.isInlineDomNode,cY=U.isMimeType,uY=U.makeStateWrapper,dY=U.markSelection,fY=U.mediaFileReader,pY=U.mergeRegister,lo=U.objectKlassEquals,hY=U.positionNodeOnRange,gY=U.registerNestedElementResolver,mY=U.removeClassNamesFromElement,_Y=U.selectionAlwaysOnDisplay;var Ay={};de(Ay,{EditorStateExtension:()=>mF});var mF={build:e=>Rr(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"};var _F=Ay,xc=_F.EditorStateExtension;var Iy={};de(Iy,{NodeSelectionExtension:()=>xF});var yF=new Set,xF={build(e,t,n){let o=n.getDependency(xc).output,r=St({watchedNodeKeys:new Map}),s=Rr(()=>{},()=>we(()=>{let i=s.peek(),{watchedNodeKeys:a}=r.value,l,c=!1;o.value.read(()=>{if(B())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=uD(()=>(s.value||yF).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:[xc],name:"@lexical/extension/NodeSelection"};var vF=Iy,$y=vF.NodeSelectionExtension;var Py={};de(Py,{$createHorizontalRuleNode:()=>Ry,$isHorizontalRuleNode:()=>qD,HorizontalRuleExtension:()=>CF,HorizontalRuleNode:()=>Bs,INSERT_HORIZONTAL_RULE_COMMAND:()=>GD});var GD=sa("INSERT_HORIZONTAL_RULE_COMMAND"),Bs=class extends F_{$config(){return this.config("horizontalrule",{extends:F_,importDOM:{hr:()=>({conversion:SF,priority:0})}})}exportDOM(){return{element:Ft().createElement("hr")}}createDOM(t){let n=Ft().createElement("hr");return xo(n,t.theme.hr),n}getTextContent(){return`
|
|
80
|
+
`}isInline(){return!1}updateDOM(){return!1}};function SF(){return{node:Ry()}}function Ry(){return _T(Bs)}function qD(e){return e instanceof Bs}var CF={dependencies:[xc,$y],name:"@lexical/extension/HorizontalRule",nodes:()=>[Bs],register(e,t,n){let{watchNodeKey:o}=n.getDependency($y).output,r=St({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return ve(e.registerCommand(GD,i=>{let a=B();if(!F(a))return!1;if(a.focus.getNode()!==null){let l=Ry();YD(l)}return!0},ne),e.registerCommand(of,i=>{if(aa(i.target)){let a=TT(i.target);if(qD(a))return(function(l,c=!1){let u=B(),d=l.isSelected(),f=l.getKey(),p;c&&Ne(u)?p=u:(p=Vd(),Sn(p)),d?p.delete(f):p.add(f)})(a,i.shiftKey),!0}return!1},Vo),e.registerMutationListener(Bs,(i,a)=>{_c(()=>{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})})}),we(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of r.value.nodeSelections.values())i.push(we(()=>{let c=a.value;c&&(l.value?xo(c,s):Mf(c,s))}));return ve(...i)}))}};var vc=Py,XD=vc.$createHorizontalRuleNode,kY=vc.$isHorizontalRuleNode,JD=vc.HorizontalRuleExtension,QD=vc.HorizontalRuleNode,AY=vc.INSERT_HORIZONTAL_RULE_COMMAND;var Ly={};de(Ly,{getExtensionDependencyFromEditor:()=>bF});function bF(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 EF=Ly,ZD=EF.getExtensionDependencyFromEditor;var Fy={};de(Fy,{$getExtensionDependency:()=>eM,$getExtensionOutput:()=>NF,$getPeerDependency:()=>TF});function eM(e){return ZD(be(),e)}function NF(e){return eM(e).output}function TF(e){return ao(be(),e)}var By=Fy,BY=By.$getExtensionDependency,tM=By.$getExtensionOutput,nM=By.$getPeerDependency;var sx={};de(sx,{$appendNodeToHTML:()=>NB,$distributeInlineWrapper:()=>BM,$generateDOMFromNodes:()=>JM,$generateDOMFromRoot:()=>bB,$generateHtmlFromNodes:()=>EB,$generateNodesFromDOM:()=>CB,$generateNodesFromDOMViaExtension:()=>_B,$getImportContextValue:()=>FM,$getRenderContextValue:()=>kF,$getSessionDOMRenderConfig:()=>Hf,$inlineStylesFromStyleSheets:()=>mM,$isBlockLevel:()=>ha,$propagateTextAlignToBlockChildren:()=>zM,$setRenderContextValue:()=>AF,$updateRenderContextValue:()=>IF,$withImportContext:()=>tx,$withRenderContext:()=>Zy,BlockSchema:()=>KM,CoreImportExtension:()=>qM,CoreImportRules:()=>VM,DOMImportExtension:()=>rx,DOMRenderExtension:()=>jF,HorizontalRuleImportExtension:()=>vB,HorizontalRuleImportRules:()=>xB,ImportOverlays:()=>PM,ImportSource:()=>JF,ImportSourceDataTransfer:()=>QF,ImportTextFormat:()=>Wf,ImportTextStyle:()=>AM,ImportWhitespaceConfig:()=>RM,InlineSchema:()=>ZF,NestedBlockSchema:()=>eB,RenderContextExport:()=>Jy,RenderContextRoot:()=>xM,RootSchema:()=>UM,contextUpdater:()=>MF,contextValue:()=>Sc,createImportState:()=>Ws,createRenderState:()=>Xy,defaultIsInline:()=>$M,defaultPreservesWhitespace:()=>IM,defineImportRule:()=>yB,defineOverlayRules:()=>pB,domOverride:()=>$F,isElementOfTag:()=>qF,parseSelector:()=>kM,sel:()=>SB});function zs(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 Pr(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Gy(e){return pa&&pa.editor===e?pa:void 0}function Kf(e,t){let n=Gy(t);return n&&n[e]}function OF(e,t){if("cfg"in t){let{cfg:n,updater:o}=t;return[n,o(Pr(e,n))]}return t}function zf(e,t){let n=t;for(let o of e){let[r,s]=OF(n,o),i=r.key;if(n===t&&Pr(n,r)===s)continue;let a=n===t||n===void 0?DF(t):n;a[i]=s,n=a}return n}function DF(e){return Object.create(e||null)}function Sc(e,t){return[e,t]}function MF(e,t){return{cfg:e,updater:t}}function pM(e,t,n,o=be()){let r=pa,s=Gy(o);try{return pa={...s,editor:o,[e]:t},n()}finally{pa=r}}function hM(e,t=()=>{}){return(n,o=be())=>r=>{let s=Gy(o),i=s&&s[e],a=zf(n,i||t(o));return a&&a!==i?pM(e,a,r,o):r()}}function gM(e,t,n,o){return Object.assign(Sf(Symbol(t),{isEqual:o,parse:n}),{[e]:!0})}var mM=(e,t,n)=>{_M(e),n()};function _M(e){if(!Ef(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(!lo(i,CSSStyleRule))continue;let a;try{a=t.querySelectorAll(i.selectorText)}catch{continue}for(let l of Array.from(a)){if(!ye(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 qy="@lexical/html/DOM",Uf=Symbol.for("@lexical/html/DOMExportContext"),yM="@lexical/html/DOMImport",Cc=Symbol.for("@lexical/html/DOMImportContext"),wF=()=>!0;function Xy(e,t,n){return gM(Uf,e,t,n)}var xM=Xy("root",Boolean),Jy=Xy("isExport",Boolean);function vM(e){let t=ao(e,qy);return t?t.output.defaults:void 0}function kF(e,t=be()){return Pr((function(n){return Kf(Uf,n)||vM(n)})(t),e)}function Qy(e){let t=ao(e,qy);return t?t.output.runtime:void 0}function AF(e,t,n=be()){let o=Qy(n);o&&o.setContextValue(e,t)}function IF(e,t,n=be()){let o=Qy(n);o&&o.setContextValue(e,t(Pr(o.editorContext,e)))}function Hf(e=be()){let t=Qy(e);return t?t.getSessionConfig():k_(e)}var Zy=hM(Uf,vM);function $F(e,t,n){return{...t,...n,nodes:e}}function RF(e){return t=>t instanceof e}function PF(e,{nodes:t}){if(t==="*")return wF;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&&zs(339,r.name,s);for(let a of i)n[a]=!0}o.push(RF(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 oM(e){return(t,n,o)=>e(t,o)}function zy(e){return(t,n,o,r)=>e(t,n,r)}function rM(e){return(t,n,o,r,s)=>e(t,n,o,s)}function LF(e){return(t,n,o,r,s,i)=>e(t,n,o,r,i)}function sM(e,t){return(n,o)=>{let r=()=>e(n,o),s=t(n);return s?s(n,r,o):r()}}function Wy(e,t){return(n,o,r)=>{let s=()=>e(n,o,r),i=t(n);return i?i(n,o,s,r):s()}}var FF=Wy,BF=zy;function iM(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 zF(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 WF(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 KF(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 UF(e){return e.nodes==="*"}function HF(e){return e}function Ky(e,{overrides:t}){let n=(function(r,s){let i=WO(eD(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(UF(g))u.push(g);else if(Array.isArray(g.nodes))for(let y of g.nodes)A_(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 jO(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=PF(i,l);for(let u in a)KF(a,u,c,l[u])}return a})(e,t),o={...L_,...e.dom};return jo(n,"$createDOM",o,sM,oM),jo(n,"$exportDOM",o,sM,oM),jo(n,"$extractWithChild",o,zF,LF),jo(n,"$getDOMSlot",o,FF,BF),jo(n,"$shouldExclude",o,Wy,zy),jo(n,"$shouldInclude",o,Wy,zy),jo(n,"$getSlotTargetElement",o,iM,rM),jo(n,"$updateDOM",o,iM,rM),jo(n,"$decorateDOM",o,WF,HF),o}function SM(e){return{get:t=>Pr(e,t)}}function aM(e){let t=Object.create(null);return zf(e,t)||t}function Uy(e,t){let n=SM(t);return e.filter(o=>!(o.disabledForEditor&&o.disabledForEditor(n)))}function VF(e){if(e.nodes==="*")return()=>!0;let t=e.nodes.map(n=>{let o=n;return A_(o.prototype)?r=>r instanceof o:n});return n=>t.some(o=>o(n))}var Hy=class{constructor(t,n,o,r){M(this,"editor");M(this,"initialEditorConfig");M(this,"overrides");M(this,"editorContext");M(this,"hasSessionGates");M(this,"installed");M(this,"sessionCache",new Map);this.editor=t,this.initialEditorConfig=n,this.overrides=o,this.editorContext=r,this.installed=Uy(o,r),this.hasSessionGates=o.some(s=>s.disabledForSession)}setContextValue(t,n){let o=this.installed;this.editorContext[t.key]=n;let r=Uy(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=Ky(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(VF(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(Gd,{discrete:!0}),i.$updateDOM=l}getSessionConfig(){let t=this.editor._config.dom||L_;if(!this.hasSessionGates)return t;let n=SM(Kf(Uf,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=Ky(this.initialEditorConfig,{overrides:r}),this.sessionCache.set(s,i)),i}},jF={build(e,t,n){let{initialEditorConfig:o}=n.getInitResult(),r=aM(t.contextDefaults);return{defaults:r,runtime:new Hy(e,o,t.overrides,r)}},config:{contextDefaults:[],overrides:[]},html:{export:new Map([[mf,()=>{let e=Ft().createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){let n={dom:e.dom,nodes:e.nodes},o=aM(t.contextDefaults),r=Uy(t.overrides,o);return e.dom=Ky(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:qy},ex=Symbol.for("@lexical/html/SelectorImpl");function bc(e,t){let n={kind:"element",predicate:(o=t,o.length===0?ye: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=>bc(e,[...t,s]);return{[ex]:n,attr:(s,i,a)=>r(Vy(s,i,a)),classAll:(...s)=>r(bM(s)),classAny:(...s)=>r((function(i){let a=CM(i);return a.length===0?()=>!1:l=>{if(!ye(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=>ye(d)&&d.style.getPropertyValue(l)===c;if(c instanceof RegExp){let d=u&&u.capture,f=c;return(p,h)=>{if(!ye(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)}}zs(362,JSON.stringify(l))})(s,i,a))}}function CM(e){let t=[];for(let n of e)n&&t.push(n);return t}function bM(e){let t=CM(e);return t.length===0?()=>!0:n=>{if(!ye(n))return!1;let o=n.classList;for(let r of t)if(!o.contains(r))return!1;return!0}}function Vy(e,t,n){if(t===!0)return o=>ye(o)&&o.hasAttribute(e);if(typeof t=="string")return o=>ye(o)&&o.getAttribute(e)===t;if(t instanceof RegExp){let o=n&&n.capture,r=t;return(s,i)=>{if(!ye(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)}}zs(361,JSON.stringify(e))}function EM(e){return{[ex]:e}}var YF=EM({kind:"text",predicate:pc,tags:new Set}),GF=EM({kind:"comment",predicate:e=>e.nodeType===8,tags:new Set});function NM(){return bc(new Set,[])}function TM(){return GF}function OM(...e){e.length>0||zs(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return bc(t,[])}function DM(){return YF}var MM={any:NM,comment:TM,tag:OM,text:DM};function qF(e,t){return ye(e)&&e.nodeName===t.toUpperCase()}var wM=/[A-Za-z0-9_-]/,jy=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()&&wM.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||zs(364,String(this.pos+1),n,this.source)}};function XF(e){let t=new Set,n=[],o=[],r=!1;if(e.skipWhitespace(),e.peek()==="*")e.consume(),r=!0;else if(wM.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(Vy("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(Vy(i,a))}}}return o.length>0&&n.push(bM(o)),e.assert(r||t.size>0||n.length>0,"expected a selector"),{predicates:n,tags:t}}function kM(e){let t=new jy(e,0),n=[];for(;n.push(XF(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 bc(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 bc(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 Ws(e,t,n){return gM(Cc,e,t,n)}var JF=Ws("importSource",()=>"unknown"),QF=Ws("importSourceDataTransfer",()=>null),Wf=Ws("textFormat",()=>0),AM=Ws("textStyle",()=>({}));function IM(e){if(!ye(e))return!1;if(e.nodeName==="PRE")return!0;let t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function $M(e){if(pc(e))return!0;if(!ye(e))return!1;let t=e.style.display;return t?t.startsWith("inline"):!Ar(e)&&ca(e)}var RM=Ws("whitespaceConfig",()=>({isInline:$M,preservesWhitespace:IM})),PM=Ws("importOverlays",()=>[]),Yy=class{constructor(t){this.record=t}get(t){return Pr(this.record,t)}set(t,n){this.record[t.key]=n}update(t,n){this.record[t.key]=n(Pr(this.record,t))}has(t){return Object.prototype.hasOwnProperty.call(this.record,t.key)}};function LM(e){let t=ao(e,yM);return t?t.output.defaults:void 0}function FM(e,t=be()){return Pr((function(n){return Kf(Cc,n)||LM(n)})(t),e)}var tx=hM(Cc,LM);function ha(e){return na(e)||xn(e)&&!e.isInline()}function BM(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(),z(s)){let i=BM(s.getChildren(),t);s.splice(0,s.getChildrenSize(),i)}n.push(s)}else o.push(s);return r(),n}function zM(e,t){if(!ye(t))return e;let n=t.style.textAlign;if(!nx(n))return e;for(let o of e)na(o)&&o.getFormatType()===""&&o.setFormat(n);return e}function WM(e,t,n){e.length===1&&Or(e[0])&&(e=[]);let o=at();if(ye(n)){let r=n.style.textAlign;nx(r)&&o.setFormat(r)}return[o.splice(0,0,e)]}var KM={$accepts:ha,$packageRun:WM,name:"BlockSchema"},ZF={$accepts:e=>!ha(e),name:"InlineSchema"},eB={$accepts:ha,$packageRun:e=>e,name:"NestedBlockSchema"},UM={$accepts:ha,$packageRun:WM,name:"RootSchema"},Ks=MM,tB=new Set(["center","end","justify","left","right","start"]);function nx(e){return tB.has(e)}var nB={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"}},oB={CODE:cO,MARK:uO},rB=new Set(["font-weight","font-style","text-decoration","text-transform","vertical-align"]),sB={$import:(e,t)=>{let n=e.get(Wf),o=nB[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|=W_:p!=="normal"&&p!=="400"||(f|=W_),h==="italic"?d|=K_:h==="normal"&&(f|=K_),g){let _=g.split(" ");_.includes("underline")&&(d|=H_),_.includes("line-through")&&(d|=U_),_.includes("none")&&(f|=H_|U_)}return y==="lowercase"?(d|=bn.lowercase,f|=bn.uppercase|bn.capitalize):y==="uppercase"?(d|=bn.uppercase,f|=bn.lowercase|bn.capitalize):y==="capitalize"?(d|=bn.capitalize,f|=bn.lowercase|bn.uppercase):y==="none"&&(f|=bn.lowercase|bn.uppercase|bn.capitalize),m==="sub"?(d|=df,f|=ff):m==="super"?(d|=ff,f|=df):m==="baseline"&&(f|=df|ff),{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=oB[t.nodeName];return c&&(a|=c),a===n?e.$importChildren(t):e.$importChildren(t,{context:[Sc(Wf,a)]})},match:Ks.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function lM(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(pc(o))return o;if(o.nodeName==="BR")return null}}function cM(e,t){return t!==0&&H(e)?e.setFormat(t):e}function uM(e,t){if(H(e)){let n=(function(o){let r="";for(let s in o)rB.has(s)||(r+=`${s}: ${o[s]}; `);return r.trimEnd()})(t);n!==""&&e.setStyle(n)}return e}var iB={$import:(e,t)=>{let n=e.get(Wf),o=e.get(AM),r=e.get(RM);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=CT(t.textContent||"");for(let l of a)cM(l,n),uM(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=lM(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=lM(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=Kn(s);return cM(i,n),uM(i,o),[i]},match:Ks.text(),name:"@lexical/html/#text"},aB={$import:()=>[],match:Ks.tag("script","style"),name:"@lexical/html/script-style-ignore"},lB={$import:(e,t)=>HO(t)||UO(t)?[]:[Hd()],match:Ks.tag("br"),name:"@lexical/html/br"},cB={$import:(e,t)=>{let n=at();if(Mr(n,t),Ir(t,n),n.getFormatType()===""){let o=t.getAttribute("align");o&&nx(o)&&n.setFormat(o)}return Dr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Ks.tag("p"),name:"@lexical/html/p"},HM={$import:(e,t,n)=>be().hasNode(QD)?[XD()]:n(),match:Ks.tag("hr"),name:"@lexical/html/hr"},VM=[aB,cB,HM,{$import:(e,t,n)=>Ar(t)?zM(e.$importChildren(t,{schema:KM}),t):n(),match:Ks.any(),name:"@lexical/html/transparent-block"},iB,lB,sB];function uB(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 jM(e){let t=[],n=new Map,o=[],r=[],s=[],i=new Set;e.forEach((l,c)=>{let u=(function(f){let p=f[ex];return p===void 0&&zs(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,uB(c,o));return{byTag:a,commentIndices:s,rules:t,textIndices:r,wildcardIndices:o}}function dM(e,t){return pc(t)?e.textIndices:t.nodeType===8?e.commentIndices:ye(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:dB}var dB=Object.freeze([]);function YM(e){let t=[];for(let n of e)if(fB(n))for(let o of n.rules)t.push(o);else t.push(n);return t}function fB(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function pB(e){let t=YM(e);return{__type:"CompiledOverlayRules",dispatch:jM(t),rules:t}}var hB=Object.freeze({});function gB(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=()=>GM(s,i,a);return a&&a.context?tx(a.context,s.editor)(c):c()}finally{l&&s.overlays.pop()}})(e,o,r),$importOne:(o,r)=>ox(e,o,r),captures:t,get:o=>FM(o,e.editor),session:e.session}}function GM(e,t,n){let o=n&&n.$onChild,r=[];for(let a of Array.from(t.childNodes)){let l=ox(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 ox(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=dM(g,d);y.length>0&&f.push({dispatch:g,indices:y})}let p=dM(u.dispatch,d);return p.length>0&&f.push({dispatch:u.dispatch,indices:p}),f})(r,s);if(i.length===0)return fM(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=gB(r,Object.keys(h).length===0?hB:h);try{return p.$import(g,s,c)}catch(y){throw y}}}a++,l=0}return fM(r,s)};return c()})(e,t);return n&&n.context?tx(n.context,e.editor)(o):o()}function fM(e,t){if(t.childNodes.length===0)return[];let n=[];for(let o of Array.from(t.childNodes)){let r=ox(e,o,void 0);for(let s of r)n.push(s)}return n}var mB={$import:(e,t)=>e.$importChildren(t),match:MM.any(),name:"@lexical/html/default-hoist"},rx={build(e,t){let n=jM(YM(t.rules)),o=zf(t.contextDefaults,void 0),r=t.preprocess;return{$generateNodesFromDOM:(s,i)=>{let a=Kf(Cc,e)||o,l=i&&i.context?zf(i.context,a):a,c=l!==void 0&&l!==a?l:Object.create(a||null),u=new Yy(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),pM(Cc,c,()=>(function(f,p,h,g){return GM({dispatch:f,editor:p,overlays:g.get(PM).map(y=>y.dispatch),session:g},Ef(h)?h.body:h,{schema:UM})})(n,e,s,u),e)},defaults:o}},config:{contextDefaults:[],preprocess:[mM],rules:[mB]},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:yM};function _B(e,t){return tM(rx).$generateNodesFromDOM(e,t)}var qM={dependencies:[[rx,{rules:VM}]],name:"@lexical/html/CoreImport"};function yB(e){return e}var xB=[HM],vB={dependencies:[JD,qM],name:"@lexical/html/HorizontalRuleImport"},SB={any:NM,comment:TM,css:kM,tag:OM,text:DM},XM=new Set(["STYLE","SCRIPT"]);function CB(e,t){_M(t);let n=Ef(t)?t.body.childNodes:t.childNodes,o=[],r=[];for(let s of n)if(!XM.has(s.nodeName)){let i=QM(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 P_&&i.insertAfter(Hd());for(let i of s){let a=i.getParent();a&&a.splice(i.getIndexWithinParent(),1,i.getChildren())}})(r),o}function JM(e,t=null,n=be()){return Zy([Sc(Jy,!0)],n)(()=>{let o=Ke(),r=Hf(n),s=qd(t),i=e.append.bind(e);for(let a of(z(s)?s:o).getChildren())Vf(n,a,i,t,r);return e})}function bB(e,t=Ke()){let n=be();return Zy([Sc(Jy,!0),Sc(xM,!0)],n)(()=>{let o=Hf(n),r=e.append.bind(e);return Vf(n,t,r,null,o),e})}function EB(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&zs(338),gT(e),JM(Ft().createElement("div"),t,e).innerHTML}function Vf(e,t,n,o=null,r=k_(e)){let s=r.$shouldInclude(t,o,e),i=r.$shouldExclude(t,o,e),a=t;o!==null&&H(t)&&(a=Ff(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():z(a)?a.getChildren():[],g=s&&Ne(o)&&z(t)?null:o,y=p.append.bind(p),m=null;for(let _ of h){let x=Vf(e,_,y,g,r);x&&(m=_),!s&&x&&r.$extractWithChild(t,_,o,"html",e)&&(s=!0)}if(s&&!i){if((ye(c)||Y_(c))&&(d?d(p):c.append(p),(function(_,x){let v=_.lastChild;if(Or(x)&&ye(_)&&Ar(_)&&v!==null&&v.nodeName==="BR"){let S=Ft().createElement("br");S.setAttribute("data-lexical-managed-linebreak","true"),_.append(S)}})(c,m)),Y_(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 NB(e,t,n,o=null){return Vf(e,t,n.append.bind(n),o,Hf(e))}function QM(e,t,n,o,r=new Map,s){let i=[];if(XM.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||!ro(a))&&(a!=null&&na(a)||o);for(let h=0;h<d.length;h++)f.push(...QM(d[h],t,n,p,new Map(r),a));if(u!=null&&(f=u(f)),Ar(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 P_;return n.push(h),h}:at)),a==null)if(f.length>0)for(let h of f)i.push(h);else Ar(e)&&(function(h){return h.nextSibling!=null&&h.previousSibling!=null&&ca(h.nextSibling)&&ca(h.previousSibling)})(e)&&i.push(Hd());else z(a)&&a.append(...f);return i}var X=sx,qY=X.$appendNodeToHTML,ZM=X.$distributeInlineWrapper,XY=X.$generateDOMFromNodes,JY=X.$generateDOMFromRoot,jf=X.$generateHtmlFromNodes,Yf=X.$generateNodesFromDOM,ew=X.$generateNodesFromDOMViaExtension,QY=X.$getImportContextValue,ZY=X.$getRenderContextValue,e4=X.$getSessionDOMRenderConfig,t4=X.$inlineStylesFromStyleSheets,n4=X.$isBlockLevel,o4=X.$propagateTextAlignToBlockChildren,r4=X.$setRenderContextValue,s4=X.$updateRenderContextValue,i4=X.$withImportContext,a4=X.$withRenderContext,tw=X.BlockSchema,ga=X.CoreImportExtension,l4=X.CoreImportRules,Gf=X.DOMImportExtension,c4=X.DOMRenderExtension,u4=X.HorizontalRuleImportExtension,d4=X.HorizontalRuleImportRules,f4=X.ImportOverlays,nw=X.ImportSource,ow=X.ImportSourceDataTransfer,p4=X.ImportTextFormat,h4=X.ImportTextStyle,g4=X.ImportWhitespaceConfig,m4=X.InlineSchema,_4=X.NestedBlockSchema,y4=X.RenderContextExport,x4=X.RenderContextRoot,v4=X.RootSchema,S4=X.contextUpdater,ix=X.contextValue,C4=X.createImportState,b4=X.createRenderState,E4=X.defaultIsInline,N4=X.defaultPreservesWhitespace,T4=X.defineImportRule,O4=X.defineOverlayRules,D4=X.domOverride,M4=X.isElementOfTag,w4=X.parseSelector,Lr=X.sel;var fx={};de(fx,{$exportMimeTypeFromSelection:()=>$B,$generateJSONFromSelectedNodes:()=>pw,$generateNodesFromSerializedNodes:()=>hw,$getClipboardDataFromSelection:()=>gw,$getHtmlContent:()=>ux,$getLexicalContent:()=>dx,$handlePlainTextDrop:()=>kB,$handleRichTextDrop:()=>wB,$insertDataTransferForPlainText:()=>cw,$insertDataTransferForRichText:()=>uw,$insertGeneratedNodes:()=>Jf,$writeDragSourceToDataTransfer:()=>MB,ClipboardDOMImportExtension:()=>DB,ClipboardImportExtension:()=>cx,DEFAULT_IMPORT_MIME_TYPE:()=>Xf,DEFAULT_IMPORT_MIME_TYPE_PRIORITY:()=>qf,GetClipboardDataExtension:()=>vw,caretFromPoint:()=>iw,copyToClipboard:()=>AB,setLexicalClipboardDataTransfer:()=>mw});function iw(e,t,n=null){let o=Rs(n),r=n?FO(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=dc(c)}return!1})(i.offsetNode,n))return{node:i.offsetNode,offset:i.offset}}if(s){let i=n.getRootNode();if(Nf(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=E=>u<E.top?E.top-u:u>E.bottom?u-E.bottom:0,g=E=>c<E.left?E.left-c:c>E.right?c-E.right:0,y=f.createTreeWalker(d,NodeFilter.SHOW_TEXT),m=null,_=1/0,x=1/0;for(let E=y.nextNode();E;E=y.nextNode()){p.selectNodeContents(E);for(let D of p.getClientRects()){let O=h(D),T=g(D);(O<_||O===_&&T<x)&&(_=O,x=T,m=E)}}if(m===null)return null;let v=0,S=1/0,b=1/0;for(let E=0;E<=m.length;E++){p.setStart(m,E),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=E)}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 Ec(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 qf={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function aw(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(e):e}var rw=(e,t)=>{if(!F(t))return t.insertRawText(e),!0;t!==B()&&Sn(t);let n=o=>{let r=B();F(r)&&o(r)};return YO(e,{linebreak:()=>n(o=>o.insertParagraph()),tab:()=>n(o=>o.insertNodes([jd()])),text:o=>n(r=>r.insertText(o))}),!0},Xf={"application/x-lexical-editor":[(e,t,n)=>{try{let o=be(),r=JSON.parse(e);if(r&&r.namespace===o._config.namespace&&Array.isArray(r.nodes))return Jf(o,hw(r.nodes),t),!0}catch(o){console.error(o)}return n()}],"text/html":[(e,t,n)=>{try{let o=be(),r=new DOMParser().parseFromString(aw(e),"text/html");return Jf(o,Yf(o,r),t),!0}catch(o){return console.error(o),n()}}],"text/plain":[rw],"text/uri-list":[rw]};function TB(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 lw(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)&&TB(e.$importMimeType[r],s,n,t))return!0}return!1}var OB={$importMimeType:Xf,$insertDataTransfer:(e,t)=>lw({$importMimeType:Xf,priority:qf},e,t),priority:qf},cx={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(n,o)=>lw(t,n,o),priority:t.priority}),config:{$importMimeType:Xf,priority:qf},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"},DB={dependencies:[ga,[cx,{$importMimeType:{"text/html":[(e,t,n,o)=>{let r=new DOMParser().parseFromString(aw(e),"text/html"),s=ew(r,{context:[ix(nw,"paste"),ix(ow,o)]});return Jf(be(),s,t),!0}]}}]],name:"@lexical/clipboard/DOMImport"};function ux(e,t=B()){return t==null&&Ec(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?"":jf(e,t)}function dx(e,t=B()){return t==null&&Ec(166),F(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(pw(e,t))}function cw(e,t){let n=e.getData("text/plain")||e.getData("text/uri-list");n!=null&&t.insertRawText(n)}function uw(e,t,n){(function(){let o=nM(cx.name);return o?o.output:OB})().$insertDataTransfer(e,t)}var dw="application/x-lexical-drag";function MB(e,t){let n={editorKey:t.getKey()};e.setData(dw,JSON.stringify(n))}function ax(e){let t=e;if(so(t))if(t.offset===0)t=vn(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=vn(Xe(n,"next"));else{if(t.getNodeAtCaret()!==null)return t;t=Xe(n,"next")}}}function fw(e,t,n){let o=e.dataTransfer;if(o===null)return!1;let r=(function(f){let p=f.getData(dw);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=iw(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 OT(g,"next",h.offset);if(z(g))return M_(g,h.offset,"next");let y=g.getParent();return y===null?null:M_(y,g.getIndexWithinParent()+1,"next")})(e,t);if(s===null)return!1;let i=r.editorKey===t.getKey(),a=B();if(i){if(!F(a)||a.isCollapsed())return!1;if((function(f,p){let{anchor:h,focus:g}=Tr(Er(p),"next"),y=ax(f);return Qi(ax(h),y)<=0&&Qi(y,ax(g))<=0})(s,a))return e.preventDefault(),!0}let l=Un(s),c=so(l)?nf(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()||Ec(438),n(o,Hn(ws(d)),t),!i){let f=t.getRootElement(),p=f?f.ownerDocument:null,h=p?(function(g,y){for(let m of RO(y)){let _=bf(m);if(Tf(_)&&_.getKey()===g&&ye(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 wB(e,t){return fw(e,t,uw)}function kB(e,t){return fw(e,t,(n,o)=>cw(n,o))}function Jf(e,t,n){e.dispatchCommand(DO,{nodes:t,selection:n})||(n.insertNodes(t),(function(o){if(F(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=yn(r,"previous");if(i)if(so(i))s=i.origin;else{let a=oo(i,Qt(Ke(),"next").getFlipped());for(let l of a){if(H(l.origin)){s=l.origin;break}if(z(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 lx(e,t,n,o=[]){let r=t===null||n.isSelected(t),s=z(n)&&n.excludeFromCopy("clone"),i=n;t!==null&&H(i)&&(i=Ff(t,i,"clone"));let a=xT(i),l=z(i)?i.getChildren():[],c=a.children||[];H(i)&&i.getTextContentSize()===0&&(r=!1);let u=r&&Ne(t)&&z(n)?null:t;for(let d=0;d<l.length;d++){let f=l[d],p=lx(e,u,f,c);!r&&z(n)&&p&&n.extractWithChild(f,t,"clone")&&(r=!0)}if(r&&!s){let d=As(i);if(d.length>0){let f={};for(let p of d){let h=ea(i,p);h===null&&Ec(366,i.constructor.name,p);let g=[];lx(e,null,h,g),(g.length!==1||z(h)&&h.excludeFromCopy("clone"))&&Ec(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 pw(e,t){let n=[],o=Ke(),r=qd(t),s=(z(r)?r:o).getChildren();for(let i=0;i<s.length;i++)lx(e,t,s[i],n);return{namespace:e._config.namespace,nodes:n}}function hw(e){let t=[];for(let n of e)t.push($T(n));return t}var ma=null;async function AB(e,t,n){if(ma!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(sw(e,t,n))})});let o=e.getRootElement(),r=e._window||window,s=r.document,i=kr(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(rf,f=>(lo(f,ClipboardEvent)&&(d(),ma!==null&&(r.clearTimeout(ma),ma=null),c(sw(e,f,n))),!0),UT);ma=r.setTimeout(()=>{d(),ma=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function sw(e,t,n){if(n===void 0){let r=kr(e._window),s=B();if(!s||s.isCollapsed()||!r)return!1;let i=Cf(r,e.getRootElement()),a=i.anchorNode,l=i.focusNode;if(a!==null&&l!==null&&!VO(e,a,l))return!1;n=gw(s)}t.preventDefault();let o=t.clipboardData;return o!==null&&(mw(o,n),!0)}var IB=[["text/html",ux],["application/x-lexical-editor",dx]];function gw(e=B()){return(function(t,n){let o={"text/plain":""};for(let[r,s]of Object.entries(t))if(s){let i=xw(s,n);i!==null&&(o[r]=i)}return o})(_w(),e)}function mw(e,t){for(let[n]of IB)t[n]===void 0&&e.setData(n,"");for(let n in t){let o=t[n];o!==void 0&&e.setData(n,o)}}function _w(e=be()){let t=ao(e,vw.name);return t?t.output:yw}var yw={"application/x-lexical-editor":[(e,t)=>e?dx(be(),e):t()],"text/html":[(e,t)=>e?ux(be(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function xw(e,t){let n=o=>e[o]?e[o](t,n.bind(null,o-1)):null;return n(e.length-1)}function $B(e,t=B()){return xw(_w()[e]||[],t)}var vw={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:yw},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 lt=fx,F4=lt.$exportMimeTypeFromSelection,B4=lt.$generateJSONFromSelectedNodes,z4=lt.$generateNodesFromSerializedNodes,Sw=lt.$getClipboardDataFromSelection,W4=lt.$getHtmlContent,K4=lt.$getLexicalContent,U4=lt.$handlePlainTextDrop,Cw=lt.$handleRichTextDrop,H4=lt.$insertDataTransferForPlainText,px=lt.$insertDataTransferForRichText,V4=lt.$insertGeneratedNodes,bw=lt.$writeDragSourceToDataTransfer,j4=lt.ClipboardDOMImportExtension,Y4=lt.ClipboardImportExtension,G4=lt.DEFAULT_IMPORT_MIME_TYPE,q4=lt.DEFAULT_IMPORT_MIME_TYPE_PRIORITY,X4=lt.GetClipboardDataExtension,Qf=lt.caretFromPoint,hx=lt.copyToClipboard,Ew=lt.setLexicalClipboardDataTransfer;var gx={};de(gx,{RootElementExtension:()=>RB});var RB={build:e=>Rr(()=>e.getRootElement(),t=>e.registerRootListener(n=>{t.value=n})),name:"@lexical/extension/RootElement"};var PB=gx,mx=PB.RootElementExtension;var yx={};de(yx,{AriaLiveRegionExtension:()=>Nc,EditorModeAnnounceExtension:()=>WB,FocusManagerExtension:()=>HB,FocusTrapExtension:()=>KB,HistoryAnnounceExtension:()=>zB,RovingTabIndexExtension:()=>UB});var LB=["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 _x(e){return Array.from(e.querySelectorAll(LB))}function Zf(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=Nf(n)?n.host:n.parentNode}return!1}function FB(e,t={}){let n=t.initialFocus??"firstFocusable",o=e.ownerDocument,r=$s(o),s=ye(r)?r:null,i=_x(e);return n==="container"&&e.hasAttribute("tabindex")?e.focus():i.length>0?i[0].focus():e.hasAttribute("tabindex")&&e.focus(),ve(()=>{s!==null&&typeof s.focus=="function"&&Zf(o,s)&&s.focus()},Ps(e,"keydown",a=>{if(a.key!=="Tab")return;let l=_x(e);if(l.length===0)return void a.preventDefault();a.preventDefault();let c=l[0],u=l[l.length-1],d=$s(o),f=ye(d)&&Zf(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()}),Ps(o,"focusin",a=>{let l=j_(a);if(!ye(l)||Zf(e,l)||t.allowOutside!=null&&t.allowOutside(l))return;let c=_x(e);c.length>0?c[0].focus():e.hasAttribute("tabindex")&&e.focus()}))}function BB(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=$s(e.ownerDocument),l=i.findIndex(c=>c===a);s(i,l>=0?l:0)})(),ve(Ps(e,"keydown",i=>{let a=r();if(a.length===0)return;let l=$s(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 Nc={build(e,t,n){let o=n.getInitResult();return{...Je(t),announce(r){o.value=r===o.peek()?r+"\u200B":r}}},config:{owner:null,politeness:"polite"},dependencies:[mx],init:()=>St(""),name:"@lexical/a11y/AriaLiveRegion",register(e,t,n){let o=n.getInitResult(),{owner:r,politeness:s}=n.getOutput(),i=n.getDependency(mx).output,a=St(null);return ve(we(()=>{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}}),we(()=>{let l=a.value;l&&l.setAttribute("aria-live",s.value)}),we(()=>{let l=o.value,c=a.peek();c&&(c.textContent=l)}))}},zB={build:(e,t)=>Je(t),config:{disabled:!1,redone:"Redone",undone:"Undone"},dependencies:[Nc],name:"@lexical/a11y/HistoryAnnounce",register(e,t,n){let{disabled:o,redone:r,undone:s}=n.getOutput(),{announce:i}=n.getDependency(Nc).output;return we(()=>o.value?void 0:ve(e.registerCommand(_f,()=>(i(s.peek()),!1),Vo),e.registerCommand(gf,()=>(i(r.peek()),!1),Vo)))}},WB={build:(e,t)=>Je(t),config:{disabled:!1,editable:"Editor is editable",readOnly:"Editor is read-only"},dependencies:[Nc],name:"@lexical/a11y/EditorModeAnnounce",register(e,t,n){let{disabled:o,editable:r,readOnly:s}=n.getOutput(),{announce:i}=n.getDependency(Nc).output;return we(()=>o.value?void 0:e.registerEditableListener(a=>{i(a?r.peek():s.peek())}))}},KB={build:()=>vf(FB),name:"@lexical/a11y/FocusTrap",register:(e,t,n)=>()=>n.getOutput().dispose()},UB={build:()=>vf(BB),name:"@lexical/a11y/RovingTabIndex",register:(e,t,n)=>()=>n.getOutput().dispose()},HB={build:e=>vf((t,n)=>(function(o,r,s={}){let i=s.toolbarItemSelector??':scope > button:not([disabled]), :scope > [tabindex="0"]';return ve(o.registerCommand(_O,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),Ps(r,"keydown",a=>{if(a.key!=="Escape")return;let l=j_(a);if(ye(l)){let u=r.querySelectorAll(i),d=!1;for(let f of u)if(f===l||Zf(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=yx,ya=_a.AriaLiveRegionExtension,rG=_a.EditorModeAnnounceExtension,sG=_a.FocusManagerExtension,iG=_a.FocusTrapExtension,aG=_a.HistoryAnnounceExtension,lG=_a.RovingTabIndexExtension;var xx={};de(xx,{NormalizeInlineElementsExtension:()=>VB});function Nw(e){z(e)&&e.isInline()&&e.isEmpty()&&e.remove()}var VB={build:(e,t,n)=>Je(t),config:{disabled:!1},name:"@lexical/NormalizeInlineElements",register:(e,t,n)=>{let o=n.getOutput();return we(()=>{if(!o.disabled.value){let r=[];for(let{klass:s,transforms:i}of e._nodes.values())s.prototype instanceof io&&s.prototype.isInline!==io.prototype.isInline&&(i.add(Nw),r.push(()=>i.delete(Nw)));return()=>r.forEach(s=>s())}})}};var jB=xx,Tw=jB.NormalizeInlineElementsExtension;var vx={};de(vx,{NormalizeTripleClickSelectionExtension:()=>GB});var YB=new Set([AO,kO]),GB={build:(e,t,n)=>Je(t),config:{$fixFocusOverselection:function(){let e=B();if(F(e)&&!e.isCollapsed()){let t=Tr(Er(e),"next"),n=t.focus;for(so(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=vn(n.getSiblingCaret())),Ho(n)&&t.anchor.origin!==n.origin&&Or(n.origin)&&(n=vn(n));Uo(n)&&t.anchor.origin!==n.origin;)n=vn(Xe(n.origin,"next"));if(Ho(n)&&z(n.origin)&&(n=Un(Qt(n.origin,"previous")).getFlipped()),n=Un(n),!n.isSamePointCaret(t.focus)){let o=Hn(oo(t.anchor,n)),r=be().getRootElement(),s=r&&kr(r.ownerDocument.defaultView);s&&BT(ks(),o,be(),s,YB,r)}}},dateNow:()=>Date.now(),disabled:!1,thresholdMsec:100},name:"@lexical/NormalizeTripleClickSelection",register:(e,t,n)=>we(()=>{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 ve(e.registerCommand(OO,()=>(i(null)&&(s=0,o.$fixFocusOverselection.peek()()),!1),KT),Df(r,{mousedown:i,mouseup:i},!0))})})};var qB=vx,Ow=qB.NormalizeTripleClickSelectionExtension;var Nx={};de(Nx,{$createHeadingNode:()=>Ca,$createQuoteNode:()=>Tc,$isHeadingNode:()=>Ww,$isQuoteNode:()=>sz,DRAG_DROP_PASTE:()=>Cx,HeadingAnnounceExtension:()=>Fw,HeadingNode:()=>Us,QuoteNode:()=>Sa,RichTextExtension:()=>zw,RichTextImportExtension:()=>rz,RichTextImportRules:()=>Bw,ShadowRootQuoteRule:()=>nz,defaultShouldHandlePasteAsFiles:()=>Ex,eventFiles:()=>Fs,quoteShadowRootState:()=>op,registerRichText:()=>Hw});var XB=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function bx(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!XB.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Lw(e,t,n,o,r){let s=bx(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function JB(e,t){e.__tag=t.__tag}var QB=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=Lw(s.indent,0,0,1/0),r.__textFormat=bx(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:JB}},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:[],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=Lw(s.indent,0,0,1/0),r.__textFormat=bx(s.textFormat,0);let l=s.textStyle;return r.__textStyle=typeof l=="string"?l:"",r}}};function Dw(e){let t=Zi(e);return Ww(t)?t.getTag():null}var Fw={build:(e,t)=>Je(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 we(()=>s.value?void 0:e.registerMutationListener(Us,(a,{prevEditorState:l})=>{let c=null,u=null;for(let[d,f]of a)f==="created"&&c===null?c=e.read("latest",()=>Dw(d)):f==="destroyed"&&u===null&&(u=l.read(()=>Dw(d)));c!==null?i(o.peek().replace("%s",c.slice(1))):u!==null&&i(r.peek().replace("%s",u.slice(1)))},{skipInitialization:!0}))}},ez={$import:(e,t)=>{let n=Ca(t.nodeName.toLowerCase());return Ir(t,n),Mr(n,t),Dr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Lr.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},tz={$import:(e,t)=>{let n=Tc();return Mr(n,t),Ir(t,n),Dr(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Lr.tag("blockquote"),name:"@lexical/rich-text/blockquote"},nz={$import:(e,t)=>{let n=Tc({shadowRoot:!0});return Mr(n,t),Ir(t,n),Dr(n,t),[n.splice(0,0,e.$importChildren(t,{schema:tw}))]},match:Lr.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"},Bw=[ez,tz,{$import:(e,t,n)=>{let o=t.firstChild;return o&&ye(r=o)&&r.nodeName==="SPAN"&&r.style.fontSize==="26pt"?e.$importChildren(t):n();var r},match:Lr.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:Lr.tag("span"),name:"@lexical/rich-text/google-docs-title-span"}];function oz(e,t){return e&&t!==null?Bt(e,t):t}var zw={build:(e,t)=>Je(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:Ex},conflictsWith:["@lexical/plain-text"],dependencies:[Fw,hD,Tw,Ow,ga,[Gf,{rules:Bw}]],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]=oz(o[i],r[i]);return s})(e.escapeFormatTriggers,t.escapeFormatTriggers)),n},name:"@lexical/rich-text",nodes:()=>[Us,Sa],register:(e,t,n)=>we(()=>{let{escapeFormatTriggers:o,shouldHandlePasteAsFiles:r}=n.getOutput();return Hw(e,o,r)})},rz={dependencies:[zw],name:"@lexical/rich-text/Import"},Cx=sa("DRAG_DROP_PASTE_FILE"),op=Sf("shadowRoot",{parse:yf()}),Sa=class extends io{$config(){return this.config("quote",{extends:io,generated:ZB,importDOM:{blockquote:()=>({conversion:az,priority:0})},stateConfigs:[{flat:!0,stateConfig:op}]})}isShadowRoot(){return Qd(this,op)}setIsShadowRoot(t){return tf(this,op,t)}createDOM(t){let n=Ft().createElement("blockquote");return xo(n,t.theme.quote),n}updateDOM(t,n,o){return!1}exportDOM(t){let{element:n}=super.exportDOM(t);if(ye(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 Tc().updateFromJSON(t)}insertNewAfter(t,n){let o=at();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=at();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Tc(e){let t=Ji(new Sa);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function sz(e){return e instanceof Sa}var iz=hc()({tag:$r($O(["h1","h2","h3","h4","h5","h6"]),{field:"__tag"})}),Us=class extends io{constructor(n="h1",o){super(o);M(this,"__tag");this.__tag=n}$config(){return this.config("heading",{extends:io,generated:QB,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&&Mw(o)?{conversion:()=>({node:null}),priority:3}:null},span:n=>Mw(n)?{conversion:()=>({node:Ca("h1")}),priority:3}:null},json:iz})}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];xo(r,i)}return r}updateDOM(n,o,r){return n.__tag!==this.__tag}exportDOM(n){let{element:o}=super.exportDOM(n);if(ye(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?at():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=at();l.select(),this.replace(l,!0)}return i}collapseAtStart(){if(this.isEmpty()){let n=at();this.getChildren().forEach(o=>n.append(o)),this.replace(n)}return!0}extractWithChild(){return!0}};function Mw(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),Ir(e,n),Mr(n,e),Dr(n,e)),{node:n}}function az(e){let t=Tc();return Mr(t,e),Ir(e,t),Dr(t,e),{node:t}}function Ca(e="h1"){return Ji(new Us(e))}function Ww(e){return e instanceof Us}function ww(e){let t=Ko(e);return xn(t)}function Kw(e){let t=e.focus;return t.key==="root"&&t.offset===Ke().getChildrenSize()}function Uw(e){let t=e.focus;return t.key==="root"&&t.offset===0}function kw(e,t){if(!e.isCollapsed())return!1;let n=t==="next";if(!(n?Kw(e):Uw(e)))return!1;let o=e.focus.offset;return R_(Ke().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 lz={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function ep(e,t){return(function(n,o){if(!n.isCollapsed())return!1;let r=yn(n.focus,o),s=De(r.origin,Zd);if(!s)return!1;let i=n.focus.getNode();if(!s.is(i)&&!nc(i,s))return!1;let a=oo(r,Xe(s,o));if(a.getTextSlices().some(d=>d&&d.getTextContentSize()>0))return!1;let l=oo(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 Yd(Xe(s,o))){if(!d.origin.is(u.getParent())){if(R_(d.origin)){let f=Xe(u,o);return Hn(oo(f,f)),!0}break}if(!Zd(d.origin))break;u=d.origin}return!1})(e,t)||(function(n,o){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;let r=yn(n.anchor,o).getNodeAtCaret();return!(!Zd(r)||r.isInline()||(Hn(ws(Un(Qt(r,o)))),0))})(e,t)}function Aw(e){return xn(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function Sx(e){let t=Vd();t.add(e),Sn(t)}function Iw(e,t){if(!e.isCollapsed())return!1;let n=e.focus,o=n.getNode(),r=t?"previous":"next",s=yn(n,r);if(n.type==="element"&&z(o)&&ro(o)){let m=s.getNodeAtCaret();return!(m===null||!Aw(m)||(Sx(m.__key),0))}let i=De(z(o)?o:o.getParentOrThrow(),m=>z(m)&&!m.isInline()&&ro(m.getParent()));if(i===null)return!1;let a=Xe(i,r).getNodeAtCaret();if(a===null||!Aw(a))return!1;if(i.getTextContentSize()===0)return Sx(a.__key),!0;let l=be().getRootElement();if(l===null)return!1;let c=kr(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 $w(c,u,d,f,p),!1;let y=Ko(h);return $w(c,u,d,f,p),y!==null&&(h===u&&g===d||!y.is(i)&&!nc(y,i))&&(Sx(a.__key),!0)}function $w(e,t,n,o,r){t!==null&&o!==null&&e.setBaseAndExtent(t,n,o,r)}function Rw(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),o=De(z(n)?n:n.getParentOrThrow(),y=>z(y)&&!y.isInline());if(o===null)return!1;let r=be(),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(z(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=Xe(o,t?"previous":"next").getNodeAtCaret();if(l===null||!z(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=kr(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=Qf(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 tp(e,t){let n=Xe(e,t),o=n.getAdjacentCaret();o!==null&&z(o.origin)&&!o.origin.isInline()&&o.origin.isShadowRoot()?Hn(ws(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function np(e,t){let n=e.getNodes().map(s=>Xe(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 Hn(Tr(oo(vn(o),r),t)),vT(),!0}function Pw(e,t,n){n.preventDefault(),n.stopPropagation();let o=e.getNodes();if(o.length===0)return!0;let r=o.map(l=>Xe(l,"next")).sort(Qi),s=(t?r[0]:r[r.length-1]).origin,i=De(s,l=>l!==s&&z(l)&&!l.isInline())??Ke(),a=t?0:i.getChildrenSize();return i.select(a,a),!0}function Ex(e,t){return e.length>0&&!t}function Hw(e,t=St(lz),n=St(Ex)){return ve(e.registerCommand(of,o=>{let r=B();if(Ne(r)){let s=o.target;if(ye(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},ne),e.registerCommand(sf,o=>{let r=B();return F(r)?(r.deleteCharacter(o),!0):!!Ne(r)&&(r.deleteNodes(),!0)},ne),e.registerCommand(qT,o=>{let r=B();return!!F(r)&&(r.deleteWord(o),!0)},ne),e.registerCommand(GT,o=>{let r=B();return!!F(r)&&(r.deleteLine(o),!0)},ne),e.registerCommand(jT,o=>{let r=B();if(typeof o=="string")r!==null&&r.insertText(o);else{if(r===null)return!1;let s=o.dataTransfer;if(s!=null)px(s,r,e);else if(F(r)){let i=o.data;return i&&r.insertText(i),!0}}return!0},ne),e.registerCommand(TO,()=>{let o=B();return!!F(o)&&(o.removeText(),!0)},ne),e.registerCommand(eO,o=>{let r=B();return!(!F(r)&&!Ne(r)||(ST(r,o),0))},ne),e.registerCommand(wO,o=>{let r=B();return!(!F(r)&&!Ne(r)||(LT(r,o),0))},ne),e.registerCommand(ZT,o=>{let r=B();if(!F(r)&&!Ne(r))return!1;let s=r.getNodes();for(let i of s){let a=De(i,l=>z(l)&&!l.isInline());a!==null&&a.setFormat(o)}return!0},ne),e.registerCommand(B_,o=>{let r=B();return!!F(r)&&(r.insertLineBreak(o),!0)},ne),e.registerCommand(z_,()=>{let o=B();return!!F(o)&&(o.insertParagraph(),!0)},ne),e.registerCommand(oO,()=>{let o=jd(),r=B();return F(r)&&(o.setFormat(r.format),o.setStyle(r.style)),DT([o]),!0},ne),e.registerCommand(nO,()=>ky(o=>{let r=o.getIndent();o.setIndent(r+1)}),ne),e.registerCommand(V_,()=>ky(o=>{let r=o.getIndent();r>0&&o.setIndent(Math.max(0,r-1))}),ne),e.registerCommand(hO,o=>{let r=B();if(Ne(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!np(r,"previous"))return o.preventDefault(),tp(s[0],"previous"),!0;r=B()}}return F(r)&&(Uw(r)||!o.shiftKey&&ep(r,"previous")||!o.shiftKey&&Iw(r,!0)||!o.shiftKey&&Rw(r,!0))?(o.preventDefault(),!0):!1},ne),e.registerCommand(dO,o=>{let r=B();if(Ne(r)){let s=r.getNodes();if(s.length>0){if(!o.shiftKey||!np(r,"next"))return o.preventDefault(),tp(s[0],"next"),!0;r=B()}}return F(r)&&(Kw(r)||!o.shiftKey&&ep(r,"next")||!o.shiftKey&&Iw(r,!1)||!o.shiftKey&&Rw(r,!1))?(o.preventDefault(),!0):!1},ne),e.registerCommand(fO,o=>{let r=B();if(Ne(r)){let i=r.getNodes();if(i.length>0){let a=yc(i[0])?"next":"previous";if(!o.shiftKey||!np(r,a))return o.preventDefault(),tp(i[0],a),!0;r=B()}}if(!F(r))return!1;let s=yc(r.anchor.getNode())?"next":"previous";if(kw(r,s)||!o.shiftKey&&ep(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","start",t.peek()),by(r,!0)){let i=o.shiftKey;return o.preventDefault(),Cy(r,i,!0),!0}return!1},ne),e.registerCommand(pO,o=>{let r=B();if(Ne(r)){let i=r.getNodes();if(i.length>0){let a=yc(i[0])?"previous":"next";if(!o.shiftKey||!np(r,a))return o.preventDefault(),tp(i[0],a),!0;r=B()}}if(!F(r))return!1;let s=yc(r.anchor.getNode())?"previous":"next";if(kw(r,s)||!o.shiftKey&&ep(r,s))return o.preventDefault(),!0;if(o.shiftKey||va(r,"arrow","end",t.peek()),by(r,!1)){let i=o.shiftKey;return o.preventDefault(),Cy(r,i,!1),!0}return!1},ne),e.registerCommand(gO,o=>{let r=B();if(!Ne(r)&&ww(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(Is(a))return!1;let l=jD(a);return l.getIndent()>0&&(l.is(a)||a.is(l.getFirstDescendant()))})(r))return o.preventDefault(),e.dispatchCommand(V_);if(uc&&ac)return!1}else if(!Ne(r))return!1;return o.preventDefault(),e.dispatchCommand(sf,!0)},ne),e.registerCommand(mO,o=>{let r=B();return!(!Ne(r)&&ww(o.target))&&!(!F(r)&&!Ne(r))&&(o.preventDefault(),e.dispatchCommand(sf,!1))},ne),e.registerCommand(yO,o=>{let r=B();if(Ne(r)){let s=r.getNodes();s.length===1&&xn(s[0])&&!s[0].isInline()&&(r=s[0].selectNext())}if(!F(r))return!1;if(va(r,"enter","both",t.peek()),o!==null){if((uc||uf||lf)&&ac)return!1;if(o.preventDefault(),o.shiftKey)return e.dispatchCommand(B_,!1)}return e.dispatchCommand(z_)},ne),e.registerCommand(xO,()=>{let o=B();return!!F(o)&&(e.blur(),!0)},ne),e.registerCommand(QT,o=>{let[,r]=Fs(o);if(r.length>0){let s=o.clientX,i=o.clientY,a=Qf(s,i,e.getRootElement());if(a!==null){let{offset:l,node:c}=a,u=Ko(c);if(u!==null){let d=yT();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);Sn(f)}}return e.dispatchCommand(Cx,r),o.preventDefault(),!0}return Cw(o,e)},ne),e.registerCommand(JT,o=>{let[r]=Fs(o),s=B();return!(r&&!F(s)||(F(s)&&!s.isCollapsed()&&o.dataTransfer!==null&&(Ew(o.dataTransfer,Sw(s)),bw(o.dataTransfer,e)),0))},ne),e.registerCommand(XT,o=>{let[r]=Fs(o),s=B();if(r&&!F(s))return!1;let i=o.clientX,a=o.clientY,l=Qf(i,a,e.getRootElement());if(l!==null){let c=Ko(l.node);xn(c)&&o.preventDefault()}return!0},ne),e.registerCommand(MO,()=>{let o=B();return ef(F(o)&&Xd(o.anchor.getNode())!==null?o:null),!0},ne),e.registerCommand(rf,o=>(hx(e,lo(o,ClipboardEvent)?o:null),!0),ne),e.registerCommand(YT,o=>((async function(r,s){s.update(()=>{let i=B();F(i)&&!i.isCollapsed()&&rO(i)},{discrete:!0,tag:lc}),await hx(s,lo(r,ClipboardEvent)?r:null),s.update(()=>{let i=B();F(i)?i.removeText():Ne(i)&&i.getNodes().forEach(a=>a.remove())},{tag:lc})})(o,e),!0),ne),e.registerCommand(pf,o=>{let[,r,s]=Fs(o);return!(!n.peek()(r,s)||!e.dispatchCommand(Cx,r))||(!aa(o.target)||!IT(o.target))&&B()!==null&&((function(i,a){i.preventDefault(),a.update(()=>{let l=B(),c=lo(i,InputEvent)||lo(i,KeyboardEvent)?null:i.clipboardData;c!=null&&l!==null&&px(c,l,a)},{tag:hf})})(o,e),!0)},ne),e.registerCommand(vO,()=>{let o=B();return F(o)&&va(o,"space","both",t.peek()),!1},ne),e.registerCommand(SO,()=>{let o=B();return F(o)&&va(o,"tab","both",t.peek()),!1},ne),e.registerCommand(bO,o=>{let r=B();if(Ne(r))return Pw(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(!z(i))return!1;let a=i.getFirstChild();if(!xn(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},ne),e.registerCommand(EO,o=>{let r=B();if(Ne(r))return Pw(r,!0,o);if(!F(r))return!1;let{anchor:s,focus:i}=r,a=De(i.getNode(),u=>z(u)&&!u.isInline());if(a===null)return!1;let l=a.getFirstChild();if(!xn(l)||!l.isInline()||De(s.getNode(),u=>z(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)},ne))}var zt=Nx,kG=zt.$createHeadingNode,AG=zt.$createQuoteNode,IG=zt.$isHeadingNode,$G=zt.$isQuoteNode,RG=zt.DRAG_DROP_PASTE,PG=zt.HeadingAnnounceExtension,LG=zt.HeadingNode,FG=zt.QuoteNode,BG=zt.RichTextExtension,zG=zt.RichTextImportExtension,WG=zt.RichTextImportRules,KG=zt.ShadowRootQuoteRule,UG=zt.defaultShouldHandlePasteAsFiles,HG=zt.eventFiles,VG=zt.quoteShadowRootState,Vw=zt.registerRichText;var Tx={};de(Tx,{RichTextPlugin:()=>fz});function cz(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 uz({editor:e,ErrorBoundary:t}){return(function(n,o){let[r,s]=Tn(()=>[l=>n.registerDecoratorListener(l),()=>n.getDecorators()],[n]),i=yp(r,s,s),a=(function(l){let[c,u]=Tn(()=>[l.registerRootListener.bind(l),l.getRootElement.bind(l)],[l]);return yp(c,u,u)})(n);return Tn(()=>{let l=u=>n._onError(u),c=[];for(let u in i){let d=n.getElementByKey(u);if(d!==null){let f=Mt(o,{onError:l,children:Mt(Jx,{fallback:null,children:i[u]})});c.push(Yx(f,d,u))}}return c},[o,i,n,a])})(e,t)}function dz({editor:e,ErrorBoundary:t}){return(function(n){let o=fa.maybeFromEditor(n);if(o&&o.hasExtensionByName(aD.name)){for(let r of["@lexical/plain-text","@lexical/rich-text"])o.hasExtensionByName(r)&&cz(320,r);return!0}return!1})(e)?null:Mt(uz,{editor:e,ErrorBoundary:t})}var Yw=Cn?co:Ze;function jw(e){return e.read("latest",Rf(e.isComposing()))}function fz({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[o]=Yt();return(function(r){Yw(()=>ve(Vw(r),gD(r)),[r])})(o),kf(wf,{children:[e,Mt(pz,{content:t}),Mt(dz,{editor:o,ErrorBoundary:n})]})}function pz({content:e}){let[t]=Yt(),n=(function(r){let[s,i]=ke(()=>jw(r));return Yw(()=>{function a(){let l=jw(r);i(l)}return a(),ve(r.registerUpdateListener(()=>{a()}),r.registerEditableListener(()=>{a()}))},[r]),s})(t),o=JO();return n?typeof e=="function"?e(o):e:null}var hz=Tx,Gw=hz.RichTextPlugin;var Dx={};de(Dx,{ContentEditable:()=>mz,ContentEditableElement:()=>Xw});var Ox=Cn?co:Ze;function gz({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[E,D]=ke(e.isEditable()),O=Zx(A=>{A&&A.ownerDocument&&A.ownerDocument.defaultView?e.setRootElement(A):e.setRootElement(null)},[e]),T=Tn(()=>(function(...A){return $=>{for(let I of A)typeof I=="function"?I($):I!=null&&(I.current=$)}})(b,O),[O,b]);return Ox(()=>(D(e.isEditable()),e.registerEditableListener(A=>{D(A)})),[e]),Mt("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?o:void 0,"aria-describedby":r,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":E&&y==="combobox"?!!i:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?d:void 0,"aria-readonly":!E||void 0,"aria-required":f,autoCapitalize:p,className:h,contentEditable:E,"data-testid":v,id:g,ref:T,role:y,spellCheck:m,style:_,tabIndex:x??(E?void 0:-1),...S})}var Xw=Wr(gz);function qw(e){return e.read("latest",Rf(e.isComposing()))}var mz=Wr(_z);function _z(e,t){let{placeholder:n,...o}=e,[r]=Yt();return kf(wf,{children:[Mt(Xw,{editor:r,...o,ref:t}),n!=null&&Mt(yz,{editor:r,content:n})]})}function yz({content:e,editor:t}){let n=(function(i){let[a,l]=ke(()=>qw(i));return Ox(()=>{function c(){let u=qw(i);l(u)}return c(),ve(i.registerUpdateListener(()=>{c()}),i.registerEditableListener(()=>{c()}))},[i]),a})(t),[o,r]=ke(t.isEditable());if(Ox(()=>(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:Mt("div",{"aria-hidden":!0,children:s})}var Jw=Dx,Qw=Jw.ContentEditable,u5=Jw.ContentEditableElement;var wx={};de(wx,{LexicalErrorBoundary:()=>xz});var Mx=class extends Xx{constructor(){super(...arguments);M(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 xz({children:e,fallback:t,onError:n}){return Mt(Mx,{fallback:t===void 0?Mt("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}var vz=wx,Zw=vz.LexicalErrorBoundary;var kx={};de(kx,{HistoryExtension:()=>rp,SharedHistoryExtension:()=>Cz,createEmptyHistoryState:()=>rk,registerHistory:()=>ok});function Sz(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(VT)&&(s=o,i=r,a=l),p.has(af))return r=0,o=h,2;p.has(HT)&&a&&(o=s,r=i,l=a);let g=p.has(hf)||p.has(lc)?0:(function(m,_,x,v,S){if(m===null||x.size===0&&v.size===0&&!S)return 0;let b=_._selection,E=m._selection;if(S)return 1;if(!(F(b)&&F(E)&&E.isCollapsed()&&b.isCollapsed()))return 0;let D=(function(oe,Z,ae){let ee=oe._nodeMap,Re=[];for(let le of Z){let V=ee.get(le);V!==void 0&&Re.push(V)}for(let[le,V]of ae){if(!V)continue;let te=ee.get(le);te===void 0||Is(te)||Re.push(te)}return Re})(_,x,v);if(D.length===0)return 0;if(D.length>1){let oe=_._nodeMap,Z=oe.get(b.anchor.key),ae=oe.get(E.anchor.key);return Z&&ae&&!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,R=E.anchor;if(I.key!==R.key||I.type!=="text")return 0;let K=I.offset,J=R.offset,Q=$.length-A.length;return Q===1&&J===K-1?2:Q===-1&&J===K+1?3:Q===-1&&J===K?4:0})(l,c,d,f,e.isComposing()),y=(()=>{let m=u===null||u.editor===e,_=p.has(tO);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,E){let D=b._nodeMap.get(S),O=E._nodeMap.get(S),T=b._selection,A=E._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(E.read(()=>O.exportJSON()))})(Array.from(d)[0],l,c)?0:1})();return o=h,r=g,y}}function ek(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 tk(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function ok(e,t,n,o=Date.now,r,s=null){let i=Sz(e,n,o),a=()=>{r&&r(t)};return a(),ve(e.registerCommand(_f,()=>((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=ek(h,p);g!==null&&(d.push(g),l.dispatchCommand(sc,!0))}f.length===0&&l.dispatchCommand(ic,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:af})}})(e,t,r),!0),ne),e.registerCommand(gf,()=>((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=ek(h,p);g!==null&&(f.push(g),l.dispatchCommand(ic,!0))}d.length===0&&l.dispatchCommand(sc,!1),c.current=h||null,u&&u(c),h&&h.editor.setEditorState(h.editorState,{tag:af})}})(e,t,r),!0),ne),e.registerCommand(zT,()=>(tk(t,r),!1),ne),e.registerCommand(WT,()=>(tk(t,r),e.dispatchCommand(sc,!1),e.dispatchCommand(ic,!1),!0),ne),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(sc,!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(ic,!0)}}else if(m===2)return;t.current={editor:e,editorState:l},a()}))}function rk(){return{current:null,redoStack:[],undoStack:[]}}var rp={build:(e,{delay:t,createInitialHistoryState:n,disabled:o,maxDepth:r,now:s},i)=>({...Je({delay:t,disabled:o,historyState:n(e),maxDepth:r,now:s}),...i.getInitResult()}),config:{createInitialHistoryState:rk,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=>_c(()=>{o.value=a!=null&&a.undoStack.length>0,r.value=a!=null&&a.redoStack.length>0});return we(()=>{if(!s.disabled.value)return ok(e,s.historyState.value,s.delay,()=>s.now.peek()(),i,s.maxDepth);i(null)})}};function nk(e){let t=e?ao(e,"@lexical/extension/HMR"):void 0;return t?t.output.restoreCount.value:0}var Cz={build:(e,{disabled:t,parentEditor:n})=>Je({disabled:t,parentEditor:n||e._parentEditor}),config:{disabled:!1,parentEditor:null},dependencies:[[rp,{disabled:!0}]],name:"@lexical/history/SharedHistory",register:(e,t,n)=>we(()=>{let{disabled:o,parentEditor:r}=n.getOutput();if(!o.value){let{output:s}=n.getDependency(rp);nk(e),nk(r.value);let i=(function(l){return l?ao(l,rp.name):null})(r.value);if(!i)return;let a=i.output;_c(()=>{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 sp=kx,v5=sp.HistoryExtension,S5=sp.SharedHistoryExtension,ip=sp.createEmptyHistoryState,sk=sp.registerHistory;var Ax={};de(Ax,{HistoryPlugin:()=>bz,createEmptyHistoryState:()=>ip});function bz({delay:e,externalHistoryState:t}){let[n]=Yt();return(function(o,r,s=1e3){let i=Tn(()=>r||ip(),[r]);Ze(()=>sk(o,i,s),[s,o,i])})(n,t,e),null}var ik=Ax,ak=ik.HistoryPlugin,O5=ik.createEmptyHistoryState;var Lx={};de(Lx,{$createAutoLinkNode:()=>hk,$createLinkNode:()=>Dc,$isAutoLinkNode:()=>Zt,$isLinkNode:()=>En,$toggleLink:()=>ap,AutoLinkAnnounceExtension:()=>gk,AutoLinkExtension:()=>Kz,AutoLinkNode:()=>Hs,ClickableLinkExtension:()=>Rz,LinkExtension:()=>up,LinkImportExtension:()=>$z,LinkImportRules:()=>mk,LinkNode:()=>Yo,TOGGLE_LINK_COMMAND:()=>lp,autoLinkEmailMatcher:()=>Fz,autoLinkUrlMatcher:()=>Lz,createLinkMatcherWithRegExp:()=>xk,formatUrl:()=>Ix,registerAutoLink:()=>Nk,registerClickableLink:()=>yk,registerLink:()=>_k});var Ez=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Px(e,t){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e!="string"||!Ez.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function pk(e,t,n,o,r){let s=Px(e,t);return s>=n&&s<=o&&Number.isInteger(s)?s:t}function Nz(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}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:[],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=pk(s.indent,0,0,1/0),r.__textFormat=Px(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:Nz}};function Oz(e,t){e.__isUnlinked=t.__isUnlinked}var Dz=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=pk(s.indent,0,0,1/0),r.__textFormat=Px(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:Oz}},lk=new Set(["http:","https:","mailto:","sms:","tel:"]),Mz=hc()({rel:$r(Of(gc(),{defaultAsNull:!0}),{field:"__rel"}),target:$r(Of(gc(),{defaultAsNull:!0}),{field:"__target"}),title:$r(Of(gc(),{defaultAsNull:!0}),{field:"__title"}),url:$r(gc(),{field:"__url",getter:"getURL",setter:"setURL"})}),Yo=class extends io{constructor(n="",o={},r){super(r);M(this,"__url");M(this,"__target");M(this,"__rel");M(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:io,generated:Tz,importDOM:{a:()=>({conversion:kz,priority:1})},json:Mz})}createDOM(n){let o=Ft().createElement("a");return this.updateLinkDOM(null,o,n),xo(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=Ix(n);try{let r=new URL(Ix(n));if(!lk.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&&!lk.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=Ud(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 ck(e){let t=yn(e,"next");return[t,t.getFlipped()]}function uk(e,t){for(let n of t)if(n.origin.isAttached()){let o=Un(n);return void PT(e,o)}}function wz(e){let t=B(),n=null,o=null;function r(){F(t)&&(uk(t.anchor,n),uk(t.focus,o),oa(t))}F(t)&&(n=ck(t.anchor),o=ck(t.focus));let s=!1;for(let a of Qt(e,"next")){let l=a.origin;if(z(l)&&!l.isInline()){let c=l.getChildren();if(c.length>0){let u=Ud(e);u.append(...c),l.append(u),s=!0}ta(l,vn(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=Un(Qt(c,"next"));return[p,p.getFlipped()]}if(e.isAttached()){let a=e.getPreviousSibling();if(En(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();En(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 kz(e){let t=null;if(la(e)){let n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Dc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Dc(e="",t){return Ji(new Yo(e,t))}function En(e){return e instanceof Yo}var Az=hc()({isUnlinked:$r(yf(),{field:"__isUnlinked"})}),Hs=class extends Yo{constructor(n="",o={},r){super(n,o,r);M(this,"__isUnlinked");this.__isUnlinked=o.isUnlinked!==void 0&&o.isUnlinked!==null&&o.isUnlinked}$config(){return this.config("autolink",{extends:Yo,generated:Dz,json:Az})}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 hk(e="",t){return Ji(new Hs(e,t))}function Zt(e){return e instanceof Hs}var lp=sa("TOGGLE_LINK_COMMAND");function dk(e,t){if(e.type==="element"){let n=e.getNode();return z(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 ap(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=B();if(i===null||!F(i)&&!Ne(i))return;if(Ne(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(n===null){let f=De(d,p=>!Zt(p)&&En(p));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=De(d,p=>!Zt(p)&&En(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=Dc(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=De(u,f=>!Zt(f)&&En(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=De(d,p=>!Zt(p)&&En(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())||z(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,E=S===m.length-1;if(b)x.forEach(D=>h.insertBefore(D));else if(E)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=Ud(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=De(u,En);if(d!==null)return c(d)}(function(u){let d=B();if(!F(d))return u();let f=oa(d),p=f.isBackward(),h=dk(f.anchor,p?-1:0),g=dk(f.focus,p?0:-1);if(u(),h||g){let y=B();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")}Sn(oa(m))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let f=De(d,En);if(f){c(f);continue}if(z(d)){if(!d.isInline())continue;if(En(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();En(p)&&p.is(u)?p.append(d):(u=Dc(n,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var Iz=/^\+?[0-9\s()-]{5,}$/;function Ix(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Iz.test(e)?`tel:${e}`:`https://${e}`}var gk={build:(e,t)=>Je(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 we(()=>a.value?void 0:e.registerMutationListener(Hs,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}))}},mk=[{$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 ZM(e.$importChildren(t),()=>Dc(n,o))},match:Lr.tag("a"),name:"@lexical/link/a"}];function _k(e,t){return ve(e.registerNodeTransform(Yo,wz),e.registerCommand(lp,n=>{let o=t.validateUrl.peek(),r=t.attributes.peek();if(n===null)return ap(null),!0;if(typeof n=="string")return!(o!==void 0&&!o(n)||(ap(n,r),0));{let{url:s,...i}=n;return!(o!==void 0&&!o(s)||(ap(s,{...r,...i}),0))}},ne),we(()=>{let n=t.validateUrl.value;if(!n)return;let o=t.attributes.value;return e.registerCommand(pf,r=>{let s=B();if(!F(s)||s.isCollapsed()||!lo(r,ClipboardEvent)||r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!n(i)&&!s.getNodes().some(a=>z(a)||H(a)&&!a.isSimpleText())&&(e.dispatchCommand(lp,{...o,url:i}),r.preventDefault(),!0)},Vo)}))}var up={build:(e,t,n)=>Je(t),config:{attributes:void 0,validateUrl:void 0},dependencies:[ga,[Gf,{rules:mk}]],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)=>_k(e,n.getOutput())},$z={dependencies:[up],name:"@lexical/link/Import"};function yk(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=zO(i);if(a===null)return;let l=null,c=null,u=!1;if(a.update(()=>{let f=Ko(i);if(f!==null){let p=De(f,z);if(!t.disabled.peek())if(En(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",B);(!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 Df(r,{auxclick:o,click:o},n)})}var Rz={build:(e,t,n)=>Je(t),config:{disabled:!1,newTab:!1},dependencies:[up],name:"@lexical/link/ClickableLink",register:(e,t,n)=>yk(e,n.getOutput())};function xk(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 Pz=/((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u,Lz=e=>{let t=Pz.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}`}},Fz=xk(/(([^<>()[\]\\.,;:\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 $x(e,t){for(let n=0;n<t.length;n++){let o=t[n](e);if(o)return o}return null}var vk=/[.,;\s]/;function cp(e,t){return t.test(e)}function Sk(e,t){return cp(e[e.length-1],t)}function Rx(e,t){return cp(e[0],t)}function Ck(e,t){let n=e.getPreviousSibling();return z(n)&&(n=n.getLastDescendant()),n===null||Or(n)||H(n)&&Sk(n.getTextContent(),t)}function bk(e,t){let n=e.getNextSibling();return z(n)&&(n=n.getFirstDescendant()),n===null||Or(n)||H(n)&&Rx(n.getTextContent(),t)}function Bz(e,t,n,o,r){return!!(e>0?cp(o[e-1],n):Ck(r[0],n))&&(t<o.length?cp(o[t],n):bk(r[r.length-1],n))}function zz(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 Wz(e,t,n,o){let r=hk(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=Kn(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=B(),d=u?u.getNodes().find(H):void 0,f=Kn(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):Ne(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function fk(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 Oc(e),void n(null,e.getURL())}let i=e.getTextContent(),a=$x(i,t);if(a===null||a.text!==i||!Ck(e,o)||!bk(e,o))return Oc(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 Oc(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 Ek={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:vk};function Nk(e,t=Ek){let{matchers:n,changeHandlers:o,excludeParents:r,separatorRegex:s=vk}=t,i=(a,l)=>{for(let c of o)c(a,l)};return ve(e.registerNodeTransform(wr,a=>{let l=a.getParentOrThrow(),c=a.getPreviousSibling();if(Zt(l))fk(l,n,i,s);else if(!En(l)&&!r.some(u=>u(l))){if(a.isSimpleText()&&(Rx(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=$x(_,f))&&m!==null;){let v=m.index,S=v+m.length;if(Bz(x+v,x+S,h,y,g)){let[b,,E,D]=zz(g,x+v,x+S),O=!1;for(let A of E){let $=A.getParent();if(Zt($)&&!$.getIsUnlinked()){O=!0;break}}if(O){x+=S,_=_.substring(S);continue}let T=Wz(E,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(!Rx(m,p))return Oc(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=$x(x,d);v!==null&&v.text===x&&(g.append(u),fk(g,d,f,p),f(null,g.getURL()))}}var _;!Zt(y)||y.getIsUnlinked()||Sk(m,p)||y.is(u.getNextSibling())&&u.getParent()===y.getParent()&&(Oc(y),f(null,y.getURL()))}})(a,n,i,s)}}),e.registerCommand(lp,a=>{let l=B();return!(a!==null||!F(l))&&(l.extract().forEach(c=>{let u=c.getParent();Zt(u)&&(u.setIsUnlinked(!u.getIsUnlinked()),u.markDirty())}),!1)},Vo))}var Kz={config:Ek,dependencies:[gk,up],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:[Hs],register:Nk};var nt=Lx,P5=nt.$createAutoLinkNode,L5=nt.$createLinkNode,F5=nt.$isAutoLinkNode,Fx=nt.$isLinkNode,B5=nt.$toggleLink,z5=nt.AutoLinkAnnounceExtension,W5=nt.AutoLinkExtension,K5=nt.AutoLinkNode,U5=nt.ClickableLinkExtension,H5=nt.LinkExtension,V5=nt.LinkImportExtension,j5=nt.LinkImportRules,dp=nt.LinkNode,Bx=nt.TOGGLE_LINK_COMMAND,Y5=nt.autoLinkEmailMatcher,G5=nt.autoLinkUrlMatcher,q5=nt.createLinkMatcherWithRegExp,X5=nt.formatUrl,J5=nt.registerAutoLink,Q5=nt.registerClickableLink,Tk=nt.registerLink;var zx={};de(zx,{LinkPlugin:()=>Uz});function Uz({validateUrl:e,attributes:t}){let[n]=Yt();return Ze(()=>{if(!n.hasNodes([dp]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),Ze(()=>Tk(n,Je({attributes:t,validateUrl:e})),[n,e,t]),null}var Hz=zx,Ok=Hz.LinkPlugin;var Vz=e=>t=>{let n=Ke();if(e&&typeof e=="object"&&"html"in e){let o=new DOMParser().parseFromString(e.html,"text/html");n.append(...Yf(t,o))}else n.append(at().append(Kn(e??"")))},jz=()=>{let e=B();if(!F(e))return null;let t=e.anchor.getNode();return Fx(t)?t:Fx(t.getParent())?t.getParent():null},Yz=()=>{let[e]=Yt();return Ze(()=>e.registerNodeTransform(wr,t=>{t.getFormat()!==0&&t.setFormat(0),t.getStyle()!==""&&t.setStyle("")}),[e]),null},Gz=()=>{let[e]=Yt(),[t,n]=ke(null),o=()=>e.getEditorState().read(()=>n(jz()?.getURL()??"")),r=()=>{e.dispatchCommand(Bx,t||null),n(null)},s=()=>{e.dispatchCommand(Bx,null),n(null)};return t===null?N.createElement(We,{type:"button",variant:"secondary",onClick:o},"Link"):N.createElement("div",{className:"flex flex-col gap-2"},N.createElement(on,{htmlFor:"ks-pages-link-address"},"Link address"),N.createElement(_t,{id:"ks-pages-link-address",type:"url",value:t,onChange:i=>n(i.target.value)}),N.createElement("div",{className:"flex gap-2"},N.createElement(We,{type:"button",onClick:r},"Save link"),N.createElement(We,{type:"button",variant:"secondary",onClick:s},"Remove link")))},qz=({fieldKey:e,onChange:t,children:n})=>{let[o]=Yt();return N.createElement("div",{"data-rich-text-field":e,onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||o.getEditorState().read(()=>t(e,{html:jf(o,null)}))},className:"flex flex-col gap-2"},n)};function Wx({field:e,value:t,onChange:n}){let o={namespace:`ks-pages-${e.key}`,nodes:[dp],editorState:Vz(t??e.default),onError:r=>{throw r}};return N.createElement(qO,{initialConfig:o},N.createElement(qz,{fieldKey:e.key,onChange:n},N.createElement(Gw,{contentEditable:N.createElement(Qw,{id:`ks-pages-field-${e.key}`,className:"ks-input min-h-24"}),ErrorBoundary:Zw}),N.createElement(ak,null),N.createElement(Ok,null),N.createElement(Yz,null),N.createElement(Gz,null)))}var Xz=({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"?N.createElement($u,{id:r.id,defaultChecked:t==="true",onChange:s=>n(e.key,String(s.target.checked))}):e.kind==="one_of"?N.createElement(yt,{id:r.id,defaultValue:t??e.default??"",onChange:s=>n(e.key,s.target.value)},e.options.map(s=>N.createElement("option",{key:s,value:s},s))):e.kind==="long_text"?N.createElement(pC,{...r,rows:4}):e.kind==="number"?N.createElement(_t,{...r,type:"number"}):e.kind==="address"?N.createElement(_t,{...r,type:"url"}):N.createElement(_t,{...r,type:"text"})},Jz=["text","long_text","address","number","list","data",void 0],Mc=e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&"value"in e,Qz=({field:e,stored:t,valueNames:n,onChange:o,onBind:r})=>{let s=Mc(t)?t:null,i=s?s.fallback??"":t??e.default??"";return N.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)},N.createElement("option",{value:""},"Typed text"),Object.entries(n).map(([a,l])=>N.createElement("option",{key:a,value:a},l)))};function Kx({element:e,definition:t,alignments:n,valueNames:o={},onChange:r,onArrange:s,onBind:i,onRemove:a}){return N.createElement("aside",{"data-element-fields":!0,className:"flex flex-col gap-3"},t.fields.map(l=>N.createElement("div",{key:`${e.id}-${l.key}`,className:"flex flex-col gap-1"},N.createElement(on,{htmlFor:`ks-pages-field-${l.key}`},l.label),Jz.includes(l.kind)&&Object.keys(o).length>0&&N.createElement(Qz,{field:l,stored:e.fields[l.key],valueNames:o,onChange:r,onBind:i}),l.kind==="list"&&!Mc(e.fields[l.key])&&N.createElement(Cg,{field:l,entries:e.fields[l.key]??l.default??[],onChange:r}),l.kind==="data"&&N.createElement("p",{className:"ks-hint"},"Filled with data the host supplies on a template page"),l.kind==="rich_text"&&N.createElement(Wx,{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"&&N.createElement(Xz,{key:JSON.stringify(e.fields[l.key]??null),field:l,value:Mc(e.fields[l.key])?e.fields[l.key].fallback??"":e.fields[l.key],onChange:(c,u)=>Mc(e.fields[c])?i(c,e.fields[c].value,u):r(c,u)}),Mc(e.fields[l.key])&&N.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"))),N.createElement("div",{className:"flex flex-col gap-1"},N.createElement(on,{htmlFor:"ks-pages-element-align"},"Horizontal alignment"),N.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=>N.createElement("option",{key:l,value:l},l)))),N.createElement(We,{type:"button",variant:"danger",onClick:()=>a(e.id)},"Remove element"))}var Dk=e=>e.sections.flatMap(t=>t.rows).flatMap(t=>t.columns),fp=(e,t)=>Dk(e).flatMap(n=>n.elements).find(n=>n.id===t),pp=(e,t)=>{let n=e.sections.flatMap(o=>o.rows);return[...e.sections,...n,...Dk(e)].find(o=>o.id===t)};var Zz=[{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}],eW=[["[data-element-id]","Element"],["[data-column-id]","Column"],["[data-row-id]","Row"],["[data-section-id]","Section"]],tW=e=>eW.map(([t,n])=>[e.closest(t),n]).filter(([t])=>t).reduce((t,n)=>!t||t[0].contains(n[0])?n:t,null),nW=[Qh.configure({preventActivation:()=>!1}),Jh];function Ux({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:E,live_url:D,back_url:O,undo_url:T,redo_url:A,undoable:$,redoable:I,token:R}){let[K,J]=ke(r),[Q,oe]=ke($),[Z,ae]=ke(I),[ee,Re]=ke(s),[le,V]=ke(null),[te,Qe]=ke(null),[Ue,ct]=ke(null),[Ct,bt]=ke("desktop"),Fr=qo(null),So=qo(null),[ht,Co]=ke(null),[fe,ze]=ke([]),ot=qo(null),Nn=qo(null),rt=qo(null),Pe=({canvas:L,document:q,undoable:j,redoable:ge})=>{ct(null),J(L),Re(q),j!==void 0&&oe(j),ge!==void 0&&ae(ge)},wt=({error:L})=>ct(L),wc=L=>{ct(null),Qe(L)},kc=L=>{rt.current.querySelectorAll("[data-hovered]").forEach(en=>delete en.dataset.hovered);let[q,j]=tW(L.target)??[];if(!q)return;q.dataset.hovered="";let ge=j==="Element"&&fp(ee,q.dataset.elementId);q.dataset.kind=ge?o.find(en=>en.key===ge.key)?.name??j:j},hp=L=>{let q=L.target.closest("[data-element-id]");if(q)return L.preventDefault(),Qe(null),V(q.dataset.elementId);let j=L.target.closest("[data-column-id]");j&&(V(null),Qe({kind:"column",id:j.dataset.columnId,rowId:j.closest("[data-row-id]").dataset.rowId,sectionId:j.closest("[data-section-id]").dataset.sectionId}))},Vn=le&&fp(ee,le),Br=Vn&&o.find(L=>L.key===Vn.key);co(()=>{rt.current.innerHTML=K},[K]),Ze(()=>{let L=new O0;ot.current=L;let q=[...Nn.current.querySelectorAll("[data-element-key]")].map(ge=>new us({id:`palette-${ge.dataset.elementKey}`,element:ge,feedback:"clone",data:{key:ge.dataset.elementKey}},L)),j=()=>rt.current.querySelectorAll("[data-drop-target]").forEach(ge=>delete ge.dataset.dropTarget);return L.monitor.addEventListener("dragover",({operation:ge})=>{j(),ge.target?.element&&(ge.target.element.dataset.dropTarget="")}),L.monitor.addEventListener("dragend",({operation:ge,canceled:en})=>{j();let{source:Le,target:Et}=ge;if(en||!Et)return;if(Le.data?.key)return Et.data?.columnId&&J0(i,R,Le.data.key,Et.data.columnId).then(Pe);if(Le.type!=="element")return dg(u,R,Le.id,Le.group==="page"?null:Le.group,Le.index).then(Pe,wt);let zr=Le.group===Le.initialGroup&&Et.data?.columnId&&Et.data.columnId!==Le.group?Et.data.columnId:Le.group,gp=zr===Le.group?Le.index:0;dg(u,R,Le.id,zr,gp).then(Pe,wt)}),()=>{q.forEach(ge=>ge.destroy()),L.destroy()}},[]),Ze(()=>{let L=[...rt.current.querySelectorAll("[data-column-id]")].map(j=>new xi({id:`drop-${j.dataset.columnId}`,element:j,data:{columnId:j.dataset.columnId},accept:ge=>!ge.type||ge.type==="element"},ot.current)),q=[...rt.current.querySelectorAll("[data-element-id]")].map(j=>{let ge=j.closest("[data-column-id]"),en=[...ge.children].indexOf(j);return new bi({id:j.dataset.elementId,element:j,index:en,group:ge.dataset.columnId,type:"element",accept:"element",sensors:nW},ot.current)});return()=>[...L,...q].forEach(j=>j.destroy())},[K]);let bo=L=>[["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(([q,j,ge,en])=>{let Le=L.closest(j);if(!Le)return[];let Et=q==="element"&&fp(ee,Le.dataset[ge]);return[{kind:q,id:Le.dataset[ge],label:en??o.find(zr=>zr.key===Et?.key)?.name??"Element"}]}),Vs=({kind:L,id:q})=>{if(ct(null),L==="element")return Qe(null),V(q);let j=rt.current.querySelector(`[data-${L}-id="${q}"]`);V(null),Qe({kind:L,id:q,rowId:j.closest("[data-row-id]")?.dataset.rowId,sectionId:j.closest("[data-section-id]")?.dataset.sectionId})};Ze(()=>{let L=fe[fe.length-2],q=j=>{j.key!=="Escape"||!L||j.target.closest("input, textarea, select")||Vs(L)};return window.document.addEventListener("keydown",q),()=>window.document.removeEventListener("keydown",q)},[fe]);let Wt=le??te?.id;Ze(()=>{rt.current.querySelectorAll("[data-selected]").forEach(ge=>delete ge.dataset.selected);let L=Wt&&rt.current.querySelector(`[data-element-id="${Wt}"], [data-column-id="${Wt}"], [data-row-id="${Wt}"], [data-section-id="${Wt}"]`);if(!L)return ze([]),Co(null);L.dataset.selected="",ze(bo(L));let q=Fr.current.getBoundingClientRect(),j=L.getBoundingClientRect();Co({top:j.top-q.top,left:j.left-q.left})},[K,Wt,Ct]),Ze(()=>{let L=window.document.createElement("span"),q=Zz.flatMap(({kind:j,selector:ge,id:en,group:Le})=>[...rt.current.querySelectorAll(ge)].map(Et=>new bi({id:en(Et),element:Et,index:[...Et.parentElement.children].indexOf(Et),group:Le(Et),type:j,accept:j,handle:Wt===en(Et)?So.current:L},ot.current)));return()=>q.forEach(j=>j.destroy())},[K,Wt]);let Ac=L=>{let q=L.kind==="column"&&pp(ee,L.rowId),j=q?{wide:p[q.columns.length]??"1/1"}:{};return{...f[L.kind],...j,...pp(ee,L.id)}},Ic=()=>Au(u,R,Wt).then(L=>{Pe(L),Qe(null),V(null)},wt);return N.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)"},N.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"},N.createElement("div",{className:"flex min-w-0 items-center gap-2"},N.createElement("a",{href:O,className:"text-sm hover:underline"},"Back"),N.createElement("h1",{className:"truncate text-base font-semibold"},e)),N.createElement("div",{className:"flex items-center gap-4 max-lg:hidden"},N.createElement(hg,{chosen:Ct,onChoose:bt}),N.createElement(vg,null),N.createElement(Sg,{looks:g}),N.createElement(mg,{samples:y,chosen:m,onChoose:L=>sC(_,R,L).then(Pe,wt)}),N.createElement(yg,{exceptions:v,chosen:S,onChoose:L=>iC(b,R,L).then(Pe,wt)})),N.createElement("div",{className:"flex items-center gap-2"},N.createElement(We,{type:"button",size:"sm",variant:"secondary",disabled:!Q,title:Q?"Undo the last change":"Nothing to undo",onClick:()=>fg(T,R).then(Pe,wt)},"\u21B6 Undo"),N.createElement(We,{type:"button",size:"sm",variant:"secondary",disabled:!Z,title:Z?"Redo the change you undid":"Nothing to redo",onClick:()=>fg(A,R).then(Pe,wt)},"\u21B7 Redo"),D&&N.createElement("a",{href:D,className:"text-sm whitespace-nowrap hover:underline"},"View live"),N.createElement("a",{href:E,className:"text-sm hover:underline"},"History"),n&&N.createElement("form",{method:"post",action:n},N.createElement("input",{type:"hidden",name:"authenticity_token",value:R}),N.createElement(We,{type:"submit",size:"sm",variant:"secondary"},"Unpublish")),N.createElement("form",{method:"post",action:t},N.createElement("input",{type:"hidden",name:"authenticity_token",value:R}),N.createElement(We,{type:"submit",size:"sm"},"Publish")))),N.createElement("div",{className:"relative flex min-h-0 flex-1"},N.createElement(dC,{ref:Nn,elements:o},N.createElement(We,{type:"button",variant:"secondary",onClick:()=>eC(a,R).then(Pe)},"Add section")),N.createElement("main",{"data-page-frame":!0,className:"min-w-0 flex-1 overflow-auto bg-surface-200 p-8 dark:bg-surface-900"},N.createElement("div",{ref:Fr,"data-page-sheet":!0,"data-theme":fl.find(L=>L.key===Ct).theme,style:{width:fl.find(L=>L.key===Ct).width,colorScheme:fl.find(L=>L.key===Ct).theme},className:"relative mx-auto min-h-full max-w-full bg-[Canvas] shadow-lg ring-1 ring-black/5"},N.createElement("div",{ref:rt,"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:hp,onMouseOver:kc,onMouseLeave:()=>rt.current.querySelectorAll("[data-hovered]").forEach(L=>delete L.dataset.hovered)}),N.createElement(cC,{ref:So,place:ht,onRemove:Ic,onDuplicate:()=>oC(u,R,Wt).then(Pe,wt)}))),N.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)"},N.createElement(gg,{path:fe,onChoose:Vs}),!te&&!Br&&N.createElement("p",{className:"ks-hint"},"Select something on the page to change it."),!te&&!Br&&N.createElement(_g,{key:ee.title??"",title:ee.title,onChange:L=>Q0(x,R,L).then(Pe,wt)}),te&&N.createElement(pg,{node:te,values:Ac(te),arrangements:d,onArrange:(L,q,j)=>ug(u,R,L,q,j).then(Pe,wt),refusal:Ue,onSelect:wc,onRemove:L=>Au(u,R,L).then(q=>{Pe(q),Qe(null)},wt),onAddColumn:L=>tC(l,R,L).then(Pe),onAddRow:L=>nC(c,R,L).then(Pe)}),Br&&N.createElement(Kx,{element:Vn,definition:Br,alignments:d.element.align,onRemove:L=>Au(u,R,L).then(q=>{Pe(q),V(null)}),onArrange:(L,q,j)=>ug(u,R,L,q,j).then(Pe),valueNames:h,onBind:(L,q,j)=>rC(i,R,Vn.id,L,q,j).then(Pe,wt),onChange:(L,q)=>Z0(i,R,Vn.id,L,q).then(Pe)}),(Vn||te&&te.kind!=="column")&&N.createElement(xg,{key:Vn?.id??te.id,condition:(Vn??pp(ee,te.id))?.show_when,valueNames:h,onChange:(L,q)=>aC(u,R,Vn?.id??te.id,L,q).then(Pe,wt)}))))}nv("keystone_ui_pages/editor",Ux);sv(document,Gx);})();
|