var VB=Object.defineProperty;var qB=(n,e,t)=>e in n?VB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ft=(n,e,t)=>qB(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function OR(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ky={exports:{}},Eu={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var aA;function HB(){if(aA)return Eu;aA=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var o in r)o!=="key"&&(s[o]=r[o])}else s=r;return r=s.ref,{$$typeof:n,type:i,key:l,ref:r!==void 0?r:null,props:s}}return Eu.Fragment=e,Eu.jsx=t,Eu.jsxs=t,Eu}var cA;function YB(){return cA||(cA=1,ky.exports=HB()),ky.exports}var L=YB(),wy={exports:{}},Le={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var uA;function UB(){if(uA)return Le;uA=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(Q){return Q===null||typeof Q!="object"?null:(Q=g&&Q[g]||Q["@@iterator"],typeof Q=="function"?Q:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function k(Q,j,F){this.props=Q,this.context=j,this.refs=x,this.updater=F||b}k.prototype.isReactComponent={},k.prototype.setState=function(Q,j){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,j,"setState")},k.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function C(){}C.prototype=k.prototype;function A(Q,j,F){this.props=Q,this.context=j,this.refs=x,this.updater=F||b}var P=A.prototype=new C;P.constructor=A,v(P,k.prototype),P.isPureReactComponent=!0;var E=Array.isArray;function D(){}var $={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function W(Q,j,F){var le=F.ref;return{$$typeof:n,type:Q,key:j,ref:le!==void 0?le:null,props:F}}function te(Q,j){return W(Q.type,j,Q.props)}function ce(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===n}function ie(Q){var j={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(F){return j[F]})}var ue=/\/+/g;function se(Q,j){return typeof Q=="object"&&Q!==null&&Q.key!=null?ie(""+Q.key):j.toString(36)}function fe(Q){switch(Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason;default:switch(typeof Q.status=="string"?Q.then(D,D):(Q.status="pending",Q.then(function(j){Q.status==="pending"&&(Q.status="fulfilled",Q.value=j)},function(j){Q.status==="pending"&&(Q.status="rejected",Q.reason=j)})),Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason}}throw Q}function B(Q,j,F,le,ye){var Re=typeof Q;(Re==="undefined"||Re==="boolean")&&(Q=null);var je=!1;if(Q===null)je=!0;else switch(Re){case"bigint":case"string":case"number":je=!0;break;case"object":switch(Q.$$typeof){case n:case e:je=!0;break;case d:return je=Q._init,B(je(Q._payload),j,F,le,ye)}}if(je)return ye=ye(Q),je=le===""?"."+se(Q,0):le,E(ye)?(F="",je!=null&&(F=je.replace(ue,"$&/")+"/"),B(ye,j,F,"",function(js){return js})):ye!=null&&(ce(ye)&&(ye=te(ye,F+(ye.key==null||Q&&Q.key===ye.key?"":(""+ye.key).replace(ue,"$&/")+"/")+je)),j.push(ye)),1;je=0;var Gt=le===""?".":le+":";if(E(Q))for(var bt=0;bt<Q.length;bt++)le=Q[bt],Re=Gt+se(le,bt),je+=B(le,j,F,Re,ye);else if(bt=O(Q),typeof bt=="function")for(Q=bt.call(Q),bt=0;!(le=Q.next()).done;)le=le.value,Re=Gt+se(le,bt++),je+=B(le,j,F,Re,ye);else if(Re==="object"){if(typeof Q.then=="function")return B(fe(Q),j,F,le,ye);throw j=String(Q),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return je}function G(Q,j,F){if(Q==null)return Q;var le=[],ye=0;return B(Q,le,"","",function(Re){return j.call(F,Re,ye++)}),le}function he(Q){if(Q._status===-1){var j=Q._result;j=j(),j.then(function(F){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=F)},function(F){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=F)}),Q._status===-1&&(Q._status=0,Q._result=j)}if(Q._status===1)return Q._result.default;throw Q._result}var z=typeof reportError=="function"?reportError:function(Q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Q=="object"&&Q!==null&&typeof Q.message=="string"?String(Q.message):String(Q),error:Q});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Q);return}console.error(Q)},J={map:G,forEach:function(Q,j,F){G(Q,function(){j.apply(this,arguments)},F)},count:function(Q){var j=0;return G(Q,function(){j++}),j},toArray:function(Q){return G(Q,function(j){return j})||[]},only:function(Q){if(!ce(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}};return Le.Activity=p,Le.Children=J,Le.Component=k,Le.Fragment=t,Le.Profiler=r,Le.PureComponent=A,Le.StrictMode=i,Le.Suspense=c,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Le.__COMPILER_RUNTIME={__proto__:null,c:function(Q){return $.H.useMemoCache(Q)}},Le.cache=function(Q){return function(){return Q.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(Q,j,F){if(Q==null)throw Error("The argument must be a React element, but you passed "+Q+".");var le=v({},Q.props),ye=Q.key;if(j!=null)for(Re in j.key!==void 0&&(ye=""+j.key),j)!H.call(j,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&j.ref===void 0||(le[Re]=j[Re]);var Re=arguments.length-2;if(Re===1)le.children=F;else if(1<Re){for(var je=Array(Re),Gt=0;Gt<Re;Gt++)je[Gt]=arguments[Gt+2];le.children=je}return W(Q.type,ye,le)},Le.createContext=function(Q){return Q={$$typeof:l,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null},Q.Provider=Q,Q.Consumer={$$typeof:s,_context:Q},Q},Le.createElement=function(Q,j,F){var le,ye={},Re=null;if(j!=null)for(le in j.key!==void 0&&(Re=""+j.key),j)H.call(j,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ye[le]=j[le]);var je=arguments.length-2;if(je===1)ye.children=F;else if(1<je){for(var Gt=Array(je),bt=0;bt<je;bt++)Gt[bt]=arguments[bt+2];ye.children=Gt}if(Q&&Q.defaultProps)for(le in je=Q.defaultProps,je)ye[le]===void 0&&(ye[le]=je[le]);return W(Q,Re,ye)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(Q){return{$$typeof:o,render:Q}},Le.isValidElement=ce,Le.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:he}},Le.memo=function(Q,j){return{$$typeof:h,type:Q,compare:j===void 0?null:j}},Le.startTransition=function(Q){var j=$.T,F={};$.T=F;try{var le=Q(),ye=$.S;ye!==null&&ye(F,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(D,z)}catch(Re){z(Re)}finally{j!==null&&F.types!==null&&(j.types=F.types),$.T=j}},Le.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Le.use=function(Q){return $.H.use(Q)},Le.useActionState=function(Q,j,F){return $.H.useActionState(Q,j,F)},Le.useCallback=function(Q,j){return $.H.useCallback(Q,j)},Le.useContext=function(Q){return $.H.useContext(Q)},Le.useDebugValue=function(){},Le.useDeferredValue=function(Q,j){return $.H.useDeferredValue(Q,j)},Le.useEffect=function(Q,j){return $.H.useEffect(Q,j)},Le.useEffectEvent=function(Q){return $.H.useEffectEvent(Q)},Le.useId=function(){return $.H.useId()},Le.useImperativeHandle=function(Q,j,F){return $.H.useImperativeHandle(Q,j,F)},Le.useInsertionEffect=function(Q,j){return $.H.useInsertionEffect(Q,j)},Le.useLayoutEffect=function(Q,j){return $.H.useLayoutEffect(Q,j)},Le.useMemo=function(Q,j){return $.H.useMemo(Q,j)},Le.useOptimistic=function(Q,j){return $.H.useOptimistic(Q,j)},Le.useReducer=function(Q,j,F){return $.H.useReducer(Q,j,F)},Le.useRef=function(Q){return $.H.useRef(Q)},Le.useState=function(Q){return $.H.useState(Q)},Le.useSyncExternalStore=function(Q,j,F){return $.H.useSyncExternalStore(Q,j,F)},Le.useTransition=function(){return $.H.useTransition()},Le.version="19.2.6",Le}var hA;function uf(){return hA||(hA=1,wy.exports=UB()),wy.exports}var Ee=uf();const Ae=OR(Ee);var Ty={exports:{}},$u={},Cy={exports:{}},Ay={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fA;function WB(){return fA||(fA=1,(function(n){function e(B,G){var he=B.length;B.push(G);e:for(;0<he;){var z=he-1>>>1,J=B[z];if(0<r(J,G))B[z]=G,B[he]=J,he=z;else break e}}function t(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var G=B[0],he=B.pop();if(he!==G){B[0]=he;e:for(var z=0,J=B.length,Q=J>>>1;z<Q;){var j=2*(z+1)-1,F=B[j],le=j+1,ye=B[le];if(0>r(F,he))le<J&&0>r(ye,F)?(B[z]=ye,B[le]=he,z=le):(B[z]=F,B[j]=he,z=j);else if(le<J&&0>r(ye,he))B[z]=ye,B[le]=he,z=le;else break e}}return G}function r(B,G){var he=B.sortIndex-G.sortIndex;return he!==0?he:B.id-G.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var l=Date,o=l.now();n.unstable_now=function(){return l.now()-o}}var c=[],h=[],d=1,p=null,g=3,O=!1,b=!1,v=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function P(B){for(var G=t(h);G!==null;){if(G.callback===null)i(h);else if(G.startTime<=B)i(h),G.sortIndex=G.expirationTime,e(c,G);else break;G=t(h)}}function E(B){if(v=!1,P(B),!b)if(t(c)!==null)b=!0,D||(D=!0,ie());else{var G=t(h);G!==null&&fe(E,G.startTime-B)}}var D=!1,$=-1,H=5,W=-1;function te(){return x?!0:!(n.unstable_now()-W<H)}function ce(){if(x=!1,D){var B=n.unstable_now();W=B;var G=!0;try{e:{b=!1,v&&(v=!1,C($),$=-1),O=!0;var he=g;try{t:{for(P(B),p=t(c);p!==null&&!(p.expirationTime>B&&te());){var z=p.callback;if(typeof z=="function"){p.callback=null,g=p.priorityLevel;var J=z(p.expirationTime<=B);if(B=n.unstable_now(),typeof J=="function"){p.callback=J,P(B),G=!0;break t}p===t(c)&&i(c),P(B)}else i(c);p=t(c)}if(p!==null)G=!0;else{var Q=t(h);Q!==null&&fe(E,Q.startTime-B),G=!1}}break e}finally{p=null,g=he,O=!1}G=void 0}}finally{G?ie():D=!1}}}var ie;if(typeof A=="function")ie=function(){A(ce)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,se=ue.port2;ue.port1.onmessage=ce,ie=function(){se.postMessage(null)}}else ie=function(){k(ce,0)};function fe(B,G){$=k(function(){B(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return g},n.unstable_next=function(B){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var he=g;g=G;try{return B()}finally{g=he}},n.unstable_requestPaint=function(){x=!0},n.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var he=g;g=B;try{return G()}finally{g=he}},n.unstable_scheduleCallback=function(B,G,he){var z=n.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?z+he:z):he=z,B){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=he+J,B={id:d++,callback:G,priorityLevel:B,startTime:he,expirationTime:J,sortIndex:-1},he>z?(B.sortIndex=he,e(h,B),t(c)===null&&B===t(h)&&(v?(C($),$=-1):v=!0,fe(E,he-z))):(B.sortIndex=J,e(c,B),b||O||(b=!0,D||(D=!0,ie()))),B},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(B){var G=g;return function(){var he=g;g=G;try{return B.apply(this,arguments)}finally{g=he}}}})(Ay)),Ay}var dA;function GB(){return dA||(dA=1,Cy.exports=WB()),Cy.exports}var My={exports:{}},wn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var pA;function FB(){if(pA)return wn;pA=1;var n=uf();function e(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)h+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(c,h,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:c,containerInfo:h,implementation:d}}var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,wn.createPortal=function(c,h){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(c,h,null,d)},wn.flushSync=function(c){var h=l.T,d=i.p;try{if(l.T=null,i.p=2,c)return c()}finally{l.T=h,i.p=d,i.d.f()}},wn.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(c,h))},wn.prefetchDNS=function(c){typeof c=="string"&&i.d.D(c)},wn.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var d=h.as,p=o(d,h.crossOrigin),g=typeof h.integrity=="string"?h.integrity:void 0,O=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;d==="style"?i.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):d==="script"&&i.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},wn.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var d=o(h.as,h.crossOrigin);i.d.M(c,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(c)},wn.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var d=h.as,p=o(d,h.crossOrigin);i.d.L(c,d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},wn.preloadModule=function(c,h){if(typeof c=="string")if(h){var d=o(h.as,h.crossOrigin);i.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(c)},wn.requestFormReset=function(c){i.d.r(c)},wn.unstable_batchedUpdates=function(c,h){return c(h)},wn.useFormState=function(c,h,d){return l.H.useFormState(c,h,d)},wn.useFormStatus=function(){return l.H.useHostTransitionStatus()},wn.version="19.2.6",wn}var mA;function yR(){if(mA)return My.exports;mA=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),My.exports=FB(),My.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var gA;function KB(){if(gA)return $u;gA=1;var n=GB(),e=uf(),t=yR();function i(a){var u="https://react.dev/errors/"+a;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var u=a,f=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(f=u.return),a=u.return;while(a)}return u.tag===3?f:null}function l(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function o(a){if(a.tag===31){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function c(a){if(s(a)!==a)throw Error(i(188))}function h(a){var u=a.alternate;if(!u){if(u=s(a),u===null)throw Error(i(188));return u!==a?null:a}for(var f=a,m=u;;){var y=f.return;if(y===null)break;var S=y.alternate;if(S===null){if(m=y.return,m!==null){f=m;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===f)return c(y),a;if(S===m)return c(y),u;S=S.sibling}throw Error(i(188))}if(f.return!==m.return)f=y,m=S;else{for(var w=!1,T=y.child;T;){if(T===f){w=!0,f=y,m=S;break}if(T===m){w=!0,m=y,f=S;break}T=T.sibling}if(!w){for(T=S.child;T;){if(T===f){w=!0,f=S,m=y;break}if(T===m){w=!0,m=S,f=y;break}T=T.sibling}if(!w)throw Error(i(189))}}if(f.alternate!==m)throw Error(i(190))}if(f.tag!==3)throw Error(i(188));return f.stateNode.current===f?a:u}function d(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a;for(a=a.child;a!==null;){if(u=d(a),u!==null)return u;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function ie(a){return a===null||typeof a!="object"?null:(a=ce&&a[ce]||a["@@iterator"],typeof a=="function"?a:null)}var ue=Symbol.for("react.client.reference");function se(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ue?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case v:return"Fragment";case k:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case D:return"SuspenseList";case W:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case A:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case P:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case $:return u=a.displayName||null,u!==null?u:se(a.type)||"Memo";case H:u=a._payload,a=a._init;try{return se(a(u))}catch{}}return null}var fe=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},z=[],J=-1;function Q(a){return{current:a}}function j(a){0>J||(a.current=z[J],z[J]=null,J--)}function F(a,u){J++,z[J]=a.current,a.current=u}var le=Q(null),ye=Q(null),Re=Q(null),je=Q(null);function Gt(a,u){switch(F(Re,u),F(ye,a),F(le,null),u.nodeType){case 9:case 11:a=(a=u.documentElement)&&(a=a.namespaceURI)?$C(a):0;break;default:if(a=u.tagName,u=u.namespaceURI)u=$C(u),a=RC(u,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}j(le),F(le,a)}function bt(){j(le),j(ye),j(Re)}function js(a){a.memoizedState!==null&&F(je,a);var u=le.current,f=RC(u,a.type);u!==f&&(F(ye,a),F(le,f))}function Ul(a){ye.current===a&&(j(le),j(ye)),je.current===a&&(j(je),Cu._currentValue=he)}var Wi,Yr;function wi(a){if(Wi===void 0)try{throw Error()}catch(f){var u=f.stack.trim().match(/\n( *(at )?)/);Wi=u&&u[1]||"",Yr=-1<f.stack.indexOf(`
    at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Wi+a+Yr}var Zs=!1;function Jo(a,u){if(!a||Zs)return"";Zs=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(u){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(q){var I=q}Reflect.construct(a,[],ee)}else{try{ee.call()}catch(q){I=q}a.call(ee.prototype)}}else{try{throw Error()}catch(q){I=q}(ee=a())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(q){if(q&&I&&typeof q.stack=="string")return[q.stack,I.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),w=S[0],T=S[1];if(w&&T){var R=w.split(`
`),X=T.split(`
`);for(y=m=0;m<R.length&&!R[m].includes("DetermineComponentFrameRoot");)m++;for(;y<X.length&&!X[y].includes("DetermineComponentFrameRoot");)y++;if(m===R.length||y===X.length)for(m=R.length-1,y=X.length-1;1<=m&&0<=y&&R[m]!==X[y];)y--;for(;1<=m&&0<=y;m--,y--)if(R[m]!==X[y]){if(m!==1||y!==1)do if(m--,y--,0>y||R[m]!==X[y]){var U=`
`+R[m].replace(" at new "," at ");return a.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",a.displayName)),U}while(1<=m&&0<=y);break}}}finally{Zs=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?wi(f):""}function Af(a,u){switch(a.tag){case 26:case 27:case 5:return wi(a.type);case 16:return wi("Lazy");case 13:return a.child!==u&&u!==null?wi("Suspense Fallback"):wi("Suspense");case 19:return wi("SuspenseList");case 0:case 15:return Jo(a.type,!1);case 11:return Jo(a.type.render,!1);case 1:return Jo(a.type,!0);case 31:return wi("Activity");default:return""}}function Mf(a){try{var u="",f=null;do u+=Af(a,f),f=a,a=a.return;while(a);return u}catch(m){return`
Error generating stack: `+m.message+`
`+m.stack}}var Xs=Object.prototype.hasOwnProperty,ea=n.unstable_scheduleCallback,_t=n.unstable_cancelCallback,Qf=n.unstable_shouldYield,Ur=n.unstable_requestPaint,kn=n.unstable_now,Wl=n.unstable_getCurrentPriorityLevel,Is=n.unstable_ImmediatePriority,_c=n.unstable_UserBlockingPriority,ta=n.unstable_NormalPriority,cO=n.unstable_LowPriority,Ef=n.unstable_IdlePriority,uO=n.log,hO=n.unstable_setDisableYieldValue,Gl=null,At=null;function pr(a){if(typeof uO=="function"&&hO(a),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Gl,a)}catch{}}var jn=Math.clz32?Math.clz32:Ne,V=Math.log,re=Math.LN2;function Ne(a){return a>>>=0,a===0?32:31-(V(a)/re|0)|0}var Me=256,ze=262144,cn=4194304;function Ft(a){var u=a&42;if(u!==0)return u;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Gi(a,u,f){var m=a.pendingLanes;if(m===0)return 0;var y=0,S=a.suspendedLanes,w=a.pingedLanes;a=a.warmLanes;var T=m&134217727;return T!==0?(m=T&~S,m!==0?y=Ft(m):(w&=T,w!==0?y=Ft(w):f||(f=T&~a,f!==0&&(y=Ft(f))))):(T=m&~S,T!==0?y=Ft(T):w!==0?y=Ft(w):f||(f=m&~a,f!==0&&(y=Ft(f)))),y===0?0:u!==0&&u!==y&&(u&S)===0&&(S=y&-y,f=u&-u,S>=f||S===32&&(f&4194048)!==0)?u:y}function mr(a,u){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&u)===0}function gr(a,u){switch(a){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fi(){var a=cn;return cn<<=1,(cn&62914560)===0&&(cn=4194304),a}function Bc(a){for(var u=[],f=0;31>f;f++)u.push(a);return u}function jc(a,u){a.pendingLanes|=u,u!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function R5(a,u,f,m,y,S){var w=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var T=a.entanglements,R=a.expirationTimes,X=a.hiddenUpdates;for(f=w&~f;0<f;){var U=31-jn(f),ee=1<<U;T[U]=0,R[U]=-1;var I=X[U];if(I!==null)for(X[U]=null,U=0;U<I.length;U++){var q=I[U];q!==null&&(q.lane&=-536870913)}f&=~ee}m!==0&&dk(a,m,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(w&~u))}function dk(a,u,f){a.pendingLanes|=u,a.suspendedLanes&=~u;var m=31-jn(u);a.entangledLanes|=u,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function pk(a,u){var f=a.entangledLanes|=u;for(a=a.entanglements;f;){var m=31-jn(f),y=1<<m;y&u|a[m]&u&&(a[m]|=u),f&=~y}}function mk(a,u){var f=u&-u;return f=(f&42)!==0?1:fO(f),(f&(a.suspendedLanes|u))!==0?0:f}function fO(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function dO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function gk(){var a=G.p;return a!==0?a:(a=window.event,a===void 0?32:tA(a.type))}function Ok(a,u){var f=G.p;try{return G.p=a,u()}finally{G.p=f}}var Vs=Math.random().toString(36).slice(2),un="__reactFiber$"+Vs,Zn="__reactProps$"+Vs,na="__reactContainer$"+Vs,pO="__reactEvents$"+Vs,P5="__reactListeners$"+Vs,D5="__reactHandles$"+Vs,yk="__reactResources$"+Vs,Zc="__reactMarker$"+Vs;function mO(a){delete a[un],delete a[Zn],delete a[pO],delete a[P5],delete a[D5]}function ia(a){var u=a[un];if(u)return u;for(var f=a.parentNode;f;){if(u=f[na]||f[un]){if(f=u.alternate,u.child!==null||f!==null&&f.child!==null)for(a=BC(a);a!==null;){if(f=a[un])return f;a=BC(a)}return u}a=f,f=a.parentNode}return null}function ra(a){if(a=a[un]||a[na]){var u=a.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return a}return null}function Xc(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a.stateNode;throw Error(i(33))}function sa(a){var u=a[yk];return u||(u=a[yk]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function tn(a){a[Zc]=!0}var bk=new Set,Sk={};function Fl(a,u){la(a,u),la(a+"Capture",u)}function la(a,u){for(Sk[a]=u,a=0;a<u.length;a++)bk.add(u[a])}var N5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),vk={},xk={};function z5(a){return Xs.call(xk,a)?!0:Xs.call(vk,a)?!1:N5.test(a)?xk[a]=!0:(vk[a]=!0,!1)}function $f(a,u,f){if(z5(u))if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(u);return;case"boolean":var m=u.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(u);return}}a.setAttribute(u,""+f)}}function Rf(a,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttribute(u,""+f)}}function Wr(a,u,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(u,f,""+m)}}function Ti(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function kk(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function L5(a,u,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,u);if(!a.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,S=m.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return y.call(this)},set:function(w){f=""+w,S.call(this,w)}}),Object.defineProperty(a,u,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(w){f=""+w},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function gO(a){if(!a._valueTracker){var u=kk(a)?"checked":"value";a._valueTracker=L5(a,u,""+a[u])}}function wk(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var f=u.getValue(),m="";return a&&(m=kk(a)?a.checked?"true":"false":a.value),a=m,a!==f?(u.setValue(a),!0):!1}function Pf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var _5=/[\n"\\]/g;function Ci(a){return a.replace(_5,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function OO(a,u,f,m,y,S,w,T){a.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?a.type=w:a.removeAttribute("type"),u!=null?w==="number"?(u===0&&a.value===""||a.value!=u)&&(a.value=""+Ti(u)):a.value!==""+Ti(u)&&(a.value=""+Ti(u)):w!=="submit"&&w!=="reset"||a.removeAttribute("value"),u!=null?yO(a,w,Ti(u)):f!=null?yO(a,w,Ti(f)):m!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?a.name=""+Ti(T):a.removeAttribute("name")}function Tk(a,u,f,m,y,S,w,T){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),u!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||u!=null)){gO(a);return}f=f!=null?""+Ti(f):"",u=u!=null?""+Ti(u):f,T||u===a.value||(a.value=u),a.defaultValue=u}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=T?a.checked:!!m,a.defaultChecked=!!m,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.name=w),gO(a)}function yO(a,u,f){u==="number"&&Pf(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function oa(a,u,f,m){if(a=a.options,u){u={};for(var y=0;y<f.length;y++)u["$"+f[y]]=!0;for(f=0;f<a.length;f++)y=u.hasOwnProperty("$"+a[f].value),a[f].selected!==y&&(a[f].selected=y),y&&m&&(a[f].defaultSelected=!0)}else{for(f=""+Ti(f),u=null,y=0;y<a.length;y++){if(a[y].value===f){a[y].selected=!0,m&&(a[y].defaultSelected=!0);return}u!==null||a[y].disabled||(u=a[y])}u!==null&&(u.selected=!0)}}function Ck(a,u,f){if(u!=null&&(u=""+Ti(u),u!==a.value&&(a.value=u),f==null)){a.defaultValue!==u&&(a.defaultValue=u);return}a.defaultValue=f!=null?""+Ti(f):""}function Ak(a,u,f,m){if(u==null){if(m!=null){if(f!=null)throw Error(i(92));if(fe(m)){if(1<m.length)throw Error(i(93));m=m[0]}f=m}f==null&&(f=""),u=f}f=Ti(u),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),gO(a)}function aa(a,u){if(u){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=u;return}}a.textContent=u}var B5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mk(a,u,f){var m=u.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(u,""):u==="float"?a.cssFloat="":a[u]="":m?a.setProperty(u,f):typeof f!="number"||f===0||B5.has(u)?u==="float"?a.cssFloat=f:a[u]=(""+f).trim():a[u]=f+"px"}function Qk(a,u,f){if(u!=null&&typeof u!="object")throw Error(i(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||u!=null&&u.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var y in u)m=u[y],u.hasOwnProperty(y)&&f[y]!==m&&Mk(a,y,m)}else for(var S in u)u.hasOwnProperty(S)&&Mk(a,S,u[S])}function bO(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var j5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Z5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Df(a){return Z5.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Gr(){}var SO=null;function vO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ca=null,ua=null;function Ek(a){var u=ra(a);if(u&&(a=u.stateNode)){var f=a[Zn]||null;e:switch(a=u.stateNode,u.type){case"input":if(OO(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),u=f.name,f.type==="radio"&&u!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Ci(""+u)+'"][type="radio"]'),u=0;u<f.length;u++){var m=f[u];if(m!==a&&m.form===a.form){var y=m[Zn]||null;if(!y)throw Error(i(90));OO(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(u=0;u<f.length;u++)m=f[u],m.form===a.form&&wk(m)}break e;case"textarea":Ck(a,f.value,f.defaultValue);break e;case"select":u=f.value,u!=null&&oa(a,!!f.multiple,u,!1)}}}var xO=!1;function $k(a,u,f){if(xO)return a(u,f);xO=!0;try{var m=a(u);return m}finally{if(xO=!1,(ca!==null||ua!==null)&&(vd(),ca&&(u=ca,a=ua,ua=ca=null,Ek(u),a)))for(u=0;u<a.length;u++)Ek(a[u])}}function Ic(a,u){var f=a.stateNode;if(f===null)return null;var m=f[Zn]||null;if(m===null)return null;f=m[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(i(231,u,typeof f));return f}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kO=!1;if(Fr)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){kO=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{kO=!1}var qs=null,wO=null,Nf=null;function Rk(){if(Nf)return Nf;var a,u=wO,f=u.length,m,y="value"in qs?qs.value:qs.textContent,S=y.length;for(a=0;a<f&&u[a]===y[a];a++);var w=f-a;for(m=1;m<=w&&u[f-m]===y[S-m];m++);return Nf=y.slice(a,1<m?1-m:void 0)}function zf(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function Lf(){return!0}function Pk(){return!1}function Xn(a){function u(f,m,y,S,w){this._reactName=f,this._targetInst=y,this.type=m,this.nativeEvent=S,this.target=w,this.currentTarget=null;for(var T in a)a.hasOwnProperty(T)&&(f=a[T],this[T]=f?f(S):S[T]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Lf:Pk,this.isPropagationStopped=Pk,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Lf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Lf)},persist:function(){},isPersistent:Lf}),u}var Kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_f=Xn(Kl),qc=p({},Kl,{view:0,detail:0}),X5=Xn(qc),TO,CO,Hc,Bf=p({},qc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:MO,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Hc&&(Hc&&a.type==="mousemove"?(TO=a.screenX-Hc.screenX,CO=a.screenY-Hc.screenY):CO=TO=0,Hc=a),TO)},movementY:function(a){return"movementY"in a?a.movementY:CO}}),Dk=Xn(Bf),I5=p({},Bf,{dataTransfer:0}),V5=Xn(I5),q5=p({},qc,{relatedTarget:0}),AO=Xn(q5),H5=p({},Kl,{animationName:0,elapsedTime:0,pseudoElement:0}),Y5=Xn(H5),U5=p({},Kl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),W5=Xn(U5),G5=p({},Kl,{data:0}),Nk=Xn(G5),F5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},J5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e_(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=J5[a])?!!u[a]:!1}function MO(){return e_}var t_=p({},qc,{key:function(a){if(a.key){var u=F5[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=zf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?K5[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:MO,charCode:function(a){return a.type==="keypress"?zf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?zf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),n_=Xn(t_),i_=p({},Bf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zk=Xn(i_),r_=p({},qc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:MO}),s_=Xn(r_),l_=p({},Kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),o_=Xn(l_),a_=p({},Bf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),c_=Xn(a_),u_=p({},Kl,{newState:0,oldState:0}),h_=Xn(u_),f_=[9,13,27,32],QO=Fr&&"CompositionEvent"in window,Yc=null;Fr&&"documentMode"in document&&(Yc=document.documentMode);var d_=Fr&&"TextEvent"in window&&!Yc,Lk=Fr&&(!QO||Yc&&8<Yc&&11>=Yc),_k=" ",Bk=!1;function jk(a,u){switch(a){case"keyup":return f_.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zk(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ha=!1;function p_(a,u){switch(a){case"compositionend":return Zk(u);case"keypress":return u.which!==32?null:(Bk=!0,_k);case"textInput":return a=u.data,a===_k&&Bk?null:a;default:return null}}function m_(a,u){if(ha)return a==="compositionend"||!QO&&jk(a,u)?(a=Rk(),Nf=wO=qs=null,ha=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return Lk&&u.locale!=="ko"?null:u.data;default:return null}}var g_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xk(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!g_[a.type]:u==="textarea"}function Ik(a,u,f,m){ca?ua?ua.push(m):ua=[m]:ca=m,u=Md(u,"onChange"),0<u.length&&(f=new _f("onChange","change",null,f,m),a.push({event:f,listeners:u}))}var Uc=null,Wc=null;function O_(a){TC(a,0)}function jf(a){var u=Xc(a);if(wk(u))return a}function Vk(a,u){if(a==="change")return u}var qk=!1;if(Fr){var EO;if(Fr){var $O="oninput"in document;if(!$O){var Hk=document.createElement("div");Hk.setAttribute("oninput","return;"),$O=typeof Hk.oninput=="function"}EO=$O}else EO=!1;qk=EO&&(!document.documentMode||9<document.documentMode)}function Yk(){Uc&&(Uc.detachEvent("onpropertychange",Uk),Wc=Uc=null)}function Uk(a){if(a.propertyName==="value"&&jf(Wc)){var u=[];Ik(u,Wc,a,vO(a)),$k(O_,u)}}function y_(a,u,f){a==="focusin"?(Yk(),Uc=u,Wc=f,Uc.attachEvent("onpropertychange",Uk)):a==="focusout"&&Yk()}function b_(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return jf(Wc)}function S_(a,u){if(a==="click")return jf(u)}function v_(a,u){if(a==="input"||a==="change")return jf(u)}function x_(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var ri=typeof Object.is=="function"?Object.is:x_;function Gc(a,u){if(ri(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var f=Object.keys(a),m=Object.keys(u);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var y=f[m];if(!Xs.call(u,y)||!ri(a[y],u[y]))return!1}return!0}function Wk(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Gk(a,u){var f=Wk(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=u&&m>=u)return{node:f,offset:u-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Wk(f)}}function Fk(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?Fk(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function Kk(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var u=Pf(a.document);u instanceof a.HTMLIFrameElement;){try{var f=typeof u.contentWindow.location.href=="string"}catch{f=!1}if(f)a=u.contentWindow;else break;u=Pf(a.document)}return u}function RO(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}var k_=Fr&&"documentMode"in document&&11>=document.documentMode,fa=null,PO=null,Fc=null,DO=!1;function Jk(a,u,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;DO||fa==null||fa!==Pf(m)||(m=fa,"selectionStart"in m&&RO(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Fc&&Gc(Fc,m)||(Fc=m,m=Md(PO,"onSelect"),0<m.length&&(u=new _f("onSelect","select",null,u,f),a.push({event:u,listeners:m}),u.target=fa)))}function Jl(a,u){var f={};return f[a.toLowerCase()]=u.toLowerCase(),f["Webkit"+a]="webkit"+u,f["Moz"+a]="moz"+u,f}var da={animationend:Jl("Animation","AnimationEnd"),animationiteration:Jl("Animation","AnimationIteration"),animationstart:Jl("Animation","AnimationStart"),transitionrun:Jl("Transition","TransitionRun"),transitionstart:Jl("Transition","TransitionStart"),transitioncancel:Jl("Transition","TransitionCancel"),transitionend:Jl("Transition","TransitionEnd")},NO={},ew={};Fr&&(ew=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function eo(a){if(NO[a])return NO[a];if(!da[a])return a;var u=da[a],f;for(f in u)if(u.hasOwnProperty(f)&&f in ew)return NO[a]=u[f];return a}var tw=eo("animationend"),nw=eo("animationiteration"),iw=eo("animationstart"),w_=eo("transitionrun"),T_=eo("transitionstart"),C_=eo("transitioncancel"),rw=eo("transitionend"),sw=new Map,zO="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zO.push("scrollEnd");function Ki(a,u){sw.set(a,u),Fl(u,[a])}var Zf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ai=[],pa=0,LO=0;function Xf(){for(var a=pa,u=LO=pa=0;u<a;){var f=Ai[u];Ai[u++]=null;var m=Ai[u];Ai[u++]=null;var y=Ai[u];Ai[u++]=null;var S=Ai[u];if(Ai[u++]=null,m!==null&&y!==null){var w=m.pending;w===null?y.next=y:(y.next=w.next,w.next=y),m.pending=y}S!==0&&lw(f,y,S)}}function If(a,u,f,m){Ai[pa++]=a,Ai[pa++]=u,Ai[pa++]=f,Ai[pa++]=m,LO|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function _O(a,u,f,m){return If(a,u,f,m),Vf(a)}function to(a,u){return If(a,null,null,u),Vf(a)}function lw(a,u,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var y=!1,S=a.return;S!==null;)S.childLanes|=f,m=S.alternate,m!==null&&(m.childLanes|=f),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&u!==null&&(y=31-jn(f),a=S.hiddenUpdates,m=a[y],m===null?a[y]=[u]:m.push(u),u.lane=f|536870912),S):null}function Vf(a){if(50<bu)throw bu=0,Y0=null,Error(i(185));for(var u=a.return;u!==null;)a=u,u=a.return;return a.tag===3?a.stateNode:null}var ma={};function A_(a,u,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(a,u,f,m){return new A_(a,u,f,m)}function BO(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Kr(a,u){var f=a.alternate;return f===null?(f=si(a.tag,u,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=u,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,u=a.dependencies,f.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function ow(a,u){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=u,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,u=f.dependencies,a.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),a}function qf(a,u,f,m,y,S){var w=0;if(m=a,typeof a=="function")BO(a)&&(w=1);else if(typeof a=="string")w=RB(a,f,le.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case W:return a=si(31,f,u,y),a.elementType=W,a.lanes=S,a;case v:return no(f.children,y,S,u);case x:w=8,y|=24;break;case k:return a=si(12,f,u,y|2),a.elementType=k,a.lanes=S,a;case E:return a=si(13,f,u,y),a.elementType=E,a.lanes=S,a;case D:return a=si(19,f,u,y),a.elementType=D,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:w=10;break e;case C:w=9;break e;case P:w=11;break e;case $:w=14;break e;case H:w=16,m=null;break e}w=29,f=Error(i(130,a===null?"null":typeof a,"")),m=null}return u=si(w,f,u,y),u.elementType=a,u.type=m,u.lanes=S,u}function no(a,u,f,m){return a=si(7,a,m,u),a.lanes=f,a}function jO(a,u,f){return a=si(6,a,null,u),a.lanes=f,a}function aw(a){var u=si(18,null,null,0);return u.stateNode=a,u}function ZO(a,u,f){return u=si(4,a.children!==null?a.children:[],a.key,u),u.lanes=f,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}var cw=new WeakMap;function Mi(a,u){if(typeof a=="object"&&a!==null){var f=cw.get(a);return f!==void 0?f:(u={value:a,source:u,stack:Mf(u)},cw.set(a,u),u)}return{value:a,source:u,stack:Mf(u)}}var ga=[],Oa=0,Hf=null,Kc=0,Qi=[],Ei=0,Hs=null,Or=1,yr="";function Jr(a,u){ga[Oa++]=Kc,ga[Oa++]=Hf,Hf=a,Kc=u}function uw(a,u,f){Qi[Ei++]=Or,Qi[Ei++]=yr,Qi[Ei++]=Hs,Hs=a;var m=Or;a=yr;var y=32-jn(m)-1;m&=~(1<<y),f+=1;var S=32-jn(u)+y;if(30<S){var w=y-y%5;S=(m&(1<<w)-1).toString(32),m>>=w,y-=w,Or=1<<32-jn(u)+y|f<<y|m,yr=S+a}else Or=1<<S|f<<y|m,yr=a}function XO(a){a.return!==null&&(Jr(a,1),uw(a,1,0))}function IO(a){for(;a===Hf;)Hf=ga[--Oa],ga[Oa]=null,Kc=ga[--Oa],ga[Oa]=null;for(;a===Hs;)Hs=Qi[--Ei],Qi[Ei]=null,yr=Qi[--Ei],Qi[Ei]=null,Or=Qi[--Ei],Qi[Ei]=null}function hw(a,u){Qi[Ei++]=Or,Qi[Ei++]=yr,Qi[Ei++]=Hs,Or=u.id,yr=u.overflow,Hs=a}var hn=null,xt=null,Ue=!1,Ys=null,$i=!1,VO=Error(i(519));function Us(a){var u=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jc(Mi(u,a)),VO}function fw(a){var u=a.stateNode,f=a.type,m=a.memoizedProps;switch(u[un]=a,u[Zn]=m,f){case"dialog":Ie("cancel",u),Ie("close",u);break;case"iframe":case"object":case"embed":Ie("load",u);break;case"video":case"audio":for(f=0;f<vu.length;f++)Ie(vu[f],u);break;case"source":Ie("error",u);break;case"img":case"image":case"link":Ie("error",u),Ie("load",u);break;case"details":Ie("toggle",u);break;case"input":Ie("invalid",u),Tk(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ie("invalid",u);break;case"textarea":Ie("invalid",u),Ak(u,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||u.textContent===""+f||m.suppressHydrationWarning===!0||QC(u.textContent,f)?(m.popover!=null&&(Ie("beforetoggle",u),Ie("toggle",u)),m.onScroll!=null&&Ie("scroll",u),m.onScrollEnd!=null&&Ie("scrollend",u),m.onClick!=null&&(u.onclick=Gr),u=!0):u=!1,u||Us(a,!0)}function dw(a){for(hn=a.return;hn;)switch(hn.tag){case 5:case 31:case 13:$i=!1;return;case 27:case 3:$i=!0;return;default:hn=hn.return}}function ya(a){if(a!==hn)return!1;if(!Ue)return dw(a),Ue=!0,!1;var u=a.tag,f;if((f=u!==3&&u!==27)&&((f=u===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||ay(a.type,a.memoizedProps)),f=!f),f&&xt&&Us(a),dw(a),u===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));xt=_C(a)}else if(u===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));xt=_C(a)}else u===27?(u=xt,al(a.type)?(a=dy,dy=null,xt=a):xt=u):xt=hn?Pi(a.stateNode.nextSibling):null;return!0}function io(){xt=hn=null,Ue=!1}function qO(){var a=Ys;return a!==null&&(Hn===null?Hn=a:Hn.push.apply(Hn,a),Ys=null),a}function Jc(a){Ys===null?Ys=[a]:Ys.push(a)}var HO=Q(null),ro=null,es=null;function Ws(a,u,f){F(HO,u._currentValue),u._currentValue=f}function ts(a){a._currentValue=HO.current,j(HO)}function YO(a,u,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,m!==null&&(m.childLanes|=u)):m!==null&&(m.childLanes&u)!==u&&(m.childLanes|=u),a===f)break;a=a.return}}function UO(a,u,f,m){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var w=y.child;S=S.firstContext;e:for(;S!==null;){var T=S;S=y;for(var R=0;R<u.length;R++)if(T.context===u[R]){S.lanes|=f,T=S.alternate,T!==null&&(T.lanes|=f),YO(S.return,f,a),m||(w=null);break e}S=T.next}}else if(y.tag===18){if(w=y.return,w===null)throw Error(i(341));w.lanes|=f,S=w.alternate,S!==null&&(S.lanes|=f),YO(w,f,a),w=null}else w=y.child;if(w!==null)w.return=y;else for(w=y;w!==null;){if(w===a){w=null;break}if(y=w.sibling,y!==null){y.return=w.return,w=y;break}w=w.return}y=w}}function ba(a,u,f,m){a=null;for(var y=u,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var w=y.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var T=y.type;ri(y.pendingProps.value,w.value)||(a!==null?a.push(T):a=[T])}}else if(y===je.current){if(w=y.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Cu):a=[Cu])}y=y.return}a!==null&&UO(u,a,f,m),u.flags|=262144}function Yf(a){for(a=a.firstContext;a!==null;){if(!ri(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function so(a){ro=a,es=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function fn(a){return pw(ro,a)}function Uf(a,u){return ro===null&&so(a),pw(a,u)}function pw(a,u){var f=u._currentValue;if(u={context:u,memoizedValue:f,next:null},es===null){if(a===null)throw Error(i(308));es=u,a.dependencies={lanes:0,firstContext:u},a.flags|=524288}else es=es.next=u;return f}var M_=typeof AbortController<"u"?AbortController:function(){var a=[],u=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){u.aborted=!0,a.forEach(function(f){return f()})}},Q_=n.unstable_scheduleCallback,E_=n.unstable_NormalPriority,Xt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function WO(){return{controller:new M_,data:new Map,refCount:0}}function eu(a){a.refCount--,a.refCount===0&&Q_(E_,function(){a.controller.abort()})}var tu=null,GO=0,Sa=0,va=null;function $_(a,u){if(tu===null){var f=tu=[];GO=0,Sa=J0(),va={status:"pending",value:void 0,then:function(m){f.push(m)}}}return GO++,u.then(mw,mw),u}function mw(){if(--GO===0&&tu!==null){va!==null&&(va.status="fulfilled");var a=tu;tu=null,Sa=0,va=null;for(var u=0;u<a.length;u++)(0,a[u])()}}function R_(a,u){var f=[],m={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return a.then(function(){m.status="fulfilled",m.value=u;for(var y=0;y<f.length;y++)(0,f[y])(u)},function(y){for(m.status="rejected",m.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),m}var gw=B.S;B.S=function(a,u){JT=kn(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&$_(a,u),gw!==null&&gw(a,u)};var lo=Q(null);function FO(){var a=lo.current;return a!==null?a:ht.pooledCache}function Wf(a,u){u===null?F(lo,lo.current):F(lo,u.pool)}function Ow(){var a=FO();return a===null?null:{parent:Xt._currentValue,pool:a}}var xa=Error(i(460)),KO=Error(i(474)),Gf=Error(i(542)),Ff={then:function(){}};function yw(a){return a=a.status,a==="fulfilled"||a==="rejected"}function bw(a,u,f){switch(f=a[f],f===void 0?a.push(u):f!==u&&(u.then(Gr,Gr),u=f),u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,vw(a),a;default:if(typeof u.status=="string")u.then(Gr,Gr);else{if(a=ht,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=u,a.status="pending",a.then(function(m){if(u.status==="pending"){var y=u;y.status="fulfilled",y.value=m}},function(m){if(u.status==="pending"){var y=u;y.status="rejected",y.reason=m}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,vw(a),a}throw ao=u,xa}}function oo(a){try{var u=a._init;return u(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ao=f,xa):f}}var ao=null;function Sw(){if(ao===null)throw Error(i(459));var a=ao;return ao=null,a}function vw(a){if(a===xa||a===Gf)throw Error(i(483))}var ka=null,nu=0;function Kf(a){var u=nu;return nu+=1,ka===null&&(ka=[]),bw(ka,a,u)}function iu(a,u){u=u.props.ref,a.ref=u!==void 0?u:null}function Jf(a,u){throw u.$$typeof===g?Error(i(525)):(a=Object.prototype.toString.call(u),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a)))}function xw(a){function u(_,N){if(a){var Z=_.deletions;Z===null?(_.deletions=[N],_.flags|=16):Z.push(N)}}function f(_,N){if(!a)return null;for(;N!==null;)u(_,N),N=N.sibling;return null}function m(_){for(var N=new Map;_!==null;)_.key!==null?N.set(_.key,_):N.set(_.index,_),_=_.sibling;return N}function y(_,N){return _=Kr(_,N),_.index=0,_.sibling=null,_}function S(_,N,Z){return _.index=Z,a?(Z=_.alternate,Z!==null?(Z=Z.index,Z<N?(_.flags|=67108866,N):Z):(_.flags|=67108866,N)):(_.flags|=1048576,N)}function w(_){return a&&_.alternate===null&&(_.flags|=67108866),_}function T(_,N,Z,K){return N===null||N.tag!==6?(N=jO(Z,_.mode,K),N.return=_,N):(N=y(N,Z),N.return=_,N)}function R(_,N,Z,K){var Te=Z.type;return Te===v?U(_,N,Z.props.children,K,Z.key):N!==null&&(N.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===H&&oo(Te)===N.type)?(N=y(N,Z.props),iu(N,Z),N.return=_,N):(N=qf(Z.type,Z.key,Z.props,null,_.mode,K),iu(N,Z),N.return=_,N)}function X(_,N,Z,K){return N===null||N.tag!==4||N.stateNode.containerInfo!==Z.containerInfo||N.stateNode.implementation!==Z.implementation?(N=ZO(Z,_.mode,K),N.return=_,N):(N=y(N,Z.children||[]),N.return=_,N)}function U(_,N,Z,K,Te){return N===null||N.tag!==7?(N=no(Z,_.mode,K,Te),N.return=_,N):(N=y(N,Z),N.return=_,N)}function ee(_,N,Z){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=jO(""+N,_.mode,Z),N.return=_,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case O:return Z=qf(N.type,N.key,N.props,null,_.mode,Z),iu(Z,N),Z.return=_,Z;case b:return N=ZO(N,_.mode,Z),N.return=_,N;case H:return N=oo(N),ee(_,N,Z)}if(fe(N)||ie(N))return N=no(N,_.mode,Z,null),N.return=_,N;if(typeof N.then=="function")return ee(_,Kf(N),Z);if(N.$$typeof===A)return ee(_,Uf(_,N),Z);Jf(_,N)}return null}function I(_,N,Z,K){var Te=N!==null?N.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Te!==null?null:T(_,N,""+Z,K);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case O:return Z.key===Te?R(_,N,Z,K):null;case b:return Z.key===Te?X(_,N,Z,K):null;case H:return Z=oo(Z),I(_,N,Z,K)}if(fe(Z)||ie(Z))return Te!==null?null:U(_,N,Z,K,null);if(typeof Z.then=="function")return I(_,N,Kf(Z),K);if(Z.$$typeof===A)return I(_,N,Uf(_,Z),K);Jf(_,Z)}return null}function q(_,N,Z,K,Te){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return _=_.get(Z)||null,T(N,_,""+K,Te);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case O:return _=_.get(K.key===null?Z:K.key)||null,R(N,_,K,Te);case b:return _=_.get(K.key===null?Z:K.key)||null,X(N,_,K,Te);case H:return K=oo(K),q(_,N,Z,K,Te)}if(fe(K)||ie(K))return _=_.get(Z)||null,U(N,_,K,Te,null);if(typeof K.then=="function")return q(_,N,Z,Kf(K),Te);if(K.$$typeof===A)return q(_,N,Z,Uf(N,K),Te);Jf(N,K)}return null}function be(_,N,Z,K){for(var Te=null,Fe=null,Se=N,Be=N=0,He=null;Se!==null&&Be<Z.length;Be++){Se.index>Be?(He=Se,Se=null):He=Se.sibling;var Ke=I(_,Se,Z[Be],K);if(Ke===null){Se===null&&(Se=He);break}a&&Se&&Ke.alternate===null&&u(_,Se),N=S(Ke,N,Be),Fe===null?Te=Ke:Fe.sibling=Ke,Fe=Ke,Se=He}if(Be===Z.length)return f(_,Se),Ue&&Jr(_,Be),Te;if(Se===null){for(;Be<Z.length;Be++)Se=ee(_,Z[Be],K),Se!==null&&(N=S(Se,N,Be),Fe===null?Te=Se:Fe.sibling=Se,Fe=Se);return Ue&&Jr(_,Be),Te}for(Se=m(Se);Be<Z.length;Be++)He=q(Se,_,Be,Z[Be],K),He!==null&&(a&&He.alternate!==null&&Se.delete(He.key===null?Be:He.key),N=S(He,N,Be),Fe===null?Te=He:Fe.sibling=He,Fe=He);return a&&Se.forEach(function(dl){return u(_,dl)}),Ue&&Jr(_,Be),Te}function Qe(_,N,Z,K){if(Z==null)throw Error(i(151));for(var Te=null,Fe=null,Se=N,Be=N=0,He=null,Ke=Z.next();Se!==null&&!Ke.done;Be++,Ke=Z.next()){Se.index>Be?(He=Se,Se=null):He=Se.sibling;var dl=I(_,Se,Ke.value,K);if(dl===null){Se===null&&(Se=He);break}a&&Se&&dl.alternate===null&&u(_,Se),N=S(dl,N,Be),Fe===null?Te=dl:Fe.sibling=dl,Fe=dl,Se=He}if(Ke.done)return f(_,Se),Ue&&Jr(_,Be),Te;if(Se===null){for(;!Ke.done;Be++,Ke=Z.next())Ke=ee(_,Ke.value,K),Ke!==null&&(N=S(Ke,N,Be),Fe===null?Te=Ke:Fe.sibling=Ke,Fe=Ke);return Ue&&Jr(_,Be),Te}for(Se=m(Se);!Ke.done;Be++,Ke=Z.next())Ke=q(Se,_,Be,Ke.value,K),Ke!==null&&(a&&Ke.alternate!==null&&Se.delete(Ke.key===null?Be:Ke.key),N=S(Ke,N,Be),Fe===null?Te=Ke:Fe.sibling=Ke,Fe=Ke);return a&&Se.forEach(function(IB){return u(_,IB)}),Ue&&Jr(_,Be),Te}function ct(_,N,Z,K){if(typeof Z=="object"&&Z!==null&&Z.type===v&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case O:e:{for(var Te=Z.key;N!==null;){if(N.key===Te){if(Te=Z.type,Te===v){if(N.tag===7){f(_,N.sibling),K=y(N,Z.props.children),K.return=_,_=K;break e}}else if(N.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===H&&oo(Te)===N.type){f(_,N.sibling),K=y(N,Z.props),iu(K,Z),K.return=_,_=K;break e}f(_,N);break}else u(_,N);N=N.sibling}Z.type===v?(K=no(Z.props.children,_.mode,K,Z.key),K.return=_,_=K):(K=qf(Z.type,Z.key,Z.props,null,_.mode,K),iu(K,Z),K.return=_,_=K)}return w(_);case b:e:{for(Te=Z.key;N!==null;){if(N.key===Te)if(N.tag===4&&N.stateNode.containerInfo===Z.containerInfo&&N.stateNode.implementation===Z.implementation){f(_,N.sibling),K=y(N,Z.children||[]),K.return=_,_=K;break e}else{f(_,N);break}else u(_,N);N=N.sibling}K=ZO(Z,_.mode,K),K.return=_,_=K}return w(_);case H:return Z=oo(Z),ct(_,N,Z,K)}if(fe(Z))return be(_,N,Z,K);if(ie(Z)){if(Te=ie(Z),typeof Te!="function")throw Error(i(150));return Z=Te.call(Z),Qe(_,N,Z,K)}if(typeof Z.then=="function")return ct(_,N,Kf(Z),K);if(Z.$$typeof===A)return ct(_,N,Uf(_,Z),K);Jf(_,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,N!==null&&N.tag===6?(f(_,N.sibling),K=y(N,Z),K.return=_,_=K):(f(_,N),K=jO(Z,_.mode,K),K.return=_,_=K),w(_)):f(_,N)}return function(_,N,Z,K){try{nu=0;var Te=ct(_,N,Z,K);return ka=null,Te}catch(Se){if(Se===xa||Se===Gf)throw Se;var Fe=si(29,Se,null,_.mode);return Fe.lanes=K,Fe.return=_,Fe}finally{}}}var co=xw(!0),kw=xw(!1),Gs=!1;function JO(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function e0(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Fs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ks(a,u,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Je&2)!==0){var y=m.pending;return y===null?u.next=u:(u.next=y.next,y.next=u),m.pending=u,u=Vf(a),lw(a,null,f),u}return If(a,m,u,f),Vf(a)}function ru(a,u,f){if(u=u.updateQueue,u!==null&&(u=u.shared,(f&4194048)!==0)){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,pk(a,f)}}function t0(a,u){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var y=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var w={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?y=S=w:S=S.next=w,f=f.next}while(f!==null);S===null?y=S=u:S=S.next=u}else y=S=u;f={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=u}var n0=!1;function su(){if(n0){var a=va;if(a!==null)throw a}}function lu(a,u,f,m){n0=!1;var y=a.updateQueue;Gs=!1;var S=y.firstBaseUpdate,w=y.lastBaseUpdate,T=y.shared.pending;if(T!==null){y.shared.pending=null;var R=T,X=R.next;R.next=null,w===null?S=X:w.next=X,w=R;var U=a.alternate;U!==null&&(U=U.updateQueue,T=U.lastBaseUpdate,T!==w&&(T===null?U.firstBaseUpdate=X:T.next=X,U.lastBaseUpdate=R))}if(S!==null){var ee=y.baseState;w=0,U=X=R=null,T=S;do{var I=T.lane&-536870913,q=I!==T.lane;if(q?(qe&I)===I:(m&I)===I){I!==0&&I===Sa&&(n0=!0),U!==null&&(U=U.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var be=a,Qe=T;I=u;var ct=f;switch(Qe.tag){case 1:if(be=Qe.payload,typeof be=="function"){ee=be.call(ct,ee,I);break e}ee=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Qe.payload,I=typeof be=="function"?be.call(ct,ee,I):be,I==null)break e;ee=p({},ee,I);break e;case 2:Gs=!0}}I=T.callback,I!==null&&(a.flags|=64,q&&(a.flags|=8192),q=y.callbacks,q===null?y.callbacks=[I]:q.push(I))}else q={lane:I,tag:T.tag,payload:T.payload,callback:T.callback,next:null},U===null?(X=U=q,R=ee):U=U.next=q,w|=I;if(T=T.next,T===null){if(T=y.shared.pending,T===null)break;q=T,T=q.next,q.next=null,y.lastBaseUpdate=q,y.shared.pending=null}}while(!0);U===null&&(R=ee),y.baseState=R,y.firstBaseUpdate=X,y.lastBaseUpdate=U,S===null&&(y.shared.lanes=0),il|=w,a.lanes=w,a.memoizedState=ee}}function ww(a,u){if(typeof a!="function")throw Error(i(191,a));a.call(u)}function Tw(a,u){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)ww(f[a],u)}var wa=Q(null),ed=Q(0);function Cw(a,u){a=hs,F(ed,a),F(wa,u),hs=a|u.baseLanes}function i0(){F(ed,hs),F(wa,wa.current)}function r0(){hs=ed.current,j(wa),j(ed)}var li=Q(null),Ri=null;function Js(a){var u=a.alternate;F(Bt,Bt.current&1),F(li,a),Ri===null&&(u===null||wa.current!==null||u.memoizedState!==null)&&(Ri=a)}function s0(a){F(Bt,Bt.current),F(li,a),Ri===null&&(Ri=a)}function Aw(a){a.tag===22?(F(Bt,Bt.current),F(li,a),Ri===null&&(Ri=a)):el()}function el(){F(Bt,Bt.current),F(li,li.current)}function oi(a){j(li),Ri===a&&(Ri=null),j(Bt)}var Bt=Q(0);function td(a){for(var u=a;u!==null;){if(u.tag===13){var f=u.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||hy(f)||fy(f)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ns=0,_e=null,ot=null,It=null,nd=!1,Ta=!1,uo=!1,id=0,ou=0,Ca=null,P_=0;function $t(){throw Error(i(321))}function l0(a,u){if(u===null)return!1;for(var f=0;f<u.length&&f<a.length;f++)if(!ri(a[f],u[f]))return!1;return!0}function o0(a,u,f,m,y,S){return ns=S,_e=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,B.H=a===null||a.memoizedState===null?uT:x0,uo=!1,S=f(m,y),uo=!1,Ta&&(S=Qw(u,f,m,y)),Mw(a),S}function Mw(a){B.H=uu;var u=ot!==null&&ot.next!==null;if(ns=0,It=ot=_e=null,nd=!1,ou=0,Ca=null,u)throw Error(i(300));a===null||Vt||(a=a.dependencies,a!==null&&Yf(a)&&(Vt=!0))}function Qw(a,u,f,m){_e=a;var y=0;do{if(Ta&&(Ca=null),ou=0,Ta=!1,25<=y)throw Error(i(301));if(y+=1,It=ot=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}B.H=hT,S=u(f,m)}while(Ta);return S}function D_(){var a=B.H,u=a.useState()[0];return u=typeof u.then=="function"?au(u):u,a=a.useState()[0],(ot!==null?ot.memoizedState:null)!==a&&(_e.flags|=1024),u}function a0(){var a=id!==0;return id=0,a}function c0(a,u,f){u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~f}function u0(a){if(nd){for(a=a.memoizedState;a!==null;){var u=a.queue;u!==null&&(u.pending=null),a=a.next}nd=!1}ns=0,It=ot=_e=null,Ta=!1,ou=id=0,Ca=null}function Pn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?_e.memoizedState=It=a:It=It.next=a,It}function jt(){if(ot===null){var a=_e.alternate;a=a!==null?a.memoizedState:null}else a=ot.next;var u=It===null?_e.memoizedState:It.next;if(u!==null)It=u,ot=a;else{if(a===null)throw _e.alternate===null?Error(i(467)):Error(i(310));ot=a,a={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},It===null?_e.memoizedState=It=a:It=It.next=a}return It}function rd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function au(a){var u=ou;return ou+=1,Ca===null&&(Ca=[]),a=bw(Ca,a,u),u=_e,(It===null?u.memoizedState:It.next)===null&&(u=u.alternate,B.H=u===null||u.memoizedState===null?uT:x0),a}function sd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return au(a);if(a.$$typeof===A)return fn(a)}throw Error(i(438,String(a)))}function h0(a){var u=null,f=_e.updateQueue;if(f!==null&&(u=f.memoCache),u==null){var m=_e.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(u={data:m.data.map(function(y){return y.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),f===null&&(f=rd(),_e.updateQueue=f),f.memoCache=u,f=u.data[u.index],f===void 0)for(f=u.data[u.index]=Array(a),m=0;m<a;m++)f[m]=te;return u.index++,f}function is(a,u){return typeof u=="function"?u(a):u}function ld(a){var u=jt();return f0(u,ot,a)}function f0(a,u,f){var m=a.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=f;var y=a.baseQueue,S=m.pending;if(S!==null){if(y!==null){var w=y.next;y.next=S.next,S.next=w}u.baseQueue=y=S,m.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{u=y.next;var T=w=null,R=null,X=u,U=!1;do{var ee=X.lane&-536870913;if(ee!==X.lane?(qe&ee)===ee:(ns&ee)===ee){var I=X.revertLane;if(I===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ee===Sa&&(U=!0);else if((ns&I)===I){X=X.next,I===Sa&&(U=!0);continue}else ee={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(T=R=ee,w=S):R=R.next=ee,_e.lanes|=I,il|=I;ee=X.action,uo&&f(S,ee),S=X.hasEagerState?X.eagerState:f(S,ee)}else I={lane:ee,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(T=R=I,w=S):R=R.next=I,_e.lanes|=ee,il|=ee;X=X.next}while(X!==null&&X!==u);if(R===null?w=S:R.next=T,!ri(S,a.memoizedState)&&(Vt=!0,U&&(f=va,f!==null)))throw f;a.memoizedState=S,a.baseState=w,a.baseQueue=R,m.lastRenderedState=S}return y===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function d0(a){var u=jt(),f=u.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=a;var m=f.dispatch,y=f.pending,S=u.memoizedState;if(y!==null){f.pending=null;var w=y=y.next;do S=a(S,w.action),w=w.next;while(w!==y);ri(S,u.memoizedState)||(Vt=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),f.lastRenderedState=S}return[S,m]}function Ew(a,u,f){var m=_e,y=jt(),S=Ue;if(S){if(f===void 0)throw Error(i(407));f=f()}else f=u();var w=!ri((ot||y).memoizedState,f);if(w&&(y.memoizedState=f,Vt=!0),y=y.queue,g0(Pw.bind(null,m,y,a),[a]),y.getSnapshot!==u||w||It!==null&&It.memoizedState.tag&1){if(m.flags|=2048,Aa(9,{destroy:void 0},Rw.bind(null,m,y,f,u),null),ht===null)throw Error(i(349));S||(ns&127)!==0||$w(m,u,f)}return f}function $w(a,u,f){a.flags|=16384,a={getSnapshot:u,value:f},u=_e.updateQueue,u===null?(u=rd(),_e.updateQueue=u,u.stores=[a]):(f=u.stores,f===null?u.stores=[a]:f.push(a))}function Rw(a,u,f,m){u.value=f,u.getSnapshot=m,Dw(u)&&Nw(a)}function Pw(a,u,f){return f(function(){Dw(u)&&Nw(a)})}function Dw(a){var u=a.getSnapshot;a=a.value;try{var f=u();return!ri(a,f)}catch{return!0}}function Nw(a){var u=to(a,2);u!==null&&Yn(u,a,2)}function p0(a){var u=Pn();if(typeof a=="function"){var f=a;if(a=f(),uo){pr(!0);try{f()}finally{pr(!1)}}}return u.memoizedState=u.baseState=a,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:a},u}function zw(a,u,f,m){return a.baseState=f,f0(a,ot,typeof m=="function"?m:is)}function N_(a,u,f,m,y){if(cd(a))throw Error(i(485));if(a=u.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){S.listeners.push(w)}};B.T!==null?f(!0):S.isTransition=!1,m(S),f=u.pending,f===null?(S.next=u.pending=S,Lw(u,S)):(S.next=f.next,u.pending=f.next=S)}}function Lw(a,u){var f=u.action,m=u.payload,y=a.state;if(u.isTransition){var S=B.T,w={};B.T=w;try{var T=f(y,m),R=B.S;R!==null&&R(w,T),_w(a,u,T)}catch(X){m0(a,u,X)}finally{S!==null&&w.types!==null&&(S.types=w.types),B.T=S}}else try{S=f(y,m),_w(a,u,S)}catch(X){m0(a,u,X)}}function _w(a,u,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){Bw(a,u,m)},function(m){return m0(a,u,m)}):Bw(a,u,f)}function Bw(a,u,f){u.status="fulfilled",u.value=f,jw(u),a.state=f,u=a.pending,u!==null&&(f=u.next,f===u?a.pending=null:(f=f.next,u.next=f,Lw(a,f)))}function m0(a,u,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=f,jw(u),u=u.next;while(u!==m)}a.action=null}function jw(a){a=a.listeners;for(var u=0;u<a.length;u++)(0,a[u])()}function Zw(a,u){return u}function Xw(a,u){if(Ue){var f=ht.formState;if(f!==null){e:{var m=_e;if(Ue){if(xt){t:{for(var y=xt,S=$i;y.nodeType!==8;){if(!S){y=null;break t}if(y=Pi(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){xt=Pi(y.nextSibling),m=y.data==="F!";break e}}Us(m)}m=!1}m&&(u=f[0])}}return f=Pn(),f.memoizedState=f.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zw,lastRenderedState:u},f.queue=m,f=oT.bind(null,_e,m),m.dispatch=f,m=p0(!1),S=v0.bind(null,_e,!1,m.queue),m=Pn(),y={state:u,dispatch:null,action:a,pending:null},m.queue=y,f=N_.bind(null,_e,y,S,f),y.dispatch=f,m.memoizedState=a,[u,f,!1]}function Iw(a){var u=jt();return Vw(u,ot,a)}function Vw(a,u,f){if(u=f0(a,u,Zw)[0],a=ld(is)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=au(u)}catch(w){throw w===xa?Gf:w}else m=u;u=jt();var y=u.queue,S=y.dispatch;return f!==u.memoizedState&&(_e.flags|=2048,Aa(9,{destroy:void 0},z_.bind(null,y,f),null)),[m,S,a]}function z_(a,u){a.action=u}function qw(a){var u=jt(),f=ot;if(f!==null)return Vw(u,f,a);jt(),u=u.memoizedState,f=jt();var m=f.queue.dispatch;return f.memoizedState=a,[u,m,!1]}function Aa(a,u,f,m){return a={tag:a,create:f,deps:m,inst:u,next:null},u=_e.updateQueue,u===null&&(u=rd(),_e.updateQueue=u),f=u.lastEffect,f===null?u.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,u.lastEffect=a),a}function Hw(){return jt().memoizedState}function od(a,u,f,m){var y=Pn();_e.flags|=a,y.memoizedState=Aa(1|u,{destroy:void 0},f,m===void 0?null:m)}function ad(a,u,f,m){var y=jt();m=m===void 0?null:m;var S=y.memoizedState.inst;ot!==null&&m!==null&&l0(m,ot.memoizedState.deps)?y.memoizedState=Aa(u,S,f,m):(_e.flags|=a,y.memoizedState=Aa(1|u,S,f,m))}function Yw(a,u){od(8390656,8,a,u)}function g0(a,u){ad(2048,8,a,u)}function L_(a){_e.flags|=4;var u=_e.updateQueue;if(u===null)u=rd(),_e.updateQueue=u,u.events=[a];else{var f=u.events;f===null?u.events=[a]:f.push(a)}}function Uw(a){var u=jt().memoizedState;return L_({ref:u,nextImpl:a}),function(){if((Je&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}function Ww(a,u){return ad(4,2,a,u)}function Gw(a,u){return ad(4,4,a,u)}function Fw(a,u){if(typeof u=="function"){a=a();var f=u(a);return function(){typeof f=="function"?f():u(null)}}if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function Kw(a,u,f){f=f!=null?f.concat([a]):null,ad(4,4,Fw.bind(null,u,a),f)}function O0(){}function Jw(a,u){var f=jt();u=u===void 0?null:u;var m=f.memoizedState;return u!==null&&l0(u,m[1])?m[0]:(f.memoizedState=[a,u],a)}function eT(a,u){var f=jt();u=u===void 0?null:u;var m=f.memoizedState;if(u!==null&&l0(u,m[1]))return m[0];if(m=a(),uo){pr(!0);try{a()}finally{pr(!1)}}return f.memoizedState=[m,u],m}function y0(a,u,f){return f===void 0||(ns&1073741824)!==0&&(qe&261930)===0?a.memoizedState=u:(a.memoizedState=f,a=tC(),_e.lanes|=a,il|=a,f)}function tT(a,u,f,m){return ri(f,u)?f:wa.current!==null?(a=y0(a,f,m),ri(a,u)||(Vt=!0),a):(ns&42)===0||(ns&1073741824)!==0&&(qe&261930)===0?(Vt=!0,a.memoizedState=f):(a=tC(),_e.lanes|=a,il|=a,u)}function nT(a,u,f,m,y){var S=G.p;G.p=S!==0&&8>S?S:8;var w=B.T,T={};B.T=T,v0(a,!1,u,f);try{var R=y(),X=B.S;if(X!==null&&X(T,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var U=R_(R,m);cu(a,u,U,ui(a))}else cu(a,u,m,ui(a))}catch(ee){cu(a,u,{then:function(){},status:"rejected",reason:ee},ui())}finally{G.p=S,w!==null&&T.types!==null&&(w.types=T.types),B.T=w}}function __(){}function b0(a,u,f,m){if(a.tag!==5)throw Error(i(476));var y=iT(a).queue;nT(a,y,u,he,f===null?__:function(){return rT(a),f(m)})}function iT(a){var u=a.memoizedState;if(u!==null)return u;u={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:he},next:null};var f={};return u.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:f},next:null},a.memoizedState=u,a=a.alternate,a!==null&&(a.memoizedState=u),u}function rT(a){var u=iT(a);u.next===null&&(u=a.alternate.memoizedState),cu(a,u.next.queue,{},ui())}function S0(){return fn(Cu)}function sT(){return jt().memoizedState}function lT(){return jt().memoizedState}function B_(a){for(var u=a.return;u!==null;){switch(u.tag){case 24:case 3:var f=ui();a=Fs(f);var m=Ks(u,a,f);m!==null&&(Yn(m,u,f),ru(m,u,f)),u={cache:WO()},a.payload=u;return}u=u.return}}function j_(a,u,f){var m=ui();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},cd(a)?aT(u,f):(f=_O(a,u,f,m),f!==null&&(Yn(f,a,m),cT(f,u,m)))}function oT(a,u,f){var m=ui();cu(a,u,f,m)}function cu(a,u,f,m){var y={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(cd(a))aT(u,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=u.lastRenderedReducer,S!==null))try{var w=u.lastRenderedState,T=S(w,f);if(y.hasEagerState=!0,y.eagerState=T,ri(T,w))return If(a,u,y,0),ht===null&&Xf(),!1}catch{}finally{}if(f=_O(a,u,y,m),f!==null)return Yn(f,a,m),cT(f,u,m),!0}return!1}function v0(a,u,f,m){if(m={lane:2,revertLane:J0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},cd(a)){if(u)throw Error(i(479))}else u=_O(a,f,m,2),u!==null&&Yn(u,a,2)}function cd(a){var u=a.alternate;return a===_e||u!==null&&u===_e}function aT(a,u){Ta=nd=!0;var f=a.pending;f===null?u.next=u:(u.next=f.next,f.next=u),a.pending=u}function cT(a,u,f){if((f&4194048)!==0){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,pk(a,f)}}var uu={readContext:fn,use:sd,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};uu.useEffectEvent=$t;var uT={readContext:fn,use:sd,useCallback:function(a,u){return Pn().memoizedState=[a,u===void 0?null:u],a},useContext:fn,useEffect:Yw,useImperativeHandle:function(a,u,f){f=f!=null?f.concat([a]):null,od(4194308,4,Fw.bind(null,u,a),f)},useLayoutEffect:function(a,u){return od(4194308,4,a,u)},useInsertionEffect:function(a,u){od(4,2,a,u)},useMemo:function(a,u){var f=Pn();u=u===void 0?null:u;var m=a();if(uo){pr(!0);try{a()}finally{pr(!1)}}return f.memoizedState=[m,u],m},useReducer:function(a,u,f){var m=Pn();if(f!==void 0){var y=f(u);if(uo){pr(!0);try{f(u)}finally{pr(!1)}}}else y=u;return m.memoizedState=m.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},m.queue=a,a=a.dispatch=j_.bind(null,_e,a),[m.memoizedState,a]},useRef:function(a){var u=Pn();return a={current:a},u.memoizedState=a},useState:function(a){a=p0(a);var u=a.queue,f=oT.bind(null,_e,u);return u.dispatch=f,[a.memoizedState,f]},useDebugValue:O0,useDeferredValue:function(a,u){var f=Pn();return y0(f,a,u)},useTransition:function(){var a=p0(!1);return a=nT.bind(null,_e,a.queue,!0,!1),Pn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,u,f){var m=_e,y=Pn();if(Ue){if(f===void 0)throw Error(i(407));f=f()}else{if(f=u(),ht===null)throw Error(i(349));(qe&127)!==0||$w(m,u,f)}y.memoizedState=f;var S={value:f,getSnapshot:u};return y.queue=S,Yw(Pw.bind(null,m,S,a),[a]),m.flags|=2048,Aa(9,{destroy:void 0},Rw.bind(null,m,S,f,u),null),f},useId:function(){var a=Pn(),u=ht.identifierPrefix;if(Ue){var f=yr,m=Or;f=(m&~(1<<32-jn(m)-1)).toString(32)+f,u="_"+u+"R_"+f,f=id++,0<f&&(u+="H"+f.toString(32)),u+="_"}else f=P_++,u="_"+u+"r_"+f.toString(32)+"_";return a.memoizedState=u},useHostTransitionStatus:S0,useFormState:Xw,useActionState:Xw,useOptimistic:function(a){var u=Pn();u.memoizedState=u.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=f,u=v0.bind(null,_e,!0,f),f.dispatch=u,[a,u]},useMemoCache:h0,useCacheRefresh:function(){return Pn().memoizedState=B_.bind(null,_e)},useEffectEvent:function(a){var u=Pn(),f={impl:a};return u.memoizedState=f,function(){if((Je&2)!==0)throw Error(i(440));return f.impl.apply(void 0,arguments)}}},x0={readContext:fn,use:sd,useCallback:Jw,useContext:fn,useEffect:g0,useImperativeHandle:Kw,useInsertionEffect:Ww,useLayoutEffect:Gw,useMemo:eT,useReducer:ld,useRef:Hw,useState:function(){return ld(is)},useDebugValue:O0,useDeferredValue:function(a,u){var f=jt();return tT(f,ot.memoizedState,a,u)},useTransition:function(){var a=ld(is)[0],u=jt().memoizedState;return[typeof a=="boolean"?a:au(a),u]},useSyncExternalStore:Ew,useId:sT,useHostTransitionStatus:S0,useFormState:Iw,useActionState:Iw,useOptimistic:function(a,u){var f=jt();return zw(f,ot,a,u)},useMemoCache:h0,useCacheRefresh:lT};x0.useEffectEvent=Uw;var hT={readContext:fn,use:sd,useCallback:Jw,useContext:fn,useEffect:g0,useImperativeHandle:Kw,useInsertionEffect:Ww,useLayoutEffect:Gw,useMemo:eT,useReducer:d0,useRef:Hw,useState:function(){return d0(is)},useDebugValue:O0,useDeferredValue:function(a,u){var f=jt();return ot===null?y0(f,a,u):tT(f,ot.memoizedState,a,u)},useTransition:function(){var a=d0(is)[0],u=jt().memoizedState;return[typeof a=="boolean"?a:au(a),u]},useSyncExternalStore:Ew,useId:sT,useHostTransitionStatus:S0,useFormState:qw,useActionState:qw,useOptimistic:function(a,u){var f=jt();return ot!==null?zw(f,ot,a,u):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:h0,useCacheRefresh:lT};hT.useEffectEvent=Uw;function k0(a,u,f,m){u=a.memoizedState,f=f(m,u),f=f==null?u:p({},u,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var w0={enqueueSetState:function(a,u,f){a=a._reactInternals;var m=ui(),y=Fs(m);y.payload=u,f!=null&&(y.callback=f),u=Ks(a,y,m),u!==null&&(Yn(u,a,m),ru(u,a,m))},enqueueReplaceState:function(a,u,f){a=a._reactInternals;var m=ui(),y=Fs(m);y.tag=1,y.payload=u,f!=null&&(y.callback=f),u=Ks(a,y,m),u!==null&&(Yn(u,a,m),ru(u,a,m))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var f=ui(),m=Fs(f);m.tag=2,u!=null&&(m.callback=u),u=Ks(a,m,f),u!==null&&(Yn(u,a,f),ru(u,a,f))}};function fT(a,u,f,m,y,S,w){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,S,w):u.prototype&&u.prototype.isPureReactComponent?!Gc(f,m)||!Gc(y,S):!0}function dT(a,u,f,m){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(f,m),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(f,m),u.state!==a&&w0.enqueueReplaceState(u,u.state,null)}function ho(a,u){var f=u;if("ref"in u){f={};for(var m in u)m!=="ref"&&(f[m]=u[m])}if(a=a.defaultProps){f===u&&(f=p({},f));for(var y in a)f[y]===void 0&&(f[y]=a[y])}return f}function pT(a){Zf(a)}function mT(a){console.error(a)}function gT(a){Zf(a)}function ud(a,u){try{var f=a.onUncaughtError;f(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function OT(a,u,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function T0(a,u,f){return f=Fs(f),f.tag=3,f.payload={element:null},f.callback=function(){ud(a,u)},f}function yT(a){return a=Fs(a),a.tag=3,a}function bT(a,u,f,m){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var S=m.value;a.payload=function(){return y(S)},a.callback=function(){OT(u,f,m)}}var w=f.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){OT(u,f,m),typeof y!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var T=m.stack;this.componentDidCatch(m.value,{componentStack:T!==null?T:""})})}function Z_(a,u,f,m,y){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=f.alternate,u!==null&&ba(u,f,y,!0),f=li.current,f!==null){switch(f.tag){case 31:case 13:return Ri===null?xd():f.alternate===null&&Rt===0&&(Rt=3),f.flags&=-257,f.flags|=65536,f.lanes=y,m===Ff?f.flags|=16384:(u=f.updateQueue,u===null?f.updateQueue=new Set([m]):u.add(m),G0(a,m,y)),!1;case 22:return f.flags|=65536,m===Ff?f.flags|=16384:(u=f.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=u):(f=u.retryQueue,f===null?u.retryQueue=new Set([m]):f.add(m)),G0(a,m,y)),!1}throw Error(i(435,f.tag))}return G0(a,m,y),xd(),!1}if(Ue)return u=li.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=y,m!==VO&&(a=Error(i(422),{cause:m}),Jc(Mi(a,f)))):(m!==VO&&(u=Error(i(423),{cause:m}),Jc(Mi(u,f))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,m=Mi(m,f),y=T0(a.stateNode,m,y),t0(a,y),Rt!==4&&(Rt=2)),!1;var S=Error(i(520),{cause:m});if(S=Mi(S,f),yu===null?yu=[S]:yu.push(S),Rt!==4&&(Rt=2),u===null)return!0;m=Mi(m,f),f=u;do{switch(f.tag){case 3:return f.flags|=65536,a=y&-y,f.lanes|=a,a=T0(f.stateNode,m,a),t0(f,a),!1;case 1:if(u=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(rl===null||!rl.has(S))))return f.flags|=65536,y&=-y,f.lanes|=y,y=yT(y),bT(y,a,f,m),t0(f,y),!1}f=f.return}while(f!==null);return!1}var C0=Error(i(461)),Vt=!1;function dn(a,u,f,m){u.child=a===null?kw(u,null,f,m):co(u,a.child,f,m)}function ST(a,u,f,m,y){f=f.render;var S=u.ref;if("ref"in m){var w={};for(var T in m)T!=="ref"&&(w[T]=m[T])}else w=m;return so(u),m=o0(a,u,f,w,S,y),T=a0(),a!==null&&!Vt?(c0(a,u,y),rs(a,u,y)):(Ue&&T&&XO(u),u.flags|=1,dn(a,u,m,y),u.child)}function vT(a,u,f,m,y){if(a===null){var S=f.type;return typeof S=="function"&&!BO(S)&&S.defaultProps===void 0&&f.compare===null?(u.tag=15,u.type=S,xT(a,u,S,m,y)):(a=qf(f.type,null,m,u,u.mode,y),a.ref=u.ref,a.return=u,u.child=a)}if(S=a.child,!D0(a,y)){var w=S.memoizedProps;if(f=f.compare,f=f!==null?f:Gc,f(w,m)&&a.ref===u.ref)return rs(a,u,y)}return u.flags|=1,a=Kr(S,m),a.ref=u.ref,a.return=u,u.child=a}function xT(a,u,f,m,y){if(a!==null){var S=a.memoizedProps;if(Gc(S,m)&&a.ref===u.ref)if(Vt=!1,u.pendingProps=m=S,D0(a,y))(a.flags&131072)!==0&&(Vt=!0);else return u.lanes=a.lanes,rs(a,u,y)}return A0(a,u,f,m,y)}function kT(a,u,f,m){var y=m.children,S=a!==null?a.memoizedState:null;if(a===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((u.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,a!==null){for(m=u.child=a.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~S}else m=0,u.child=null;return wT(a,u,S,f,m)}if((f&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},a!==null&&Wf(u,S!==null?S.cachePool:null),S!==null?Cw(u,S):i0(),Aw(u);else return m=u.lanes=536870912,wT(a,u,S!==null?S.baseLanes|f:f,f,m)}else S!==null?(Wf(u,S.cachePool),Cw(u,S),el(),u.memoizedState=null):(a!==null&&Wf(u,null),i0(),el());return dn(a,u,y,f),u.child}function hu(a,u){return a!==null&&a.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function wT(a,u,f,m,y){var S=FO();return S=S===null?null:{parent:Xt._currentValue,pool:S},u.memoizedState={baseLanes:f,cachePool:S},a!==null&&Wf(u,null),i0(),Aw(u),a!==null&&ba(a,u,m,!0),u.childLanes=y,null}function hd(a,u){return u=dd({mode:u.mode,children:u.children},a.mode),u.ref=a.ref,a.child=u,u.return=a,u}function TT(a,u,f){return co(u,a.child,null,f),a=hd(u,u.pendingProps),a.flags|=2,oi(u),u.memoizedState=null,a}function X_(a,u,f){var m=u.pendingProps,y=(u.flags&128)!==0;if(u.flags&=-129,a===null){if(Ue){if(m.mode==="hidden")return a=hd(u,m),u.lanes=536870912,hu(null,a);if(s0(u),(a=xt)?(a=LC(a,$i),a=a!==null&&a.data==="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:Hs!==null?{id:Or,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},f=aw(a),f.return=u,u.child=f,hn=u,xt=null)):a=null,a===null)throw Us(u);return u.lanes=536870912,null}return hd(u,m)}var S=a.memoizedState;if(S!==null){var w=S.dehydrated;if(s0(u),y)if(u.flags&256)u.flags&=-257,u=TT(a,u,f);else if(u.memoizedState!==null)u.child=a.child,u.flags|=128,u=null;else throw Error(i(558));else if(Vt||ba(a,u,f,!1),y=(f&a.childLanes)!==0,Vt||y){if(m=ht,m!==null&&(w=mk(m,f),w!==0&&w!==S.retryLane))throw S.retryLane=w,to(a,w),Yn(m,a,w),C0;xd(),u=TT(a,u,f)}else a=S.treeContext,xt=Pi(w.nextSibling),hn=u,Ue=!0,Ys=null,$i=!1,a!==null&&hw(u,a),u=hd(u,m),u.flags|=4096;return u}return a=Kr(a.child,{mode:m.mode,children:m.children}),a.ref=u.ref,u.child=a,a.return=u,a}function fd(a,u){var f=u.ref;if(f===null)a!==null&&a.ref!==null&&(u.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(i(284));(a===null||a.ref!==f)&&(u.flags|=4194816)}}function A0(a,u,f,m,y){return so(u),f=o0(a,u,f,m,void 0,y),m=a0(),a!==null&&!Vt?(c0(a,u,y),rs(a,u,y)):(Ue&&m&&XO(u),u.flags|=1,dn(a,u,f,y),u.child)}function CT(a,u,f,m,y,S){return so(u),u.updateQueue=null,f=Qw(u,m,f,y),Mw(a),m=a0(),a!==null&&!Vt?(c0(a,u,S),rs(a,u,S)):(Ue&&m&&XO(u),u.flags|=1,dn(a,u,f,S),u.child)}function AT(a,u,f,m,y){if(so(u),u.stateNode===null){var S=ma,w=f.contextType;typeof w=="object"&&w!==null&&(S=fn(w)),S=new f(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=w0,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},JO(u),w=f.contextType,S.context=typeof w=="object"&&w!==null?fn(w):ma,S.state=u.memoizedState,w=f.getDerivedStateFromProps,typeof w=="function"&&(k0(u,f,w,m),S.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(w=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),w!==S.state&&w0.enqueueReplaceState(S,S.state,null),lu(u,m,S,y),su(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(a===null){S=u.stateNode;var T=u.memoizedProps,R=ho(f,T);S.props=R;var X=S.context,U=f.contextType;w=ma,typeof U=="object"&&U!==null&&(w=fn(U));var ee=f.getDerivedStateFromProps;U=typeof ee=="function"||typeof S.getSnapshotBeforeUpdate=="function",T=u.pendingProps!==T,U||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(T||X!==w)&&dT(u,S,m,w),Gs=!1;var I=u.memoizedState;S.state=I,lu(u,m,S,y),su(),X=u.memoizedState,T||I!==X||Gs?(typeof ee=="function"&&(k0(u,f,ee,m),X=u.memoizedState),(R=Gs||fT(u,f,R,m,I,X,w))?(U||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(u.flags|=4194308)):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=m,u.memoizedState=X),S.props=m,S.state=X,S.context=w,m=R):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,e0(a,u),w=u.memoizedProps,U=ho(f,w),S.props=U,ee=u.pendingProps,I=S.context,X=f.contextType,R=ma,typeof X=="object"&&X!==null&&(R=fn(X)),T=f.getDerivedStateFromProps,(X=typeof T=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(w!==ee||I!==R)&&dT(u,S,m,R),Gs=!1,I=u.memoizedState,S.state=I,lu(u,m,S,y),su();var q=u.memoizedState;w!==ee||I!==q||Gs||a!==null&&a.dependencies!==null&&Yf(a.dependencies)?(typeof T=="function"&&(k0(u,f,T,m),q=u.memoizedState),(U=Gs||fT(u,f,U,m,I,q,R)||a!==null&&a.dependencies!==null&&Yf(a.dependencies))?(X||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,q,R),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,q,R)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=q),S.props=m,S.state=q,S.context=R,m=U):(typeof S.componentDidUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=1024),m=!1)}return S=m,fd(a,u),m=(u.flags&128)!==0,S||m?(S=u.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:S.render(),u.flags|=1,a!==null&&m?(u.child=co(u,a.child,null,y),u.child=co(u,null,f,y)):dn(a,u,f,y),u.memoizedState=S.state,a=u.child):a=rs(a,u,y),a}function MT(a,u,f,m){return io(),u.flags|=256,dn(a,u,f,m),u.child}var M0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Q0(a){return{baseLanes:a,cachePool:Ow()}}function E0(a,u,f){return a=a!==null?a.childLanes&~f:0,u&&(a|=ci),a}function QT(a,u,f){var m=u.pendingProps,y=!1,S=(u.flags&128)!==0,w;if((w=S)||(w=a!==null&&a.memoizedState===null?!1:(Bt.current&2)!==0),w&&(y=!0,u.flags&=-129),w=(u.flags&32)!==0,u.flags&=-33,a===null){if(Ue){if(y?Js(u):el(),(a=xt)?(a=LC(a,$i),a=a!==null&&a.data!=="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:Hs!==null?{id:Or,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},f=aw(a),f.return=u,u.child=f,hn=u,xt=null)):a=null,a===null)throw Us(u);return fy(a)?u.lanes=32:u.lanes=536870912,null}var T=m.children;return m=m.fallback,y?(el(),y=u.mode,T=dd({mode:"hidden",children:T},y),m=no(m,y,f,null),T.return=u,m.return=u,T.sibling=m,u.child=T,m=u.child,m.memoizedState=Q0(f),m.childLanes=E0(a,w,f),u.memoizedState=M0,hu(null,m)):(Js(u),$0(u,T))}var R=a.memoizedState;if(R!==null&&(T=R.dehydrated,T!==null)){if(S)u.flags&256?(Js(u),u.flags&=-257,u=R0(a,u,f)):u.memoizedState!==null?(el(),u.child=a.child,u.flags|=128,u=null):(el(),T=m.fallback,y=u.mode,m=dd({mode:"visible",children:m.children},y),T=no(T,y,f,null),T.flags|=2,m.return=u,T.return=u,m.sibling=T,u.child=m,co(u,a.child,null,f),m=u.child,m.memoizedState=Q0(f),m.childLanes=E0(a,w,f),u.memoizedState=M0,u=hu(null,m));else if(Js(u),fy(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var X=w.dgst;w=X,m=Error(i(419)),m.stack="",m.digest=w,Jc({value:m,source:null,stack:null}),u=R0(a,u,f)}else if(Vt||ba(a,u,f,!1),w=(f&a.childLanes)!==0,Vt||w){if(w=ht,w!==null&&(m=mk(w,f),m!==0&&m!==R.retryLane))throw R.retryLane=m,to(a,m),Yn(w,a,m),C0;hy(T)||xd(),u=R0(a,u,f)}else hy(T)?(u.flags|=192,u.child=a.child,u=null):(a=R.treeContext,xt=Pi(T.nextSibling),hn=u,Ue=!0,Ys=null,$i=!1,a!==null&&hw(u,a),u=$0(u,m.children),u.flags|=4096);return u}return y?(el(),T=m.fallback,y=u.mode,R=a.child,X=R.sibling,m=Kr(R,{mode:"hidden",children:m.children}),m.subtreeFlags=R.subtreeFlags&65011712,X!==null?T=Kr(X,T):(T=no(T,y,f,null),T.flags|=2),T.return=u,m.return=u,m.sibling=T,u.child=m,hu(null,m),m=u.child,T=a.child.memoizedState,T===null?T=Q0(f):(y=T.cachePool,y!==null?(R=Xt._currentValue,y=y.parent!==R?{parent:R,pool:R}:y):y=Ow(),T={baseLanes:T.baseLanes|f,cachePool:y}),m.memoizedState=T,m.childLanes=E0(a,w,f),u.memoizedState=M0,hu(a.child,m)):(Js(u),f=a.child,a=f.sibling,f=Kr(f,{mode:"visible",children:m.children}),f.return=u,f.sibling=null,a!==null&&(w=u.deletions,w===null?(u.deletions=[a],u.flags|=16):w.push(a)),u.child=f,u.memoizedState=null,f)}function $0(a,u){return u=dd({mode:"visible",children:u},a.mode),u.return=a,a.child=u}function dd(a,u){return a=si(22,a,null,u),a.lanes=0,a}function R0(a,u,f){return co(u,a.child,null,f),a=$0(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function ET(a,u,f){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u),YO(a.return,u,f)}function P0(a,u,f,m,y,S){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:y,treeForkCount:S}:(w.isBackwards=u,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=f,w.tailMode=y,w.treeForkCount=S)}function $T(a,u,f){var m=u.pendingProps,y=m.revealOrder,S=m.tail;m=m.children;var w=Bt.current,T=(w&2)!==0;if(T?(w=w&1|2,u.flags|=128):w&=1,F(Bt,w),dn(a,u,m,f),m=Ue?Kc:0,!T&&a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&ET(a,f,u);else if(a.tag===19)ET(a,f,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(f=u.child,y=null;f!==null;)a=f.alternate,a!==null&&td(a)===null&&(y=f),f=f.sibling;f=y,f===null?(y=u.child,u.child=null):(y=f.sibling,f.sibling=null),P0(u,!1,y,f,S,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=u.child,u.child=null;y!==null;){if(a=y.alternate,a!==null&&td(a)===null){u.child=y;break}a=y.sibling,y.sibling=f,f=y,y=a}P0(u,!0,f,null,S,m);break;case"together":P0(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function rs(a,u,f){if(a!==null&&(u.dependencies=a.dependencies),il|=u.lanes,(f&u.childLanes)===0)if(a!==null){if(ba(a,u,f,!1),(f&u.childLanes)===0)return null}else return null;if(a!==null&&u.child!==a.child)throw Error(i(153));if(u.child!==null){for(a=u.child,f=Kr(a,a.pendingProps),u.child=f,f.return=u;a.sibling!==null;)a=a.sibling,f=f.sibling=Kr(a,a.pendingProps),f.return=u;f.sibling=null}return u.child}function D0(a,u){return(a.lanes&u)!==0?!0:(a=a.dependencies,!!(a!==null&&Yf(a)))}function I_(a,u,f){switch(u.tag){case 3:Gt(u,u.stateNode.containerInfo),Ws(u,Xt,a.memoizedState.cache),io();break;case 27:case 5:js(u);break;case 4:Gt(u,u.stateNode.containerInfo);break;case 10:Ws(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,s0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(Js(u),u.flags|=128,null):(f&u.child.childLanes)!==0?QT(a,u,f):(Js(u),a=rs(a,u,f),a!==null?a.sibling:null);Js(u);break;case 19:var y=(a.flags&128)!==0;if(m=(f&u.childLanes)!==0,m||(ba(a,u,f,!1),m=(f&u.childLanes)!==0),y){if(m)return $T(a,u,f);u.flags|=128}if(y=u.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),F(Bt,Bt.current),m)break;return null;case 22:return u.lanes=0,kT(a,u,f,u.pendingProps);case 24:Ws(u,Xt,a.memoizedState.cache)}return rs(a,u,f)}function RT(a,u,f){if(a!==null)if(a.memoizedProps!==u.pendingProps)Vt=!0;else{if(!D0(a,f)&&(u.flags&128)===0)return Vt=!1,I_(a,u,f);Vt=(a.flags&131072)!==0}else Vt=!1,Ue&&(u.flags&1048576)!==0&&uw(u,Kc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(a=oo(u.elementType),u.type=a,typeof a=="function")BO(a)?(m=ho(a,m),u.tag=1,u=AT(null,u,a,m,f)):(u.tag=0,u=A0(null,u,a,m,f));else{if(a!=null){var y=a.$$typeof;if(y===P){u.tag=11,u=ST(null,u,a,m,f);break e}else if(y===$){u.tag=14,u=vT(null,u,a,m,f);break e}}throw u=se(a)||a,Error(i(306,u,""))}}return u;case 0:return A0(a,u,u.type,u.pendingProps,f);case 1:return m=u.type,y=ho(m,u.pendingProps),AT(a,u,m,y,f);case 3:e:{if(Gt(u,u.stateNode.containerInfo),a===null)throw Error(i(387));m=u.pendingProps;var S=u.memoizedState;y=S.element,e0(a,u),lu(u,m,null,f);var w=u.memoizedState;if(m=w.cache,Ws(u,Xt,m),m!==S.cache&&UO(u,[Xt],f,!0),su(),m=w.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:w.cache},u.updateQueue.baseState=S,u.memoizedState=S,u.flags&256){u=MT(a,u,m,f);break e}else if(m!==y){y=Mi(Error(i(424)),u),Jc(y),u=MT(a,u,m,f);break e}else{switch(a=u.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(xt=Pi(a.firstChild),hn=u,Ue=!0,Ys=null,$i=!0,f=kw(u,null,m,f),u.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(io(),m===y){u=rs(a,u,f);break e}dn(a,u,m,f)}u=u.child}return u;case 26:return fd(a,u),a===null?(f=IC(u.type,null,u.pendingProps,null))?u.memoizedState=f:Ue||(f=u.type,a=u.pendingProps,m=Qd(Re.current).createElement(f),m[un]=u,m[Zn]=a,pn(m,f,a),tn(m),u.stateNode=m):u.memoizedState=IC(u.type,a.memoizedProps,u.pendingProps,a.memoizedState),null;case 27:return js(u),a===null&&Ue&&(m=u.stateNode=jC(u.type,u.pendingProps,Re.current),hn=u,$i=!0,y=xt,al(u.type)?(dy=y,xt=Pi(m.firstChild)):xt=y),dn(a,u,u.pendingProps.children,f),fd(a,u),a===null&&(u.flags|=4194304),u.child;case 5:return a===null&&Ue&&((y=m=xt)&&(m=bB(m,u.type,u.pendingProps,$i),m!==null?(u.stateNode=m,hn=u,xt=Pi(m.firstChild),$i=!1,y=!0):y=!1),y||Us(u)),js(u),y=u.type,S=u.pendingProps,w=a!==null?a.memoizedProps:null,m=S.children,ay(y,S)?m=null:w!==null&&ay(y,w)&&(u.flags|=32),u.memoizedState!==null&&(y=o0(a,u,D_,null,null,f),Cu._currentValue=y),fd(a,u),dn(a,u,m,f),u.child;case 6:return a===null&&Ue&&((a=f=xt)&&(f=SB(f,u.pendingProps,$i),f!==null?(u.stateNode=f,hn=u,xt=null,a=!0):a=!1),a||Us(u)),null;case 13:return QT(a,u,f);case 4:return Gt(u,u.stateNode.containerInfo),m=u.pendingProps,a===null?u.child=co(u,null,m,f):dn(a,u,m,f),u.child;case 11:return ST(a,u,u.type,u.pendingProps,f);case 7:return dn(a,u,u.pendingProps,f),u.child;case 8:return dn(a,u,u.pendingProps.children,f),u.child;case 12:return dn(a,u,u.pendingProps.children,f),u.child;case 10:return m=u.pendingProps,Ws(u,u.type,m.value),dn(a,u,m.children,f),u.child;case 9:return y=u.type._context,m=u.pendingProps.children,so(u),y=fn(y),m=m(y),u.flags|=1,dn(a,u,m,f),u.child;case 14:return vT(a,u,u.type,u.pendingProps,f);case 15:return xT(a,u,u.type,u.pendingProps,f);case 19:return $T(a,u,f);case 31:return X_(a,u,f);case 22:return kT(a,u,f,u.pendingProps);case 24:return so(u),m=fn(Xt),a===null?(y=FO(),y===null&&(y=ht,S=WO(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=f),y=S),u.memoizedState={parent:m,cache:y},JO(u),Ws(u,Xt,y)):((a.lanes&f)!==0&&(e0(a,u),lu(u,null,null,f),su()),y=a.memoizedState,S=u.memoizedState,y.parent!==m?(y={parent:m,cache:m},u.memoizedState=y,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=y),Ws(u,Xt,m)):(m=S.cache,Ws(u,Xt,m),m!==y.cache&&UO(u,[Xt],f,!0))),dn(a,u,u.pendingProps.children,f),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function ss(a){a.flags|=4}function N0(a,u,f,m,y){if((u=(a.mode&32)!==0)&&(u=!1),u){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(sC())a.flags|=8192;else throw ao=Ff,KO}else a.flags&=-16777217}function PT(a,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!UC(u))if(sC())a.flags|=8192;else throw ao=Ff,KO}function pd(a,u){u!==null&&(a.flags|=4),a.flags&16384&&(u=a.tag!==22?Fi():536870912,a.lanes|=u,$a|=u)}function fu(a,u){if(!Ue)switch(a.tailMode){case"hidden":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function kt(a){var u=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(u)for(var y=a.child;y!==null;)f|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)f|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=m,a.childLanes=f,u}function V_(a,u,f){var m=u.pendingProps;switch(IO(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(u),null;case 1:return kt(u),null;case 3:return f=u.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),ts(Xt),bt(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(ya(u)?ss(u):a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,qO())),kt(u),null;case 26:var y=u.type,S=u.memoizedState;return a===null?(ss(u),S!==null?(kt(u),PT(u,S)):(kt(u),N0(u,y,null,m,f))):S?S!==a.memoizedState?(ss(u),kt(u),PT(u,S)):(kt(u),u.flags&=-16777217):(a=a.memoizedProps,a!==m&&ss(u),kt(u),N0(u,y,a,m,f)),null;case 27:if(Ul(u),f=Re.current,y=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&ss(u);else{if(!m){if(u.stateNode===null)throw Error(i(166));return kt(u),null}a=le.current,ya(u)?fw(u):(a=jC(y,m,f),u.stateNode=a,ss(u))}return kt(u),null;case 5:if(Ul(u),y=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&ss(u);else{if(!m){if(u.stateNode===null)throw Error(i(166));return kt(u),null}if(S=le.current,ya(u))fw(u);else{var w=Qd(Re.current);switch(S){case 1:S=w.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=w.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=w.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?w.createElement("select",{is:m.is}):w.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?w.createElement(y,{is:m.is}):w.createElement(y)}}S[un]=u,S[Zn]=m;e:for(w=u.child;w!==null;){if(w.tag===5||w.tag===6)S.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===u)break e;for(;w.sibling===null;){if(w.return===null||w.return===u)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}u.stateNode=S;e:switch(pn(S,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ss(u)}}return kt(u),N0(u,u.type,a===null?null:a.memoizedProps,u.pendingProps,f),null;case 6:if(a&&u.stateNode!=null)a.memoizedProps!==m&&ss(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(i(166));if(a=Re.current,ya(u)){if(a=u.stateNode,f=u.memoizedProps,m=null,y=hn,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}a[un]=u,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||QC(a.nodeValue,f)),a||Us(u,!0)}else a=Qd(a).createTextNode(m),a[un]=u,u.stateNode=a}return kt(u),null;case 31:if(f=u.memoizedState,a===null||a.memoizedState!==null){if(m=ya(u),f!==null){if(a===null){if(!m)throw Error(i(318));if(a=u.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[un]=u}else io(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;kt(u),a=!1}else f=qO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return u.flags&256?(oi(u),u):(oi(u),null);if((u.flags&128)!==0)throw Error(i(558))}return kt(u),null;case 13:if(m=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=ya(u),m!==null&&m.dehydrated!==null){if(a===null){if(!y)throw Error(i(318));if(y=u.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[un]=u}else io(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;kt(u),y=!1}else y=qO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return u.flags&256?(oi(u),u):(oi(u),null)}return oi(u),(u.flags&128)!==0?(u.lanes=f,u):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=u.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==y&&(m.flags|=2048)),f!==a&&f&&(u.child.flags|=8192),pd(u,u.updateQueue),kt(u),null);case 4:return bt(),a===null&&iy(u.stateNode.containerInfo),kt(u),null;case 10:return ts(u.type),kt(u),null;case 19:if(j(Bt),m=u.memoizedState,m===null)return kt(u),null;if(y=(u.flags&128)!==0,S=m.rendering,S===null)if(y)fu(m,!1);else{if(Rt!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(S=td(a),S!==null){for(u.flags|=128,fu(m,!1),a=S.updateQueue,u.updateQueue=a,pd(u,a),u.subtreeFlags=0,a=f,f=u.child;f!==null;)ow(f,a),f=f.sibling;return F(Bt,Bt.current&1|2),Ue&&Jr(u,m.treeForkCount),u.child}a=a.sibling}m.tail!==null&&kn()>bd&&(u.flags|=128,y=!0,fu(m,!1),u.lanes=4194304)}else{if(!y)if(a=td(S),a!==null){if(u.flags|=128,y=!0,a=a.updateQueue,u.updateQueue=a,pd(u,a),fu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Ue)return kt(u),null}else 2*kn()-m.renderingStartTime>bd&&f!==536870912&&(u.flags|=128,y=!0,fu(m,!1),u.lanes=4194304);m.isBackwards?(S.sibling=u.child,u.child=S):(a=m.last,a!==null?a.sibling=S:u.child=S,m.last=S)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=kn(),a.sibling=null,f=Bt.current,F(Bt,y?f&1|2:f&1),Ue&&Jr(u,m.treeForkCount),a):(kt(u),null);case 22:case 23:return oi(u),r0(),m=u.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(u.flags|=8192):m&&(u.flags|=8192),m?(f&536870912)!==0&&(u.flags&128)===0&&(kt(u),u.subtreeFlags&6&&(u.flags|=8192)):kt(u),f=u.updateQueue,f!==null&&pd(u,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==f&&(u.flags|=2048),a!==null&&j(lo),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),u.memoizedState.cache!==f&&(u.flags|=2048),ts(Xt),kt(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function q_(a,u){switch(IO(u),u.tag){case 1:return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return ts(Xt),bt(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 26:case 27:case 5:return Ul(u),null;case 31:if(u.memoizedState!==null){if(oi(u),u.alternate===null)throw Error(i(340));io()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 13:if(oi(u),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(i(340));io()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return j(Bt),null;case 4:return bt(),null;case 10:return ts(u.type),null;case 22:case 23:return oi(u),r0(),a!==null&&j(lo),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 24:return ts(Xt),null;case 25:return null;default:return null}}function DT(a,u){switch(IO(u),u.tag){case 3:ts(Xt),bt();break;case 26:case 27:case 5:Ul(u);break;case 4:bt();break;case 31:u.memoizedState!==null&&oi(u);break;case 13:oi(u);break;case 19:j(Bt);break;case 10:ts(u.type);break;case 22:case 23:oi(u),r0(),a!==null&&j(lo);break;case 24:ts(Xt)}}function du(a,u){try{var f=u.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var y=m.next;f=y;do{if((f.tag&a)===a){m=void 0;var S=f.create,w=f.inst;m=S(),w.destroy=m}f=f.next}while(f!==y)}}catch(T){st(u,u.return,T)}}function tl(a,u,f){try{var m=u.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var S=y.next;m=S;do{if((m.tag&a)===a){var w=m.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,y=u;var R=f,X=T;try{X()}catch(U){st(y,R,U)}}}m=m.next}while(m!==S)}}catch(U){st(u,u.return,U)}}function NT(a){var u=a.updateQueue;if(u!==null){var f=a.stateNode;try{Tw(u,f)}catch(m){st(a,a.return,m)}}}function zT(a,u,f){f.props=ho(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){st(a,u,m)}}function pu(a,u){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(y){st(a,u,y)}}function br(a,u){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(y){st(a,u,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){st(a,u,y)}else f.current=null}function LT(a){var u=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(y){st(a,a.return,y)}}function z0(a,u,f){try{var m=a.stateNode;dB(m,a.type,f,u),m[Zn]=u}catch(y){st(a,a.return,y)}}function _T(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&al(a.type)||a.tag===4}function L0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||_T(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&al(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _0(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,u):(u=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,u.appendChild(a),f=f._reactRootContainer,f!=null||u.onclick!==null||(u.onclick=Gr));else if(m!==4&&(m===27&&al(a.type)&&(f=a.stateNode,u=null),a=a.child,a!==null))for(_0(a,u,f),a=a.sibling;a!==null;)_0(a,u,f),a=a.sibling}function md(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?f.insertBefore(a,u):f.appendChild(a);else if(m!==4&&(m===27&&al(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(md(a,u,f),a=a.sibling;a!==null;)md(a,u,f),a=a.sibling}function BT(a){var u=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,y=u.attributes;y.length;)u.removeAttributeNode(y[0]);pn(u,m,f),u[un]=a,u[Zn]=f}catch(S){st(a,a.return,S)}}var ls=!1,qt=!1,B0=!1,jT=typeof WeakSet=="function"?WeakSet:Set,nn=null;function H_(a,u){if(a=a.containerInfo,ly=zd,a=Kk(a),RO(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var y=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var w=0,T=-1,R=-1,X=0,U=0,ee=a,I=null;t:for(;;){for(var q;ee!==f||y!==0&&ee.nodeType!==3||(T=w+y),ee!==S||m!==0&&ee.nodeType!==3||(R=w+m),ee.nodeType===3&&(w+=ee.nodeValue.length),(q=ee.firstChild)!==null;)I=ee,ee=q;for(;;){if(ee===a)break t;if(I===f&&++X===y&&(T=w),I===S&&++U===m&&(R=w),(q=ee.nextSibling)!==null)break;ee=I,I=ee.parentNode}ee=q}f=T===-1||R===-1?null:{start:T,end:R}}else f=null}f=f||{start:0,end:0}}else f=null;for(oy={focusedElem:a,selectionRange:f},zd=!1,nn=u;nn!==null;)if(u=nn,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,nn=a;else for(;nn!==null;){switch(u=nn,S=u.alternate,a=u.flags,u.tag){case 0:if((a&4)!==0&&(a=u.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)y=a[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,f=u,y=S.memoizedProps,S=S.memoizedState,m=f.stateNode;try{var be=ho(f.type,y);a=m.getSnapshotBeforeUpdate(be,S),m.__reactInternalSnapshotBeforeUpdate=a}catch(Qe){st(f,f.return,Qe)}}break;case 3:if((a&1024)!==0){if(a=u.stateNode.containerInfo,f=a.nodeType,f===9)uy(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":uy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=u.sibling,a!==null){a.return=u.return,nn=a;break}nn=u.return}}function ZT(a,u,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:cs(a,f),m&4&&du(5,f);break;case 1:if(cs(a,f),m&4)if(a=f.stateNode,u===null)try{a.componentDidMount()}catch(w){st(f,f.return,w)}else{var y=ho(f.type,u.memoizedProps);u=u.memoizedState;try{a.componentDidUpdate(y,u,a.__reactInternalSnapshotBeforeUpdate)}catch(w){st(f,f.return,w)}}m&64&&NT(f),m&512&&pu(f,f.return);break;case 3:if(cs(a,f),m&64&&(a=f.updateQueue,a!==null)){if(u=null,f.child!==null)switch(f.child.tag){case 27:case 5:u=f.child.stateNode;break;case 1:u=f.child.stateNode}try{Tw(a,u)}catch(w){st(f,f.return,w)}}break;case 27:u===null&&m&4&&BT(f);case 26:case 5:cs(a,f),u===null&&m&4&&LT(f),m&512&&pu(f,f.return);break;case 12:cs(a,f);break;case 31:cs(a,f),m&4&&VT(a,f);break;case 13:cs(a,f),m&4&&qT(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=tB.bind(null,f),vB(a,f))));break;case 22:if(m=f.memoizedState!==null||ls,!m){u=u!==null&&u.memoizedState!==null||qt,y=ls;var S=qt;ls=m,(qt=u)&&!S?us(a,f,(f.subtreeFlags&8772)!==0):cs(a,f),ls=y,qt=S}break;case 30:break;default:cs(a,f)}}function XT(a){var u=a.alternate;u!==null&&(a.alternate=null,XT(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&mO(u)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Mt=null,In=!1;function as(a,u,f){for(f=f.child;f!==null;)IT(a,u,f),f=f.sibling}function IT(a,u,f){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Gl,f)}catch{}switch(f.tag){case 26:qt||br(f,u),as(a,u,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:qt||br(f,u);var m=Mt,y=In;al(f.type)&&(Mt=f.stateNode,In=!1),as(a,u,f),ku(f.stateNode),Mt=m,In=y;break;case 5:qt||br(f,u);case 6:if(m=Mt,y=In,Mt=null,as(a,u,f),Mt=m,In=y,Mt!==null)if(In)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(f.stateNode)}catch(S){st(f,u,S)}else try{Mt.removeChild(f.stateNode)}catch(S){st(f,u,S)}break;case 18:Mt!==null&&(In?(a=Mt,NC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Ba(a)):NC(Mt,f.stateNode));break;case 4:m=Mt,y=In,Mt=f.stateNode.containerInfo,In=!0,as(a,u,f),Mt=m,In=y;break;case 0:case 11:case 14:case 15:tl(2,f,u),qt||tl(4,f,u),as(a,u,f);break;case 1:qt||(br(f,u),m=f.stateNode,typeof m.componentWillUnmount=="function"&&zT(f,u,m)),as(a,u,f);break;case 21:as(a,u,f);break;case 22:qt=(m=qt)||f.memoizedState!==null,as(a,u,f),qt=m;break;default:as(a,u,f)}}function VT(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ba(a)}catch(f){st(u,u.return,f)}}}function qT(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ba(a)}catch(f){st(u,u.return,f)}}function Y_(a){switch(a.tag){case 31:case 13:case 19:var u=a.stateNode;return u===null&&(u=a.stateNode=new jT),u;case 22:return a=a.stateNode,u=a._retryCache,u===null&&(u=a._retryCache=new jT),u;default:throw Error(i(435,a.tag))}}function gd(a,u){var f=Y_(a);u.forEach(function(m){if(!f.has(m)){f.add(m);var y=nB.bind(null,a,m);m.then(y,y)}})}function Vn(a,u){var f=u.deletions;if(f!==null)for(var m=0;m<f.length;m++){var y=f[m],S=a,w=u,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(al(T.type)){Mt=T.stateNode,In=!1;break e}break;case 5:Mt=T.stateNode,In=!1;break e;case 3:case 4:Mt=T.stateNode.containerInfo,In=!0;break e}T=T.return}if(Mt===null)throw Error(i(160));IT(S,w,y),Mt=null,In=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)HT(u,a),u=u.sibling}var Ji=null;function HT(a,u){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Vn(u,a),qn(a),m&4&&(tl(3,a,a.return),du(3,a),tl(5,a,a.return));break;case 1:Vn(u,a),qn(a),m&512&&(qt||f===null||br(f,f.return)),m&64&&ls&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var y=Ji;if(Vn(u,a),qn(a),m&512&&(qt||f===null||br(f,f.return)),m&4){var S=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Zc]||S[un]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(m),y.head.insertBefore(S,y.querySelector("head > title"))),pn(S,m,f),S[un]=a,tn(S),m=S;break e;case"link":var w=HC("link","href",y).get(m+(f.href||""));if(w){for(var T=0;T<w.length;T++)if(S=w[T],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){w.splice(T,1);break t}}S=y.createElement(m),pn(S,m,f),y.head.appendChild(S);break;case"meta":if(w=HC("meta","content",y).get(m+(f.content||""))){for(T=0;T<w.length;T++)if(S=w[T],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){w.splice(T,1);break t}}S=y.createElement(m),pn(S,m,f),y.head.appendChild(S);break;default:throw Error(i(468,m))}S[un]=a,tn(S),m=S}a.stateNode=m}else YC(y,a.type,a.stateNode);else a.stateNode=qC(y,m,a.memoizedProps);else S!==m?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,m===null?YC(y,a.type,a.stateNode):qC(y,m,a.memoizedProps)):m===null&&a.stateNode!==null&&z0(a,a.memoizedProps,f.memoizedProps)}break;case 27:Vn(u,a),qn(a),m&512&&(qt||f===null||br(f,f.return)),f!==null&&m&4&&z0(a,a.memoizedProps,f.memoizedProps);break;case 5:if(Vn(u,a),qn(a),m&512&&(qt||f===null||br(f,f.return)),a.flags&32){y=a.stateNode;try{aa(y,"")}catch(be){st(a,a.return,be)}}m&4&&a.stateNode!=null&&(y=a.memoizedProps,z0(a,y,f!==null?f.memoizedProps:y)),m&1024&&(B0=!0);break;case 6:if(Vn(u,a),qn(a),m&4){if(a.stateNode===null)throw Error(i(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(be){st(a,a.return,be)}}break;case 3:if(Rd=null,y=Ji,Ji=Ed(u.containerInfo),Vn(u,a),Ji=y,qn(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Ba(u.containerInfo)}catch(be){st(a,a.return,be)}B0&&(B0=!1,YT(a));break;case 4:m=Ji,Ji=Ed(a.stateNode.containerInfo),Vn(u,a),qn(a),Ji=m;break;case 12:Vn(u,a),qn(a);break;case 31:Vn(u,a),qn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gd(a,m)));break;case 13:Vn(u,a),qn(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(yd=kn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gd(a,m)));break;case 22:y=a.memoizedState!==null;var R=f!==null&&f.memoizedState!==null,X=ls,U=qt;if(ls=X||y,qt=U||R,Vn(u,a),qt=U,ls=X,qn(a),m&8192)e:for(u=a.stateNode,u._visibility=y?u._visibility&-2:u._visibility|1,y&&(f===null||R||ls||qt||fo(a)),f=null,u=a;;){if(u.tag===5||u.tag===26){if(f===null){R=f=u;try{if(S=R.stateNode,y)w=S.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=R.stateNode;var ee=R.memoizedProps.style,I=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;T.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(be){st(R,R.return,be)}}}else if(u.tag===6){if(f===null){R=u;try{R.stateNode.nodeValue=y?"":R.memoizedProps}catch(be){st(R,R.return,be)}}}else if(u.tag===18){if(f===null){R=u;try{var q=R.stateNode;y?zC(q,!0):zC(R.stateNode,!1)}catch(be){st(R,R.return,be)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===a)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break e;for(;u.sibling===null;){if(u.return===null||u.return===a)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,gd(a,f))));break;case 19:Vn(u,a),qn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gd(a,m)));break;case 30:break;case 21:break;default:Vn(u,a),qn(a)}}function qn(a){var u=a.flags;if(u&2){try{for(var f,m=a.return;m!==null;){if(_T(m)){f=m;break}m=m.return}if(f==null)throw Error(i(160));switch(f.tag){case 27:var y=f.stateNode,S=L0(a);md(a,S,y);break;case 5:var w=f.stateNode;f.flags&32&&(aa(w,""),f.flags&=-33);var T=L0(a);md(a,T,w);break;case 3:case 4:var R=f.stateNode.containerInfo,X=L0(a);_0(a,X,R);break;default:throw Error(i(161))}}catch(U){st(a,a.return,U)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function YT(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var u=a;YT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),a=a.sibling}}function cs(a,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ZT(a,u.alternate,u),u=u.sibling}function fo(a){for(a=a.child;a!==null;){var u=a;switch(u.tag){case 0:case 11:case 14:case 15:tl(4,u,u.return),fo(u);break;case 1:br(u,u.return);var f=u.stateNode;typeof f.componentWillUnmount=="function"&&zT(u,u.return,f),fo(u);break;case 27:ku(u.stateNode);case 26:case 5:br(u,u.return),fo(u);break;case 22:u.memoizedState===null&&fo(u);break;case 30:fo(u);break;default:fo(u)}a=a.sibling}}function us(a,u,f){for(f=f&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var m=u.alternate,y=a,S=u,w=S.flags;switch(S.tag){case 0:case 11:case 15:us(y,S,f),du(4,S);break;case 1:if(us(y,S,f),m=S,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(X){st(m,m.return,X)}if(m=S,y=m.updateQueue,y!==null){var T=m.stateNode;try{var R=y.shared.hiddenCallbacks;if(R!==null)for(y.shared.hiddenCallbacks=null,y=0;y<R.length;y++)ww(R[y],T)}catch(X){st(m,m.return,X)}}f&&w&64&&NT(S),pu(S,S.return);break;case 27:BT(S);case 26:case 5:us(y,S,f),f&&m===null&&w&4&&LT(S),pu(S,S.return);break;case 12:us(y,S,f);break;case 31:us(y,S,f),f&&w&4&&VT(y,S);break;case 13:us(y,S,f),f&&w&4&&qT(y,S);break;case 22:S.memoizedState===null&&us(y,S,f),pu(S,S.return);break;case 30:break;default:us(y,S,f)}u=u.sibling}}function j0(a,u){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(a=u.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&eu(f))}function Z0(a,u){a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&eu(a))}function er(a,u,f,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)UT(a,u,f,m),u=u.sibling}function UT(a,u,f,m){var y=u.flags;switch(u.tag){case 0:case 11:case 15:er(a,u,f,m),y&2048&&du(9,u);break;case 1:er(a,u,f,m);break;case 3:er(a,u,f,m),y&2048&&(a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&eu(a)));break;case 12:if(y&2048){er(a,u,f,m),a=u.stateNode;try{var S=u.memoizedProps,w=S.id,T=S.onPostCommit;typeof T=="function"&&T(w,u.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(R){st(u,u.return,R)}}else er(a,u,f,m);break;case 31:er(a,u,f,m);break;case 13:er(a,u,f,m);break;case 23:break;case 22:S=u.stateNode,w=u.alternate,u.memoizedState!==null?S._visibility&2?er(a,u,f,m):mu(a,u):S._visibility&2?er(a,u,f,m):(S._visibility|=2,Ma(a,u,f,m,(u.subtreeFlags&10256)!==0||!1)),y&2048&&j0(w,u);break;case 24:er(a,u,f,m),y&2048&&Z0(u.alternate,u);break;default:er(a,u,f,m)}}function Ma(a,u,f,m,y){for(y=y&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=a,w=u,T=f,R=m,X=w.flags;switch(w.tag){case 0:case 11:case 15:Ma(S,w,T,R,y),du(8,w);break;case 23:break;case 22:var U=w.stateNode;w.memoizedState!==null?U._visibility&2?Ma(S,w,T,R,y):mu(S,w):(U._visibility|=2,Ma(S,w,T,R,y)),y&&X&2048&&j0(w.alternate,w);break;case 24:Ma(S,w,T,R,y),y&&X&2048&&Z0(w.alternate,w);break;default:Ma(S,w,T,R,y)}u=u.sibling}}function mu(a,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var f=a,m=u,y=m.flags;switch(m.tag){case 22:mu(f,m),y&2048&&j0(m.alternate,m);break;case 24:mu(f,m),y&2048&&Z0(m.alternate,m);break;default:mu(f,m)}u=u.sibling}}var gu=8192;function Qa(a,u,f){if(a.subtreeFlags&gu)for(a=a.child;a!==null;)WT(a,u,f),a=a.sibling}function WT(a,u,f){switch(a.tag){case 26:Qa(a,u,f),a.flags&gu&&a.memoizedState!==null&&PB(f,Ji,a.memoizedState,a.memoizedProps);break;case 5:Qa(a,u,f);break;case 3:case 4:var m=Ji;Ji=Ed(a.stateNode.containerInfo),Qa(a,u,f),Ji=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=gu,gu=16777216,Qa(a,u,f),gu=m):Qa(a,u,f));break;default:Qa(a,u,f)}}function GT(a){var u=a.alternate;if(u!==null&&(a=u.child,a!==null)){u.child=null;do u=a.sibling,a.sibling=null,a=u;while(a!==null)}}function Ou(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];nn=m,KT(m,a)}GT(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)FT(a),a=a.sibling}function FT(a){switch(a.tag){case 0:case 11:case 15:Ou(a),a.flags&2048&&tl(9,a,a.return);break;case 3:Ou(a);break;case 12:Ou(a);break;case 22:var u=a.stateNode;a.memoizedState!==null&&u._visibility&2&&(a.return===null||a.return.tag!==13)?(u._visibility&=-3,Od(a)):Ou(a);break;default:Ou(a)}}function Od(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];nn=m,KT(m,a)}GT(a)}for(a=a.child;a!==null;){switch(u=a,u.tag){case 0:case 11:case 15:tl(8,u,u.return),Od(u);break;case 22:f=u.stateNode,f._visibility&2&&(f._visibility&=-3,Od(u));break;default:Od(u)}a=a.sibling}}function KT(a,u){for(;nn!==null;){var f=nn;switch(f.tag){case 0:case 11:case 15:tl(8,f,u);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:eu(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,nn=m;else e:for(f=a;nn!==null;){m=nn;var y=m.sibling,S=m.return;if(XT(m),m===f){nn=null;break e}if(y!==null){y.return=S,nn=y;break e}nn=S}}}var U_={getCacheForType:function(a){var u=fn(Xt),f=u.data.get(a);return f===void 0&&(f=a(),u.data.set(a,f)),f},cacheSignal:function(){return fn(Xt).controller.signal}},W_=typeof WeakMap=="function"?WeakMap:Map,Je=0,ht=null,Xe=null,qe=0,rt=0,ai=null,nl=!1,Ea=!1,X0=!1,hs=0,Rt=0,il=0,po=0,I0=0,ci=0,$a=0,yu=null,Hn=null,V0=!1,yd=0,JT=0,bd=1/0,Sd=null,rl=null,Kt=0,sl=null,Ra=null,fs=0,q0=0,H0=null,eC=null,bu=0,Y0=null;function ui(){return(Je&2)!==0&&qe!==0?qe&-qe:B.T!==null?J0():gk()}function tC(){if(ci===0)if((qe&536870912)===0||Ue){var a=ze;ze<<=1,(ze&3932160)===0&&(ze=262144),ci=a}else ci=536870912;return a=li.current,a!==null&&(a.flags|=32),ci}function Yn(a,u,f){(a===ht&&(rt===2||rt===9)||a.cancelPendingCommit!==null)&&(Pa(a,0),ll(a,qe,ci,!1)),jc(a,f),((Je&2)===0||a!==ht)&&(a===ht&&((Je&2)===0&&(po|=f),Rt===4&&ll(a,qe,ci,!1)),Sr(a))}function nC(a,u,f){if((Je&6)!==0)throw Error(i(327));var m=!f&&(u&127)===0&&(u&a.expiredLanes)===0||mr(a,u),y=m?K_(a,u):W0(a,u,!0),S=m;do{if(y===0){Ea&&!m&&ll(a,u,0,!1);break}else{if(f=a.current.alternate,S&&!G_(f)){y=W0(a,u,!1),S=!1;continue}if(y===2){if(S=u,a.errorRecoveryDisabledLanes&S)var w=0;else w=a.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){u=w;e:{var T=a;y=yu;var R=T.current.memoizedState.isDehydrated;if(R&&(Pa(T,w).flags|=256),w=W0(T,w,!1),w!==2){if(X0&&!R){T.errorRecoveryDisabledLanes|=S,po|=S,y=4;break e}S=Hn,Hn=y,S!==null&&(Hn===null?Hn=S:Hn.push.apply(Hn,S))}y=w}if(S=!1,y!==2)continue}}if(y===1){Pa(a,0),ll(a,u,0,!0);break}e:{switch(m=a,S=y,S){case 0:case 1:throw Error(i(345));case 4:if((u&4194048)!==u)break;case 6:ll(m,u,ci,!nl);break e;case 2:Hn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((u&62914560)===u&&(y=yd+300-kn(),10<y)){if(ll(m,u,ci,!nl),Gi(m,0,!0)!==0)break e;fs=u,m.timeoutHandle=PC(iC.bind(null,m,f,Hn,Sd,V0,u,ci,po,$a,nl,S,"Throttled",-0,0),y);break e}iC(m,f,Hn,Sd,V0,u,ci,po,$a,nl,S,null,-0,0)}}break}while(!0);Sr(a)}function iC(a,u,f,m,y,S,w,T,R,X,U,ee,I,q){if(a.timeoutHandle=-1,ee=u.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gr},WT(u,S,ee);var be=(S&62914560)===S?yd-kn():(S&4194048)===S?JT-kn():0;if(be=DB(ee,be),be!==null){fs=S,a.cancelPendingCommit=be(hC.bind(null,a,u,S,f,m,y,w,T,R,U,ee,null,I,q)),ll(a,S,w,!X);return}}hC(a,u,S,f,m,y,w,T,R)}function G_(a){for(var u=a;;){var f=u.tag;if((f===0||f===11||f===15)&&u.flags&16384&&(f=u.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var y=f[m],S=y.getSnapshot;y=y.value;try{if(!ri(S(),y))return!1}catch{return!1}}if(f=u.child,u.subtreeFlags&16384&&f!==null)f.return=u,u=f;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function ll(a,u,f,m){u&=~I0,u&=~po,a.suspendedLanes|=u,a.pingedLanes&=~u,m&&(a.warmLanes|=u),m=a.expirationTimes;for(var y=u;0<y;){var S=31-jn(y),w=1<<S;m[S]=-1,y&=~w}f!==0&&dk(a,f,u)}function vd(){return(Je&6)===0?(Su(0),!1):!0}function U0(){if(Xe!==null){if(rt===0)var a=Xe.return;else a=Xe,es=ro=null,u0(a),ka=null,nu=0,a=Xe;for(;a!==null;)DT(a.alternate,a),a=a.return;Xe=null}}function Pa(a,u){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,gB(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),fs=0,U0(),ht=a,Xe=f=Kr(a.current,null),qe=u,rt=0,ai=null,nl=!1,Ea=mr(a,u),X0=!1,$a=ci=I0=po=il=Rt=0,Hn=yu=null,V0=!1,(u&8)!==0&&(u|=u&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=u;0<m;){var y=31-jn(m),S=1<<y;u|=a[y],m&=~S}return hs=u,Xf(),f}function rC(a,u){_e=null,B.H=uu,u===xa||u===Gf?(u=Sw(),rt=3):u===KO?(u=Sw(),rt=4):rt=u===C0?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,ai=u,Xe===null&&(Rt=1,ud(a,Mi(u,a.current)))}function sC(){var a=li.current;return a===null?!0:(qe&4194048)===qe?Ri===null:(qe&62914560)===qe||(qe&536870912)!==0?a===Ri:!1}function lC(){var a=B.H;return B.H=uu,a===null?uu:a}function oC(){var a=B.A;return B.A=U_,a}function xd(){Rt=4,nl||(qe&4194048)!==qe&&li.current!==null||(Ea=!0),(il&134217727)===0&&(po&134217727)===0||ht===null||ll(ht,qe,ci,!1)}function W0(a,u,f){var m=Je;Je|=2;var y=lC(),S=oC();(ht!==a||qe!==u)&&(Sd=null,Pa(a,u)),u=!1;var w=Rt;e:do try{if(rt!==0&&Xe!==null){var T=Xe,R=ai;switch(rt){case 8:U0(),w=6;break e;case 3:case 2:case 9:case 6:li.current===null&&(u=!0);var X=rt;if(rt=0,ai=null,Da(a,T,R,X),f&&Ea){w=0;break e}break;default:X=rt,rt=0,ai=null,Da(a,T,R,X)}}F_(),w=Rt;break}catch(U){rC(a,U)}while(!0);return u&&a.shellSuspendCounter++,es=ro=null,Je=m,B.H=y,B.A=S,Xe===null&&(ht=null,qe=0,Xf()),w}function F_(){for(;Xe!==null;)aC(Xe)}function K_(a,u){var f=Je;Je|=2;var m=lC(),y=oC();ht!==a||qe!==u?(Sd=null,bd=kn()+500,Pa(a,u)):Ea=mr(a,u);e:do try{if(rt!==0&&Xe!==null){u=Xe;var S=ai;t:switch(rt){case 1:rt=0,ai=null,Da(a,u,S,1);break;case 2:case 9:if(yw(S)){rt=0,ai=null,cC(u);break}u=function(){rt!==2&&rt!==9||ht!==a||(rt=7),Sr(a)},S.then(u,u);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:yw(S)?(rt=0,ai=null,cC(u)):(rt=0,ai=null,Da(a,u,S,7));break;case 5:var w=null;switch(Xe.tag){case 26:w=Xe.memoizedState;case 5:case 27:var T=Xe;if(w?UC(w):T.stateNode.complete){rt=0,ai=null;var R=T.sibling;if(R!==null)Xe=R;else{var X=T.return;X!==null?(Xe=X,kd(X)):Xe=null}break t}}rt=0,ai=null,Da(a,u,S,5);break;case 6:rt=0,ai=null,Da(a,u,S,6);break;case 8:U0(),Rt=6;break e;default:throw Error(i(462))}}J_();break}catch(U){rC(a,U)}while(!0);return es=ro=null,B.H=m,B.A=y,Je=f,Xe!==null?0:(ht=null,qe=0,Xf(),Rt)}function J_(){for(;Xe!==null&&!Qf();)aC(Xe)}function aC(a){var u=RT(a.alternate,a,hs);a.memoizedProps=a.pendingProps,u===null?kd(a):Xe=u}function cC(a){var u=a,f=u.alternate;switch(u.tag){case 15:case 0:u=CT(f,u,u.pendingProps,u.type,void 0,qe);break;case 11:u=CT(f,u,u.pendingProps,u.type.render,u.ref,qe);break;case 5:u0(u);default:DT(f,u),u=Xe=ow(u,hs),u=RT(f,u,hs)}a.memoizedProps=a.pendingProps,u===null?kd(a):Xe=u}function Da(a,u,f,m){es=ro=null,u0(u),ka=null,nu=0;var y=u.return;try{if(Z_(a,y,u,f,qe)){Rt=1,ud(a,Mi(f,a.current)),Xe=null;return}}catch(S){if(y!==null)throw Xe=y,S;Rt=1,ud(a,Mi(f,a.current)),Xe=null;return}u.flags&32768?(Ue||m===1?a=!0:Ea||(qe&536870912)!==0?a=!1:(nl=a=!0,(m===2||m===9||m===3||m===6)&&(m=li.current,m!==null&&m.tag===13&&(m.flags|=16384))),uC(u,a)):kd(u)}function kd(a){var u=a;do{if((u.flags&32768)!==0){uC(u,nl);return}a=u.return;var f=V_(u.alternate,u,hs);if(f!==null){Xe=f;return}if(u=u.sibling,u!==null){Xe=u;return}Xe=u=a}while(u!==null);Rt===0&&(Rt=5)}function uC(a,u){do{var f=q_(a.alternate,a);if(f!==null){f.flags&=32767,Xe=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!u&&(a=a.sibling,a!==null)){Xe=a;return}Xe=a=f}while(a!==null);Rt=6,Xe=null}function hC(a,u,f,m,y,S,w,T,R){a.cancelPendingCommit=null;do wd();while(Kt!==0);if((Je&6)!==0)throw Error(i(327));if(u!==null){if(u===a.current)throw Error(i(177));if(S=u.lanes|u.childLanes,S|=LO,R5(a,f,S,w,T,R),a===ht&&(Xe=ht=null,qe=0),Ra=u,sl=a,fs=f,q0=S,H0=y,eC=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,iB(ta,function(){return gC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=B.T,B.T=null,y=G.p,G.p=2,w=Je,Je|=4;try{H_(a,u,f)}finally{Je=w,G.p=y,B.T=m}}Kt=1,fC(),dC(),pC()}}function fC(){if(Kt===1){Kt=0;var a=sl,u=Ra,f=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||f){f=B.T,B.T=null;var m=G.p;G.p=2;var y=Je;Je|=4;try{HT(u,a);var S=oy,w=Kk(a.containerInfo),T=S.focusedElem,R=S.selectionRange;if(w!==T&&T&&T.ownerDocument&&Fk(T.ownerDocument.documentElement,T)){if(R!==null&&RO(T)){var X=R.start,U=R.end;if(U===void 0&&(U=X),"selectionStart"in T)T.selectionStart=X,T.selectionEnd=Math.min(U,T.value.length);else{var ee=T.ownerDocument||document,I=ee&&ee.defaultView||window;if(I.getSelection){var q=I.getSelection(),be=T.textContent.length,Qe=Math.min(R.start,be),ct=R.end===void 0?Qe:Math.min(R.end,be);!q.extend&&Qe>ct&&(w=ct,ct=Qe,Qe=w);var _=Gk(T,Qe),N=Gk(T,ct);if(_&&N&&(q.rangeCount!==1||q.anchorNode!==_.node||q.anchorOffset!==_.offset||q.focusNode!==N.node||q.focusOffset!==N.offset)){var Z=ee.createRange();Z.setStart(_.node,_.offset),q.removeAllRanges(),Qe>ct?(q.addRange(Z),q.extend(N.node,N.offset)):(Z.setEnd(N.node,N.offset),q.addRange(Z))}}}}for(ee=[],q=T;q=q.parentNode;)q.nodeType===1&&ee.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ee.length;T++){var K=ee[T];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}zd=!!ly,oy=ly=null}finally{Je=y,G.p=m,B.T=f}}a.current=u,Kt=2}}function dC(){if(Kt===2){Kt=0;var a=sl,u=Ra,f=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||f){f=B.T,B.T=null;var m=G.p;G.p=2;var y=Je;Je|=4;try{ZT(a,u.alternate,u)}finally{Je=y,G.p=m,B.T=f}}Kt=3}}function pC(){if(Kt===4||Kt===3){Kt=0,Ur();var a=sl,u=Ra,f=fs,m=eC;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Kt=5:(Kt=0,Ra=sl=null,mC(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(rl=null),dO(f),u=u.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Gl,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=B.T,y=G.p,G.p=2,B.T=null;try{for(var S=a.onRecoverableError,w=0;w<m.length;w++){var T=m[w];S(T.value,{componentStack:T.stack})}}finally{B.T=u,G.p=y}}(fs&3)!==0&&wd(),Sr(a),y=a.pendingLanes,(f&261930)!==0&&(y&42)!==0?a===Y0?bu++:(bu=0,Y0=a):bu=0,Su(0)}}function mC(a,u){(a.pooledCacheLanes&=u)===0&&(u=a.pooledCache,u!=null&&(a.pooledCache=null,eu(u)))}function wd(){return fC(),dC(),pC(),gC()}function gC(){if(Kt!==5)return!1;var a=sl,u=q0;q0=0;var f=dO(fs),m=B.T,y=G.p;try{G.p=32>f?32:f,B.T=null,f=H0,H0=null;var S=sl,w=fs;if(Kt=0,Ra=sl=null,fs=0,(Je&6)!==0)throw Error(i(331));var T=Je;if(Je|=4,FT(S.current),UT(S,S.current,w,f),Je=T,Su(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Gl,S)}catch{}return!0}finally{G.p=y,B.T=m,mC(a,u)}}function OC(a,u,f){u=Mi(f,u),u=T0(a.stateNode,u,2),a=Ks(a,u,2),a!==null&&(jc(a,2),Sr(a))}function st(a,u,f){if(a.tag===3)OC(a,a,f);else for(;u!==null;){if(u.tag===3){OC(u,a,f);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(rl===null||!rl.has(m))){a=Mi(f,a),f=yT(2),m=Ks(u,f,2),m!==null&&(bT(f,m,u,a),jc(m,2),Sr(m));break}}u=u.return}}function G0(a,u,f){var m=a.pingCache;if(m===null){m=a.pingCache=new W_;var y=new Set;m.set(u,y)}else y=m.get(u),y===void 0&&(y=new Set,m.set(u,y));y.has(f)||(X0=!0,y.add(f),a=eB.bind(null,a,u,f),u.then(a,a))}function eB(a,u,f){var m=a.pingCache;m!==null&&m.delete(u),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,ht===a&&(qe&f)===f&&(Rt===4||Rt===3&&(qe&62914560)===qe&&300>kn()-yd?(Je&2)===0&&Pa(a,0):I0|=f,$a===qe&&($a=0)),Sr(a)}function yC(a,u){u===0&&(u=Fi()),a=to(a,u),a!==null&&(jc(a,u),Sr(a))}function tB(a){var u=a.memoizedState,f=0;u!==null&&(f=u.retryLane),yC(a,f)}function nB(a,u){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,y=a.memoizedState;y!==null&&(f=y.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(u),yC(a,f)}function iB(a,u){return ea(a,u)}var Td=null,Na=null,F0=!1,Cd=!1,K0=!1,ol=0;function Sr(a){a!==Na&&a.next===null&&(Na===null?Td=Na=a:Na=Na.next=a),Cd=!0,F0||(F0=!0,sB())}function Su(a,u){if(!K0&&Cd){K0=!0;do for(var f=!1,m=Td;m!==null;){if(a!==0){var y=m.pendingLanes;if(y===0)var S=0;else{var w=m.suspendedLanes,T=m.pingedLanes;S=(1<<31-jn(42|a)+1)-1,S&=y&~(w&~T),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,xC(m,S))}else S=qe,S=Gi(m,m===ht?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||mr(m,S)||(f=!0,xC(m,S));m=m.next}while(f);K0=!1}}function rB(){bC()}function bC(){Cd=F0=!1;var a=0;ol!==0&&mB()&&(a=ol);for(var u=kn(),f=null,m=Td;m!==null;){var y=m.next,S=SC(m,u);S===0?(m.next=null,f===null?Td=y:f.next=y,y===null&&(Na=f)):(f=m,(a!==0||(S&3)!==0)&&(Cd=!0)),m=y}Kt!==0&&Kt!==5||Su(a),ol!==0&&(ol=0)}function SC(a,u){for(var f=a.suspendedLanes,m=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var w=31-jn(S),T=1<<w,R=y[w];R===-1?((T&f)===0||(T&m)!==0)&&(y[w]=gr(T,u)):R<=u&&(a.expiredLanes|=T),S&=~T}if(u=ht,f=qe,f=Gi(a,a===u?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===u&&(rt===2||rt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&_t(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||mr(a,f)){if(u=f&-f,u===a.callbackPriority)return u;switch(m!==null&&_t(m),dO(f)){case 2:case 8:f=_c;break;case 32:f=ta;break;case 268435456:f=Ef;break;default:f=ta}return m=vC.bind(null,a),f=ea(f,m),a.callbackPriority=u,a.callbackNode=f,u}return m!==null&&m!==null&&_t(m),a.callbackPriority=2,a.callbackNode=null,2}function vC(a,u){if(Kt!==0&&Kt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(wd()&&a.callbackNode!==f)return null;var m=qe;return m=Gi(a,a===ht?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(nC(a,m,u),SC(a,kn()),a.callbackNode!=null&&a.callbackNode===f?vC.bind(null,a):null)}function xC(a,u){if(wd())return null;nC(a,u,!0)}function sB(){OB(function(){(Je&6)!==0?ea(Is,rB):bC()})}function J0(){if(ol===0){var a=Sa;a===0&&(a=Me,Me<<=1,(Me&261888)===0&&(Me=256)),ol=a}return ol}function kC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Df(""+a)}function wC(a,u){var f=u.ownerDocument.createElement("input");return f.name=u.name,f.value=u.value,a.id&&f.setAttribute("form",a.id),u.parentNode.insertBefore(f,u),a=new FormData(a),f.parentNode.removeChild(f),a}function lB(a,u,f,m,y){if(u==="submit"&&f&&f.stateNode===y){var S=kC((y[Zn]||null).action),w=m.submitter;w&&(u=(u=w[Zn]||null)?kC(u.formAction):w.getAttribute("formAction"),u!==null&&(S=u,w=null));var T=new _f("action","action",null,m,y);a.push({event:T,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ol!==0){var R=w?wC(y,w):new FormData(y);b0(f,{pending:!0,data:R,method:y.method,action:S},null,R)}}else typeof S=="function"&&(T.preventDefault(),R=w?wC(y,w):new FormData(y),b0(f,{pending:!0,data:R,method:y.method,action:S},S,R))},currentTarget:y}]})}}for(var ey=0;ey<zO.length;ey++){var ty=zO[ey],oB=ty.toLowerCase(),aB=ty[0].toUpperCase()+ty.slice(1);Ki(oB,"on"+aB)}Ki(tw,"onAnimationEnd"),Ki(nw,"onAnimationIteration"),Ki(iw,"onAnimationStart"),Ki("dblclick","onDoubleClick"),Ki("focusin","onFocus"),Ki("focusout","onBlur"),Ki(w_,"onTransitionRun"),Ki(T_,"onTransitionStart"),Ki(C_,"onTransitionCancel"),Ki(rw,"onTransitionEnd"),la("onMouseEnter",["mouseout","mouseover"]),la("onMouseLeave",["mouseout","mouseover"]),la("onPointerEnter",["pointerout","pointerover"]),la("onPointerLeave",["pointerout","pointerover"]),Fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vu));function TC(a,u){u=(u&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],y=m.event;m=m.listeners;e:{var S=void 0;if(u)for(var w=m.length-1;0<=w;w--){var T=m[w],R=T.instance,X=T.currentTarget;if(T=T.listener,R!==S&&y.isPropagationStopped())break e;S=T,y.currentTarget=X;try{S(y)}catch(U){Zf(U)}y.currentTarget=null,S=R}else for(w=0;w<m.length;w++){if(T=m[w],R=T.instance,X=T.currentTarget,T=T.listener,R!==S&&y.isPropagationStopped())break e;S=T,y.currentTarget=X;try{S(y)}catch(U){Zf(U)}y.currentTarget=null,S=R}}}}function Ie(a,u){var f=u[pO];f===void 0&&(f=u[pO]=new Set);var m=a+"__bubble";f.has(m)||(CC(u,a,2,!1),f.add(m))}function ny(a,u,f){var m=0;u&&(m|=4),CC(f,a,m,u)}var Ad="_reactListening"+Math.random().toString(36).slice(2);function iy(a){if(!a[Ad]){a[Ad]=!0,bk.forEach(function(f){f!=="selectionchange"&&(cB.has(f)||ny(f,!1,a),ny(f,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[Ad]||(u[Ad]=!0,ny("selectionchange",!1,u))}}function CC(a,u,f,m){switch(tA(u)){case 2:var y=LB;break;case 8:y=_B;break;default:y=yy}f=y.bind(null,u,f,a),y=void 0,!kO||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(y=!0),m?y!==void 0?a.addEventListener(u,f,{capture:!0,passive:y}):a.addEventListener(u,f,!0):y!==void 0?a.addEventListener(u,f,{passive:y}):a.addEventListener(u,f,!1)}function ry(a,u,f,m,y){var S=m;if((u&1)===0&&(u&2)===0&&m!==null)e:for(;;){if(m===null)return;var w=m.tag;if(w===3||w===4){var T=m.stateNode.containerInfo;if(T===y)break;if(w===4)for(w=m.return;w!==null;){var R=w.tag;if((R===3||R===4)&&w.stateNode.containerInfo===y)return;w=w.return}for(;T!==null;){if(w=ia(T),w===null)return;if(R=w.tag,R===5||R===6||R===26||R===27){m=S=w;continue e}T=T.parentNode}}m=m.return}$k(function(){var X=S,U=vO(f),ee=[];e:{var I=sw.get(a);if(I!==void 0){var q=_f,be=a;switch(a){case"keypress":if(zf(f)===0)break e;case"keydown":case"keyup":q=n_;break;case"focusin":be="focus",q=AO;break;case"focusout":be="blur",q=AO;break;case"beforeblur":case"afterblur":q=AO;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Dk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=V5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=s_;break;case tw:case nw:case iw:q=Y5;break;case rw:q=o_;break;case"scroll":case"scrollend":q=X5;break;case"wheel":q=c_;break;case"copy":case"cut":case"paste":q=W5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=zk;break;case"toggle":case"beforetoggle":q=h_}var Qe=(u&4)!==0,ct=!Qe&&(a==="scroll"||a==="scrollend"),_=Qe?I!==null?I+"Capture":null:I;Qe=[];for(var N=X,Z;N!==null;){var K=N;if(Z=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||Z===null||_===null||(K=Ic(N,_),K!=null&&Qe.push(xu(N,K,Z))),ct)break;N=N.return}0<Qe.length&&(I=new q(I,be,null,f,U),ee.push({event:I,listeners:Qe}))}}if((u&7)===0){e:{if(I=a==="mouseover"||a==="pointerover",q=a==="mouseout"||a==="pointerout",I&&f!==SO&&(be=f.relatedTarget||f.fromElement)&&(ia(be)||be[na]))break e;if((q||I)&&(I=U.window===U?U:(I=U.ownerDocument)?I.defaultView||I.parentWindow:window,q?(be=f.relatedTarget||f.toElement,q=X,be=be?ia(be):null,be!==null&&(ct=s(be),Qe=be.tag,be!==ct||Qe!==5&&Qe!==27&&Qe!==6)&&(be=null)):(q=null,be=X),q!==be)){if(Qe=Dk,K="onMouseLeave",_="onMouseEnter",N="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=zk,K="onPointerLeave",_="onPointerEnter",N="pointer"),ct=q==null?I:Xc(q),Z=be==null?I:Xc(be),I=new Qe(K,N+"leave",q,f,U),I.target=ct,I.relatedTarget=Z,K=null,ia(U)===X&&(Qe=new Qe(_,N+"enter",be,f,U),Qe.target=Z,Qe.relatedTarget=ct,K=Qe),ct=K,q&&be)t:{for(Qe=uB,_=q,N=be,Z=0,K=_;K;K=Qe(K))Z++;K=0;for(var Te=N;Te;Te=Qe(Te))K++;for(;0<Z-K;)_=Qe(_),Z--;for(;0<K-Z;)N=Qe(N),K--;for(;Z--;){if(_===N||N!==null&&_===N.alternate){Qe=_;break t}_=Qe(_),N=Qe(N)}Qe=null}else Qe=null;q!==null&&AC(ee,I,q,Qe,!1),be!==null&&ct!==null&&AC(ee,ct,be,Qe,!0)}}e:{if(I=X?Xc(X):window,q=I.nodeName&&I.nodeName.toLowerCase(),q==="select"||q==="input"&&I.type==="file")var Fe=Vk;else if(Xk(I))if(qk)Fe=v_;else{Fe=b_;var Se=y_}else q=I.nodeName,!q||q.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?X&&bO(X.elementType)&&(Fe=Vk):Fe=S_;if(Fe&&(Fe=Fe(a,X))){Ik(ee,Fe,f,U);break e}Se&&Se(a,I,X),a==="focusout"&&X&&I.type==="number"&&X.memoizedProps.value!=null&&yO(I,"number",I.value)}switch(Se=X?Xc(X):window,a){case"focusin":(Xk(Se)||Se.contentEditable==="true")&&(fa=Se,PO=X,Fc=null);break;case"focusout":Fc=PO=fa=null;break;case"mousedown":DO=!0;break;case"contextmenu":case"mouseup":case"dragend":DO=!1,Jk(ee,f,U);break;case"selectionchange":if(k_)break;case"keydown":case"keyup":Jk(ee,f,U)}var Be;if(QO)e:{switch(a){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else ha?jk(a,f)&&(He="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(He="onCompositionStart");He&&(Lk&&f.locale!=="ko"&&(ha||He!=="onCompositionStart"?He==="onCompositionEnd"&&ha&&(Be=Rk()):(qs=U,wO="value"in qs?qs.value:qs.textContent,ha=!0)),Se=Md(X,He),0<Se.length&&(He=new Nk(He,a,null,f,U),ee.push({event:He,listeners:Se}),Be?He.data=Be:(Be=Zk(f),Be!==null&&(He.data=Be)))),(Be=d_?p_(a,f):m_(a,f))&&(He=Md(X,"onBeforeInput"),0<He.length&&(Se=new Nk("onBeforeInput","beforeinput",null,f,U),ee.push({event:Se,listeners:He}),Se.data=Be)),lB(ee,a,X,f,U)}TC(ee,u)})}function xu(a,u,f){return{instance:a,listener:u,currentTarget:f}}function Md(a,u){for(var f=u+"Capture",m=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Ic(a,f),y!=null&&m.unshift(xu(a,y,S)),y=Ic(a,u),y!=null&&m.push(xu(a,y,S))),a.tag===3)return m;a=a.return}return[]}function uB(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function AC(a,u,f,m,y){for(var S=u._reactName,w=[];f!==null&&f!==m;){var T=f,R=T.alternate,X=T.stateNode;if(T=T.tag,R!==null&&R===m)break;T!==5&&T!==26&&T!==27||X===null||(R=X,y?(X=Ic(f,S),X!=null&&w.unshift(xu(f,X,R))):y||(X=Ic(f,S),X!=null&&w.push(xu(f,X,R)))),f=f.return}w.length!==0&&a.push({event:u,listeners:w})}var hB=/\r\n?/g,fB=/\u0000|\uFFFD/g;function MC(a){return(typeof a=="string"?a:""+a).replace(hB,`
`).replace(fB,"")}function QC(a,u){return u=MC(u),MC(a)===u}function at(a,u,f,m,y,S){switch(f){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||aa(a,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&aa(a,""+m);break;case"className":Rf(a,"class",m);break;case"tabIndex":Rf(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rf(a,f,m);break;case"style":Qk(a,m,S);break;case"data":if(u!=="object"){Rf(a,"data",m);break}case"src":case"href":if(m===""&&(u!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Df(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(u!=="input"&&at(a,u,"name",y.name,y,null),at(a,u,"formEncType",y.formEncType,y,null),at(a,u,"formMethod",y.formMethod,y,null),at(a,u,"formTarget",y.formTarget,y,null)):(at(a,u,"encType",y.encType,y,null),at(a,u,"method",y.method,y,null),at(a,u,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Df(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Gr);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Df(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":Ie("beforetoggle",a),Ie("toggle",a),$f(a,"popover",m);break;case"xlinkActuate":Wr(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Wr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Wr(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Wr(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Wr(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Wr(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Wr(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Wr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Wr(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":$f(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=j5.get(f)||f,$f(a,f,m))}}function sy(a,u,f,m,y,S){switch(f){case"style":Qk(a,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=f}}break;case"children":typeof m=="string"?aa(a,m):(typeof m=="number"||typeof m=="bigint")&&aa(a,""+m);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sk.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),u=f.slice(2,y?f.length-7:void 0),S=a[Zn]||null,S=S!=null?S[f]:null,typeof S=="function"&&a.removeEventListener(u,S,y),typeof m=="function")){typeof S!="function"&&S!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(u,m,y);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):$f(a,f,m)}}}function pn(a,u,f){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",a),Ie("load",a);var m=!1,y=!1,S;for(S in f)if(f.hasOwnProperty(S)){var w=f[S];if(w!=null)switch(S){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:at(a,u,S,w,f,null)}}y&&at(a,u,"srcSet",f.srcSet,f,null),m&&at(a,u,"src",f.src,f,null);return;case"input":Ie("invalid",a);var T=S=w=y=null,R=null,X=null;for(m in f)if(f.hasOwnProperty(m)){var U=f[m];if(U!=null)switch(m){case"name":y=U;break;case"type":w=U;break;case"checked":R=U;break;case"defaultChecked":X=U;break;case"value":S=U;break;case"defaultValue":T=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,u));break;default:at(a,u,m,U,f,null)}}Tk(a,S,T,R,X,w,y,!1);return;case"select":Ie("invalid",a),m=w=S=null;for(y in f)if(f.hasOwnProperty(y)&&(T=f[y],T!=null))switch(y){case"value":S=T;break;case"defaultValue":w=T;break;case"multiple":m=T;default:at(a,u,y,T,f,null)}u=S,f=w,a.multiple=!!m,u!=null?oa(a,!!m,u,!1):f!=null&&oa(a,!!m,f,!0);return;case"textarea":Ie("invalid",a),S=y=m=null;for(w in f)if(f.hasOwnProperty(w)&&(T=f[w],T!=null))switch(w){case"value":m=T;break;case"defaultValue":y=T;break;case"children":S=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(i(91));break;default:at(a,u,w,T,f,null)}Ak(a,m,y,S);return;case"option":for(R in f)if(f.hasOwnProperty(R)&&(m=f[R],m!=null))switch(R){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:at(a,u,R,m,f,null)}return;case"dialog":Ie("beforetoggle",a),Ie("toggle",a),Ie("cancel",a),Ie("close",a);break;case"iframe":case"object":Ie("load",a);break;case"video":case"audio":for(m=0;m<vu.length;m++)Ie(vu[m],a);break;case"image":Ie("error",a),Ie("load",a);break;case"details":Ie("toggle",a);break;case"embed":case"source":case"link":Ie("error",a),Ie("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in f)if(f.hasOwnProperty(X)&&(m=f[X],m!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:at(a,u,X,m,f,null)}return;default:if(bO(u)){for(U in f)f.hasOwnProperty(U)&&(m=f[U],m!==void 0&&sy(a,u,U,m,f,void 0));return}}for(T in f)f.hasOwnProperty(T)&&(m=f[T],m!=null&&at(a,u,T,m,f,null))}function dB(a,u,f,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,w=null,T=null,R=null,X=null,U=null;for(q in f){var ee=f[q];if(f.hasOwnProperty(q)&&ee!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":R=ee;default:m.hasOwnProperty(q)||at(a,u,q,null,m,ee)}}for(var I in m){var q=m[I];if(ee=f[I],m.hasOwnProperty(I)&&(q!=null||ee!=null))switch(I){case"type":S=q;break;case"name":y=q;break;case"checked":X=q;break;case"defaultChecked":U=q;break;case"value":w=q;break;case"defaultValue":T=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,u));break;default:q!==ee&&at(a,u,I,q,m,ee)}}OO(a,w,T,R,X,U,S,y);return;case"select":q=w=T=I=null;for(S in f)if(R=f[S],f.hasOwnProperty(S)&&R!=null)switch(S){case"value":break;case"multiple":q=R;default:m.hasOwnProperty(S)||at(a,u,S,null,m,R)}for(y in m)if(S=m[y],R=f[y],m.hasOwnProperty(y)&&(S!=null||R!=null))switch(y){case"value":I=S;break;case"defaultValue":T=S;break;case"multiple":w=S;default:S!==R&&at(a,u,y,S,m,R)}u=T,f=w,m=q,I!=null?oa(a,!!f,I,!1):!!m!=!!f&&(u!=null?oa(a,!!f,u,!0):oa(a,!!f,f?[]:"",!1));return;case"textarea":q=I=null;for(T in f)if(y=f[T],f.hasOwnProperty(T)&&y!=null&&!m.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:at(a,u,T,null,m,y)}for(w in m)if(y=m[w],S=f[w],m.hasOwnProperty(w)&&(y!=null||S!=null))switch(w){case"value":I=y;break;case"defaultValue":q=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==S&&at(a,u,w,y,m,S)}Ck(a,I,q);return;case"option":for(var be in f)if(I=f[be],f.hasOwnProperty(be)&&I!=null&&!m.hasOwnProperty(be))switch(be){case"selected":a.selected=!1;break;default:at(a,u,be,null,m,I)}for(R in m)if(I=m[R],q=f[R],m.hasOwnProperty(R)&&I!==q&&(I!=null||q!=null))switch(R){case"selected":a.selected=I&&typeof I!="function"&&typeof I!="symbol";break;default:at(a,u,R,I,m,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Qe in f)I=f[Qe],f.hasOwnProperty(Qe)&&I!=null&&!m.hasOwnProperty(Qe)&&at(a,u,Qe,null,m,I);for(X in m)if(I=m[X],q=f[X],m.hasOwnProperty(X)&&I!==q&&(I!=null||q!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(137,u));break;default:at(a,u,X,I,m,q)}return;default:if(bO(u)){for(var ct in f)I=f[ct],f.hasOwnProperty(ct)&&I!==void 0&&!m.hasOwnProperty(ct)&&sy(a,u,ct,void 0,m,I);for(U in m)I=m[U],q=f[U],!m.hasOwnProperty(U)||I===q||I===void 0&&q===void 0||sy(a,u,U,I,m,q);return}}for(var _ in f)I=f[_],f.hasOwnProperty(_)&&I!=null&&!m.hasOwnProperty(_)&&at(a,u,_,null,m,I);for(ee in m)I=m[ee],q=f[ee],!m.hasOwnProperty(ee)||I===q||I==null&&q==null||at(a,u,ee,I,m,q)}function EC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pB(){if(typeof performance.getEntriesByType=="function"){for(var a=0,u=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var y=f[m],S=y.transferSize,w=y.initiatorType,T=y.duration;if(S&&T&&EC(w)){for(w=0,T=y.responseEnd,m+=1;m<f.length;m++){var R=f[m],X=R.startTime;if(X>T)break;var U=R.transferSize,ee=R.initiatorType;U&&EC(ee)&&(R=R.responseEnd,w+=U*(R<T?1:(T-X)/(R-X)))}if(--m,u+=8*(S+w)/(y.duration/1e3),a++,10<a)break}}if(0<a)return u/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var ly=null,oy=null;function Qd(a){return a.nodeType===9?a:a.ownerDocument}function $C(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function RC(a,u){if(a===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&u==="foreignObject"?0:a}function ay(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var cy=null;function mB(){var a=window.event;return a&&a.type==="popstate"?a===cy?!1:(cy=a,!0):(cy=null,!1)}var PC=typeof setTimeout=="function"?setTimeout:void 0,gB=typeof clearTimeout=="function"?clearTimeout:void 0,DC=typeof Promise=="function"?Promise:void 0,OB=typeof queueMicrotask=="function"?queueMicrotask:typeof DC<"u"?function(a){return DC.resolve(null).then(a).catch(yB)}:PC;function yB(a){setTimeout(function(){throw a})}function al(a){return a==="head"}function NC(a,u){var f=u,m=0;do{var y=f.nextSibling;if(a.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(y),Ba(u);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")ku(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,ku(f);for(var S=f.firstChild;S;){var w=S.nextSibling,T=S.nodeName;S[Zc]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=w}}else f==="body"&&ku(a.ownerDocument.body);f=y}while(f);Ba(u)}function zC(a,u){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?u?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(u?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function uy(a){var u=a.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var f=u;switch(u=u.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":uy(f),mO(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function bB(a,u,f,m){for(;a.nodeType===1;){var y=f;if(a.nodeName.toLowerCase()!==u.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Zc])switch(u){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(u==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Pi(a.nextSibling),a===null)break}return null}function SB(a,u,f){if(u==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=Pi(a.nextSibling),a===null))return null;return a}function LC(a,u){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Pi(a.nextSibling),a===null))return null;return a}function hy(a){return a.data==="$?"||a.data==="$~"}function fy(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function vB(a,u){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=u;else if(a.data!=="$?"||f.readyState!=="loading")u();else{var m=function(){u(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Pi(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return a}var dy=null;function _C(a){a=a.nextSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(u===0)return Pi(a.nextSibling);u--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||u++}a=a.nextSibling}return null}function BC(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(u===0)return a;u--}else f!=="/$"&&f!=="/&"||u++}a=a.previousSibling}return null}function jC(a,u,f){switch(u=Qd(f),a){case"html":if(a=u.documentElement,!a)throw Error(i(452));return a;case"head":if(a=u.head,!a)throw Error(i(453));return a;case"body":if(a=u.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function ku(a){for(var u=a.attributes;u.length;)a.removeAttributeNode(u[0]);mO(a)}var Di=new Map,ZC=new Set;function Ed(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ds=G.d;G.d={f:xB,r:kB,D:wB,C:TB,L:CB,m:AB,X:QB,S:MB,M:EB};function xB(){var a=ds.f(),u=vd();return a||u}function kB(a){var u=ra(a);u!==null&&u.tag===5&&u.type==="form"?rT(u):ds.r(a)}var za=typeof document>"u"?null:document;function XC(a,u,f){var m=za;if(m&&typeof u=="string"&&u){var y=Ci(u);y='link[rel="'+a+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),ZC.has(y)||(ZC.add(y),a={rel:a,crossOrigin:f,href:u},m.querySelector(y)===null&&(u=m.createElement("link"),pn(u,"link",a),tn(u),m.head.appendChild(u)))}}function wB(a){ds.D(a),XC("dns-prefetch",a,null)}function TB(a,u){ds.C(a,u),XC("preconnect",a,u)}function CB(a,u,f){ds.L(a,u,f);var m=za;if(m&&a&&u){var y='link[rel="preload"][as="'+Ci(u)+'"]';u==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+Ci(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+Ci(f.imageSizes)+'"]')):y+='[href="'+Ci(a)+'"]';var S=y;switch(u){case"style":S=La(a);break;case"script":S=_a(a)}Di.has(S)||(a=p({rel:"preload",href:u==="image"&&f&&f.imageSrcSet?void 0:a,as:u},f),Di.set(S,a),m.querySelector(y)!==null||u==="style"&&m.querySelector(wu(S))||u==="script"&&m.querySelector(Tu(S))||(u=m.createElement("link"),pn(u,"link",a),tn(u),m.head.appendChild(u)))}}function AB(a,u){ds.m(a,u);var f=za;if(f&&a){var m=u&&typeof u.as=="string"?u.as:"script",y='link[rel="modulepreload"][as="'+Ci(m)+'"][href="'+Ci(a)+'"]',S=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=_a(a)}if(!Di.has(S)&&(a=p({rel:"modulepreload",href:a},u),Di.set(S,a),f.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Tu(S)))return}m=f.createElement("link"),pn(m,"link",a),tn(m),f.head.appendChild(m)}}}function MB(a,u,f){ds.S(a,u,f);var m=za;if(m&&a){var y=sa(m).hoistableStyles,S=La(a);u=u||"default";var w=y.get(S);if(!w){var T={loading:0,preload:null};if(w=m.querySelector(wu(S)))T.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":u},f),(f=Di.get(S))&&py(a,f);var R=w=m.createElement("link");tn(R),pn(R,"link",a),R._p=new Promise(function(X,U){R.onload=X,R.onerror=U}),R.addEventListener("load",function(){T.loading|=1}),R.addEventListener("error",function(){T.loading|=2}),T.loading|=4,$d(w,u,m)}w={type:"stylesheet",instance:w,count:1,state:T},y.set(S,w)}}}function QB(a,u){ds.X(a,u);var f=za;if(f&&a){var m=sa(f).hoistableScripts,y=_a(a),S=m.get(y);S||(S=f.querySelector(Tu(y)),S||(a=p({src:a,async:!0},u),(u=Di.get(y))&&my(a,u),S=f.createElement("script"),tn(S),pn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(y,S))}}function EB(a,u){ds.M(a,u);var f=za;if(f&&a){var m=sa(f).hoistableScripts,y=_a(a),S=m.get(y);S||(S=f.querySelector(Tu(y)),S||(a=p({src:a,async:!0,type:"module"},u),(u=Di.get(y))&&my(a,u),S=f.createElement("script"),tn(S),pn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(y,S))}}function IC(a,u,f,m){var y=(y=Re.current)?Ed(y):null;if(!y)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(u=La(f.href),f=sa(y).hoistableStyles,m=f.get(u),m||(m={type:"style",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=La(f.href);var S=sa(y).hoistableStyles,w=S.get(a);if(w||(y=y.ownerDocument||y,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,w),(S=y.querySelector(wu(a)))&&!S._p&&(w.instance=S,w.state.loading=5),Di.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Di.set(a,f),S||$B(y,a,f,w.state))),u&&m===null)throw Error(i(528,""));return w}if(u&&m!==null)throw Error(i(529,""));return null;case"script":return u=f.async,f=f.src,typeof f=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=_a(f),f=sa(y).hoistableScripts,m=f.get(u),m||(m={type:"script",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function La(a){return'href="'+Ci(a)+'"'}function wu(a){return'link[rel="stylesheet"]['+a+"]"}function VC(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function $B(a,u,f,m){a.querySelector('link[rel="preload"][as="style"]['+u+"]")?m.loading=1:(u=a.createElement("link"),m.preload=u,u.addEventListener("load",function(){return m.loading|=1}),u.addEventListener("error",function(){return m.loading|=2}),pn(u,"link",f),tn(u),a.head.appendChild(u))}function _a(a){return'[src="'+Ci(a)+'"]'}function Tu(a){return"script[async]"+a}function qC(a,u,f){if(u.count++,u.instance===null)switch(u.type){case"style":var m=a.querySelector('style[data-href~="'+Ci(f.href)+'"]');if(m)return u.instance=m,tn(m),m;var y=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),tn(m),pn(m,"style",y),$d(m,f.precedence,a),u.instance=m;case"stylesheet":y=La(f.href);var S=a.querySelector(wu(y));if(S)return u.state.loading|=4,u.instance=S,tn(S),S;m=VC(f),(y=Di.get(y))&&py(m,y),S=(a.ownerDocument||a).createElement("link"),tn(S);var w=S;return w._p=new Promise(function(T,R){w.onload=T,w.onerror=R}),pn(S,"link",m),u.state.loading|=4,$d(S,f.precedence,a),u.instance=S;case"script":return S=_a(f.src),(y=a.querySelector(Tu(S)))?(u.instance=y,tn(y),y):(m=f,(y=Di.get(S))&&(m=p({},f),my(m,y)),a=a.ownerDocument||a,y=a.createElement("script"),tn(y),pn(y,"link",m),a.head.appendChild(y),u.instance=y);case"void":return null;default:throw Error(i(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(m=u.instance,u.state.loading|=4,$d(m,f.precedence,a));return u.instance}function $d(a,u,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,S=y,w=0;w<m.length;w++){var T=m[w];if(T.dataset.precedence===u)S=T;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(u=f.nodeType===9?f.head:f,u.insertBefore(a,u.firstChild))}function py(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.title==null&&(a.title=u.title)}function my(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.integrity==null&&(a.integrity=u.integrity)}var Rd=null;function HC(a,u,f){if(Rd===null){var m=new Map,y=Rd=new Map;y.set(f,m)}else y=Rd,m=y.get(f),m||(m=new Map,y.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),y=0;y<f.length;y++){var S=f[y];if(!(S[Zc]||S[un]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var w=S.getAttribute(u)||"";w=a+w;var T=m.get(w);T?T.push(S):m.set(w,[S])}}return m}function YC(a,u,f){a=a.ownerDocument||a,a.head.insertBefore(f,u==="title"?a.querySelector("head > title"):null)}function RB(a,u,f){if(f===1||u.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return a=u.disabled,typeof u.precedence=="string"&&a==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function UC(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function PB(a,u,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=La(m.href),S=u.querySelector(wu(y));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(a.count++,a=Pd.bind(a),u.then(a,a)),f.state.loading|=4,f.instance=S,tn(S);return}S=u.ownerDocument||u,m=VC(m),(y=Di.get(y))&&py(m,y),S=S.createElement("link"),tn(S);var w=S;w._p=new Promise(function(T,R){w.onload=T,w.onerror=R}),pn(S,"link",m),f.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,u),(u=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Pd.bind(a),u.addEventListener("load",f),u.addEventListener("error",f))}}var gy=0;function DB(a,u){return a.stylesheets&&a.count===0&&Nd(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Nd(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+u);0<a.imgBytes&&gy===0&&(gy=62500*pB());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Nd(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>gy?50:800)+u);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function Pd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nd(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Dd=null;function Nd(a,u){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Dd=new Map,u.forEach(NB,a),Dd=null,Pd.call(a))}function NB(a,u){if(!(u.state.loading&4)){var f=Dd.get(a);if(f)var m=f.get(null);else{f=new Map,Dd.set(a,f);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var w=y[S];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(f.set(w.dataset.precedence,w),m=w)}m&&f.set(null,m)}y=u.instance,w=y.getAttribute("data-precedence"),S=f.get(w)||m,S===m&&f.set(null,y),f.set(w,y),this.count++,m=Pd.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),u.state.loading|=4}}var Cu={$$typeof:A,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function zB(a,u,f,m,y,S,w,T,R){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bc(0),this.hiddenUpdates=Bc(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function WC(a,u,f,m,y,S,w,T,R,X,U,ee){return a=new zB(a,u,f,w,R,X,U,ee,T),u=1,S===!0&&(u|=24),S=si(3,null,null,u),a.current=S,S.stateNode=a,u=WO(),u.refCount++,a.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:f,cache:u},JO(S),a}function GC(a){return a?(a=ma,a):ma}function FC(a,u,f,m,y,S){y=GC(y),m.context===null?m.context=y:m.pendingContext=y,m=Fs(u),m.payload={element:f},S=S===void 0?null:S,S!==null&&(m.callback=S),f=Ks(a,m,u),f!==null&&(Yn(f,a,u),ru(f,a,u))}function KC(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<u?f:u}}function Oy(a,u){KC(a,u),(a=a.alternate)&&KC(a,u)}function JC(a){if(a.tag===13||a.tag===31){var u=to(a,67108864);u!==null&&Yn(u,a,67108864),Oy(a,67108864)}}function eA(a){if(a.tag===13||a.tag===31){var u=ui();u=fO(u);var f=to(a,u);f!==null&&Yn(f,a,u),Oy(a,u)}}var zd=!0;function LB(a,u,f,m){var y=B.T;B.T=null;var S=G.p;try{G.p=2,yy(a,u,f,m)}finally{G.p=S,B.T=y}}function _B(a,u,f,m){var y=B.T;B.T=null;var S=G.p;try{G.p=8,yy(a,u,f,m)}finally{G.p=S,B.T=y}}function yy(a,u,f,m){if(zd){var y=by(m);if(y===null)ry(a,u,m,Ld,f),nA(a,m);else if(jB(y,a,u,f,m))m.stopPropagation();else if(nA(a,m),u&4&&-1<BB.indexOf(a)){for(;y!==null;){var S=ra(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var w=Ft(S.pendingLanes);if(w!==0){var T=S;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var R=1<<31-jn(w);T.entanglements[1]|=R,w&=~R}Sr(S),(Je&6)===0&&(bd=kn()+500,Su(0))}}break;case 31:case 13:T=to(S,2),T!==null&&Yn(T,S,2),vd(),Oy(S,2)}if(S=by(m),S===null&&ry(a,u,m,Ld,f),S===y)break;y=S}y!==null&&m.stopPropagation()}else ry(a,u,m,null,f)}}function by(a){return a=vO(a),Sy(a)}var Ld=null;function Sy(a){if(Ld=null,a=ia(a),a!==null){var u=s(a);if(u===null)a=null;else{var f=u.tag;if(f===13){if(a=l(u),a!==null)return a;a=null}else if(f===31){if(a=o(u),a!==null)return a;a=null}else if(f===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null)}}return Ld=a,null}function tA(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wl()){case Is:return 2;case _c:return 8;case ta:case cO:return 32;case Ef:return 268435456;default:return 32}default:return 32}}var vy=!1,cl=null,ul=null,hl=null,Au=new Map,Mu=new Map,fl=[],BB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function nA(a,u){switch(a){case"focusin":case"focusout":cl=null;break;case"dragenter":case"dragleave":ul=null;break;case"mouseover":case"mouseout":hl=null;break;case"pointerover":case"pointerout":Au.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mu.delete(u.pointerId)}}function Qu(a,u,f,m,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:u,domEventName:f,eventSystemFlags:m,nativeEvent:S,targetContainers:[y]},u!==null&&(u=ra(u),u!==null&&JC(u)),a):(a.eventSystemFlags|=m,u=a.targetContainers,y!==null&&u.indexOf(y)===-1&&u.push(y),a)}function jB(a,u,f,m,y){switch(u){case"focusin":return cl=Qu(cl,a,u,f,m,y),!0;case"dragenter":return ul=Qu(ul,a,u,f,m,y),!0;case"mouseover":return hl=Qu(hl,a,u,f,m,y),!0;case"pointerover":var S=y.pointerId;return Au.set(S,Qu(Au.get(S)||null,a,u,f,m,y)),!0;case"gotpointercapture":return S=y.pointerId,Mu.set(S,Qu(Mu.get(S)||null,a,u,f,m,y)),!0}return!1}function iA(a){var u=ia(a.target);if(u!==null){var f=s(u);if(f!==null){if(u=f.tag,u===13){if(u=l(f),u!==null){a.blockedOn=u,Ok(a.priority,function(){eA(f)});return}}else if(u===31){if(u=o(f),u!==null){a.blockedOn=u,Ok(a.priority,function(){eA(f)});return}}else if(u===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function _d(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var f=by(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);SO=m,f.target.dispatchEvent(m),SO=null}else return u=ra(f),u!==null&&JC(u),a.blockedOn=f,!1;u.shift()}return!0}function rA(a,u,f){_d(a)&&f.delete(u)}function ZB(){vy=!1,cl!==null&&_d(cl)&&(cl=null),ul!==null&&_d(ul)&&(ul=null),hl!==null&&_d(hl)&&(hl=null),Au.forEach(rA),Mu.forEach(rA)}function Bd(a,u){a.blockedOn===u&&(a.blockedOn=null,vy||(vy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ZB)))}var jd=null;function sA(a){jd!==a&&(jd=a,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){jd===a&&(jd=null);for(var u=0;u<a.length;u+=3){var f=a[u],m=a[u+1],y=a[u+2];if(typeof m!="function"){if(Sy(m||f)===null)continue;break}var S=ra(f);S!==null&&(a.splice(u,3),u-=3,b0(S,{pending:!0,data:y,method:f.method,action:m},m,y))}}))}function Ba(a){function u(R){return Bd(R,a)}cl!==null&&Bd(cl,a),ul!==null&&Bd(ul,a),hl!==null&&Bd(hl,a),Au.forEach(u),Mu.forEach(u);for(var f=0;f<fl.length;f++){var m=fl[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<fl.length&&(f=fl[0],f.blockedOn===null);)iA(f),f.blockedOn===null&&fl.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var y=f[m],S=f[m+1],w=y[Zn]||null;if(typeof S=="function")w||sA(f);else if(w){var T=null;if(S&&S.hasAttribute("formAction")){if(y=S,w=S[Zn]||null)T=w.formAction;else if(Sy(y)!==null)continue}else T=w.action;typeof T=="function"?f[m+1]=T:(f.splice(m,3),m-=3),sA(f)}}}function lA(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(w){return y=w})},focusReset:"manual",scroll:"manual"})}function u(){y!==null&&(y(),y=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),y!==null&&(y(),y=null)}}}function xy(a){this._internalRoot=a}Zd.prototype.render=xy.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(i(409));var f=u.current,m=ui();FC(f,m,a,u,null,null)},Zd.prototype.unmount=xy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;FC(a.current,2,null,a,null,null),vd(),u[na]=null}};function Zd(a){this._internalRoot=a}Zd.prototype.unstable_scheduleHydration=function(a){if(a){var u=gk();a={blockedOn:null,target:a,priority:u};for(var f=0;f<fl.length&&u!==0&&u<fl[f].priority;f++);fl.splice(f,0,a),f===0&&iA(a)}};var oA=e.version;if(oA!=="19.2.6")throw Error(i(527,oA,"19.2.6"));G.findDOMNode=function(a){var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=h(u),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var XB={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xd.isDisabled&&Xd.supportsFiber)try{Gl=Xd.inject(XB),At=Xd}catch{}}return $u.createRoot=function(a,u){if(!r(a))throw Error(i(299));var f=!1,m="",y=pT,S=mT,w=gT;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(w=u.onRecoverableError)),u=WC(a,1,!1,null,null,f,m,null,y,S,w,lA),a[na]=u.current,iy(a),new xy(u)},$u.hydrateRoot=function(a,u,f){if(!r(a))throw Error(i(299));var m=!1,y="",S=pT,w=mT,T=gT,R=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(w=f.onCaughtError),f.onRecoverableError!==void 0&&(T=f.onRecoverableError),f.formState!==void 0&&(R=f.formState)),u=WC(a,1,!0,u,f??null,m,y,R,S,w,T,lA),u.context=GC(null),f=u.current,m=ui(),m=fO(m),y=Fs(m),y.callback=null,Ks(f,y,m),f=m,u.current.lanes=f,jc(u,f),Sr(u),a[na]=u.current,iy(a),new Zd(u)},$u.version="19.2.6",$u}var OA;function JB(){if(OA)return Ty.exports;OA=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Ty.exports=KB(),Ty.exports}var ej=JB(),tv=yR();const tj=OR(tv);var Qy={exports:{}},Ey={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yA;function nj(){if(yA)return Ey;yA=1;var n=uf();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function o(p,g){var O=g(),b=i({inst:{value:O,getSnapshot:g}}),v=b[0].inst,x=b[1];return s(function(){v.value=O,v.getSnapshot=g,c(v)&&x({inst:v})},[p,O,g]),r(function(){return c(v)&&x({inst:v}),p(function(){c(v)&&x({inst:v})})},[p]),l(O),O}function c(p){var g=p.getSnapshot;p=p.value;try{var O=g();return!t(p,O)}catch{return!0}}function h(p,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:o;return Ey.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:d,Ey}var bA;function bR(){return bA||(bA=1,Qy.exports=nj()),Qy.exports}var SR=bR();function mn(n){this.content=n}mn.prototype={constructor:mn,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,r=i.find(n),s=i.content.slice();return r==-1?s.push(t||n,e):(s[r+1]=e,t&&(s[r]=t)),new mn(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new mn(t)},addToStart:function(n,e){return new mn([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new mn(t)},addBefore:function(n,e,t){var i=this.remove(e),r=i.content.slice(),s=i.find(n);return r.splice(s==-1?r.length:s,0,e,t),new mn(r)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=mn.from(n),n.size?new mn(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=mn.from(n),n.size?new mn(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=mn.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};mn.from=function(n){if(n instanceof mn)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new mn(e)};function vR(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let r=n.child(i),s=e.child(i);if(r==s){t+=r.nodeSize;continue}if(!r.sameMarkup(s))return t;if(r.isText&&r.text!=s.text){for(let l=0;r.text[l]==s.text[l];l++)t++;return t}if(r.content.size||s.content.size){let l=vR(r.content,s.content,t+1);if(l!=null)return l}t+=r.nodeSize}}function xR(n,e,t,i){for(let r=n.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:t,b:i};let l=n.child(--r),o=e.child(--s),c=l.nodeSize;if(l==o){t-=c,i-=c;continue}if(!l.sameMarkup(o))return{a:t,b:i};if(l.isText&&l.text!=o.text){let h=0,d=Math.min(l.text.length,o.text.length);for(;h<d&&l.text[l.text.length-h-1]==o.text[o.text.length-h-1];)h++,t--,i--;return{a:t,b:i}}if(l.content.size||o.content.size){let h=xR(l.content,o.content,t-1,i-1);if(h)return h}t-=c,i-=c}}class ne{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,r=0,s){for(let l=0,o=0;o<t;l++){let c=this.content[l],h=o+c.nodeSize;if(h>e&&i(c,r+o,s||null,l)!==!1&&c.content.size){let d=o+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,t-d),i,r+d)}o=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,r){let s="",l=!0;return this.nodesBetween(e,t,(o,c)=>{let h=o.isText?o.text.slice(Math.max(e,c)-c,t-c):o.isLeaf?r?typeof r=="function"?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&h||o.isTextblock)&&i&&(l?l=!1:s+=i),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(i)&&(r[r.length-1]=t.withText(t.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new ne(r,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],r=0;if(t>e)for(let s=0,l=0;l<t;s++){let o=this.content[s],c=l+o.nodeSize;c>e&&((l<e||c>t)&&(o.isText?o=o.cut(Math.max(0,e-l),Math.min(o.text.length,t-l)):o=o.cut(Math.max(0,e-l-1),Math.min(o.content.size,t-l-1))),i.push(o),r+=o.nodeSize),l=c}return new ne(i,r)}cutByIndex(e,t){return e==t?ne.empty:e==0&&t==this.content.length?this:new ne(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let r=this.content.slice(),s=this.size+t.nodeSize-i.nodeSize;return r[e]=t,new ne(r,s)}addToStart(e){return new ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let r=this.content[t];e(r,i,t),i+=r.nodeSize}}findDiffStart(e,t=0){return vR(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return xR(this,e,t,i)}findIndex(e){if(e==0)return Id(0,e);if(e==this.size)return Id(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let r=this.child(t),s=i+r.nodeSize;if(s>=e)return s==e?Id(t+1,s):Id(t,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ne.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ne.empty;let t,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(t||(t=e.slice(0,r)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new ne(t||e,i)}static from(e){if(!e)return ne.empty;if(e instanceof ne)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ne([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ne.empty=new ne([],0);const $y={index:0,offset:0};function Id(n,e){return $y.index=n,$y.offset=e,$y}function Kp(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!Kp(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!Kp(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let pt=class o1{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),i=!0),t&&t.push(s)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Kp(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=i.create(t.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return o1.none;if(e instanceof o1)return[e];let t=e.slice();return t.sort((i,r)=>i.type.rank-r.type.rank),t}};pt.none=[];class Jp extends Error{}class me{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=wR(this.content,e+this.openStart,t);return i&&new me(i,this.openStart,this.openEnd)}removeBetween(e,t){return new me(kR(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return me.empty;let i=t.openStart||0,r=t.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new me(ne.fromJSON(e,t.content),i,r)}static maxOpen(e,t=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)r++;return new me(e,i,r)}}me.empty=new me(ne.empty,0,0);function kR(n,e,t){let{index:i,offset:r}=n.findIndex(e),s=n.maybeChild(i),{index:l,offset:o}=n.findIndex(t);if(r==e||s.isText){if(o!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(i,s.copy(kR(s.content,e-r-1,t-r-1)))}function wR(n,e,t,i){let{index:r,offset:s}=n.findIndex(e),l=n.maybeChild(r);if(s==e||l.isText)return i&&!i.canReplace(r,r,t)?null:n.cut(0,e).append(t).append(n.cut(e));let o=wR(l.content,e-s-1,t,l);return o&&n.replaceChild(r,l.copy(o))}function ij(n,e,t){if(t.openStart>n.depth)throw new Jp("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Jp("Inconsistent open depths");return TR(n,e,t,0)}function TR(n,e,t,i){let r=n.index(i),s=n.node(i);if(r==e.index(i)&&i<n.depth-t.openStart){let l=TR(n,e,t,i+1);return s.copy(s.content.replaceChild(r,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let l=n.parent,o=l.content;return $o(l,o.cut(0,n.parentOffset).append(t.content).append(o.cut(e.parentOffset)))}else{let{start:l,end:o}=rj(t,n);return $o(s,AR(n,l,o,e,i))}else return $o(s,em(n,e,i))}function CR(n,e){if(!e.type.compatibleContent(n.type))throw new Jp("Cannot join "+e.type.name+" onto "+n.type.name)}function a1(n,e,t){let i=n.node(t);return CR(i,e.node(t)),i}function Eo(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function sh(n,e,t,i){let r=(e||n).node(t),s=0,l=e?e.index(t):r.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Eo(n.nodeAfter,i),s++));for(let o=s;o<l;o++)Eo(r.child(o),i);e&&e.depth==t&&e.textOffset&&Eo(e.nodeBefore,i)}function $o(n,e){return n.type.checkContent(e),n.copy(e)}function AR(n,e,t,i,r){let s=n.depth>r&&a1(n,e,r+1),l=i.depth>r&&a1(t,i,r+1),o=[];return sh(null,n,r,o),s&&l&&e.index(r)==t.index(r)?(CR(s,l),Eo($o(s,AR(n,e,t,i,r+1)),o)):(s&&Eo($o(s,em(n,e,r+1)),o),sh(e,t,r,o),l&&Eo($o(l,em(t,i,r+1)),o)),sh(i,null,r,o),new ne(o)}function em(n,e,t){let i=[];if(sh(null,n,t,i),n.depth>t){let r=a1(n,e,t+1);Eo($o(r,em(n,e,t+1)),i)}return sh(e,null,t,i),new ne(i)}function rj(n,e){let t=e.depth-n.openStart,r=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)r=e.node(s).copy(ne.from(r));return{start:r.resolveNoCache(n.openStart+t),end:r.resolveNoCache(r.content.size-n.openEnd-t)}}class Ch{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=e.child(t);return i?e.child(t).cut(i):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let i=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return pt.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),r=e.maybeChild(t);if(!i){let o=i;i=r,r=o}let s=i.marks;for(var l=0;l<s.length;l++)s[l].type.spec.inclusive===!1&&(!r||!s[l].isInSet(r.marks))&&(s=s[l--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new tm(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],r=0,s=t;for(let l=e;;){let{index:o,offset:c}=l.content.findIndex(s),h=s-c;if(i.push(l,o,r+c),!h||(l=l.child(o),l.isText))break;s=h-1,r+=c+1}return new Ch(t,i,s)}static resolveCached(e,t){let i=SA.get(e);if(i)for(let s=0;s<i.elts.length;s++){let l=i.elts[s];if(l.pos==t)return l}else SA.set(e,i=new sj);let r=i.elts[i.i]=Ch.resolve(e,t);return i.i=(i.i+1)%lj,r}}class sj{constructor(){this.elts=[],this.i=0}}const lj=12,SA=new WeakMap;class tm{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const oj=Object.create(null);let El=class c1{constructor(e,t,i,r=pt.none){this.type=e,this.attrs=t,this.marks=r,this.content=i||ne.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,r=0){this.content.nodesBetween(e,t,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,r){return this.content.textBetween(e,t,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&Kp(this.attrs,t||e.defaultAttrs||oj)&&pt.sameSet(this.marks,i||pt.none)}copy(e=null){return e==this.content?this:new c1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new c1(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return me.empty;let r=this.resolve(e),s=this.resolve(t),l=i?0:r.sharedDepth(t),o=r.start(l),h=r.node(l).content.cut(r.pos-o,s.pos-o);return new me(h,r.depth-l,s.depth-l)}replace(e,t,i){return ij(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let r=this.content.child(t-1);return{node:r,index:t-1,offset:i-r.nodeSize}}resolve(e){return Ch.resolveCached(this,e)}resolveNoCache(e){return Ch.resolve(this,e)}rangeHasMark(e,t,i){let r=!1;return t>e&&this.nodesBetween(e,t,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),MR(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,i=ne.empty,r=0,s=i.childCount){let l=this.contentMatchAt(e).matchFragment(i,r,s),o=l&&l.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let c=r;c<s;c++)if(!this.type.allowsMarks(i.child(c).marks))return!1;return!0}canReplaceWith(e,t,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),l=s&&s.matchFragment(this.content,t);return l?l.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=pt.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,i)}let r=ne.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,r,i);return s.type.checkAttrs(s.attrs),s}};El.prototype.text=void 0;let aj=class u1 extends El{constructor(e,t,i,r){if(super(e,t,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):MR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new u1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new u1(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function MR(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Lo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new cj(e,t);if(i.next==null)return Lo.empty;let r=QR(i);i.next&&i.err("Unexpected trailing text");let s=gj(mj(r));return Oj(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let r=this;for(let s=t;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let r=[this];function s(l,o){let c=l.matchFragment(e,i);if(c&&(!t||c.validEnd))return ne.from(o.map(h=>h.createAndFill()));for(let h=0;h<l.next.length;h++){let{type:d,next:p}=l.next[h];if(!(d.isText||d.hasRequiredAttrs())&&r.indexOf(p)==-1){r.push(p);let g=s(p,o.concat(d));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let l=[];for(let o=r;o.type;o=o.via)l.push(o.type);return l.reverse()}for(let l=0;l<s.next.length;l++){let{type:o,next:c}=s.next[l];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in t)&&(!r.type||c.validEnd)&&(i.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&t(i.next[r].next)}return t(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let l=0;l<i.next.length;l++)s+=(l?", ":"")+i.next[l].type.name+"->"+e.indexOf(i.next[l].next);return s}).join(`
`)}}Lo.empty=new Lo(!0);class cj{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function QR(n){let e=[];do e.push(uj(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function uj(n){let e=[];do e.push(hj(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function hj(n){let e=pj(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=fj(n,e);else break;return e}function vA(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function fj(n,e){let t=vA(n),i=t;return n.eat(",")&&(n.next!="}"?i=vA(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function dj(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let r=[];for(let s in t){let l=t[s];l.isInGroup(e)&&r.push(l)}return r.length==0&&n.err("No node type or group '"+e+"' found"),r}function pj(n){if(n.eat("(")){let e=QR(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=dj(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mj(n){let e=[[]];return r(s(n,0),t()),e;function t(){return e.push([])-1}function i(l,o,c){let h={term:c,to:o};return e[l].push(h),h}function r(l,o){l.forEach(c=>c.to=o)}function s(l,o){if(l.type=="choice")return l.exprs.reduce((c,h)=>c.concat(s(h,o)),[]);if(l.type=="seq")for(let c=0;;c++){let h=s(l.exprs[c],o);if(c==l.exprs.length-1)return h;r(h,o=t())}else if(l.type=="star"){let c=t();return i(o,c),r(s(l.expr,c),c),[i(c)]}else if(l.type=="plus"){let c=t();return r(s(l.expr,o),c),r(s(l.expr,c),c),[i(c)]}else{if(l.type=="opt")return[i(o)].concat(s(l.expr,o));if(l.type=="range"){let c=o;for(let h=0;h<l.min;h++){let d=t();r(s(l.expr,c),d),c=d}if(l.max==-1)r(s(l.expr,c),c);else for(let h=l.min;h<l.max;h++){let d=t();i(c,d),r(s(l.expr,c),d),c=d}return[i(c)]}else{if(l.type=="name")return[i(o,void 0,l.value)];throw new Error("Unknown expr type")}}}}function ER(n,e){return e-n}function xA(n,e){let t=[];return i(e),t.sort(ER);function i(r){let s=n[r];if(s.length==1&&!s[0].term)return i(s[0].to);t.push(r);for(let l=0;l<s.length;l++){let{term:o,to:c}=s[l];!o&&t.indexOf(c)==-1&&i(c)}}}function gj(n){let e=Object.create(null);return t(xA(n,0));function t(i){let r=[];i.forEach(l=>{n[l].forEach(({term:o,to:c})=>{if(!o)return;let h;for(let d=0;d<r.length;d++)r[d][0]==o&&(h=r[d][1]);xA(n,c).forEach(d=>{h||r.push([o,h=[]]),h.indexOf(d)==-1&&h.push(d)})})});let s=e[i.join(",")]=new Lo(i.indexOf(n.length-1)>-1);for(let l=0;l<r.length;l++){let o=r[l][1].sort(ER);s.next.push({type:r[l][0],next:e[o.join(",")]||t(o)})}return s}}function Oj(n,e){for(let t=0,i=[n];t<i.length;t++){let r=i[t],s=!r.validEnd,l=[];for(let o=0;o<r.next.length;o++){let{type:c,next:h}=r.next[o];l.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),i.indexOf(h)==-1&&i.push(h)}s&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $R(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function RR(n,e){let t=Object.create(null);for(let i in n){let r=e&&e[i];if(r===void 0){let s=n[i];if(s.hasDefault)r=s.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=r}return t}function PR(n,e,t,i){for(let r in e)if(!(r in n))throw new RangeError(`Unsupported attribute ${r} for ${t} of type ${r}`);for(let r in n){let s=n[r];s.validate&&s.validate(e[r])}}function DR(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new bj(n,i,e[i]);return t}let kA=class NR{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=DR(e,i.attrs),this.defaultAttrs=$R(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Lo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:RR(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new El(this,this.computeAttrs(e),ne.from(t),pt.setFrom(i))}createChecked(e=null,t,i){return t=ne.from(t),this.checkContent(t),new El(this,this.computeAttrs(e),t,pt.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=ne.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let r=this.contentMatch.matchFragment(t),s=r&&r.fillBefore(ne.empty,!0);return s?new El(this,e,t.append(s),pt.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){PR(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:pt.none:e}static compile(e,t){let i=Object.create(null);e.forEach((s,l)=>i[s]=new NR(s,t,l));let r=t.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function yj(n,e,t){let i=t.split("|");return r=>{let s=r===null?"null":typeof r;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${s}`)}}let bj=class{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?yj(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}};class Cg{constructor(e,t,i,r){this.name=e,this.rank=t,this.schema=i,this.spec=r,this.attrs=DR(e,r.attrs),this.excluded=null;let s=$R(this.attrs);this.instance=s?new pt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new pt(this,RR(this.attrs,e))}static compile(e,t){let i=Object.create(null),r=0;return e.forEach((s,l)=>i[s]=new Cg(s,r++,t,l)),i}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){PR(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let zR=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=mn.from(e.nodes),t.marks=mn.from(e.marks||{}),this.nodes=kA.compile(this.spec.nodes,this),this.marks=Cg.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let s=this.nodes[r],l=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=i[l]||(i[l]=Lo.parse(l,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?wA(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let r in this.marks){let s=this.marks[r],l=s.spec.excludes;s.excluded=l==null?[s]:l==""?[]:wA(this,l.split(" "))}this.nodeFromJSON=r=>El.fromJSON(this,r),this.markFromJSON=r=>pt.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof kA){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,i,r)}text(e,t){let i=this.nodes.text;return new aj(i,i.defaultAttrs,e,pt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function wA(n,e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],s=n.marks[r],l=s;if(s)t.push(s);else for(let o in n.marks){let c=n.marks[o];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&t.push(l=c)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function Sj(n){return n.tag!=null}function vj(n){return n.style!=null}class $l{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(r=>{if(Sj(r))this.tags.push(r);else if(vj(r)){let s=/[^=]*/.exec(r.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let s=e.nodes[r.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let i=new CA(this,t,!1);return i.addAll(e,pt.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new CA(this,t,!0);return i.addAll(e,pt.none,t.from,t.to),me.maxOpen(i.finish())}matchTag(e,t,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let s=this.tags[r];if(wj(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let l=s.getAttrs(e);if(l===!1)continue;s.attrs=l||void 0}return s}}}matchStyle(e,t,i,r){for(let s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let l=this.styles[s],o=l.style;if(!(o.indexOf(e)!=0||l.context&&!i.matchesContext(l.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=t))){if(l.getAttrs){let c=l.getAttrs(t);if(c===!1)continue;l.attrs=c||void 0}return l}}}static schemaRules(e){let t=[];function i(r){let s=r.priority==null?50:r.priority,l=0;for(;l<t.length;l++){let o=t[l];if((o.priority==null?50:o.priority)<s)break}t.splice(l,0,r)}for(let r in e.marks){let s=e.marks[r].spec.parseDOM;s&&s.forEach(l=>{i(l=AA(l)),l.mark||l.ignore||l.clearMark||(l.mark=r)})}for(let r in e.nodes){let s=e.nodes[r].spec.parseDOM;s&&s.forEach(l=>{i(l=AA(l)),l.node||l.ignore||l.mark||(l.node=r)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $l(e,$l.schemaRules(e)))}}const LR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xj={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_R={ol:!0,ul:!0},Ah=1,h1=2,lh=4;function TA(n,e,t){return e!=null?(e?Ah:0)|(e==="full"?h1:0):n&&n.whitespace=="pre"?Ah|h1:t&~lh}class Vd{constructor(e,t,i,r,s,l){this.type=e,this.attrs=t,this.marks=i,this.solid=r,this.options=l,this.content=[],this.activeMarks=pt.none,this.match=s||(l&lh?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ne.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ah)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-r[0].length))}}let t=ne.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!LR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}let CA=class{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=t.topNode,s,l=TA(null,t.preserveWhitespace,0)|(i?lh:0);r?s=new Vd(r.type,r.attrs,pt.none,!0,t.topMatch||r.type.contentMatch,l):i?s=new Vd(null,null,pt.none,!0,null,l):s=new Vd(e.schema.topNodeType,null,pt.none,!0,null,l),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let i=e.nodeValue,r=this.top,s=r.options&h1?"full":this.localPreserveWS||(r.options&Ah)>0,{schema:l}=this.parser;if(s==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,`
`);else if(l.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(l.linebreakReplacement.create())){let o=i.split(/\r?\n|\r/);for(let c=0;c<o.length;c++)c&&this.insertNode(l.linebreakReplacement.create(),t,!0),o[c]&&this.insertNode(l.text(o[c]),t,!/\S/.test(o[c]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],c=e.previousSibling;(!o||c&&c.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(i=i.slice(1))}i&&this.insertNode(l.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let r=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let l=e.nodeName.toLowerCase(),o;_R.hasOwnProperty(l)&&this.parser.normalizeLists&&kj(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,i));e:if(c?c.ignore:xj.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let h,d=this.needsBlock;if(LR.hasOwnProperty(l))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),h=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let p=c&&c.skip?t:this.readStyles(e,t);p&&this.addAll(e,p),h&&this.sync(s),this.needsBlock=d}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,c,h,c.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let i=e.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let s=this.parser.matchedStyles[r],l=i.getPropertyValue(s);if(l)for(let o=void 0;;){let c=this.parser.matchStyle(s,l,this,o);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)o=c;else break}}return t}addElementByRule(e,t,i,r){let s,l;if(t.node)if(l=this.parser.schema.nodes[t.node],l.isLeaf)this.insertNode(l.create(t.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let c=this.enter(l,t.attrs||null,i,t.preserveWhitespace);c&&(s=!0,i=c)}else{let c=this.parser.schema.marks[t.mark];i=i.concat(c.create(t.attrs))}let o=this.top;if(l&&l.isLeaf)this.findInside(e);else if(r)this.addElement(e,i,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,i),this.findAround(e,c,!1)}s&&this.sync(o)&&this.open--}addAll(e,t,i,r){let s=i||0;for(let l=i?e.childNodes[i]:e.firstChild,o=r==null?null:e.childNodes[r];l!=o;l=l.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(l,t);this.findAtPoint(e,s)}findPlace(e,t,i){let r,s;for(let l=this.open,o=0;l>=0;l--){let c=this.nodes[l],h=c.findWrapping(e);if(h&&(!r||r.length>h.length+o)&&(r=h,s=c,!h.length))break;if(c.solid){if(i)break;o+=2}}if(!r)return null;this.sync(s);for(let l=0;l<r.length;l++)t=this.enterInner(r[l],null,t,!1);return t}insertNode(e,t,i){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let r=this.findPlace(e,t,i);if(r){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let l=pt.none;for(let o of r.concat(e.marks))(s.type?s.type.allowsMarkType(o.type):MA(o.type,e.type))&&(l=o.addToSet(l));return s.content.push(e.mark(l)),!0}return!1}enter(e,t,i,r){let s=this.findPlace(e.create(t),i,!1);return s&&(s=this.enterInner(e,t,i,!0,r)),s}enterInner(e,t,i,r=!1,s){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(e);let o=TA(e,s,l.options);l.options&lh&&l.content.length==0&&(o|=lh);let c=pt.none;return i=i.filter(h=>(l.type?l.type.allowsMarkType(h.type):MA(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new Vd(e,t,c,r,null,o)),this.open++,i}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Ah)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let i=this.nodes[t].content;for(let r=i.length-1;r>=0;r--)e+=i[r].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,i){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(r?0:1),l=(o,c)=>{for(;o>=0;o--){let h=t[o];if(h==""){if(o==t.length-1||o==0)continue;for(;c>=s;c--)if(l(o-1,c))return!0;return!1}else{let d=c>0||c==0&&r?this.nodes[c].type:i&&c>=s?i.node(c-s).type:null;if(!d||d.name!=h&&!d.isInGroup(h))return!1;c--}}return!0};return l(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let t in this.parser.schema.nodes){let i=this.parser.schema.nodes[t];if(i.isTextblock&&i.defaultAttrs)return i}}};function kj(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&_R.hasOwnProperty(i)&&t?(t.appendChild(e),e=t):i=="li"?t=e:i&&(t=null)}}function wj(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function AA(n){let e={};for(let t in n)e[t]=n[t];return e}function MA(n,e){let t=e.schema.nodes;for(let i in t){let r=t[i];if(!r.allowsMarkType(n))continue;let s=[],l=o=>{s.push(o);for(let c=0;c<o.edgeCount;c++){let{type:h,next:d}=o.edge(c);if(h==e||s.indexOf(d)<0&&l(d))return!0}};if(l(r.contentMatch))return!0}}class Wo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},i){i||(i=Ry(t).createDocumentFragment());let r=i,s=[];return e.forEach(l=>{if(s.length||l.marks.length){let o=0,c=0;for(;o<s.length&&c<l.marks.length;){let h=l.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[o][0])||h.type.spec.spanning===!1)break;o++,c++}for(;o<s.length;)r=s.pop()[1];for(;c<l.marks.length;){let h=l.marks[c++],d=this.serializeMark(h,l.isInline,t);d&&(s.push([h,r]),r.appendChild(d.dom),r=d.contentDOM||d.dom)}}r.appendChild(this.serializeNodeInner(l,t))}),i}serializeNodeInner(e,t){let{dom:i,contentDOM:r}=Rp(Ry(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return i}serializeNode(e,t={}){let i=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let s=this.serializeMark(e.marks[r],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(e,t,i={}){let r=this.marks[e.type.name];return r&&Rp(Ry(i),r(e,t),null,e.attrs)}static renderSpec(e,t,i=null,r){return Rp(e,t,i,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Wo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=QA(e.nodes);return t.text||(t.text=i=>i.text),t}static marksFromSchema(e){return QA(e.marks)}}function QA(n){let e={};for(let t in n){let i=n[t].spec.toDOM;i&&(e[t]=i)}return e}function Ry(n){return n.document||window.document}const EA=new WeakMap;function Tj(n){let e=EA.get(n);return e===void 0&&EA.set(n,e=Cj(n)),e}function Cj(n){let e=null;function t(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let r=0;r<i.length;r++)t(i[r]);else for(let r in i)t(i[r])}return t(n),e}function Rp(n,e,t,i){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let r=e[0],s;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(s=Tj(i))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=r.indexOf(" ");l>0&&(t=r.slice(0,l),r=r.slice(l+1));let o,c=t?n.createElementNS(t,r):n.createElement(r),h=e[1],d=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){d=2;for(let p in h)if(h[p]!=null){let g=p.indexOf(" ");g>0?c.setAttributeNS(p.slice(0,g),p.slice(g+1),h[p]):p=="style"&&c.style?c.style.cssText=h[p]:c.setAttribute(p,h[p])}}for(let p=d;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:O,contentDOM:b}=Rp(n,g,t,i);if(c.appendChild(O),b){if(o)throw new RangeError("Multiple content holes");o=b}}}return{dom:c,contentDOM:o}}const BR=65535,jR=Math.pow(2,16);function Aj(n,e){return n+e*jR}function $A(n){return n&BR}function Mj(n){return(n-(n&BR))/jR}const ZR=1,XR=2,Pp=4,IR=8;class f1{constructor(e,t,i){this.pos=e,this.delInfo=t,this.recover=i}get deleted(){return(this.delInfo&IR)>0}get deletedBefore(){return(this.delInfo&(ZR|Pp))>0}get deletedAfter(){return(this.delInfo&(XR|Pp))>0}get deletedAcross(){return(this.delInfo&Pp)>0}}class Oi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Oi.empty)return Oi.empty}recover(e){let t=0,i=$A(e);if(!this.inverted)for(let r=0;r<i;r++)t+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+t+Mj(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,i){let r=0,s=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[o+s],d=this.ranges[o+l],p=c+h;if(e<=p){let g=h?e==c?-1:e==p?1:t:t,O=c+r+(g<0?0:d);if(i)return O;let b=e==(t<0?c:p)?null:Aj(o/3,e-c),v=e==c?XR:e==p?ZR:Pp;return(t<0?e!=c:e!=p)&&(v|=IR),new f1(O,v,b)}r+=d-h}return i?e+r:new f1(e+r,0,null)}touches(e,t){let i=0,r=$A(t),s=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[o+s],d=c+h;if(e<=d&&o==r*3)return!0;i+=this.ranges[o+l]-h}return!1}forEach(e){let t=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,s=0;r<this.ranges.length;r+=3){let l=this.ranges[r],o=l-(this.inverted?s:0),c=l+(this.inverted?0:s),h=this.ranges[r+t],d=this.ranges[r+i];e(o,o+h,c,c+d),s+=d-h}}invert(){return new Oi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Oi.empty:new Oi(e<0?[0,-e,0]:[0,0,e])}}Oi.empty=new Oi([]);class Mh{constructor(e,t,i=0,r=e?e.length:0){this.mirror=t,this.from=i,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Mh(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,i=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?i+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,i=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?i-r-1:void 0)}}invert(){let e=new Mh;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,i){let r=0;for(let s=this.from;s<this.to;s++){let l=this._maps[s],o=l.mapResult(e,t);if(o.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this._maps[c].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return i?e:new f1(e,r,null)}}const Py=Object.create(null);class En{getMap(){return Oi.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=Py[t.stepType];if(!i)throw new RangeError(`No step type ${t.stepType} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in Py)throw new RangeError("Duplicate use of step JSON ID "+e);return Py[e]=t,t.prototype.jsonID=e,t}}class Yt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Yt(e,null)}static fail(e){return new Yt(null,e)}static fromReplace(e,t,i,r){try{return Yt.ok(e.replace(t,i,r))}catch(s){if(s instanceof Jp)return Yt.fail(s.message);throw s}}}function nv(n,e,t){let i=[];for(let r=0;r<n.childCount;r++){let s=n.child(r);s.content.size&&(s=s.copy(nv(s.content,e,s))),s.isInline&&(s=e(s,t,r)),i.push(s)}return ne.fromArray(i)}class Cl extends En{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),s=new me(nv(t.content,(l,o)=>!l.isAtom||!o.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),r),t.openStart,t.openEnd);return Yt.fromReplace(e,this.from,this.to,s)}invert(){return new ir(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new Cl(t.pos,i.pos,this.mark)}merge(e){return e instanceof Cl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Cl(t.from,t.to,e.markFromJSON(t.mark))}}En.jsonID("addMark",Cl);class ir extends En{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=new me(nv(t.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),t.openStart,t.openEnd);return Yt.fromReplace(e,this.from,this.to,i)}invert(){return new Cl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new ir(t.pos,i.pos,this.mark)}merge(e){return e instanceof ir&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ir(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ir(t.from,t.to,e.markFromJSON(t.mark))}}En.jsonID("removeMark",ir);class Al extends En{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yt.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Yt.fromReplace(e,this.pos,this.pos+1,new me(ne.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let i=this.mark.addToSet(t.marks);if(i.length==t.marks.length){for(let r=0;r<t.marks.length;r++)if(!t.marks[r].isInSet(i))return new Al(this.pos,t.marks[r]);return new Al(this.pos,this.mark)}}return new _o(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Al(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Al(t.pos,e.markFromJSON(t.mark))}}En.jsonID("addNodeMark",Al);class _o extends En{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yt.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Yt.fromReplace(e,this.pos,this.pos+1,new me(ne.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Al(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new _o(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new _o(t.pos,e.markFromJSON(t.mark))}}En.jsonID("removeNodeMark",_o);class Ht extends En{constructor(e,t,i,r=!1){super(),this.from=e,this.to=t,this.slice=i,this.structure=r}apply(e){return this.structure&&d1(e,this.from,this.to)?Yt.fail("Structure replace would overwrite content"):Yt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Oi([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ht(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),i=this.from==this.to&&Ht.MAP_BIAS<0?t:e.mapResult(this.from,1);return i.deletedAcross&&t.deletedAcross?null:new Ht(i.pos,Math.max(i.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ht)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?me.empty:new me(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ht(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?me.empty:new me(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ht(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ht(t.from,t.to,me.fromJSON(e,t.slice),!!t.structure)}}Ht.MAP_BIAS=1;En.jsonID("replace",Ht);class ln extends En{constructor(e,t,i,r,s,l,o=!1){super(),this.from=e,this.to=t,this.gapFrom=i,this.gapTo=r,this.slice=s,this.insert=l,this.structure=o}apply(e){if(this.structure&&(d1(e,this.from,this.gapFrom)||d1(e,this.gapTo,this.to)))return Yt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Yt.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,t.content);return i?Yt.fromReplace(e,this.from,this.to,i):Yt.fail("Content does not fit in gap")}getMap(){return new Oi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ln(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return t.deletedAcross&&i.deletedAcross||r<t.pos||s>i.pos?null:new ln(t.pos,i.pos,r,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ln(t.from,t.to,t.gapFrom,t.gapTo,me.fromJSON(e,t.slice),t.insert,!!t.structure)}}En.jsonID("replaceAround",ln);function d1(n,e,t){let i=n.resolve(e),r=t-e,s=i.depth;for(;r>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,r--;if(r>0){let l=i.node(s).maybeChild(i.indexAfter(s));for(;r>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,r--}}return!1}function Qj(n,e,t,i){let r=[],s=[],l,o;n.doc.nodesBetween(e,t,(c,h,d)=>{if(!c.isInline)return;let p=c.marks;if(!i.isInSet(p)&&d.type.allowsMarkType(i.type)){let g=Math.max(h,e),O=Math.min(h+c.nodeSize,t),b=i.addToSet(p);for(let v=0;v<p.length;v++)p[v].isInSet(b)||(l&&l.to==g&&l.mark.eq(p[v])?l.to=O:r.push(l=new ir(g,O,p[v])));o&&o.to==g?o.to=O:s.push(o=new Cl(g,O,i))}}),r.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function Ej(n,e,t,i){let r=[],s=0;n.doc.nodesBetween(e,t,(l,o)=>{if(!l.isInline)return;s++;let c=null;if(i instanceof Cg){let h=l.marks,d;for(;d=i.isInSet(h);)(c||(c=[])).push(d),h=d.removeFromSet(h)}else i?i.isInSet(l.marks)&&(c=[i]):c=l.marks;if(c&&c.length){let h=Math.min(o+l.nodeSize,t);for(let d=0;d<c.length;d++){let p=c[d],g;for(let O=0;O<r.length;O++){let b=r[O];b.step==s-1&&p.eq(r[O].style)&&(g=b)}g?(g.to=h,g.step=s):r.push({style:p,from:Math.max(o,e),to:h,step:s})}}}),r.forEach(l=>n.step(new ir(l.from,l.to,l.style)))}function iv(n,e,t,i=t.contentMatch,r=!0){let s=n.doc.nodeAt(e),l=[],o=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),d=o+h.nodeSize,p=i.matchType(h.type);if(!p)l.push(new Ht(o,d,me.empty));else{i=p;for(let g=0;g<h.marks.length;g++)t.allowsMarkType(h.marks[g].type)||n.step(new ir(o,d,h.marks[g]));if(r&&h.isText&&t.whitespace!="pre"){let g,O=/\r?\n|\r/g,b;for(;g=O.exec(h.text);)b||(b=new me(ne.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),l.push(new Ht(o+g.index,o+g.index+g[0].length,b))}}o=d}if(!i.validEnd){let c=i.fillBefore(ne.empty,!0);n.replace(o,o,new me(c,0,0))}for(let c=l.length-1;c>=0;c--)n.step(l[c])}function $j(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Qc(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let i=n.depth,r=0,s=0;;--i){let l=n.$from.node(i),o=n.$from.index(i)+r,c=n.$to.indexAfter(i)-s;if(i<n.depth&&l.canReplace(o,c,t))return i;if(i==0||l.type.spec.isolating||!$j(l,o,c))break;o&&(r=1),c<l.childCount&&(s=1)}return null}function Rj(n,e,t){let{$from:i,$to:r,depth:s}=e,l=i.before(s+1),o=r.after(s+1),c=l,h=o,d=ne.empty,p=0;for(let b=s,v=!1;b>t;b--)v||i.index(b)>0?(v=!0,d=ne.from(i.node(b).copy(d)),p++):c--;let g=ne.empty,O=0;for(let b=s,v=!1;b>t;b--)v||r.after(b+1)<r.end(b)?(v=!0,g=ne.from(r.node(b).copy(g)),O++):h++;n.step(new ln(c,h,l,o,new me(d.append(g),p,O),d.size-p,!0))}function rv(n,e,t=null,i=n){let r=Pj(n,e),s=r&&Dj(i,e);return s?r.map(RA).concat({type:e,attrs:t}).concat(s.map(RA)):null}function RA(n){return{type:n,attrs:null}}function Pj(n,e){let{parent:t,startIndex:i,endIndex:r}=n,s=t.contentMatchAt(i).findWrapping(e);if(!s)return null;let l=s.length?s[0]:e;return t.canReplaceWith(i,r,l)?s:null}function Dj(n,e){let{parent:t,startIndex:i,endIndex:r}=n,s=t.child(i),l=e.contentMatch.findWrapping(s.type);if(!l)return null;let c=(l.length?l[l.length-1]:e).contentMatch;for(let h=i;c&&h<r;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:l}function Nj(n,e,t){let i=ne.empty;for(let l=t.length-1;l>=0;l--){if(i.size){let o=t[l].type.contentMatch.matchFragment(i);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=ne.from(t[l].type.create(t[l].attrs,i))}let r=e.start,s=e.end;n.step(new ln(r,s,r,s,new me(i,0,0),t.length,!0))}function zj(n,e,t,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(l,o)=>{let c=typeof r=="function"?r(l):r;if(l.isTextblock&&!l.hasMarkup(i,c)&&Lj(n.doc,n.mapping.slice(s).map(o),i)){let h=null;if(i.schema.linebreakReplacement){let O=i.whitespace=="pre",b=!!i.contentMatch.matchType(i.schema.linebreakReplacement);O&&!b?h=!1:!O&&b&&(h=!0)}h===!1&&qR(n,l,o,s),iv(n,n.mapping.slice(s).map(o,1),i,void 0,h===null);let d=n.mapping.slice(s),p=d.map(o,1),g=d.map(o+l.nodeSize,1);return n.step(new ln(p,g,p+1,g-1,new me(ne.from(i.create(c,null,l.marks)),0,0),1,!0)),h===!0&&VR(n,l,o,s),!1}})}function VR(n,e,t,i){e.forEach((r,s)=>{if(r.isText){let l,o=/\r?\n|\r/g;for(;l=o.exec(r.text);){let c=n.mapping.slice(i).map(t+1+s+l.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function qR(n,e,t,i){e.forEach((r,s)=>{if(r.type==r.type.schema.linebreakReplacement){let l=n.mapping.slice(i).map(t+1+s);n.replaceWith(l,l+1,e.type.schema.text(`
`))}})}function Lj(n,e,t){let i=n.resolve(e),r=i.index();return i.parent.canReplaceWith(r,r+1,t)}function _j(n,e,t,i,r){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let l=t.create(i,null,r||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,l);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new ln(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new me(ne.from(l),0,0),1,!0))}function As(n,e,t=1,i){let r=n.resolve(e),s=r.depth-t,l=i&&i[i.length-1]||r.parent;if(s<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!l.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let h=r.depth-1,d=t-2;h>s;h--,d--){let p=r.node(h),g=r.index(h);if(p.type.spec.isolating)return!1;let O=p.content.cutByIndex(g,p.childCount),b=i&&i[d+1];b&&(O=O.replaceChild(0,b.type.create(b.attrs)));let v=i&&i[d]||p;if(!p.canReplace(g+1,p.childCount)||!v.type.validContent(O))return!1}let o=r.indexAfter(s),c=i&&i[0];return r.node(s).canReplaceWith(o,o,c?c.type:r.node(s+1).type)}function Bj(n,e,t=1,i){let r=n.doc.resolve(e),s=ne.empty,l=ne.empty;for(let o=r.depth,c=r.depth-t,h=t-1;o>c;o--,h--){s=ne.from(r.node(o).copy(s));let d=i&&i[h];l=ne.from(d?d.type.create(d.attrs,l):r.node(o).copy(l))}n.step(new Ht(e,e,new me(s.append(l),t,t),!0))}function Vl(n,e){let t=n.resolve(e),i=t.index();return HR(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(i,i+1)}function jj(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:i}=n.type.schema;for(let r=0;r<e.childCount;r++){let s=e.child(r),l=s.type==i?n.type.schema.nodes.text:s.type;if(t=t.matchType(l),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function HR(n,e){return!!(n&&e&&!n.isLeaf&&jj(n,e))}function Ag(n,e,t=-1){let i=n.resolve(e);for(let r=i.depth;;r--){let s,l,o=i.index(r);if(r==i.depth?(s=i.nodeBefore,l=i.nodeAfter):t>0?(s=i.node(r+1),o++,l=i.node(r).maybeChild(o)):(s=i.node(r).maybeChild(o-1),l=i.node(r+1)),s&&!s.isTextblock&&HR(s,l)&&i.node(r).canReplace(o,o+1))return e;if(r==0)break;e=t<0?i.before(r):i.after(r)}}function Zj(n,e,t){let i=null,{linebreakReplacement:r}=n.doc.type.schema,s=n.doc.resolve(e-t),l=s.node().type;if(r&&l.inlineContent){let d=l.whitespace=="pre",p=!!l.contentMatch.matchType(r);d&&!p?i=!1:!d&&p&&(i=!0)}let o=n.steps.length;if(i===!1){let d=n.doc.resolve(e+t);qR(n,d.node(),d.before(),o)}l.inlineContent&&iv(n,e+t-1,l,s.node().contentMatchAt(s.index()),i==null);let c=n.mapping.slice(o),h=c.map(e-t);if(n.step(new Ht(h,c.map(e+t,-1),me.empty,!0)),i===!0){let d=n.doc.resolve(h);VR(n,d.node(),d.before(),n.steps.length)}return n}function Xj(n,e,t){let i=n.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),t))return e;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let s=i.index(r);if(i.node(r).canReplaceWith(s,s,t))return i.before(r+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let s=i.indexAfter(r);if(i.node(r).canReplaceWith(s,s,t))return i.after(r+1);if(s<i.node(r).childCount)return null}return null}function YR(n,e,t){let i=n.resolve(e);if(!t.content.size)return e;let r=t.content;for(let s=0;s<t.openStart;s++)r=r.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let l=i.depth;l>=0;l--){let o=l==i.depth?0:i.pos<=(i.start(l+1)+i.end(l+1))/2?-1:1,c=i.index(l)+(o>0?1:0),h=i.node(l),d=!1;if(s==1)d=h.canReplace(c,c,r);else{let p=h.contentMatchAt(c).findWrapping(r.firstChild.type);d=p&&h.canReplaceWith(c,c,p[0])}if(d)return o==0?i.pos:o<0?i.before(l+1):i.after(l+1)}return null}function Mg(n,e,t=e,i=me.empty){if(e==t&&!i.size)return null;let r=n.resolve(e),s=n.resolve(t);return UR(r,s,i)?new Ht(e,t,i):new Ij(r,s,i).fit()}function UR(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Ij{constructor(e,t,i){this.$from=e,this.$to=t,this.unplaced=i,this.frontier=[],this.placed=ne.empty;for(let r=0;r<=e.depth;r++){let s=e.node(r);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=ne.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(e<0?this.$to:i.doc.resolve(e));if(!r)return null;let s=this.placed,l=i.depth,o=r.depth;for(;l&&o&&s.childCount==1;)s=s.firstChild.content,l--,o--;let c=new me(s,l,o);return e>-1?new ln(i.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||i.pos!=this.$to.pos?new Ht(i.pos,r.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<e;i++){let s=t.firstChild;if(t.childCount>1&&(r=0),s.type.spec.isolating&&r<=i){e=i;break}t=s.content}for(let t=1;t<=2;t++)for(let i=t==1?e:this.unplaced.openStart;i>=0;i--){let r,s=null;i?(s=Dy(this.unplaced.content,i-1).firstChild,r=s.content):r=this.unplaced.content;let l=r.firstChild;for(let o=this.depth;o>=0;o--){let{type:c,match:h}=this.frontier[o],d,p=null;if(t==1&&(l?h.matchType(l.type)||(p=h.fillBefore(ne.from(l),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:o,parent:s,inject:p};if(t==2&&l&&(d=h.findWrapping(l.type)))return{sliceDepth:i,frontierDepth:o,parent:s,wrap:d};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:i}=this.unplaced,r=Dy(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new me(e,t+1,Math.max(i,r.size+t>=e.size-i?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:i}=this.unplaced,r=Dy(e,t);if(r.childCount<=1&&t>0){let s=e.size-t<=t+r.size;this.unplaced=new me(Yu(e,t-1,1),t-1,s?t-1:i)}else this.unplaced=new me(Yu(e,t,1),t,i)}placeNodes({sliceDepth:e,frontierDepth:t,parent:i,inject:r,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let l=this.unplaced,o=i?i.content:l.content,c=l.openStart-e,h=0,d=[],{match:p,type:g}=this.frontier[t];if(r){for(let v=0;v<r.childCount;v++)d.push(r.child(v));p=p.matchFragment(r)}let O=o.size+e-(l.content.size-l.openEnd);for(;h<o.childCount;){let v=o.child(h),x=p.matchType(v.type);if(!x)break;h++,(h>1||c==0||v.content.size)&&(p=x,d.push(WR(v.mark(g.allowedMarks(v.marks)),h==1?c:0,h==o.childCount?O:-1)))}let b=h==o.childCount;b||(O=-1),this.placed=Uu(this.placed,t,ne.from(d)),this.frontier[t].match=p,b&&O<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,x=o;v<O;v++){let k=x.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),x=k.content}this.unplaced=b?e==0?me.empty:new me(Yu(l.content,e-1,1),e-1,O<0?l.openEnd:e-1):new me(Yu(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Ny(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:i,type:r}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),l=Ny(e,t,r,i,s);if(l){for(let o=t-1;o>=0;o--){let{match:c,type:h}=this.frontier[o],d=Ny(e,o,h,c,!0);if(!d||d.childCount)continue e}return{depth:t,fit:l,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Uu(this.placed,t.depth,t.fit)),e=t.move;for(let i=t.depth+1;i<=e.depth;i++){let r=e.node(i),s=r.type.contentMatch.fillBefore(r.content,!0,e.index(i));this.openFrontierNode(r.type,r.attrs,s)}return e}openFrontierNode(e,t=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Uu(this.placed,this.depth,ne.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ne.empty,!0);t.childCount&&(this.placed=Uu(this.placed,this.frontier.length,t))}}function Yu(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Yu(n.firstChild.content,e-1,t)))}function Uu(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Uu(n.lastChild.content,e-1,t)))}function Dy(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function WR(n,e,t){if(e<=0)return n;let i=n.content;return e>1&&(i=i.replaceChild(0,WR(i.firstChild,e-1,i.childCount==1?t-1:0))),e>0&&(i=n.type.contentMatch.fillBefore(i).append(i),t<=0&&(i=i.append(n.type.contentMatch.matchFragment(i).fillBefore(ne.empty,!0)))),n.copy(i)}function Ny(n,e,t,i,r){let s=n.node(e),l=r?n.indexAfter(e):n.index(e);if(l==s.childCount&&!t.compatibleContent(s.type))return null;let o=i.fillBefore(s.content,!0,l);return o&&!Vj(t,s.content,l)?o:null}function Vj(n,e,t){for(let i=t;i<e.childCount;i++)if(!n.allowsMarks(e.child(i).marks))return!0;return!1}function qj(n){return n.spec.defining||n.spec.definingForContent}function Hj(n,e,t,i){if(!i.size)return n.deleteRange(e,t);let r=n.doc.resolve(e),s=n.doc.resolve(t);if(UR(r,s,i))return n.step(new Ht(e,t,i));let l=FR(r,s);l[l.length-1]==0&&l.pop();let o=-(r.depth+1);l.unshift(o);for(let g=r.depth,O=r.pos-1;g>0;g--,O--){let b=r.node(g).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;l.indexOf(g)>-1?o=g:r.before(g)==O&&l.splice(1,0,-g)}let c=l.indexOf(o),h=[],d=i.openStart;for(let g=i.content,O=0;;O++){let b=g.firstChild;if(h.push(b),O==i.openStart)break;g=b.content}for(let g=d-1;g>=0;g--){let O=h[g],b=qj(O.type);if(b&&!O.sameMarkup(r.node(Math.abs(o)-1)))d=g;else if(b||!O.type.isTextblock)break}for(let g=i.openStart;g>=0;g--){let O=(g+d+1)%(i.openStart+1),b=h[O];if(b)for(let v=0;v<l.length;v++){let x=l[(v+c)%l.length],k=!0;x<0&&(k=!1,x=-x);let C=r.node(x-1),A=r.index(x-1);if(C.canReplaceWith(A,A,b.type,b.marks))return n.replace(r.before(x),k?s.after(x):t,new me(GR(i.content,0,i.openStart,O),O,i.openEnd))}}let p=n.steps.length;for(let g=l.length-1;g>=0&&(n.replace(e,t,i),!(n.steps.length>p));g--){let O=l[g];O<0||(e=r.before(O),t=s.after(O))}}function GR(n,e,t,i,r){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(GR(s.content,e+1,t,i,s)))}if(e>i){let s=r.contentMatchAt(0),l=s.fillBefore(n).append(n);n=l.append(s.matchFragment(l).fillBefore(ne.empty,!0))}return n}function Yj(n,e,t,i){if(!i.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let r=Xj(n.doc,e,i.type);r!=null&&(e=t=r)}n.replaceRange(e,t,new me(ne.from(i),0,0))}function Uj(n,e,t){let i=n.doc.resolve(e),r=n.doc.resolve(t);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let l=i.sharedDepth(t),o=!1;for(let c=i.depth;c>l;c--)i.node(c).type.spec.isolating&&(o=!0);for(let c=r.depth;c>l;c--)r.node(c).type.spec.isolating&&(o=!0);if(!o){for(let c=i.depth;c>0&&e==i.start(c);c--)e=i.before(c);for(let c=r.depth;c>0&&t==r.start(c);c--)t=r.before(c);i=n.doc.resolve(e),r=n.doc.resolve(t)}}let s=FR(i,r);for(let l=0;l<s.length;l++){let o=s[l],c=l==s.length-1;if(c&&o==0||i.node(o).type.contentMatch.validEnd)return n.delete(i.start(o),r.end(o));if(o>0&&(c||i.node(o-1).canReplace(i.index(o-1),r.indexAfter(o-1))))return n.delete(i.before(o),r.after(o))}for(let l=1;l<=i.depth&&l<=r.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&r.end(l)-t!=r.depth-l&&i.start(l-1)==r.start(l-1)&&i.node(l-1).canReplace(i.index(l-1),r.index(l-1)))return n.delete(i.before(l),t);n.delete(e,t)}function FR(n,e){let t=[],i=Math.min(n.depth,e.depth);for(let r=i;r>=0;r--){let s=n.start(r);if(s<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(s==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==s-1)&&t.push(r)}return t}class Fa extends En{constructor(e,t,i){super(),this.pos=e,this.attr=t,this.value=i}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yt.fail("No node at attribute step's position");let i=Object.create(null);for(let s in t.attrs)i[s]=t.attrs[s];i[this.attr]=this.value;let r=t.type.create(i,null,t.marks);return Yt.fromReplace(e,this.pos,this.pos+1,new me(ne.from(r),0,t.isLeaf?0:1))}getMap(){return Oi.empty}invert(e){return new Fa(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Fa(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Fa(t.pos,t.attr,t.value)}}En.jsonID("attr",Fa);class Qh extends En{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let i=e.type.create(t,e.content,e.marks);return Yt.ok(i)}getMap(){return Oi.empty}invert(e){return new Qh(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qh(t.attr,t.value)}}En.jsonID("docAttr",Qh);let ac=class extends Error{};ac=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};ac.prototype=Object.create(Error.prototype);ac.prototype.constructor=ac;ac.prototype.name="TransformError";class sv{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Mh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ac(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((s,l,o,c)=>{e=Math.min(e,o),t=Math.max(t,c)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,i=me.empty){let r=Mg(this.doc,e,t,i);return r&&this.step(r),this}replaceWith(e,t,i){return this.replace(e,t,new me(ne.from(i),0,0))}delete(e,t){return this.replace(e,t,me.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,i){return Hj(this,e,t,i),this}replaceRangeWith(e,t,i){return Yj(this,e,t,i),this}deleteRange(e,t){return Uj(this,e,t),this}lift(e,t){return Rj(this,e,t),this}join(e,t=1){return Zj(this,e,t),this}wrap(e,t){return Nj(this,e,t),this}setBlockType(e,t=e,i,r=null){return zj(this,e,t,i,r),this}setNodeMarkup(e,t,i=null,r){return _j(this,e,t,i,r),this}setNodeAttribute(e,t,i){return this.step(new Fa(e,t,i)),this}setDocAttribute(e,t){return this.step(new Qh(e,t)),this}addNodeMark(e,t){return this.step(new Al(e,t)),this}removeNodeMark(e,t){let i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at position "+e);if(t instanceof pt)t.isInSet(i.marks)&&this.step(new _o(e,t));else{let r=i.marks,s,l=[];for(;s=t.isInSet(r);)l.push(new _o(e,s)),r=s.removeFromSet(r);for(let o=l.length-1;o>=0;o--)this.step(l[o])}return this}split(e,t=1,i){return Bj(this,e,t,i),this}addMark(e,t,i){return Qj(this,e,t,i),this}removeMark(e,t,i){return Ej(this,e,t,i),this}clearIncompatible(e,t,i){return iv(this,e,t,i),this}}const zy=Object.create(null);class $e{constructor(e,t,i){this.$anchor=e,this.$head=t,this.ranges=i||[new KR(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=me.empty){let i=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=i,i=i.lastChild;let s=e.steps.length,l=this.ranges;for(let o=0;o<l.length;o++){let{$from:c,$to:h}=l[o],d=e.mapping.slice(s);e.replaceRange(d.map(c.pos),d.map(h.pos),o?me.empty:t),o==0&&NA(e,s,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let i=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:l,$to:o}=r[s],c=e.mapping.slice(i),h=c.map(l.pos),d=c.map(o.pos);s?e.deleteRange(h,d):(e.replaceRangeWith(h,d,t),NA(e,i,t.isInline?-1:1))}}static findFrom(e,t,i=!1){let r=e.parent.inlineContent?new Ce(e):Xa(e.node(0),e.parent,e.pos,e.index(),t,i);if(r)return r;for(let s=e.depth-1;s>=0;s--){let l=t<0?Xa(e.node(0),e.node(s),e.before(s+1),e.index(s),t,i):Xa(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,i);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Si(e.node(0))}static atStart(e){return Xa(e,e,0,0,1)||new Si(e)}static atEnd(e){return Xa(e,e,e.content.size,e.childCount,-1)||new Si(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=zy[t.type];if(!i)throw new RangeError(`No selection type ${t.type} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in zy)throw new RangeError("Duplicate use of selection JSON ID "+e);return zy[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Ce.between(this.$anchor,this.$head).getBookmark()}}$e.prototype.visible=!0;let KR=class{constructor(e,t){this.$from=e,this.$to=t}},PA=!1;function DA(n){!PA&&!n.parent.inlineContent&&(PA=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Ce extends $e{constructor(e,t=e){DA(e),DA(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let i=e.resolve(t.map(this.head));if(!i.parent.inlineContent)return $e.near(i);let r=e.resolve(t.map(this.anchor));return new Ce(r.parent.inlineContent?r:i,i)}replace(e,t=me.empty){if(super.replace(e,t),t==me.empty){let i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}eq(e){return e instanceof Ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Qg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ce(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,i=t){let r=e.resolve(t);return new this(r,i==t?r:e.resolve(i))}static between(e,t,i){let r=e.pos-t.pos;if((!i||r)&&(i=r>=0?1:-1),!t.parent.inlineContent){let s=$e.findFrom(t,i,!0)||$e.findFrom(t,-i,!0);if(s)t=s.$head;else return $e.near(t,i)}return e.parent.inlineContent||(r==0?e=t:(e=($e.findFrom(e,-i,!0)||$e.findFrom(e,i,!0)).$anchor,e.pos<t.pos!=r<0&&(e=t))),new Ce(e,t)}}$e.jsonID("text",Ce);class Qg{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Qg(e.map(this.anchor),e.map(this.head))}resolve(e){return Ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class we extends $e{constructor(e){let t=e.nodeAfter,i=e.node(0).resolve(e.pos+t.nodeSize);super(e,i),this.node=t}map(e,t){let{deleted:i,pos:r}=t.mapResult(this.anchor),s=e.resolve(r);return i?$e.near(s):new we(s)}content(){return new me(ne.from(this.node),0,0)}eq(e){return e instanceof we&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lv(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new we(e.resolve(t.anchor))}static create(e,t){return new we(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}we.prototype.visible=!1;$e.jsonID("node",we);class lv{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:i}=e.mapResult(this.anchor);return t?new Qg(i,i):new lv(i)}resolve(e){let t=e.resolve(this.anchor),i=t.nodeAfter;return i&&we.isSelectable(i)?new we(t):$e.near(t)}}class Si extends $e{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=me.empty){if(t==me.empty){e.delete(0,e.doc.content.size);let i=$e.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Si(e)}map(e){return new Si(e)}eq(e){return e instanceof Si}getBookmark(){return Wj}}$e.jsonID("all",Si);const Wj={map(){return this},resolve(n){return new Si(n)}};function Xa(n,e,t,i,r,s=!1){if(e.inlineContent)return Ce.create(n,t);for(let l=i-(r>0?0:1);r>0?l<e.childCount:l>=0;l+=r){let o=e.child(l);if(o.isAtom){if(!s&&we.isSelectable(o))return we.create(n,t-(r<0?o.nodeSize:0))}else{let c=Xa(n,o,t+r,r<0?o.childCount:0,r,s);if(c)return c}t+=o.nodeSize*r}return null}function NA(n,e,t){let i=n.steps.length-1;if(i<e)return;let r=n.steps[i];if(!(r instanceof Ht||r instanceof ln))return;let s=n.mapping.maps[i],l;s.forEach((o,c,h,d)=>{l==null&&(l=d)}),n.setSelection($e.near(n.doc.resolve(l),t))}const zA=1,qd=2,LA=4;let Gj=class extends sv{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|zA)&~qd,this.storedMarks=null,this}get selectionSet(){return(this.updated&zA)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=qd,this}ensureMarks(e){return pt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&qd)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~qd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let i=this.selection;return t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||pt.none))),i.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,i){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(i==null&&(i=t),!e)return this.deleteRange(t,i);let s=this.storedMarks;if(!s){let l=this.doc.resolve(t);s=i==t?l.marks():l.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,r.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection($e.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=LA,this}get scrolledIntoView(){return(this.updated&LA)>0}};function _A(n,e){return!e||!n?n:n.bind(e)}class Wu{constructor(e,t,i){this.name=e,this.init=_A(t.init,i),this.apply=_A(t.apply,i)}}const Fj=[new Wu("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Wu("selection",{init(n,e){return n.selection||$e.atStart(e.doc)},apply(n){return n.selection}}),new Wu("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,i){return i.selection.$cursor?n.storedMarks:null}}),new Wu("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];let Ly=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Fj.slice(),t&&t.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Wu(i.key,i.spec.state,i))})}},Kj=class Gu{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let i=0;i<this.config.plugins.length;i++)if(i!=t){let r=this.config.plugins[i];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],i=this.applyInner(e),r=null;for(;;){let s=!1;for(let l=0;l<this.config.plugins.length;l++){let o=this.config.plugins[l];if(o.spec.appendTransaction){let c=r?r[l].n:0,h=r?r[l].state:this,d=c<t.length&&o.spec.appendTransaction.call(o,c?t.slice(c):t,h,i);if(d&&i.filterTransaction(d,l)){if(d.setMeta("appendedTransaction",e),!r){r=[];for(let p=0;p<this.config.plugins.length;p++)r.push(p<l?{state:i,n:t.length}:{state:this,n:0})}t.push(d),i=i.applyInner(d),s=!0}r&&(r[l]={state:i,n:t.length})}}if(!s)return{state:i,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Gu(this.config),i=this.config.fields;for(let r=0;r<i.length;r++){let s=i[r];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new Gj(this)}static create(e){let t=new Ly(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Gu(t);for(let r=0;r<t.fields.length;r++)i[t.fields[r].name]=t.fields[r].init(e,i);return i}reconfigure(e){let t=new Ly(this.schema,e.plugins),i=t.fields,r=new Gu(t);for(let s=0;s<i.length;s++){let l=i[s].name;r[l]=this.hasOwnProperty(l)?this[l]:i[s].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(i=>i.toJSON())),e&&typeof e=="object")for(let i in e){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[i],s=r.spec.state;s&&s.toJSON&&(t[i]=s.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Ly(e.schema,e.plugins),s=new Gu(r);return r.fields.forEach(l=>{if(l.name=="doc")s.doc=El.fromJSON(e.schema,t.doc);else if(l.name=="selection")s.selection=$e.fromJSON(s.doc,t.selection);else if(l.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(let o in i){let c=i[o],h=c.spec.state;if(c.key==l.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){s[l.name]=h.fromJSON.call(c,e,t[o],s);return}}s[l.name]=l.init(e,s)}}),s}};function JR(n,e,t){for(let i in n){let r=n[i];r instanceof Function?r=r.bind(e):i=="handleDOMEvents"&&(r=JR(r,e,{})),t[i]=r}return t}class yt{constructor(e){this.spec=e,this.props={},e.props&&JR(e.props,this,this.props),this.key=e.key?e.key.key:e2("plugin")}getState(e){return e[this.key]}}const _y=Object.create(null);function e2(n){return n in _y?n+"$"+ ++_y[n]:(_y[n]=0,n+"$")}class Ct{constructor(e="key"){this.key=e2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ov=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function t2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const n2=(n,e,t)=>{let i=t2(n,t);if(!i)return!1;let r=av(i);if(!r){let l=i.blockRange(),o=l&&Qc(l);return o==null?!1:(e&&e(n.tr.lift(l,o).scrollIntoView()),!0)}let s=r.nodeBefore;if(h2(n,r,e,-1))return!0;if(i.parent.content.size==0&&(cc(s,"end")||we.isSelectable(s)))for(let l=i.depth;;l--){let o=Mg(n.doc,i.before(l),i.after(l),me.empty);if(o&&o.slice.size<o.to-o.from){if(e){let c=n.tr.step(o);c.setSelection(cc(s,"end")?$e.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):we.create(c.doc,r.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(l==1||i.node(l-1).childCount>1)break}return s.isAtom&&r.depth==i.depth-1?(e&&e(n.tr.delete(r.pos-s.nodeSize,r.pos).scrollIntoView()),!0):!1},Jj=(n,e,t)=>{let i=t2(n,t);if(!i)return!1;let r=av(i);return r?i2(n,r,e):!1},eZ=(n,e,t)=>{let i=s2(n,t);if(!i)return!1;let r=cv(i);return r?i2(n,r,e):!1};function i2(n,e,t){let i=e.nodeBefore,r=i,s=e.pos-1;for(;!r.isTextblock;s--){if(r.type.spec.isolating)return!1;let d=r.lastChild;if(!d)return!1;r=d}let l=e.nodeAfter,o=l,c=e.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let h=Mg(n.doc,s,c,me.empty);if(!h||h.from!=s||h instanceof Ht&&h.slice.size>=c-s)return!1;if(t){let d=n.tr.step(h);d.setSelection(Ce.create(d.doc,s)),t(d.scrollIntoView())}return!0}function cc(n,e,t=!1){for(let i=n;i;i=e=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(t&&i.childCount!=1)return!1}return!1}const r2=(n,e,t)=>{let{$head:i,empty:r}=n.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):i.parentOffset>0)return!1;s=av(i)}let l=s&&s.nodeBefore;return!l||!we.isSelectable(l)?!1:(e&&e(n.tr.setSelection(we.create(n.doc,s.pos-l.nodeSize)).scrollIntoView()),!0)};function av(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function s2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const l2=(n,e,t)=>{let i=s2(n,t);if(!i)return!1;let r=cv(i);if(!r)return!1;let s=r.nodeAfter;if(h2(n,r,e,1))return!0;if(i.parent.content.size==0&&(cc(s,"start")||we.isSelectable(s))){let l=Mg(n.doc,i.before(),i.after(),me.empty);if(l&&l.slice.size<l.to-l.from){if(e){let o=n.tr.step(l);o.setSelection(cc(s,"start")?$e.findFrom(o.doc.resolve(o.mapping.map(r.pos)),1):we.create(o.doc,o.mapping.map(r.pos))),e(o.scrollIntoView())}return!0}}return s.isAtom&&r.depth==i.depth-1?(e&&e(n.tr.delete(r.pos,r.pos+s.nodeSize).scrollIntoView()),!0):!1},o2=(n,e,t)=>{let{$head:i,empty:r}=n.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):i.parentOffset<i.parent.content.size)return!1;s=cv(i)}let l=s&&s.nodeAfter;return!l||!we.isSelectable(l)?!1:(e&&e(n.tr.setSelection(we.create(n.doc,s.pos)).scrollIntoView()),!0)};function cv(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const tZ=(n,e)=>{let t=n.selection,i=t instanceof we,r;if(i){if(t.node.isTextblock||!Vl(n.doc,t.from))return!1;r=t.from}else if(r=Ag(n.doc,t.from,-1),r==null)return!1;if(e){let s=n.tr.join(r);i&&s.setSelection(we.create(s.doc,r-n.doc.resolve(r).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},nZ=(n,e)=>{let t=n.selection,i;if(t instanceof we){if(t.node.isTextblock||!Vl(n.doc,t.to))return!1;i=t.to}else if(i=Ag(n.doc,t.to,1),i==null)return!1;return e&&e(n.tr.join(i).scrollIntoView()),!0},iZ=(n,e)=>{let{$from:t,$to:i}=n.selection,r=t.blockRange(i),s=r&&Qc(r);return s==null?!1:(e&&e(n.tr.lift(r,s).scrollIntoView()),!0)},a2=(n,e)=>{let{$head:t,$anchor:i}=n.selection;return!t.parent.type.spec.code||!t.sameParent(i)?!1:(e&&e(n.tr.insertText(`
`).scrollIntoView()),!0)};function uv(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const rZ=(n,e)=>{let{$head:t,$anchor:i}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(i))return!1;let r=t.node(-1),s=t.indexAfter(-1),l=uv(r.contentMatchAt(s));if(!l||!r.canReplaceWith(s,s,l))return!1;if(e){let o=t.after(),c=n.tr.replaceWith(o,o,l.createAndFill());c.setSelection($e.near(c.doc.resolve(o),1)),e(c.scrollIntoView())}return!0},c2=(n,e)=>{let t=n.selection,{$from:i,$to:r}=t;if(t instanceof Si||i.parent.inlineContent||r.parent.inlineContent)return!1;let s=uv(r.parent.contentMatchAt(r.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let l=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,o=n.tr.insert(l,s.createAndFill());o.setSelection(Ce.create(o.doc,l+1)),e(o.scrollIntoView())}return!0},u2=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(As(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let i=t.blockRange(),r=i&&Qc(i);return r==null?!1:(e&&e(n.tr.lift(i,r).scrollIntoView()),!0)};function sZ(n){return(e,t)=>{let{$from:i,$to:r}=e.selection;if(e.selection instanceof we&&e.selection.node.isBlock)return!i.parentOffset||!As(e.doc,i.pos)?!1:(t&&t(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let s=[],l,o,c=!1,h=!1;for(let O=i.depth;;O--)if(i.node(O).isBlock){c=i.end(O)==i.pos+(i.depth-O),h=i.start(O)==i.pos-(i.depth-O),o=uv(i.node(O-1).contentMatchAt(i.indexAfter(O-1))),s.unshift(c&&o?{type:o}:null),l=O;break}else{if(O==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Ce||e.selection instanceof Si)&&d.deleteSelection();let p=d.mapping.map(i.pos),g=As(d.doc,p,s.length,s);if(g||(s[0]=o?{type:o}:null,g=As(d.doc,p,s.length,s)),!g)return!1;if(d.split(p,s.length,s),!c&&h&&i.node(l).type!=o){let O=d.mapping.map(i.before(l)),b=d.doc.resolve(O);o&&i.node(l-1).canReplaceWith(b.index(),b.index()+1,o)&&d.setNodeMarkup(d.mapping.map(i.before(l)),o)}return t&&t(d.scrollIntoView()),!0}}const lZ=sZ(),oZ=(n,e)=>{let{$from:t,to:i}=n.selection,r,s=t.sharedDepth(i);return s==0?!1:(r=t.before(s),e&&e(n.tr.setSelection(we.create(n.doc,r))),!0)};function aZ(n,e,t){let i=e.nodeBefore,r=e.nodeAfter,s=e.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(r.isTextblock||Vl(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function h2(n,e,t,i){let r=e.nodeBefore,s=e.nodeAfter,l,o,c=r.type.spec.isolating||s.type.spec.isolating;if(!c&&aZ(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(l=(o=r.contentMatchAt(r.childCount)).findWrapping(s.type))&&o.matchType(l[0]||s.type).validEnd){if(t){let O=e.pos+s.nodeSize,b=ne.empty;for(let k=l.length-1;k>=0;k--)b=ne.from(l[k].create(null,b));b=ne.from(r.copy(b));let v=n.tr.step(new ln(e.pos-1,O,e.pos,O,new me(b,1,0),l.length,!0)),x=v.doc.resolve(O+2*l.length);x.nodeAfter&&x.nodeAfter.type==r.type&&Vl(v.doc,x.pos)&&v.join(x.pos),t(v.scrollIntoView())}return!0}let d=s.type.spec.isolating||i>0&&c?null:$e.findFrom(e,1),p=d&&d.$from.blockRange(d.$to),g=p&&Qc(p);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(p,g).scrollIntoView()),!0;if(h&&cc(s,"start",!0)&&cc(r,"end")){let O=r,b=[];for(;b.push(O),!O.isTextblock;)O=O.lastChild;let v=s,x=1;for(;!v.isTextblock;v=v.firstChild)x++;if(O.canReplace(O.childCount,O.childCount,v.content)){if(t){let k=ne.empty;for(let A=b.length-1;A>=0;A--)k=ne.from(b[A].copy(k));let C=n.tr.step(new ln(e.pos-b.length,e.pos+s.nodeSize,e.pos+x,e.pos+s.nodeSize-x,new me(k,b.length,0),0,!0));t(C.scrollIntoView())}return!0}}return!1}function f2(n){return function(e,t){let i=e.selection,r=n<0?i.$from:i.$to,s=r.depth;for(;r.node(s).isInline;){if(!s)return!1;s--}return r.node(s).isTextblock?(t&&t(e.tr.setSelection(Ce.create(e.doc,n<0?r.start(s):r.end(s)))),!0):!1}}const cZ=f2(-1),uZ=f2(1);function hZ(n,e=null){return function(t,i){let{$from:r,$to:s}=t.selection,l=r.blockRange(s),o=l&&rv(l,n,e);return o?(i&&i(t.tr.wrap(l,o).scrollIntoView()),!0):!1}}function BA(n,e=null){return function(t,i){let r=!1;for(let s=0;s<t.selection.ranges.length&&!r;s++){let{$from:{pos:l},$to:{pos:o}}=t.selection.ranges[s];t.doc.nodesBetween(l,o,(c,h)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)r=!0;else{let d=t.doc.resolve(h),p=d.index();r=d.parent.canReplaceWith(p,p+1,n)}})}if(!r)return!1;if(i){let s=t.tr;for(let l=0;l<t.selection.ranges.length;l++){let{$from:{pos:o},$to:{pos:c}}=t.selection.ranges[l];s.setBlockType(o,c,n,e)}i(s.scrollIntoView())}return!0}}function hv(...n){return function(e,t,i){for(let r=0;r<n.length;r++)if(n[r](e,t,i))return!0;return!1}}hv(ov,n2,r2);hv(ov,l2,o2);hv(a2,c2,u2,lZ);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function fZ(n,e=null){return function(t,i){let{$from:r,$to:s}=t.selection,l=r.blockRange(s);if(!l)return!1;let o=i?t.tr:null;return dZ(o,l,n,e)?(i&&i(o.scrollIntoView()),!0):!1}}function dZ(n,e,t,i=null){let r=!1,s=e,l=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=l.resolve(e.start-2);s=new tm(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new tm(e.$from,l.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let o=rv(s,t,i,e);return o?(n&&pZ(n,e,o,r,t),!0):!1}function pZ(n,e,t,i,r){let s=ne.empty;for(let d=t.length-1;d>=0;d--)s=ne.from(t[d].type.create(t[d].attrs,s));n.step(new ln(e.start-(i?2:0),e.end,e.start,e.end,new me(s,0,0),t.length,!0));let l=0;for(let d=0;d<t.length;d++)t[d].type==r&&(l=d+1);let o=t.length-l,c=e.start+t.length-(i?2:0),h=e.parent;for(let d=e.startIndex,p=e.endIndex,g=!0;d<p;d++,g=!1)!g&&As(n.doc,c,o)&&(n.split(c,o),c+=2*o),c+=h.child(d).nodeSize;return n}function mZ(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,l=>l.childCount>0&&l.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?gZ(e,t,n,s):OZ(e,t,s):!0:!1}}function gZ(n,e,t,i){let r=n.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(r.step(new ln(s-1,l,s,l,new me(ne.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new tm(r.doc.resolve(i.$from.pos),r.doc.resolve(l),i.depth));const o=Qc(i);if(o==null)return!1;r.lift(i,o);let c=r.doc.resolve(r.mapping.map(s,-1)-1);return Vl(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),e(r.scrollIntoView()),!0}function OZ(n,e,t){let i=n.tr,r=t.parent;for(let O=t.end,b=t.endIndex-1,v=t.startIndex;b>v;b--)O-=r.child(b).nodeSize,i.delete(O-1,O+1);let s=i.doc.resolve(t.start),l=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let o=t.startIndex==0,c=t.endIndex==r.childCount,h=s.node(-1),d=s.index(-1);if(!h.canReplace(d+(o?0:1),d+1,l.content.append(c?ne.empty:ne.from(r))))return!1;let p=s.pos,g=p+l.nodeSize;return i.step(new ln(p-(o?1:0),g+(c?1:0),p+1,g-1,new me((o?ne.empty:ne.from(r.copy(ne.empty))).append(c?ne.empty:ne.from(r.copy(ne.empty))),o?0:1,c?0:1),o?0:1)),e(i.scrollIntoView()),!0}function yZ(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let l=s.startIndex;if(l==0)return!1;let o=s.parent,c=o.child(l-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==o.type,d=ne.from(h?n.create():null),p=new me(ne.from(n.create(null,ne.from(o.type.create(null,d)))),h?3:1,0),g=s.start,O=s.end;t(e.tr.step(new ln(g-(h?3:1),O,g,O,p,1,!0)).scrollIntoView())}return!0}}const On=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},uc=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let p1=null;const Ss=function(n,e,t){let i=p1||(p1=document.createRange());return i.setEnd(n,t??n.nodeValue.length),i.setStart(n,e||0),i},bZ=function(){p1=null},Bo=function(n,e,t,i){return t&&(jA(n,e,t,i,-1)||jA(n,e,t,i,1))},SZ=/^(img|br|input|textarea|hr)$/i;function jA(n,e,t,i,r){for(var s;;){if(n==t&&e==i)return!0;if(e==(r<0?0:_i(n))){let l=n.parentNode;if(!l||l.nodeType!=1||hf(n)||SZ.test(n.nodeName)||n.contentEditable=="false")return!1;e=On(n)+(r<0?0:1),n=l}else if(n.nodeType==1){let l=n.childNodes[e+(r<0?-1:0)];if(l.nodeType==1&&l.contentEditable=="false")if(!((s=l.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=r;else return!1;else n=l,e=r<0?_i(n):0}else return!1}}function _i(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function vZ(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=_i(n)}else if(n.parentNode&&!hf(n))e=On(n),n=n.parentNode;else return null}}function xZ(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!hf(n))e=On(n)+1,n=n.parentNode;else return null}}function kZ(n,e,t){for(let i=e==0,r=e==_i(n);i||r;){if(n==t)return!0;let s=On(n);if(n=n.parentNode,!n)return!1;i=i&&s==0,r=r&&s==_i(n)}}function hf(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Eg=function(n){return n.focusNode&&Bo(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function bo(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function wZ(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function TZ(n,e,t){if(n.caretPositionFromPoint)try{let i=n.caretPositionFromPoint(e,t);if(i)return{node:i.offsetNode,offset:Math.min(_i(i.offsetNode),i.offset)}}catch{}if(n.caretRangeFromPoint){let i=n.caretRangeFromPoint(e,t);if(i)return{node:i.startContainer,offset:Math.min(_i(i.startContainer),i.startOffset)}}}const Zr=typeof navigator<"u"?navigator:null,ZA=typeof document<"u"?document:null,ql=Zr&&Zr.userAgent||"",m1=/Edge\/(\d+)/.exec(ql),d2=/MSIE \d/.exec(ql),g1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ql),ni=!!(d2||g1||m1),Rl=d2?document.documentMode:g1?+g1[1]:m1?+m1[1]:0,Vi=!ni&&/gecko\/(\d+)/i.test(ql);Vi&&+(/Firefox\/(\d+)/.exec(ql)||[0,0])[1];const O1=!ni&&/Chrome\/(\d+)/.exec(ql),Sn=!!O1,p2=O1?+O1[1]:0,Mn=!ni&&!!Zr&&/Apple Computer/.test(Zr.vendor),hc=Mn&&(/Mobile\/\w+/.test(ql)||!!Zr&&Zr.maxTouchPoints>2),Li=hc||(Zr?/Mac/.test(Zr.platform):!1),m2=Zr?/Win/.test(Zr.platform):!1,ks=/Android \d/.test(ql),ff=!!ZA&&"webkitFontSmoothing"in ZA.documentElement.style,CZ=ff?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function AZ(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function ps(n,e){return typeof n=="number"?n:n[e]}function MZ(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,i=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*i}}function XA(n,e,t){let i=n.someProp("scrollThreshold")||0,r=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let l=t||n.dom;l;){if(l.nodeType!=1){l=uc(l);continue}let o=l,c=o==s.body,h=c?AZ(s):MZ(o),d=0,p=0;if(e.top<h.top+ps(i,"top")?p=-(h.top-e.top+ps(r,"top")):e.bottom>h.bottom-ps(i,"bottom")&&(p=e.bottom-e.top>h.bottom-h.top?e.top+ps(r,"top")-h.top:e.bottom-h.bottom+ps(r,"bottom")),e.left<h.left+ps(i,"left")?d=-(h.left-e.left+ps(r,"left")):e.right>h.right-ps(i,"right")&&(d=e.right-h.right+ps(r,"right")),d||p)if(c)s.defaultView.scrollBy(d,p);else{let O=o.scrollLeft,b=o.scrollTop;p&&(o.scrollTop+=p),d&&(o.scrollLeft+=d);let v=o.scrollLeft-O,x=o.scrollTop-b;e={left:e.left-v,top:e.top-x,right:e.right-v,bottom:e.bottom-x}}let g=c?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(g))break;l=g=="absolute"?l.offsetParent:uc(l)}}function QZ(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),i,r;for(let s=(e.left+e.right)/2,l=t+1;l<Math.min(innerHeight,e.bottom);l+=5){let o=n.root.elementFromPoint(s,l);if(!o||o==n.dom||!n.dom.contains(o))continue;let c=o.getBoundingClientRect();if(c.top>=t-20){i=o,r=c.top;break}}return{refDOM:i,refTop:r,stack:g2(n.dom)}}function g2(n){let e=[],t=n.ownerDocument;for(let i=n;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),n!=t);i=uc(i));return e}function EZ({refDOM:n,refTop:e,stack:t}){let i=n?n.getBoundingClientRect().top:0;O2(t,i==0?0:i-e)}function O2(n,e){for(let t=0;t<n.length;t++){let{dom:i,top:r,left:s}=n[t];i.scrollTop!=r+e&&(i.scrollTop=r+e),i.scrollLeft!=s&&(i.scrollLeft=s)}}let ja=null;function $Z(n){if(n.setActive)return n.setActive();if(ja)return n.focus(ja);let e=g2(n);n.focus(ja==null?{get preventScroll(){return ja={preventScroll:!0},!0}}:void 0),ja||(ja=!1,O2(e,0))}function y2(n,e){let t,i=2e8,r,s=0,l=e.top,o=e.top,c,h;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let g;if(d.nodeType==1)g=d.getClientRects();else if(d.nodeType==3)g=Ss(d).getClientRects();else continue;for(let O=0;O<g.length;O++){let b=g[O];if(b.top<=l&&b.bottom>=o){l=Math.max(b.bottom,l),o=Math.min(b.top,o);let v=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(v<i){t=d,i=v,r=v&&t.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,d.nodeType==1&&v&&(s=p+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!c&&b.left<=e.left&&b.right>=e.left&&(c=d,h={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!t&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(s=p+1)}}return!t&&c&&(t=c,r=h,i=0),t&&t.nodeType==3?RZ(t,r):!t||i&&t.nodeType==1?{node:n,offset:s}:y2(t,r)}function RZ(n,e){let t=n.nodeValue.length,i=document.createRange(),r;for(let s=0;s<t;s++){i.setEnd(n,s+1),i.setStart(n,s);let l=gl(i,1);if(l.top!=l.bottom&&fv(e,l)){r={node:n,offset:s+(e.left>=(l.left+l.right)/2?1:0)};break}}return i.detach(),r||{node:n,offset:0}}function fv(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function PZ(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function DZ(n,e,t){let{node:i,offset:r}=y2(e,t),s=-1;if(i.nodeType==1&&!i.firstChild){let l=i.getBoundingClientRect();s=l.left!=l.right&&t.left>(l.left+l.right)/2?1:-1}return n.docView.posFromDOM(i,r,s)}function NZ(n,e,t,i){let r=-1;for(let s=e,l=!1;s!=n.dom;){let o=n.docView.nearestDesc(s,!0),c;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((c=o.dom.getBoundingClientRect()).width||c.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!l&&c.left>i.left||c.top>i.top?r=o.posBefore:(!l&&c.right<i.left||c.bottom<i.top)&&(r=o.posAfter),l=!0),!o.contentDOM&&r<0&&!o.node.isText))return(o.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return r>-1?r:n.docView.posFromDOM(e,t,-1)}function b2(n,e,t){let i=n.childNodes.length;if(i&&t.top<t.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(e.top-t.top)/(t.bottom-t.top))-2)),s=r;;){let l=n.childNodes[s];if(l.nodeType==1){let o=l.getClientRects();for(let c=0;c<o.length;c++){let h=o[c];if(fv(e,h))return b2(l,e,h)}}if((s=(s+1)%i)==r)break}return n}function zZ(n,e){let t=n.dom.ownerDocument,i,r=0,s=TZ(t,e.left,e.top);s&&({node:i,offset:r}=s);let l=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),o;if(!l||!n.dom.contains(l.nodeType!=1?l.parentNode:l)){let h=n.dom.getBoundingClientRect();if(!fv(e,h)||(l=b2(n.dom,e,h),!l))return null}if(Mn)for(let h=l;i&&h;h=uc(h))h.draggable&&(i=void 0);if(l=PZ(l,e),i){if(Vi&&i.nodeType==1&&(r=Math.min(r,i.childNodes.length),r<i.childNodes.length)){let d=i.childNodes[r],p;d.nodeName=="IMG"&&(p=d.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&r++}let h;ff&&r&&i.nodeType==1&&(h=i.childNodes[r-1]).nodeType==1&&h.contentEditable=="false"&&h.getBoundingClientRect().top>=e.top&&r--,i==n.dom&&r==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?o=n.state.doc.content.size:(r==0||i.nodeType!=1||i.childNodes[r-1].nodeName!="BR")&&(o=NZ(n,i,r,e))}o==null&&(o=DZ(n,l,e));let c=n.docView.nearestDesc(l,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function IA(n){return n.top<n.bottom||n.left<n.right}function gl(n,e){let t=n.getClientRects();if(t.length){let i=t[e<0?0:t.length-1];if(IA(i))return i}return Array.prototype.find.call(t,IA)||n.getBoundingClientRect()}const LZ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function S2(n,e,t){let{node:i,offset:r,atom:s}=n.docView.domFromPos(e,t<0?-1:1),l=ff||Vi;if(i.nodeType==3)if(l&&(LZ.test(i.nodeValue)||(t<0?!r:r==i.nodeValue.length))){let c=gl(Ss(i,r,r),t);if(Vi&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let h=gl(Ss(i,r-1,r-1),-1);if(h.top==c.top){let d=gl(Ss(i,r,r+1),-1);if(d.top!=c.top)return Ru(d,d.left<h.left)}}return c}else{let c=r,h=r,d=t<0?1:-1;return t<0&&!r?(h++,d=-1):t>=0&&r==i.nodeValue.length?(c--,d=1):t<0?c--:h++,Ru(gl(Ss(i,c,h),d),d<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&r&&(t<0||r==_i(i))){let c=i.childNodes[r-1];if(c.nodeType==1)return By(c.getBoundingClientRect(),!1)}if(s==null&&r<_i(i)){let c=i.childNodes[r];if(c.nodeType==1)return By(c.getBoundingClientRect(),!0)}return By(i.getBoundingClientRect(),t>=0)}if(s==null&&r&&(t<0||r==_i(i))){let c=i.childNodes[r-1],h=c.nodeType==3?Ss(c,_i(c)-(l?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(h)return Ru(gl(h,1),!1)}if(s==null&&r<_i(i)){let c=i.childNodes[r];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let h=c?c.nodeType==3?Ss(c,0,l?0:1):c.nodeType==1?c:null:null;if(h)return Ru(gl(h,-1),!0)}return Ru(gl(i.nodeType==3?Ss(i):i,-t),t>=0)}function Ru(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function By(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function v2(n,e,t){let i=n.state,r=n.root.activeElement;i!=e&&n.updateState(e),r!=n.dom&&n.focus();try{return t()}finally{i!=e&&n.updateState(i),r!=n.dom&&r&&r.focus()}}function _Z(n,e,t){let i=e.selection,r=t=="up"?i.$from:i.$to;return v2(n,e,()=>{let{node:s}=n.docView.domFromPos(r.pos,t=="up"?-1:1);for(;;){let o=n.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let l=S2(n,r.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let c;if(o.nodeType==1)c=o.getClientRects();else if(o.nodeType==3)c=Ss(o,0,o.nodeValue.length).getClientRects();else continue;for(let h=0;h<c.length;h++){let d=c[h];if(d.bottom>d.top+1&&(t=="up"?l.top-d.top>(d.bottom-l.top)*2:d.bottom-l.bottom>(l.bottom-d.top)*2))return!1}}return!0})}const BZ=/[\u0590-\u08ac]/;function jZ(n,e,t){let{$head:i}=e.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,s=!r,l=r==i.parent.content.size,o=n.domSelection();return o?!BZ.test(i.parent.textContent)||!o.modify?t=="left"||t=="backward"?s:l:v2(n,e,()=>{let{focusNode:c,focusOffset:h,anchorNode:d,anchorOffset:p}=n.domSelectionRange(),g=o.caretBidiLevel;o.modify("move",t,"character");let O=i.depth?n.docView.domAfterPos(i.before()):n.dom,{focusNode:b,focusOffset:v}=n.domSelectionRange(),x=b&&!O.contains(b.nodeType==1?b:b.parentNode)||c==b&&h==v;try{o.collapse(d,p),c&&(c!=d||h!=p)&&o.extend&&o.extend(c,h)}catch{}return g!=null&&(o.caretBidiLevel=g),x}):i.pos==i.start()||i.pos==i.end()}let VA=null,qA=null,HA=!1;function ZZ(n,e,t){return VA==e&&qA==t?HA:(VA=e,qA=t,HA=t=="up"||t=="down"?_Z(n,e,t):jZ(n,e,t))}const qi=0,YA=1,ko=2,Xr=3;class df{constructor(e,t,i,r){this.parent=e,this.children=t,this.dom=i,this.contentDOM=r,this.dirty=qi,i.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,i){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,i=this.posAtStart;;t++){let r=this.children[t];if(r==e)return i;i+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,i){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(i<0){let s,l;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((l=s.pmViewDesc)&&l.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(l)+l.size:this.posAtStart}else{let s,l;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((l=s.pmViewDesc)&&l.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(l):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>On(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){r=!1;break}if(s.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){r=!0;break}if(s.nextSibling)break}}return r??i>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let i=!0,r=e;r;r=r.parentNode){let s=this.getDesc(r),l;if(s&&(!t||s.node))if(i&&(l=s.nodeDOM)&&!(l.nodeType==1?l.contains(e.nodeType==1?e:e.parentNode):l==e))i=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let i=t;i;i=i.parent)if(i==this)return t}posFromDOM(e,t,i){for(let r=e;r;r=r.parentNode){let s=this.getDesc(r);if(s)return s.localPosFromDOM(e,t,i)}return-1}descAt(e){for(let t=0,i=0;t<this.children.length;t++){let r=this.children[t],s=i+r.size;if(i==e&&s!=i){for(;!r.border&&r.children.length;)for(let l=0;l<r.children.length;l++){let o=r.children[l];if(o.size){r=o;break}}return r}if(e<s)return r.descAt(e-i-r.border);i=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let i=0,r=0;for(let s=0;i<this.children.length;i++){let l=this.children[i],o=s+l.size;if(o>e||l instanceof k2){r=e-s;break}s=o}if(r)return this.children[i].domFromPos(r-this.children[i].border,t);for(let s;i&&!(s=this.children[i-1]).size&&s instanceof x2&&s.side>=0;i--);if(t<=0){let s,l=!0;for(;s=i?this.children[i-1]:null,!(!s||s.dom.parentNode==this.contentDOM);i--,l=!1);return s&&t&&l&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?On(s.dom)+1:0}}else{let s,l=!0;for(;s=i<this.children.length?this.children[i]:null,!(!s||s.dom.parentNode==this.contentDOM);i++,l=!1);return s&&l&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?On(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,i=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,s=-1;for(let l=i,o=0;;o++){let c=this.children[o],h=l+c.size;if(r==-1&&e<=h){let d=l+c.border;if(e>=d&&t<=h-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,d);e=l;for(let p=o;p>0;p--){let g=this.children[p-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){r=On(g.dom)+1;break}e-=g.size}r==-1&&(r=0)}if(r>-1&&(h>t||o==this.children.length-1)){t=h;for(let d=o+1;d<this.children.length;d++){let p=this.children[d];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=On(p.dom);break}t+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}l=h}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:i}=this.domFromPos(e,0);if(t.nodeType!=1||i==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[i]}setSelection(e,t,i,r=!1){let s=Math.min(e,t),l=Math.max(e,t);for(let O=0,b=0;O<this.children.length;O++){let v=this.children[O],x=b+v.size;if(s>b&&l<x)return v.setSelection(e-b-v.border,t-b-v.border,i,r);b=x}let o=this.domFromPos(e,e?-1:1),c=t==e?o:this.domFromPos(t,t?-1:1),h=i.root.getSelection(),d=i.domSelectionRange(),p=!1;if((Vi||Mn)&&e==t){let{node:O,offset:b}=o;if(O.nodeType==3){if(p=!!(b&&O.nodeValue[b-1]==`
`),p&&b==O.nodeValue.length)for(let v=O,x;v;v=v.parentNode){if(x=v.nextSibling){x.nodeName=="BR"&&(o=c={node:x.parentNode,offset:On(x)+1});break}let k=v.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let v=O.childNodes[b-1];p=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Vi&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let O=d.focusNode.childNodes[d.focusOffset];O&&O.contentEditable=="false"&&(r=!0)}if(!(r||p&&Mn)&&Bo(o.node,o.offset,d.anchorNode,d.anchorOffset)&&Bo(c.node,c.offset,d.focusNode,d.focusOffset))return;let g=!1;if((h.extend||e==t)&&!(p&&Vi)){h.collapse(o.node,o.offset);try{e!=t&&h.extend(c.node,c.offset),g=!0}catch{}}if(!g){if(e>t){let b=o;o=c,c=b}let O=document.createRange();O.setEnd(c.node,c.offset),O.setStart(o.node,o.offset),h.removeAllRanges(),h.addRange(O)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let i=0,r=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(i==l?e<=l&&t>=i:e<l&&t>i){let o=i+s.border,c=l-s.border;if(e>=o&&t<=c){this.dirty=e==i||t==l?ko:YA,e==o&&t==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Xr:s.markDirty(e-o,t-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?ko:Xr}i=l}this.dirty=ko}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let i=e==1?ko:YA;t.dirty<i&&(t.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class x2 extends df{constructor(e,t,i,r){let s,l=t.type.toDOM;if(typeof l=="function"&&(l=l(i,()=>{if(!s)return r;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(l.nodeType!=1){let o=document.createElement("span");o.appendChild(l),l=o}l.contentEditable="false",l.classList.add("ProseMirror-widget")}super(e,[],l,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==qi&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class XZ extends df{constructor(e,t,i,r){super(e,[],t,null),this.textDOM=i,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class jo extends df{constructor(e,t,i,r,s){super(e,[],i,r),this.mark=t,this.spec=s}static create(e,t,i,r){let s=r.nodeViews[t.type.name],l=s&&s(t,r,i);return(!l||!l.dom)&&(l=Wo.renderSpec(document,t.type.spec.toDOM(t,i),null,t.attrs)),new jo(e,t,l.dom,l.contentDOM||l.dom,l)}parseRule(){return this.dirty&Xr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xr&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=qi){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=qi}}slice(e,t,i){let r=jo.create(this.parent,this.mark,!0,i),s=this.children,l=this.size;t<l&&(s=b1(s,t,l,i)),e>0&&(s=b1(s,0,e,i));for(let o=0;o<s.length;o++)s[o].parent=r;return r.children=s,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Pl extends df{constructor(e,t,i,r,s,l,o,c,h){super(e,[],s,l),this.node=t,this.outerDeco=i,this.innerDeco=r,this.nodeDOM=o}static create(e,t,i,r,s,l){let o=s.nodeViews[t.type.name],c,h=o&&o(t,s,()=>{if(!c)return l;if(c.parent)return c.parent.posBeforeChild(c)},i,r),d=h&&h.dom,p=h&&h.contentDOM;if(t.isText){if(!d)d=document.createTextNode(t.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:p}=Wo.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let g=d;return d=C2(d,i,t),h?c=new IZ(e,t,i,r,d,p||null,g,h,s,l+1):t.isText?new $g(e,t,i,r,d,g,s):new Pl(e,t,i,r,d,p||null,g,s,l+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let i=this.children[t];if(this.dom.contains(i.dom.parentNode)){e.contentElement=i.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ne.empty)}return e}matchesNode(e,t,i){return this.dirty==qi&&e.eq(this.node)&&nm(t,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let i=this.node.inlineContent,r=t,s=e.composing?this.localCompositionInfo(e,t):null,l=s&&s.pos>-1?s:null,o=s&&s.pos<0,c=new qZ(this,l&&l.node,e);UZ(this.node,this.innerDeco,(h,d,p)=>{h.spec.marks?c.syncToMarks(h.spec.marks,i,e,d):h.type.side>=0&&!p&&c.syncToMarks(d==this.node.childCount?pt.none:this.node.child(d).marks,i,e,d),c.placeWidget(h,e,r)},(h,d,p,g)=>{c.syncToMarks(h.marks,i,e,g);let O;c.findNodeMatch(h,d,p,g)||o&&e.state.selection.from>r&&e.state.selection.to<r+h.nodeSize&&(O=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(h,d,p,O,e)||c.updateNextNode(h,d,p,e,g,r)||c.addNode(h,d,p,e,r),r+=h.nodeSize}),c.syncToMarks([],i,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==ko)&&(l&&this.protectLocalComposition(e,l),w2(this.contentDOM,this.children,e),hc&&WZ(this.dom))}localCompositionInfo(e,t){let{from:i,to:r}=e.state.selection;if(!(e.state.selection instanceof Ce)||i<t||r>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,o=GZ(this.node.content,l,i-t,r-t);return o<0?null:{node:s,pos:o,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:i,text:r}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let l=new XZ(this,s,t,r);e.input.compositionNodes.push(l),this.children=b1(this.children,i,i+r.length,e,l)}update(e,t,i,r){return this.dirty==Xr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,i,r),!0)}updateInner(e,t,i,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=qi}updateOuterDeco(e){if(nm(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,i=this.dom;this.dom=T2(this.dom,this.nodeDOM,y1(this.outerDeco,this.node,t),y1(e,this.node,t)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function UA(n,e,t,i,r){C2(i,e,n);let s=new Pl(void 0,n,e,t,i,i,i,r,0);return s.contentDOM&&s.updateChildren(r,0),s}class $g extends Pl{constructor(e,t,i,r,s,l,o){super(e,t,i,r,s,null,l,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,i,r){return this.dirty==Xr||this.dirty!=qi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=qi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=qi,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,i){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,i)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,i){let r=this.node.cut(e,t),s=document.createTextNode(r.text);return new $g(this.parent,r,this.outerDeco,this.innerDeco,s,s,i)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Xr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class k2 extends df{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==qi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class IZ extends Pl{constructor(e,t,i,r,s,l,o,c,h,d){super(e,t,i,r,s,l,o,h,d),this.spec=c}update(e,t,i,r){if(this.dirty==Xr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,i);return s&&this.updateInner(e,t,i,r),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,i,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,i,r){this.spec.setSelection?this.spec.setSelection(e,t,i.root):super.setSelection(e,t,i,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function w2(n,e,t){let i=n.firstChild,r=!1;for(let s=0;s<e.length;s++){let l=e[s],o=l.dom;if(o.parentNode==n){for(;o!=i;)i=WA(i),r=!0;i=i.nextSibling}else r=!0,n.insertBefore(o,i);if(l instanceof jo){let c=i?i.previousSibling:n.lastChild;w2(l.contentDOM,l.children,t),i=c?c.nextSibling:n.firstChild}}for(;i;)i=WA(i),r=!0;r&&t.trackWrites==n&&(t.trackWrites=null)}const oh=function(n){n&&(this.nodeName=n)};oh.prototype=Object.create(null);const wo=[new oh];function y1(n,e,t){if(n.length==0)return wo;let i=t?wo[0]:new oh,r=[i];for(let s=0;s<n.length;s++){let l=n[s].type.attrs;if(l){l.nodeName&&r.push(i=new oh(l.nodeName));for(let o in l){let c=l[o];c!=null&&(t&&r.length==1&&r.push(i=new oh(e.isInline?"span":"div")),o=="class"?i.class=(i.class?i.class+" ":"")+c:o=="style"?i.style=(i.style?i.style+";":"")+c:o!="nodeName"&&(i[o]=c))}}}return r}function T2(n,e,t,i){if(t==wo&&i==wo)return e;let r=e;for(let s=0;s<i.length;s++){let l=i[s],o=t[s];if(s){let c;o&&o.nodeName==l.nodeName&&r!=n&&(c=r.parentNode)&&c.nodeName.toLowerCase()==l.nodeName||(c=document.createElement(l.nodeName),c.pmIsDeco=!0,c.appendChild(r),o=wo[0]),r=c}VZ(r,o||wo[0],l)}return r}function VZ(n,e,t){for(let i in e)i!="class"&&i!="style"&&i!="nodeName"&&!(i in t)&&n.removeAttribute(i);for(let i in t)i!="class"&&i!="style"&&i!="nodeName"&&t[i]!=e[i]&&n.setAttribute(i,t[i]);if(e.class!=t.class){let i=e.class?e.class.split(" ").filter(Boolean):[],r=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&n.classList.remove(i[s]);for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&n.classList.add(r[s]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function C2(n,e,t){return T2(n,n,wo,y1(e,t,n.nodeType!=1))}function nm(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function WA(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class qZ{constructor(e,t,i){this.lock=t,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=HZ(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let i=e;i<t;i++)this.top.children[i].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,i,r){let s=0,l=this.stack.length>>1,o=Math.min(l,e.length);for(;s<o&&(s==l-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<l;)this.destroyRest(),this.top.dirty=qi,this.index=this.stack.pop(),this.top=this.stack.pop(),l--;for(;l<e.length;){this.stack.push(this.top,this.index+1);let c=-1,h=this.top.children.length;r<this.preMatch.index&&(h=Math.min(this.index+3,h));for(let d=this.index;d<h;d++){let p=this.top.children[d];if(p.matchesMark(e[l])&&!this.isLocked(p.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=jo.create(this.top,e[l],t,i);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,l++}}findNodeMatch(e,t,i,r){let s=-1,l;if(r>=this.preMatch.index&&(l=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&l.matchesNode(e,t,i))s=this.top.children.indexOf(l,this.index);else for(let o=this.index,c=Math.min(this.top.children.length,o+5);o<c;o++){let h=this.top.children[o];if(h.matchesNode(e,t,i)&&!this.preMatch.matched.has(h)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,i,r,s){let l=this.top.children[r];return l.dirty==Xr&&l.dom==l.contentDOM&&(l.dirty=ko),l.update(e,t,i,s)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let i=e.pmViewDesc;if(i){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==i)return r}return-1}e=t}}updateNextNode(e,t,i,r,s,l){for(let o=this.index;o<this.top.children.length;o++){let c=this.top.children[o];if(c instanceof Pl){let h=this.preMatch.matched.get(c);if(h!=null&&h!=s)return!1;let d=c.dom,p,g=this.isLocked(d)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Xr&&nm(t,c.outerDeco));if(!g&&c.update(e,t,i,r))return this.destroyBetween(this.index,o),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!g&&(p=this.recreateWrapper(c,e,t,i,r,l)))return this.destroyBetween(this.index,o),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=ko,p.updateChildren(r,l+1),p.dirty=qi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,i,r,s,l){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!nm(i,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Pl.create(this.top,t,i,r,s,l);if(o.contentDOM){o.children=e.children,e.children=[];for(let c of o.children)c.parent=o}return e.destroy(),o}addNode(e,t,i,r,s){let l=Pl.create(this.top,e,t,i,r,s);l.contentDOM&&l.updateChildren(r,s+1),this.top.children.splice(this.index++,0,l),this.changed=!0}placeWidget(e,t,i){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let s=new x2(this.top,e,t,i);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof jo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof $g)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Mn||Sn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let i=document.createElement(e);e=="IMG"&&(i.className="ProseMirror-separator",i.alt=""),e=="BR"&&(i.className="ProseMirror-trailingBreak");let r=new k2(this.top,[],i,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function HZ(n,e){let t=e,i=t.children.length,r=n.childCount,s=new Map,l=[];e:for(;r>0;){let o;for(;;)if(i){let h=t.children[i-1];if(h instanceof jo)t=h,i=h.children.length;else{o=h,i--;break}}else{if(t==e)break e;i=t.parent.children.indexOf(t),t=t.parent}let c=o.node;if(c){if(c!=n.child(r-1))break;--r,s.set(o,r),l.push(o)}}return{index:r,matched:s,matches:l.reverse()}}function YZ(n,e){return n.type.side-e.type.side}function UZ(n,e,t,i){let r=e.locals(n),s=0;if(r.length==0){for(let h=0;h<n.childCount;h++){let d=n.child(h);i(d,r,e.forChild(s,d),h),s+=d.nodeSize}return}let l=0,o=[],c=null;for(let h=0;;){let d,p;for(;l<r.length&&r[l].to==s;){let x=r[l++];x.widget&&(d?(p||(p=[d])).push(x):d=x)}if(d)if(p){p.sort(YZ);for(let x=0;x<p.length;x++)t(p[x],h,!!c)}else t(d,h,!!c);let g,O;if(c)O=-1,g=c,c=null;else if(h<n.childCount)O=h,g=n.child(h++);else break;for(let x=0;x<o.length;x++)o[x].to<=s&&o.splice(x--,1);for(;l<r.length&&r[l].from<=s&&r[l].to>s;)o.push(r[l++]);let b=s+g.nodeSize;if(g.isText){let x=b;l<r.length&&r[l].from<x&&(x=r[l].from);for(let k=0;k<o.length;k++)o[k].to<x&&(x=o[k].to);x<b&&(c=g.cut(x-s),g=g.cut(0,x-s),b=x,O=-1)}else for(;l<r.length&&r[l].to<b;)l++;let v=g.isInline&&!g.isLeaf?o.filter(x=>!x.inline):o.slice();i(g,v,e.forChild(s,g),O),s=b}}function WZ(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function GZ(n,e,t,i){for(let r=0,s=0;r<n.childCount&&s<=i;){let l=n.child(r++),o=s;if(s+=l.nodeSize,!l.isText)continue;let c=l.text;for(;r<n.childCount;){let h=n.child(r++);if(s+=h.nodeSize,!h.isText)break;c+=h.text}if(s>=t){if(s>=i&&c.slice(i-e.length-o,i-o)==e)return i-e.length;let h=o<i?c.lastIndexOf(e,i-o-1):-1;if(h>=0&&h+e.length+o>=t)return o+h;if(t==i&&c.length>=i+e.length-o&&c.slice(i-o,i-o+e.length)==e)return i}}return-1}function b1(n,e,t,i,r){let s=[];for(let l=0,o=0;l<n.length;l++){let c=n[l],h=o,d=o+=c.size;h>=t||d<=e?s.push(c):(h<e&&s.push(c.slice(0,e-h,i)),r&&(s.push(r),r=void 0),d>t&&s.push(c.slice(t-h,c.size,i)))}return s}function dv(n,e=null){let t=n.domSelectionRange(),i=n.state.doc;if(!t.focusNode)return null;let r=n.docView.nearestDesc(t.focusNode),s=r&&r.size==0,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let o=i.resolve(l),c,h;if(Eg(t)){for(c=l;r&&!r.node;)r=r.parent;let p=r.node;if(r&&p.isAtom&&we.isSelectable(p)&&r.parent&&!(p.isInline&&kZ(t.focusNode,t.focusOffset,r.dom))){let g=r.posBefore;h=new we(l==g?o:i.resolve(g))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=l,g=l;for(let O=0;O<t.rangeCount;O++){let b=t.getRangeAt(O);p=Math.min(p,n.docView.posFromDOM(b.startContainer,b.startOffset,1)),g=Math.max(g,n.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(p<0)return null;[c,l]=g==n.state.selection.anchor?[g,p]:[p,g],o=i.resolve(l)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let d=i.resolve(c);if(!h){let p=e=="pointer"||n.state.selection.head<o.pos&&!s?1:-1;h=pv(n,d,o,p)}return h}function A2(n){return n.editable?n.hasFocus():Q2(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Ms(n,e=!1){let t=n.state.selection;if(M2(n,t),!!A2(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&Sn){let i=n.domSelectionRange(),r=n.domObserver.currentSelection;if(i.anchorNode&&r.anchorNode&&Bo(i.anchorNode,i.anchorOffset,r.anchorNode,r.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)KZ(n);else{let{anchor:i,head:r}=t,s,l;GA&&!(t instanceof Ce)&&(t.$from.parent.inlineContent||(s=FA(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=FA(n,t.to))),n.docView.setSelection(i,r,n,e),GA&&(s&&KA(s),l&&KA(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&FZ(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const GA=Mn||Sn&&p2<63;function FA(n,e){let{node:t,offset:i}=n.docView.domFromPos(e,0),r=i<t.childNodes.length?t.childNodes[i]:null,s=i?t.childNodes[i-1]:null;if(Mn&&r&&r.contentEditable=="false")return jy(r);if((!r||r.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(r)return jy(r);if(s)return jy(s)}}function jy(n){return n.contentEditable="true",Mn&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function KA(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function FZ(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),i=t.anchorNode,r=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=i||t.anchorOffset!=r)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!A2(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function KZ(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,i=t.nodeName=="IMG";i?e.collapse(t.parentNode,On(t)+1):e.collapse(t,0),!i&&!n.state.selection.visible&&ni&&Rl<=11&&(t.disabled=!0,t.disabled=!1)}function M2(n,e){if(e instanceof we){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(JA(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else JA(n)}function JA(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function pv(n,e,t,i){return n.someProp("createSelectionBetween",r=>r(n,e,t))||Ce.between(e,t,i)}function eM(n){return n.editable&&!n.hasFocus()?!1:Q2(n)}function Q2(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function JZ(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Bo(e.node,e.offset,t.anchorNode,t.anchorOffset)}function S1(n,e){let{$anchor:t,$head:i}=n.selection,r=e>0?t.max(i):t.min(i),s=r.parent.inlineContent?r.depth?n.doc.resolve(e>0?r.after():r.before()):null:r;return s&&$e.findFrom(s,e)}function Ol(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function tM(n,e,t){let i=n.state.selection;if(i instanceof Ce)if(t.indexOf("s")>-1){let{$head:r}=i,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let l=n.state.doc.resolve(r.pos+s.nodeSize*(e<0?-1:1));return Ol(n,new Ce(i.$anchor,l))}else if(i.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let r=S1(n.state,e);return r&&r instanceof we?Ol(n,r):!1}else if(!(Li&&t.indexOf("m")>-1)){let r=i.$head,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter,l;if(!s||s.isText)return!1;let o=e<0?r.pos-s.nodeSize:r.pos;return s.isAtom||(l=n.docView.descAt(o))&&!l.contentDOM?we.isSelectable(s)?Ol(n,new we(e<0?n.state.doc.resolve(r.pos-s.nodeSize):r)):ff?Ol(n,new Ce(n.state.doc.resolve(e<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(i instanceof we&&i.node.isInline)return Ol(n,new Ce(e>0?i.$to:i.$from));{let r=S1(n.state,e);return r?Ol(n,r):!1}}}function im(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ah(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Za(n,e){return e<0?eX(n):tX(n)}function eX(n){let e=n.domSelectionRange(),t=e.focusNode,i=e.focusOffset;if(!t)return;let r,s,l=!1;for(Vi&&t.nodeType==1&&i<im(t)&&ah(t.childNodes[i],-1)&&(l=!0);;)if(i>0){if(t.nodeType!=1)break;{let o=t.childNodes[i-1];if(ah(o,-1))r=t,s=--i;else if(o.nodeType==3)t=o,i=t.nodeValue.length;else break}}else{if(E2(t))break;{let o=t.previousSibling;for(;o&&ah(o,-1);)r=t.parentNode,s=On(o),o=o.previousSibling;if(o)t=o,i=im(t);else{if(t=t.parentNode,t==n.dom)break;i=0}}}l?v1(n,t,i):r&&v1(n,r,s)}function tX(n){let e=n.domSelectionRange(),t=e.focusNode,i=e.focusOffset;if(!t)return;let r=im(t),s,l;for(;;)if(i<r){if(t.nodeType!=1)break;let o=t.childNodes[i];if(ah(o,1))s=t,l=++i;else break}else{if(E2(t))break;{let o=t.nextSibling;for(;o&&ah(o,1);)s=o.parentNode,l=On(o)+1,o=o.nextSibling;if(o)t=o,i=0,r=im(t);else{if(t=t.parentNode,t==n.dom)break;i=r=0}}}s&&v1(n,s,l)}function E2(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function nX(n,e){for(;n&&e==n.childNodes.length&&!hf(n);)e=On(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function iX(n,e){for(;n&&!e&&!hf(n);)e=On(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function v1(n,e,t){if(e.nodeType!=3){let s,l;(l=nX(e,t))?(e=l,t=0):(s=iX(e,t))&&(e=s,t=s.nodeValue.length)}let i=n.domSelection();if(!i)return;if(Eg(i)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),i.removeAllRanges(),i.addRange(s)}else i.extend&&i.extend(e,t);n.domObserver.setCurSelection();let{state:r}=n;setTimeout(()=>{n.state==r&&Ms(n)},50)}function nM(n,e){let t=n.state.doc.resolve(e);if(!(Sn||m2)&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),l=(s.top+s.bottom)/2;if(l>r.top&&l<r.bottom&&Math.abs(s.left-r.left)>1)return s.left<r.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),l=(s.top+s.bottom)/2;if(l>r.top&&l<r.bottom&&Math.abs(s.left-r.left)>1)return s.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function iM(n,e,t){let i=n.state.selection;if(i instanceof Ce&&!i.empty||t.indexOf("s")>-1||Li&&t.indexOf("m")>-1)return!1;let{$from:r,$to:s}=i;if(!r.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=S1(n.state,e);if(l&&l instanceof we)return Ol(n,l)}if(!r.parent.inlineContent){let l=e<0?r:s,o=i instanceof Si?$e.near(l,e):$e.findFrom(l,e);return o?Ol(n,o):!1}return!1}function rM(n,e){if(!(n.state.selection instanceof Ce))return!0;let{$head:t,$anchor:i,empty:r}=n.state.selection;if(!t.sameParent(i))return!0;if(!r)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let l=n.state.tr;return e<0?l.delete(t.pos-s.nodeSize,t.pos):l.delete(t.pos,t.pos+s.nodeSize),n.dispatch(l),!0}return!1}function sM(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function rX(n){if(!Mn||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let i=e.firstChild;sM(n,i,"true"),setTimeout(()=>sM(n,i,"false"),20)}return!1}function sX(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function lX(n,e){let t=e.keyCode,i=sX(e);if(t==8||Li&&t==72&&i=="c")return rM(n,-1)||Za(n,-1);if(t==46&&!e.shiftKey||Li&&t==68&&i=="c")return rM(n,1)||Za(n,1);if(t==13||t==27)return!0;if(t==37||Li&&t==66&&i=="c"){let r=t==37?nM(n,n.state.selection.from)=="ltr"?-1:1:-1;return tM(n,r,i)||Za(n,r)}else if(t==39||Li&&t==70&&i=="c"){let r=t==39?nM(n,n.state.selection.from)=="ltr"?1:-1:1;return tM(n,r,i)||Za(n,r)}else{if(t==38||Li&&t==80&&i=="c")return iM(n,-1,i)||Za(n,-1);if(t==40||Li&&t==78&&i=="c")return rX(n)||iM(n,1,i)||Za(n,1);if(i==(Li?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function mv(n,e){n.someProp("transformCopied",O=>{e=O(e,n)});let t=[],{content:i,openStart:r,openEnd:s}=e;for(;r>1&&s>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,s--;let O=i.firstChild;t.push(O.type.name,O.attrs!=O.type.defaultAttrs?O.attrs:null),i=O.content}let l=n.someProp("clipboardSerializer")||Wo.fromSchema(n.state.schema),o=z2(),c=o.createElement("div");c.appendChild(l.serializeFragment(i,{document:o}));let h=c.firstChild,d,p=0;for(;h&&h.nodeType==1&&(d=N2[h.nodeName.toLowerCase()]);){for(let O=d.length-1;O>=0;O--){let b=o.createElement(d[O]);for(;c.firstChild;)b.appendChild(c.firstChild);c.appendChild(b),p++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${r} ${s}${p?` -${p}`:""} ${JSON.stringify(t)}`);let g=n.someProp("clipboardTextSerializer",O=>O(e,n))||e.content.textBetween(0,e.content.size,`

`);return{dom:c,text:g,slice:e}}function $2(n,e,t,i,r){let s=r.parent.type.spec.code,l,o;if(!t&&!e)return null;let c=!!e&&(i||s||!t);if(c){if(n.someProp("transformPastedText",g=>{e=g(e,s||i,n)}),s)return o=new me(ne.from(n.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),n.someProp("transformPasted",g=>{o=g(o,n,!0)}),o;let p=n.someProp("clipboardTextParser",g=>g(e,r,i,n));if(p)o=p;else{let g=r.marks(),{schema:O}=n.state,b=Wo.fromSchema(O);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let x=l.appendChild(document.createElement("p"));v&&x.appendChild(b.serializeNode(O.text(v,g)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=uX(t),ff&&hX(l);let h=l&&l.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let p=+d[3];p>0;p--){let g=l.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;l=g}if(o||(o=(n.someProp("clipboardParser")||n.someProp("domParser")||$l.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(c||d),context:r,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!oX.test(g.parentNode.nodeName)?{ignore:!0}:null}})),d)o=fX(lM(o,+d[1],+d[2]),d[4]);else if(o=me.maxOpen(aX(o.content,r),!0),o.openStart||o.openEnd){let p=0,g=0;for(let O=o.content.firstChild;p<o.openStart&&!O.type.spec.isolating;p++,O=O.firstChild);for(let O=o.content.lastChild;g<o.openEnd&&!O.type.spec.isolating;g++,O=O.lastChild);o=lM(o,p,g)}return n.someProp("transformPasted",p=>{o=p(o,n,c)}),o}const oX=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function aX(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.index(t)),s,l=[];if(n.forEach(o=>{if(!l)return;let c=r.findWrapping(o.type),h;if(!c)return l=null;if(h=l.length&&s.length&&P2(c,s,o,l[l.length-1],0))l[l.length-1]=h;else{l.length&&(l[l.length-1]=D2(l[l.length-1],s.length));let d=R2(o,c);l.push(d),r=r.matchType(d.type),s=c}}),l)return ne.from(l)}return n}function R2(n,e,t=0){for(let i=e.length-1;i>=t;i--)n=e[i].create(null,ne.from(n));return n}function P2(n,e,t,i,r){if(r<n.length&&r<e.length&&n[r]==e[r]){let s=P2(n,e,t,i.lastChild,r+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(r==n.length-1?t.type:n[r+1]))return i.copy(i.content.append(ne.from(R2(t,n,r+1))))}}function D2(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,D2(n.lastChild,e-1)),i=n.contentMatchAt(n.childCount).fillBefore(ne.empty,!0);return n.copy(t.append(i))}function x1(n,e,t,i,r,s){let l=e<0?n.firstChild:n.lastChild,o=l.content;return n.childCount>1&&(s=0),r<i-1&&(o=x1(o,e,t,i,r+1,s)),r>=t&&(o=e<0?l.contentMatchAt(0).fillBefore(o,s<=r).append(o):o.append(l.contentMatchAt(l.childCount).fillBefore(ne.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(o))}function lM(n,e,t){return e<n.openStart&&(n=new me(x1(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new me(x1(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const N2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let oM=null;function z2(){return oM||(oM=document.implementation.createHTMLDocument("title"))}let Zy=null;function cX(n){let e=window.trustedTypes;return e?(Zy||(Zy=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Zy.createHTML(n)):n}function uX(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=z2().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(n),r;if((r=i&&N2[i[1].toLowerCase()])&&(n=r.map(s=>"<"+s+">").join("")+n+r.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=cX(n),r)for(let s=0;s<r.length;s++)t=t.querySelector(r[s])||t;return t}function hX(n){let e=n.querySelectorAll(Sn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let i=e[t];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),i)}}function fX(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch{return n}let{content:r,openStart:s,openEnd:l}=n;for(let o=i.length-2;o>=0;o-=2){let c=t.nodes[i[o]];if(!c||c.hasRequiredAttrs())break;r=ne.from(c.create(i[o+1],r)),s++,l++}return new me(r,s,l)}const _n={},Bn={},dX={touchstart:!0,touchmove:!0};let pX=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function mX(n){for(let e in _n){let t=_n[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=i=>{OX(n,i)&&!gv(n,i)&&(n.editable||!(i.type in Bn))&&t(n,i)},dX[e]?{passive:!0}:void 0)}Mn&&n.dom.addEventListener("input",()=>null),k1(n)}function Ml(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function gX(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function k1(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=i=>gv(n,i))})}function gv(n,e){return n.someProp("handleDOMEvents",t=>{let i=t[e.type];return i?i(n,e)||e.defaultPrevented:!1})}function OX(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function yX(n,e){!gv(n,e)&&_n[e.type]&&(n.editable||!(e.type in Bn))&&_n[e.type](n,e)}Bn.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!_2(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ks&&Sn&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),hc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let i=Date.now();n.input.lastIOSEnter=i,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==i&&(n.someProp("handleKeyDown",r=>r(n,bo(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",i=>i(n,t))||lX(n,t)?t.preventDefault():Ml(n,"key")};Bn.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Bn.keypress=(n,e)=>{let t=e;if(_2(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Li&&t.metaKey)return;if(n.someProp("handleKeyPress",r=>r(n,t))){t.preventDefault();return}let i=n.state.selection;if(!(i instanceof Ce)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(t.charCode),s=()=>n.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!n.someProp("handleTextInput",l=>l(n,i.$from.pos,i.$to.pos,r,s))&&n.dispatch(s()),t.preventDefault()}};function Rg(n){return{left:n.clientX,top:n.clientY}}function bX(n,e){let t=e.x-n.clientX,i=e.y-n.clientY;return t*t+i*i<100}function Ov(n,e,t,i,r){if(i==-1)return!1;let s=n.state.doc.resolve(i);for(let l=s.depth+1;l>0;l--)if(n.someProp(e,o=>l>s.depth?o(n,t,s.nodeAfter,s.before(l),r,!0):o(n,t,s.node(l),s.before(l),r,!1)))return!0;return!1}function Ka(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let i=n.state.tr.setSelection(e);i.setMeta("pointer",!0),n.dispatch(i)}function SX(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),i=t.nodeAfter;return i&&i.isAtom&&we.isSelectable(i)?(Ka(n,new we(t)),!0):!1}function vX(n,e){if(e==-1)return!1;let t=n.state.selection,i,r;t instanceof we&&(i=t.node);let s=n.state.doc.resolve(e);for(let l=s.depth+1;l>0;l--){let o=l>s.depth?s.nodeAfter:s.node(l);if(we.isSelectable(o)){i&&t.$from.depth>0&&l>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?r=s.before(t.$from.depth):r=s.before(l);break}}return r!=null?(Ka(n,we.create(n.state.doc,r)),!0):!1}function xX(n,e,t,i,r){return Ov(n,"handleClickOn",e,t,i)||n.someProp("handleClick",s=>s(n,e,i))||(r?vX(n,t):SX(n,t))}function kX(n,e,t,i){return Ov(n,"handleDoubleClickOn",e,t,i)||n.someProp("handleDoubleClick",r=>r(n,e,i))}function wX(n,e,t,i){return Ov(n,"handleTripleClickOn",e,t,i)||n.someProp("handleTripleClick",r=>r(n,e,i))||TX(n,t,i)}function TX(n,e,t){if(t.button!=0)return!1;let i=n.state.doc;if(e==-1)return i.inlineContent?(Ka(n,Ce.create(i,0,i.content.size)),!0):!1;let r=i.resolve(e);for(let s=r.depth+1;s>0;s--){let l=s>r.depth?r.nodeAfter:r.node(s),o=r.before(s);if(l.inlineContent)Ka(n,Ce.create(i,o+1,o+1+l.content.size));else if(we.isSelectable(l))Ka(n,we.create(i,o));else continue;return!0}}function yv(n){return rm(n)}const L2=Li?"metaKey":"ctrlKey";_n.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let i=yv(n),r=Date.now(),s="singleClick";r-n.input.lastClick.time<500&&bX(t,n.input.lastClick)&&!t[L2]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:r,x:t.clientX,y:t.clientY,type:s,button:t.button};let l=n.posAtCoords(Rg(t));l&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new CX(n,l,t,!!i)):(s=="doubleClick"?kX:wX)(n,l.pos,l.inside,t)?t.preventDefault():Ml(n,"pointer"))};class CX{constructor(e,t,i,r){this.view=e,this.pos=t,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[L2],this.allowDefault=i.shiftKey;let s,l;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),l=t.inside;else{let d=e.state.doc.resolve(t.pos);s=d.parent,l=d.depth?d.before():0}const o=r?null:i.target,c=o?e.docView.nearestDesc(o,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:h}=e.state;i.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof we&&h.from<=l&&h.to>l)&&(this.mightDrag={node:s,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Vi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ml(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ms(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Rg(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ml(this.view,"pointer"):xX(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mn&&this.mightDrag&&!this.mightDrag.node.isAtom||Sn&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ka(this.view,$e.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Ml(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ml(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}_n.touchstart=n=>{n.input.lastTouch=Date.now(),yv(n),Ml(n,"pointer")};_n.touchmove=n=>{n.input.lastTouch=Date.now(),Ml(n,"pointer")};_n.contextmenu=n=>yv(n);function _2(n,e){return n.composing?!0:Mn&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const AX=ks?5e3:-1;Bn.compositionstart=Bn.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof Ce&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||Sn&&m2&&MX(n)))n.markCursor=n.state.storedMarks||t.marks(),rm(n,!0),n.markCursor=null;else if(rm(n,!e.selection.empty),Vi&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let i=n.domSelectionRange();for(let r=i.focusNode,s=i.focusOffset;r&&r.nodeType==1&&s!=0;){let l=s<0?r.lastChild:r.childNodes[s-1];if(!l)break;if(l.nodeType==3){let o=n.domSelection();o&&o.collapse(l,l.nodeValue.length);break}else r=l,s=-1}}n.input.composing=!0}B2(n,AX)};function MX(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let i=e.childNodes[t];return i.nodeType==1&&i.contentEditable=="false"}Bn.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,B2(n,20))};function B2(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>rm(n),e))}function j2(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=EX());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function QX(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=vZ(e.focusNode,e.focusOffset),i=xZ(e.focusNode,e.focusOffset);if(t&&i&&t!=i){let r=i.pmViewDesc,s=n.domObserver.lastChangedTextNode;if(t==s||i==s)return s;if(!r||!r.isText(i.nodeValue))return i;if(n.input.compositionNode==i){let l=t.pmViewDesc;if(!(!l||!l.isText(t.nodeValue)))return i}}return t||i}function EX(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function rm(n,e=!1){if(!(ks&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),j2(n),e||n.docView&&n.docView.dirty){let t=dv(n),i=n.state.selection;return t&&!t.eq(i)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function $X(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(e),n.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Eh=ni&&Rl<15||hc&&CZ<604;_n.copy=Bn.cut=(n,e)=>{let t=e,i=n.state.selection,r=t.type=="cut";if(i.empty)return;let s=Eh?null:t.clipboardData,l=i.content(),{dom:o,text:c}=mv(n,l);s?(t.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",c)):$X(n,o),r&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function RX(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function PX(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,i=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),i.parentNode&&i.parentNode.removeChild(i),t?$h(n,i.value,null,r,e):$h(n,i.textContent,i.innerHTML,r,e)},50)}function $h(n,e,t,i,r){let s=$2(n,e,t,i,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,r,s||me.empty)))return!0;if(!s)return!1;let l=RX(s),o=l?n.state.tr.replaceSelectionWith(l,i):n.state.tr.replaceSelection(s);return n.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Z2(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Bn.paste=(n,e)=>{let t=e;if(n.composing&&!ks)return;let i=Eh?null:t.clipboardData,r=n.input.shiftKey&&n.input.lastKeyCode!=45;i&&$h(n,Z2(i),i.getData("text/html"),r,t)?t.preventDefault():PX(n,t)};class X2{constructor(e,t,i){this.slice=e,this.move=t,this.node=i}}const DX=Li?"altKey":"ctrlKey";function I2(n,e){let t;return n.someProp("dragCopies",i=>{t=t||i(e)}),t!=null?!t:!e[DX]}_n.dragstart=(n,e)=>{let t=e,i=n.input.mouseDown;if(i&&i.done(),!t.dataTransfer)return;let r=n.state.selection,s=r.empty?null:n.posAtCoords(Rg(t)),l;if(!(s&&s.pos>=r.from&&s.pos<=(r instanceof we?r.to-1:r.to))){if(i&&i.mightDrag)l=we.create(n.state.doc,i.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(l=we.create(n.state.doc,p.posBefore))}}let o=(l||n.state.selection).content(),{dom:c,text:h,slice:d}=mv(n,o);(!t.dataTransfer.files.length||!Sn||p2>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Eh?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Eh||t.dataTransfer.setData("text/plain",h),n.dragging=new X2(d,I2(n,t),l)};_n.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Bn.dragover=Bn.dragenter=(n,e)=>e.preventDefault();Bn.drop=(n,e)=>{try{NX(n,e,n.dragging)}finally{n.dragging=null}};function NX(n,e,t){if(!e.dataTransfer)return;let i=n.posAtCoords(Rg(e));if(!i)return;let r=n.state.doc.resolve(i.pos),s=t&&t.slice;s?n.someProp("transformPasted",O=>{s=O(s,n,!1)}):s=$2(n,Z2(e.dataTransfer),Eh?null:e.dataTransfer.getData("text/html"),!1,r);let l=!!(t&&I2(n,e));if(n.someProp("handleDrop",O=>O(n,e,s||me.empty,l))){e.preventDefault();return}if(!s)return;e.preventDefault();let o=s?YR(n.state.doc,r.pos,s):r.pos;o==null&&(o=r.pos);let c=n.state.tr;if(l){let{node:O}=t;O?O.replace(c):c.deleteSelection()}let h=c.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(p))return;let g=c.doc.resolve(h);if(d&&we.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new we(g));else{let O=c.mapping.map(o);c.mapping.maps[c.mapping.maps.length-1].forEach((b,v,x,k)=>O=k),c.setSelection(pv(n,g,c.doc.resolve(O)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}_n.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Ms(n)},20))};_n.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};_n.beforeinput=(n,e)=>{if(Sn&&ks&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:i}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=i||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,bo(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in Bn)_n[n]=Bn[n];function Rh(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}let aM=class V2{constructor(e,t){this.toDOM=e,this.spec=t||Ro,this.side=this.spec.side||0}map(e,t,i,r){let{pos:s,deleted:l}=e.mapResult(t.from+r,this.side<0?-1:1);return l?null:new xi(s-i,s-i,this)}valid(){return!0}eq(e){return this==e||e instanceof V2&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Rh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};class Dl{constructor(e,t){this.attrs=e,this.spec=t||Ro}map(e,t,i,r){let s=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-i,l=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-i;return s>=l?null:new xi(s,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Dl&&Rh(this.attrs,e.attrs)&&Rh(this.spec,e.spec)}static is(e){return e.type instanceof Dl}destroy(){}}let zX=class q2{constructor(e,t){this.attrs=e,this.spec=t||Ro}map(e,t,i,r){let s=e.mapResult(t.from+r,1);if(s.deleted)return null;let l=e.mapResult(t.to+r,-1);return l.deleted||l.pos<=s.pos?null:new xi(s.pos-i,l.pos-i,this)}valid(e,t){let{index:i,offset:r}=e.content.findIndex(t.from),s;return r==t.from&&!(s=e.child(i)).isText&&r+s.nodeSize==t.to}eq(e){return this==e||e instanceof q2&&Rh(this.attrs,e.attrs)&&Rh(this.spec,e.spec)}destroy(){}},xi=class Fu{constructor(e,t,i){this.from=e,this.to=t,this.type=i}copy(e,t){return new Fu(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,i){return this.type.map(e,this,t,i)}static widget(e,t,i){return new Fu(e,e,new aM(t,i))}static inline(e,t,i,r){return new Fu(e,t,new Dl(i,r))}static node(e,t,i,r){return new Fu(e,t,new zX(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Dl}get widget(){return this.type instanceof aM}};const Ia=[],Ro={};class vt{constructor(e,t){this.local=e.length?e:Ia,this.children=t.length?t:Ia}static create(e,t){return t.length?sm(t,e,0,Ro):Tn}find(e,t,i){let r=[];return this.findInner(e??0,t??1e9,r,0,i),r}findInner(e,t,i,r,s){for(let l=0;l<this.local.length;l++){let o=this.local[l];o.from<=t&&o.to>=e&&(!s||s(o.spec))&&i.push(o.copy(o.from+r,o.to+r))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let o=this.children[l]+1;this.children[l+2].findInner(e-o,t-o,i,r+o,s)}}map(e,t,i){return this==Tn||e.maps.length==0?this:this.mapInner(e,t,0,0,i||Ro)}mapInner(e,t,i,r,s){let l;for(let o=0;o<this.local.length;o++){let c=this.local[o].map(e,i,r);c&&c.type.valid(t,c)?(l||(l=[])).push(c):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?LX(this.children,l||[],e,t,i,r,s):l?new vt(l.sort(Po),Ia):Tn}add(e,t){return t.length?this==Tn?vt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,i){let r,s=0;e.forEach((o,c)=>{let h=c+i,d;if(d=Y2(t,o,h)){for(r||(r=this.children.slice());s<r.length&&r[s]<c;)s+=3;r[s]==c?r[s+2]=r[s+2].addInner(o,d,h+1):r.splice(s,0,c,c+o.nodeSize,sm(d,o,h+1,Ro)),s+=3}});let l=H2(s?U2(t):t,-i);for(let o=0;o<l.length;o++)l[o].type.valid(e,l[o])||l.splice(o--,1);return new vt(l.length?this.local.concat(l).sort(Po):this.local,r||this.children)}remove(e){return e.length==0||this==Tn?this:this.removeInner(e,0)}removeInner(e,t){let i=this.children,r=this.local;for(let s=0;s<i.length;s+=3){let l,o=i[s]+t,c=i[s+1]+t;for(let d=0,p;d<e.length;d++)(p=e[d])&&p.from>o&&p.to<c&&(e[d]=null,(l||(l=[])).push(p));if(!l)continue;i==this.children&&(i=this.children.slice());let h=i[s+2].removeInner(l,o+1);h!=Tn?i[s+2]=h:(i.splice(s,3),s-=3)}if(r.length){for(let s=0,l;s<e.length;s++)if(l=e[s])for(let o=0;o<r.length;o++)r[o].eq(l,t)&&(r==this.local&&(r=this.local.slice()),r.splice(o--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new vt(r,i):Tn}forChild(e,t){if(this==Tn)return this;if(t.isLeaf)return vt.empty;let i,r;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(i=this.children[o+2]);break}let s=e+1,l=s+t.content.size;for(let o=0;o<this.local.length;o++){let c=this.local[o];if(c.from<l&&c.to>s&&c.type instanceof Dl){let h=Math.max(s,c.from)-s,d=Math.min(l,c.to)-s;h<d&&(r||(r=[])).push(c.copy(h,d))}}if(r){let o=new vt(r.sort(Po),Ia);return i?new xl([o,i]):o}return i||Tn}eq(e){if(this==e)return!0;if(!(e instanceof vt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return bv(this.localsInner(e))}localsInner(e){if(this==Tn)return Ia;if(e.inlineContent||!this.local.some(Dl.is))return this.local;let t=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Dl||t.push(this.local[i]);return t}forEachSet(e){e(this)}}vt.empty=new vt([],[]);vt.removeOverlap=bv;const Tn=vt.empty;class xl{constructor(e){this.members=e}map(e,t){const i=this.members.map(r=>r.map(e,t,Ro));return xl.from(i)}forChild(e,t){if(t.isLeaf)return vt.empty;let i=[];for(let r=0;r<this.members.length;r++){let s=this.members[r].forChild(e,t);s!=Tn&&(s instanceof xl?i=i.concat(s.members):i.push(s))}return xl.from(i)}eq(e){if(!(e instanceof xl)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,i=!0;for(let r=0;r<this.members.length;r++){let s=this.members[r].localsInner(e);if(s.length)if(!t)t=s;else{i&&(t=t.slice(),i=!1);for(let l=0;l<s.length;l++)t.push(s[l])}}return t?bv(i?t:t.sort(Po)):Ia}static from(e){switch(e.length){case 0:return Tn;case 1:return e[0];default:return new xl(e.every(t=>t instanceof vt)?e:e.reduce((t,i)=>t.concat(i instanceof vt?i:i.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function LX(n,e,t,i,r,s,l){let o=n.slice();for(let h=0,d=s;h<t.maps.length;h++){let p=0;t.maps[h].forEach((g,O,b,v)=>{let x=v-b-(O-g);for(let k=0;k<o.length;k+=3){let C=o[k+1];if(C<0||g>C+d-p)continue;let A=o[k]+d-p;O>=A?o[k+1]=g<=A?-2:-1:g>=d&&x&&(o[k]+=x,o[k+1]+=x)}p+=x}),d=t.maps[h].map(d,-1)}let c=!1;for(let h=0;h<o.length;h+=3)if(o[h+1]<0){if(o[h+1]==-2){c=!0,o[h+1]=-1;continue}let d=t.map(n[h]+s),p=d-r;if(p<0||p>=i.content.size){c=!0;continue}let g=t.map(n[h+1]+s,-1),O=g-r,{index:b,offset:v}=i.content.findIndex(p),x=i.maybeChild(b);if(x&&v==p&&v+x.nodeSize==O){let k=o[h+2].mapInner(t,x,d+1,n[h]+s+1,l);k!=Tn?(o[h]=p,o[h+1]=O,o[h+2]=k):(o[h+1]=-2,c=!0)}else c=!0}if(c){let h=_X(o,n,e,t,r,s,l),d=sm(h,i,0,l);e=d.local;for(let p=0;p<o.length;p+=3)o[p+1]<0&&(o.splice(p,3),p-=3);for(let p=0,g=0;p<d.children.length;p+=3){let O=d.children[p];for(;g<o.length&&o[g]<O;)g+=3;o.splice(g,0,d.children[p],d.children[p+1],d.children[p+2])}}return new vt(e.sort(Po),o)}function H2(n,e){if(!e||!n.length)return n;let t=[];for(let i=0;i<n.length;i++){let r=n[i];t.push(new xi(r.from+e,r.to+e,r.type))}return t}function _X(n,e,t,i,r,s,l){function o(c,h){for(let d=0;d<c.local.length;d++){let p=c.local[d].map(i,r,h);p?t.push(p):l.onRemove&&l.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)o(c.children[d+2],c.children[d]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&o(n[c+2],e[c]+s+1);return t}function Y2(n,e,t){if(e.isLeaf)return null;let i=t+e.nodeSize,r=null;for(let s=0,l;s<n.length;s++)(l=n[s])&&l.from>t&&l.to<i&&((r||(r=[])).push(l),n[s]=null);return r}function U2(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function sm(n,e,t,i){let r=[],s=!1;e.forEach((o,c)=>{let h=Y2(n,o,c+t);if(h){s=!0;let d=sm(h,o,t+c+1,i);d!=Tn&&r.push(c,c+o.nodeSize,d)}});let l=H2(s?U2(n):n,-t).sort(Po);for(let o=0;o<l.length;o++)l[o].type.valid(e,l[o])||(i.onRemove&&i.onRemove(l[o].spec),l.splice(o--,1));return l.length||r.length?new vt(l,r):Tn}function Po(n,e){return n.from-e.from||n.to-e.to}function bv(n){let e=n;for(let t=0;t<e.length-1;t++){let i=e[t];if(i.from!=i.to)for(let r=t+1;r<e.length;r++){let s=e[r];if(s.from==i.from){s.to!=i.to&&(e==n&&(e=n.slice()),e[r]=s.copy(s.from,i.to),cM(e,r+1,s.copy(i.to,s.to)));continue}else{s.from<i.to&&(e==n&&(e=n.slice()),e[t]=i.copy(i.from,s.from),cM(e,r,i.copy(s.from,i.to)));break}}}return e}function cM(n,e,t){for(;e<n.length&&Po(t,n[e])>0;)e++;n.splice(e,0,t)}function Xy(n){let e=[];return n.someProp("decorations",t=>{let i=t(n.state);i&&i!=Tn&&e.push(i)}),n.cursorWrapper&&e.push(vt.create(n.state.doc,[n.cursorWrapper.deco])),xl.from(e)}const BX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jX=ni&&Rl<=11;class ZX{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}let XX=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ZX,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let r=0;r<i.length;r++)this.queue.push(i[r]);ni&&Rl<=11&&i.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():Mn&&e.composing&&i.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),jX&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,BX)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(eM(this.view)){if(this.suppressingSelectionUpdates)return Ms(this.view);if(ni&&Rl<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Bo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,i;for(let s=e.focusNode;s;s=uc(s))t.add(s);for(let s=e.anchorNode;s;s=uc(s))if(t.has(s)){i=s;break}let r=i&&this.view.docView.nearestDesc(i);if(r&&r.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let i=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&eM(e)&&!this.ignoreSelectionChange(i),s=-1,l=-1,o=!1,c=[];if(e.editable)for(let d=0;d<t.length;d++){let p=this.registerMutation(t[d],c);p&&(s=s<0?p.from:Math.min(p.from,s),l=l<0?p.to:Math.max(p.to,l),p.typeOver&&(o=!0))}if(c.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let p=d.nextSibling;for(;p&&p.nodeType==1;){if(p.contentEditable=="false"){d.parentNode.removeChild(d);break}p=p.firstChild}}}else if(Vi&&c.length){let d=c.filter(p=>p.nodeName=="BR");if(d.length==2){let[p,g]=d;p.parentNode&&p.parentNode.parentNode==g.parentNode?g.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let g of d){let O=g.parentNode;O&&O.nodeName=="LI"&&(!p||qX(e,p)!=O)&&g.remove()}}}let h=null;s<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Eg(i)&&(h=dv(e))&&h.eq($e.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ms(e),this.currentSelection.set(i),e.scrollToSelection()):(s>-1||r)&&(s>-1&&(e.docView.markDirty(s,l),IX(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,HX(e,c)),this.handleDOMChange(s,l,o,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||Ms(e),this.currentSelection.set(i))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let p=e.addedNodes[d];t.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let r=e.previousSibling,s=e.nextSibling;if(ni&&Rl<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:p,nextSibling:g}=e.addedNodes[d];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(r=p),(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(s=g)}let l=r&&r.parentNode==e.target?On(r)+1:0,o=i.localPosFromDOM(e.target,l,-1),c=s&&s.parentNode==e.target?On(s):e.target.childNodes.length,h=i.localPosFromDOM(e.target,c,1);return{from:o,to:h}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=e.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},uM=new WeakMap,hM=!1;function IX(n){if(!uM.has(n)&&(uM.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Vi,hM)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),hM=!0}}function fM(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.domAtPos(n.state.selection.anchor);return Bo(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function VX(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return fM(n,r)}let t;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",i,!0),t?fM(n,t):null}function qX(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let i=n.docView.nearestDesc(t,!0);if(i&&i.node.isBlock)return t}return null}function HX(n,e){var t;let{focusNode:i,focusOffset:r}=n.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let l=s.nextSibling;for(;l&&l.nodeName!="TD"&&l.nodeName!="TH";)l=l.nextSibling;if(l){let o=l;for(;;){let c=o.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;o=c}o.insertBefore(s,o.firstChild),i==s&&n.domSelection().collapse(s,r)}else s.parentNode.removeChild(s)}}function YX(n,e,t){let{node:i,fromOffset:r,toOffset:s,from:l,to:o}=n.docView.parseRange(e,t),c=n.domSelectionRange(),h,d=c.anchorNode;if(d&&n.dom.contains(d.nodeType==1?d:d.parentNode)&&(h=[{node:d,offset:c.anchorOffset}],Eg(c)||h.push({node:c.focusNode,offset:c.focusOffset})),Sn&&n.input.lastKeyCode===8)for(let x=s;x>r;x--){let k=i.childNodes[x-1],C=k.pmViewDesc;if(k.nodeName=="BR"&&!C){s=x;break}if(!C||C.size)break}let p=n.state.doc,g=n.someProp("domParser")||$l.fromSchema(n.state.schema),O=p.resolve(l),b=null,v=g.parse(i,{topNode:O.parent,topMatch:O.parent.contentMatchAt(O.index()),topOpen:!0,from:r,to:s,preserveWhitespace:O.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:UX,context:O});if(h&&h[0].pos!=null){let x=h[0].pos,k=h[1]&&h[1].pos;k==null&&(k=x),b={anchor:x+l,head:k+l}}return{doc:v,sel:b,from:l,to:o}}function UX(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Mn&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Mn&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const WX=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function GX(n,e,t,i,r){let s=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let $=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,H=dv(n,$);if(H&&!n.state.selection.eq(H)){if(Sn&&ks&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",te=>te(n,bo(13,"Enter"))))return;let W=n.state.tr.setSelection(H);$=="pointer"?W.setMeta("pointer",!0):$=="key"&&W.scrollIntoView(),s&&W.setMeta("composition",s),n.dispatch(W)}return}let l=n.state.doc.resolve(e),o=l.sharedDepth(t);e=l.before(o+1),t=n.state.doc.resolve(t).after(o+1);let c=n.state.selection,h=YX(n,e,t),d=n.state.doc,p=d.slice(h.from,h.to),g,O;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(g=n.state.selection.to,O="end"):(g=n.state.selection.from,O="start"),n.input.lastKeyCode=null;let b=JX(p.content,h.doc.content,h.from,g,O);if(b&&n.input.domChangeCount++,(hc&&n.input.lastIOSEnter>Date.now()-225||ks)&&r.some($=>$.nodeType==1&&!WX.test($.nodeName))&&(!b||b.endA>=b.endB)&&n.someProp("handleKeyDown",$=>$(n,bo(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!b)if(i&&c instanceof Ce&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))b={start:c.from,endA:c.to,endB:c.to};else{if(h.sel){let $=dM(n,n.state.doc,h.sel);if($&&!$.eq(n.state.selection)){let H=n.state.tr.setSelection($);s&&H.setMeta("composition",s),n.dispatch(H)}}return}n.state.selection.from<n.state.selection.to&&b.start==b.endB&&n.state.selection instanceof Ce&&(b.start>n.state.selection.from&&b.start<=n.state.selection.from+2&&n.state.selection.from>=h.from?b.start=n.state.selection.from:b.endA<n.state.selection.to&&b.endA>=n.state.selection.to-2&&n.state.selection.to<=h.to&&(b.endB+=n.state.selection.to-b.endA,b.endA=n.state.selection.to)),ni&&Rl<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>h.from&&h.doc.textBetween(b.start-h.from-1,b.start-h.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let v=h.doc.resolveNoCache(b.start-h.from),x=h.doc.resolveNoCache(b.endB-h.from),k=d.resolve(b.start),C=v.sameParent(x)&&v.parent.inlineContent&&k.end()>=b.endA;if((hc&&n.input.lastIOSEnter>Date.now()-225&&(!C||r.some($=>$.nodeName=="DIV"||$.nodeName=="P"))||!C&&v.pos<h.doc.content.size&&(!v.sameParent(x)||!v.parent.inlineContent)&&v.pos<x.pos&&!/\S/.test(h.doc.textBetween(v.pos,x.pos,"","")))&&n.someProp("handleKeyDown",$=>$(n,bo(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>b.start&&KX(d,b.start,b.endA,v,x)&&n.someProp("handleKeyDown",$=>$(n,bo(8,"Backspace")))){ks&&Sn&&n.domObserver.suppressSelectionUpdates();return}Sn&&b.endB==b.start&&(n.input.lastChromeDelete=Date.now()),ks&&!C&&v.start()!=x.start()&&x.parentOffset==0&&v.depth==x.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==b.endA&&(b.endB-=2,x=h.doc.resolveNoCache(b.endB-h.from),setTimeout(()=>{n.someProp("handleKeyDown",function($){return $(n,bo(13,"Enter"))})},20));let A=b.start,P=b.endA,E=$=>{let H=$||n.state.tr.replace(A,P,h.doc.slice(b.start-h.from,b.endB-h.from));if(h.sel){let W=dM(n,H.doc,h.sel);W&&!(Sn&&n.composing&&W.empty&&(b.start!=b.endB||n.input.lastChromeDelete<Date.now()-100)&&(W.head==A||W.head==H.mapping.map(P)-1)||ni&&W.empty&&W.head==A)&&H.setSelection(W)}return s&&H.setMeta("composition",s),H.scrollIntoView()},D;if(C)if(v.pos==x.pos){ni&&Rl<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ms(n),20));let $=E(n.state.tr.delete(A,P)),H=d.resolve(b.start).marksAcross(d.resolve(b.endA));H&&$.ensureMarks(H),n.dispatch($)}else if(b.endA==b.endB&&(D=FX(v.parent.content.cut(v.parentOffset,x.parentOffset),k.parent.content.cut(k.parentOffset,b.endA-k.start())))){let $=E(n.state.tr);D.type=="add"?$.addMark(A,P,D.mark):$.removeMark(A,P,D.mark),n.dispatch($)}else if(v.parent.child(v.index()).isText&&v.index()==x.index()-(x.textOffset?0:1)){let $=v.parent.textBetween(v.parentOffset,x.parentOffset),H=()=>E(n.state.tr.insertText($,A,P));n.someProp("handleTextInput",W=>W(n,A,P,$,H))||n.dispatch(H())}else n.dispatch(E());else n.dispatch(E())}function dM(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:pv(n,e.resolve(t.anchor),e.resolve(t.head))}function FX(n,e){let t=n.firstChild.marks,i=e.firstChild.marks,r=t,s=i,l,o,c;for(let d=0;d<i.length;d++)r=i[d].removeFromSet(r);for(let d=0;d<t.length;d++)s=t[d].removeFromSet(s);if(r.length==1&&s.length==0)o=r[0],l="add",c=d=>d.mark(o.addToSet(d.marks));else if(r.length==0&&s.length==1)o=s[0],l="remove",c=d=>d.mark(o.removeFromSet(d.marks));else return null;let h=[];for(let d=0;d<e.childCount;d++)h.push(c(e.child(d)));if(ne.from(h).eq(n))return{mark:o,type:l}}function KX(n,e,t,i,r){if(t-e<=r.pos-i.pos||Iy(i,!0,!1)<r.pos)return!1;let s=n.resolve(e);if(!i.parent.isTextblock){let o=s.nodeAfter;return o!=null&&t==e+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let l=n.resolve(Iy(s,!0,!0));return!l.parent.isTextblock||l.pos>t||Iy(l,!0,!1)<t?!1:i.parent.content.cut(i.parentOffset).eq(l.parent.content)}function Iy(n,e,t){let i=n.depth,r=e?n.end():n.pos;for(;i>0&&(e||n.indexAfter(i)==n.node(i).childCount);)i--,r++,e=!1;if(t){let s=n.node(i).maybeChild(n.indexAfter(i));for(;s&&!s.isLeaf;)s=s.firstChild,r++}return r}function JX(n,e,t,i,r){let s=n.findDiffStart(e,t);if(s==null)return null;let{a:l,b:o}=n.findDiffEnd(e,t+n.size,t+e.size);if(r=="end"){let c=Math.max(0,s-Math.min(l,o));i-=l+c-s}if(l<s&&n.size<e.size){let c=i<=s&&i>=l?s-i:0;s-=c,s&&s<e.size&&pM(e.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-l),l=s}else if(o<s){let c=i<=s&&i>=o?s-i:0;s-=c,s&&s<n.size&&pM(n.textBetween(s-1,s+1))&&(s+=c?1:-1),l=s+(l-o),o=s}return{start:s,endA:l,endB:o}}function pM(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}let W2=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new pX,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(bM),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=OM(this),gM(this),this.nodeViews=yM(this),this.docView=UA(this.state.doc,mM(this),Xy(this),this.dom,this),this.domObserver=new XX(this,(i,r,s,l)=>GX(this,i,r,s,l)),this.domObserver.start(),mX(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&k1(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(bM),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let i in this._props)t[i]=this._props[i];t.state=this.state;for(let i in e)t[i]=e[i];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var i;let r=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(j2(this),l=!0),this.state=e;let o=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let O=yM(this);tI(O,this.nodeViews)&&(this.nodeViews=O,s=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&k1(this),this.editable=OM(this),gM(this);let c=Xy(this),h=mM(this),d=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(e.doc,h,c);(p||!e.selection.eq(r.selection))&&(l=!0);let g=d=="preserve"&&l&&this.dom.style.overflowAnchor==null&&QZ(this);if(l){this.domObserver.stop();let O=p&&(ni||Sn)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&eI(r.selection,e.selection);if(p){let b=Sn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=QX(this)),(s||!this.docView.update(e.doc,h,c,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=UA(e.doc,h,c,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(O=!0)}O||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&JZ(this))?Ms(this,O):(M2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((i=this.dragging)===null||i===void 0)&&i.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():g&&EZ(g)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof we){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&XA(this,t.getBoundingClientRect(),e)}else XA(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let i=this.directPlugins[t];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let i=this.state.plugins[t];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let i=this.pluginViews[t];i.update&&i.update(this,e)}}updateDraggedNode(e,t){let i=e.node,r=-1;if(i.from<this.state.doc.content.size&&this.state.doc.nodeAt(i.from)==i.node)r=i.from;else{let s=i.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==i.node&&(r=s)}this.dragging=new X2(e.slice,e.move,r<0?void 0:we.create(this.state.doc,r))}someProp(e,t){let i=this._props&&this._props[e],r;if(i!=null&&(r=t?t(i):i))return r;for(let l=0;l<this.directPlugins.length;l++){let o=this.directPlugins[l].props[e];if(o!=null&&(r=t?t(o):o))return r}let s=this.state.plugins;if(s)for(let l=0;l<s.length;l++){let o=s[l].props[e];if(o!=null&&(r=t?t(o):o))return r}}hasFocus(){if(ni){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&$Z(this.dom),Ms(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return zZ(this,e)}coordsAtPos(e,t=1){return S2(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,i=-1){let r=this.docView.posFromDOM(e,t,i);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return ZZ(this,t||this.state,e)}pasteHTML(e,t){return $h(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return $h(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return mv(this,e)}destroy(){this.docView&&(gX(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bZ())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return yX(this,e)}domSelectionRange(){let e=this.domSelection();return e?Mn&&this.root.nodeType===11&&wZ(this.dom.ownerDocument)==this.dom&&VX(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};W2.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function mM(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let i in t)i=="class"?e.class+=" "+t[i]:i=="style"?e.style=(e.style?e.style+";":"")+t[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(t[i]))}),e.translate||(e.translate="no"),[xi.node(0,n.state.doc.content.size,e)]}function gM(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:xi.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function OM(n){return!n.someProp("editable",e=>e(n.state)===!1)}function eI(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function yM(n){let e=Object.create(null);function t(i){for(let r in i)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=i[r])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function tI(n,e){let t=0,i=0;for(let r in n){if(n[r]!=e[r])return!0;t++}for(let r in e)i++;return t!=i}function bM(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var $s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ph={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nI=typeof navigator<"u"&&/Mac/.test(navigator.platform),iI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var yn=0;yn<10;yn++)$s[48+yn]=$s[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)$s[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)$s[yn]=String.fromCharCode(yn+32),Ph[yn]=String.fromCharCode(yn);for(var Vy in $s)Ph.hasOwnProperty(Vy)||(Ph[Vy]=$s[Vy]);function G2(n){var e=nI&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iI&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ph:$s)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const rI=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),sI=typeof navigator<"u"&&/Win/.test(navigator.platform);function lI(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let i,r,s,l;for(let o=0;o<e.length-1;o++){let c=e[o];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))rI?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(t="Alt-"+t),r&&(t="Ctrl-"+t),l&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function oI(n){let e=Object.create(null);for(let t in n)e[lI(t)]=n[t];return e}function qy(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function aI(n){return new yt({props:{handleKeyDown:Sv(n)}})}function Sv(n){let e=oI(n);return function(t,i){let r=G2(i),s,l=e[qy(r,i)];if(l&&l(t.state,t.dispatch,t))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let o=e[qy(r,i,!1)];if(o&&o(t.state,t.dispatch,t))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(sI&&i.ctrlKey&&i.altKey)&&(s=$s[i.keyCode])&&s!=r){let o=e[qy(s,i)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}var cI=Object.defineProperty,vv=(n,e)=>{for(var t in e)cI(n,t,{get:e[t],enumerable:!0})};function Pg(n){const{state:e,transaction:t}=n;let{selection:i}=t,{doc:r}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return i},get doc(){return r},get tr(){return i=t.selection,r=t.doc,s=t.storedMarks,t}}}var Dg=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:i}=e,{tr:r}=t,s=this.buildProps(r);return Object.fromEntries(Object.entries(n).map(([l,o])=>[l,(...h)=>{const d=o(...h)(s);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(r),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:i,state:r}=this,{view:s}=i,l=[],o=!!n,c=n||r.tr,h=()=>(!o&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(t).map(([p,g])=>[p,(...b)=>{const v=this.buildProps(c,e),x=g(...b)(v);return l.push(x),d}])),run:h};return d}createCan(n){const{rawCommands:e,state:t}=this,i=!1,r=n||t.tr,s=this.buildProps(r,i);return{...Object.fromEntries(Object.entries(e).map(([o,c])=>[o,(...h)=>c(...h)({...s,dispatch:void 0})])),chain:()=>this.createChain(r,i)}}buildProps(n,e=!0){const{rawCommands:t,editor:i,state:r}=this,{view:s}=i,l={tr:n,editor:i,view:s,state:Pg({state:r,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([o,c])=>[o,(...h)=>c(...h)(l)]))}};return l}},F2={};vv(F2,{blur:()=>uI,clearContent:()=>hI,clearNodes:()=>fI,command:()=>dI,createParagraphNear:()=>pI,cut:()=>mI,deleteCurrentNode:()=>gI,deleteNode:()=>OI,deleteRange:()=>yI,deleteSelection:()=>bI,enter:()=>SI,exitCode:()=>vI,extendMarkRange:()=>xI,first:()=>kI,focus:()=>TI,forEach:()=>CI,insertContent:()=>AI,insertContentAt:()=>EI,joinBackward:()=>PI,joinDown:()=>RI,joinForward:()=>DI,joinItemBackward:()=>NI,joinItemForward:()=>zI,joinTextblockBackward:()=>LI,joinTextblockForward:()=>_I,joinUp:()=>$I,keyboardShortcut:()=>jI,lift:()=>ZI,liftEmptyBlock:()=>XI,liftListItem:()=>II,newlineInCode:()=>VI,resetAttributes:()=>qI,scrollIntoView:()=>HI,selectAll:()=>YI,selectNodeBackward:()=>UI,selectNodeForward:()=>WI,selectParentNode:()=>GI,selectTextblockEnd:()=>FI,selectTextblockStart:()=>KI,setContent:()=>JI,setMark:()=>y4,setMeta:()=>b4,setNode:()=>S4,setNodeSelection:()=>v4,setTextDirection:()=>x4,setTextSelection:()=>k4,sinkListItem:()=>w4,splitBlock:()=>T4,splitListItem:()=>C4,toggleList:()=>M4,toggleMark:()=>Q4,toggleNode:()=>E4,toggleWrap:()=>$4,undoInputRule:()=>R4,unsetAllMarks:()=>P4,unsetMark:()=>D4,unsetTextDirection:()=>N4,updateAttributes:()=>z4,wrapIn:()=>L4,wrapInList:()=>_4});var uI=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),hI=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),fI=()=>({state:n,tr:e,dispatch:t})=>{const{selection:i}=e,{ranges:r}=i;return t&&r.forEach(({$from:s,$to:l})=>{n.doc.nodesBetween(s.pos,l.pos,(o,c)=>{if(o.type.isText)return;const{doc:h,mapping:d}=e,p=h.resolve(d.map(c)),g=h.resolve(d.map(c+o.nodeSize)),O=p.blockRange(g);if(!O)return;const b=Qc(O);if(o.type.isTextblock){const{defaultType:v}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(O.start,v)}(b||b===0)&&e.lift(O,b)})}),!0},dI=n=>e=>n(e),pI=()=>({state:n,dispatch:e})=>c2(n,e),mI=(n,e)=>({editor:t,tr:i})=>{const{state:r}=t,s=r.doc.slice(n.from,n.to);i.deleteRange(n.from,n.to);const l=i.mapping.map(e);return i.insert(l,s.content),i.setSelection(new Ce(i.doc.resolve(Math.max(l-1,0)))),!0},gI=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,i=t.$anchor.node();if(i.content.size>0)return!1;const r=n.selection.$anchor;for(let s=r.depth;s>0;s-=1)if(r.node(s).type===i.type){if(e){const o=r.before(s),c=r.after(s);n.delete(o,c).scrollIntoView()}return!0}return!1};function Wt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var OI=n=>({tr:e,state:t,dispatch:i})=>{const r=Wt(n,t.schema),s=e.selection.$anchor;for(let l=s.depth;l>0;l-=1)if(s.node(l).type===r){if(i){const c=s.before(l),h=s.after(l);e.delete(c,h).scrollIntoView()}return!0}return!1},yI=n=>({tr:e,dispatch:t})=>{const{from:i,to:r}=n;return t&&e.delete(i,r),!0},bI=()=>({state:n,dispatch:e})=>ov(n,e),SI=()=>({commands:n})=>n.keyboardShortcut("Enter"),vI=()=>({state:n,dispatch:e})=>rZ(n,e);function xv(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function lm(n,e,t={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>t.strict?e[r]===n[r]:xv(e[r])?e[r].test(n[r]):e[r]===n[r]):!0}function K2(n,e,t={}){return n.find(i=>i.type===e&&lm(Object.fromEntries(Object.keys(t).map(r=>[r,i.attrs[r]])),t))}function SM(n,e,t={}){return!!K2(n,e,t)}function kv(n,e,t){if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(h=>h.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(h=>h.type===e))return;if(!t){const h=i.node.marks.find(d=>d.type===e);h&&(t=h.attrs)}if(!K2([...i.node.marks],e,t))return;let s=i.index,l=n.start()+i.offset,o=s+1,c=l+i.node.nodeSize;for(;s>0&&SM([...n.parent.child(s-1).marks],e,t);)s-=1,l-=n.parent.child(s).nodeSize;for(;o<n.parent.childCount&&SM([...n.parent.child(o).marks],e,t);)c+=n.parent.child(o).nodeSize,o+=1;return{from:l,to:c}}function Ns(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}var xI=(n,e)=>({tr:t,state:i,dispatch:r})=>{const s=Ns(n,i.schema),{doc:l,selection:o}=t,{$from:c,from:h,to:d}=o;if(r){const p=kv(c,s,e);if(p&&p.from<=h&&p.to>=d){const g=Ce.create(l,p.from,p.to);t.setSelection(g)}}return!0},kI=n=>e=>{const t=typeof n=="function"?n(e):n;for(let i=0;i<t.length;i+=1)if(t[i](e))return!0;return!1};function wv(n){return n instanceof Ce}function ws(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function J2(n,e=null){if(!e)return null;const t=$e.atStart(n),i=$e.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return i;const r=t.from,s=i.to;return e==="all"?Ce.create(n,ws(0,r,s),ws(n.content.size,r,s)):Ce.create(n,ws(e,r,s),ws(e,r,s))}function vM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function om(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function wI(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var TI=(n=null,e={})=>({editor:t,view:i,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const l=()=>{(om()||vM())&&i.dom.focus(),wI()&&!om()&&!vM()&&i.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(i.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(s&&n===null&&!wv(t.state.selection))return l(),!0;const o=J2(r.doc,n)||t.state.selection,c=t.state.selection.eq(o);return s&&(c||r.setSelection(o),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),l()),!0},CI=(n,e)=>t=>n.every((i,r)=>e(i,{...t,index:r})),AI=(n,e)=>({tr:t,commands:i})=>i.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),eP=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const i=e[t];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?n.removeChild(i):i.nodeType===1&&eP(i)}return n};function Hd(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return eP(t)}function Dh(n,e,t){if(n instanceof El||n instanceof ne)return n;t={slice:!0,parseOptions:{},...t};const i=typeof n=="object"&&n!==null,r=typeof n=="string";if(i)try{if(Array.isArray(n)&&n.length>0)return ne.fromArray(n.map(o=>e.nodeFromJSON(o)));const l=e.nodeFromJSON(n);return t.errorOnInvalidContent&&l.check(),l}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),Dh("",e,t)}if(r){if(t.errorOnInvalidContent){let l=!1,o="";const c=new zR({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(l=!0,o=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?$l.fromSchema(c).parseSlice(Hd(n),t.parseOptions):$l.fromSchema(c).parse(Hd(n),t.parseOptions),t.errorOnInvalidContent&&l)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=$l.fromSchema(e);return t.slice?s.parseSlice(Hd(n),t.parseOptions).content:s.parse(Hd(n),t.parseOptions)}return Dh("",e,t)}function MI(n,e,t){const i=n.steps.length-1;if(i<e)return;const r=n.steps[i];if(!(r instanceof Ht||r instanceof ln))return;const s=n.mapping.maps[i];let l=0;s.forEach((o,c,h,d)=>{l===0&&(l=d)}),n.setSelection($e.near(n.doc.resolve(l),t))}var QI=n=>!("type"in n),EI=(n,e,t)=>({tr:i,dispatch:r,editor:s})=>{var l;if(r){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let o;const c=x=>{s.emit("contentError",{editor:s,error:x,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Dh(e,s.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(x){c(x)}try{o=Dh(e,s.schema,{parseOptions:h,errorOnInvalidContent:(l=t.errorOnInvalidContent)!=null?l:s.options.enableContentCheck})}catch(x){return c(x),!1}let{from:d,to:p}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},g=!0,O=!0;if((QI(o)?o:[o]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,O=O?x.isBlock:!1}),d===p&&O){const{parent:x}=i.doc.resolve(d);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(d-=1,p+=1)}let v;if(g){if(Array.isArray(e))v=e.map(x=>x.text||"").join("");else if(e instanceof ne){let x="";e.forEach(k=>{k.text&&(x+=k.text)}),v=x}else typeof e=="object"&&e&&e.text?v=e.text:v=e;i.insertText(v,d,p)}else{v=o;const x=i.doc.resolve(d),k=x.node(),C=x.parentOffset===0,A=k.isText||k.isTextblock,P=k.content.size>0;C&&A&&P&&O&&(d=Math.max(0,d-1)),i.replaceWith(d,p,v)}t.updateSelection&&MI(i,i.steps.length-1,-1),t.applyInputRules&&i.setMeta("applyInputRules",{from:d,text:v}),t.applyPasteRules&&i.setMeta("applyPasteRules",{from:d,text:v})}return!0},$I=()=>({state:n,dispatch:e})=>tZ(n,e),RI=()=>({state:n,dispatch:e})=>nZ(n,e),PI=()=>({state:n,dispatch:e})=>n2(n,e),DI=()=>({state:n,dispatch:e})=>l2(n,e),NI=()=>({state:n,dispatch:e,tr:t})=>{try{const i=Ag(n.doc,n.selection.$from.pos,-1);return i==null?!1:(t.join(i,2),e&&e(t),!0)}catch{return!1}},zI=()=>({state:n,dispatch:e,tr:t})=>{try{const i=Ag(n.doc,n.selection.$from.pos,1);return i==null?!1:(t.join(i,2),e&&e(t),!0)}catch{return!1}},LI=()=>({state:n,dispatch:e})=>Jj(n,e),_I=()=>({state:n,dispatch:e})=>eZ(n,e);function tP(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function BI(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let i,r,s,l;for(let o=0;o<e.length-1;o+=1){const c=e[o];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))om()||tP()?l=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(t=`Alt-${t}`),r&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}var jI=n=>({editor:e,view:t,tr:i,dispatch:r})=>{const s=BI(n).split(/-(?!$)/),l=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),o=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,o))});return c==null||c.steps.forEach(h=>{const d=h.map(i.mapping);d&&r&&i.maybeStep(d)}),!0};function zl(n,e,t={}){const{from:i,to:r,empty:s}=n.selection,l=e?Wt(e,n.schema):null,o=[];n.doc.nodesBetween(i,r,(p,g)=>{if(p.isText)return;const O=Math.max(i,g),b=Math.min(r,g+p.nodeSize);o.push({node:p,from:O,to:b})});const c=r-i,h=o.filter(p=>l?l.name===p.node.type.name:!0).filter(p=>lm(p.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((p,g)=>p+g.to-g.from,0)>=c}var ZI=(n,e={})=>({state:t,dispatch:i})=>{const r=Wt(n,t.schema);return zl(t,r,e)?iZ(t,i):!1},XI=()=>({state:n,dispatch:e})=>u2(n,e),II=n=>({state:e,dispatch:t})=>{const i=Wt(n,e.schema);return mZ(i)(e,t)},VI=()=>({state:n,dispatch:e})=>a2(n,e);function Ng(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function xM(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((i,r)=>(t.includes(r)||(i[r]=n[r]),i),{})}var qI=(n,e)=>({tr:t,state:i,dispatch:r})=>{let s=null,l=null;const o=Ng(typeof n=="string"?n:n.name,i.schema);if(!o)return!1;o==="node"&&(s=Wt(n,i.schema)),o==="mark"&&(l=Ns(n,i.schema));let c=!1;return t.selection.ranges.forEach(h=>{i.doc.nodesBetween(h.$from.pos,h.$to.pos,(d,p)=>{s&&s===d.type&&(c=!0,r&&t.setNodeMarkup(p,void 0,xM(d.attrs,e))),l&&d.marks.length&&d.marks.forEach(g=>{l===g.type&&(c=!0,r&&t.addMark(p,p+d.nodeSize,l.create(xM(g.attrs,e))))})})}),c},HI=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),YI=()=>({tr:n,dispatch:e})=>{if(e){const t=new Si(n.doc);n.setSelection(t)}return!0},UI=()=>({state:n,dispatch:e})=>r2(n,e),WI=()=>({state:n,dispatch:e})=>o2(n,e),GI=()=>({state:n,dispatch:e})=>oZ(n,e),FI=()=>({state:n,dispatch:e})=>uZ(n,e),KI=()=>({state:n,dispatch:e})=>cZ(n,e);function w1(n,e,t={},i={}){return Dh(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:i.errorOnInvalidContent})}var JI=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:i={}}={})=>({editor:r,tr:s,dispatch:l,commands:o})=>{const{doc:c}=s;if(i.preserveWhitespace!=="full"){const h=w1(n,r.schema,i,{errorOnInvalidContent:e??r.options.enableContentCheck});return l&&s.replaceWith(0,c.content.size,h).setMeta("preventUpdate",!t),!0}return l&&s.setMeta("preventUpdate",!t),o.insertContentAt({from:0,to:c.content.size},n,{parseOptions:i,errorOnInvalidContent:e??r.options.enableContentCheck})};function nP(n,e){const t=Ns(e,n.schema),{from:i,to:r,empty:s}=n.selection,l=[];s?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(i,r,c=>{l.push(...c.marks)});const o=l.find(c=>c.type.name===t.name);return o?{...o.attrs}:{}}function iP(n,e){const t=new sv(n);return e.forEach(i=>{i.steps.forEach(r=>{t.step(r)})}),t}function e4(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function t4(n,e,t){const i=[];return n.nodesBetween(e.from,e.to,(r,s)=>{t(r)&&i.push({node:r,pos:s})}),i}function rP(n,e){for(let t=n.depth;t>0;t-=1){const i=n.node(t);if(e(i))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:i}}}function zg(n){return e=>rP(e.$from,n)}function xe(n,e,t){return n.config[e]===void 0&&n.parent?xe(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?xe(n.parent,e,t):null}):n.config[e]}function Tv(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},i=xe(e,"addExtensions",t);return i?[e,...Tv(i())]:e}).flat(10)}function Cv(n,e){const t=Wo.fromSchema(e).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(t),r.innerHTML}function sP(n){return typeof n=="function"}function tt(n,e=void 0,...t){return sP(n)?e?n.bind(e)(...t):n(...t):n}function n4(n={}){return Object.keys(n).length===0&&n.constructor===Object}function fc(n){const e=n.filter(r=>r.type==="extension"),t=n.filter(r=>r.type==="node"),i=n.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:i}}function lP(n){const e=[],{nodeExtensions:t,markExtensions:i}=fc(n),r=[...t,...i],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},l=t.filter(h=>h.name!=="text").map(h=>h.name),o=i.map(h=>h.name),c=[...l,...o];return n.forEach(h=>{const d={name:h.name,options:h.options,storage:h.storage,extensions:r},p=xe(h,"addGlobalAttributes",d);if(!p)return;p().forEach(O=>{let b;Array.isArray(O.types)?b=O.types:O.types==="*"?b=c:O.types==="nodes"?b=l:O.types==="marks"?b=o:b=[],b.forEach(v=>{Object.entries(O.attributes).forEach(([x,k])=>{e.push({type:v,name:x,attribute:{...s,...k}})})})})}),r.forEach(h=>{const d={name:h.name,options:h.options,storage:h.storage},p=xe(h,"addAttributes",d);if(!p)return;const g=p();Object.entries(g).forEach(([O,b])=>{const v={...s,...b};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,e.push({type:h.name,name:O,attribute:v})})}),e}function i4(n){const e=[];let t="",i=!1,r=!1,s=0;const l=n.length;for(let o=0;o<l;o+=1){const c=n[o];if(c==="'"&&!r){i=!i,t+=c;continue}if(c==='"'&&!i){r=!r,t+=c;continue}if(!i&&!r){if(c==="("){s+=1,t+=c;continue}if(c===")"&&s>0){s-=1,t+=c;continue}if(c===";"&&s===0){e.push(t),t="";continue}}t+=c}return t&&e.push(t),e}function kM(n){const e=[],t=i4(n||""),i=t.length;for(let r=0;r<i;r+=1){const s=t[r],l=s.indexOf(":");if(l===-1)continue;const o=s.slice(0,l).trim(),c=s.slice(l+1).trim();o&&c&&e.push([o,c])}return e}function Tt(...n){return n.filter(e=>!!e).reduce((e,t)=>{const i={...e};return Object.entries(t).forEach(([r,s])=>{if(!i[r]){i[r]=s;return}if(r==="class"){const o=s?String(s).split(" "):[],c=i[r]?i[r].split(" "):[],h=o.filter(d=>!c.includes(d));i[r]=[...c,...h].join(" ")}else if(r==="style"){const o=new Map([...kM(i[r]),...kM(s)]);i[r]=Array.from(o.entries()).map(([c,h])=>`${c}: ${h}`).join("; ")}else i[r]=s}),i},{})}function Nh(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,i)=>Tt(t,i),{})}function r4(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function wM(n,e){return"style"in n?n:{...n,getAttrs:t=>{const i=n.getAttrs?n.getAttrs(t):n.attrs;if(i===!1)return!1;const r=e.reduce((s,l)=>{const o=l.attribute.parseHTML?l.attribute.parseHTML(t):r4(t.getAttribute(l.name));return o==null?s:{...s,[l.name]:o}},{});return{...i,...r}}}}function TM(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&n4(t)?!1:t!=null))}function CM(n){var e,t;const i={};return!((e=n==null?void 0:n.attribute)!=null&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(i.default=n.attribute.default),((t=n==null?void 0:n.attribute)==null?void 0:t.validate)!==void 0&&(i.validate=n.attribute.validate),[n.name,i]}function s4(n,e){var t;const i=lP(n),{nodeExtensions:r,markExtensions:s}=fc(n),l=(t=r.find(h=>xe(h,"topNode")))==null?void 0:t.name,o=Object.fromEntries(r.map(h=>{const d=i.filter(k=>k.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((k,C)=>{const A=xe(C,"extendNodeSchema",p);return{...k,...A?A(h):{}}},{}),O=TM({...g,content:tt(xe(h,"content",p)),marks:tt(xe(h,"marks",p)),group:tt(xe(h,"group",p)),inline:tt(xe(h,"inline",p)),atom:tt(xe(h,"atom",p)),selectable:tt(xe(h,"selectable",p)),draggable:tt(xe(h,"draggable",p)),code:tt(xe(h,"code",p)),whitespace:tt(xe(h,"whitespace",p)),linebreakReplacement:tt(xe(h,"linebreakReplacement",p)),defining:tt(xe(h,"defining",p)),isolating:tt(xe(h,"isolating",p)),attrs:Object.fromEntries(d.map(CM))}),b=tt(xe(h,"parseHTML",p));b&&(O.parseDOM=b.map(k=>wM(k,d)));const v=xe(h,"renderHTML",p);v&&(O.toDOM=k=>v({node:k,HTMLAttributes:Nh(k,d)}));const x=xe(h,"renderText",p);return x&&(O.toText=x),[h.name,O]})),c=Object.fromEntries(s.map(h=>{const d=i.filter(x=>x.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((x,k)=>{const C=xe(k,"extendMarkSchema",p);return{...x,...C?C(h):{}}},{}),O=TM({...g,inclusive:tt(xe(h,"inclusive",p)),excludes:tt(xe(h,"excludes",p)),group:tt(xe(h,"group",p)),spanning:tt(xe(h,"spanning",p)),code:tt(xe(h,"code",p)),attrs:Object.fromEntries(d.map(CM))}),b=tt(xe(h,"parseHTML",p));b&&(O.parseDOM=b.map(x=>wM(x,d)));const v=xe(h,"renderHTML",p);return v&&(O.toDOM=x=>v({mark:x,HTMLAttributes:Nh(x,d)})),[h.name,O]}));return new zR({topNode:l,nodes:o,marks:c})}function l4(n){const e=n.filter((t,i)=>n.indexOf(t)!==i);return Array.from(new Set(e))}function ch(n){return n.sort((t,i)=>{const r=xe(t,"priority")||100,s=xe(i,"priority")||100;return r>s?-1:r<s?1:0})}function oP(n){const e=ch(Tv(n)),t=l4(e.map(i=>i.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),e}function aP(n,e,t){const{from:i,to:r}=e,{blockSeparator:s=`

`,textSerializers:l={}}=t||{};let o="";return n.nodesBetween(i,r,(c,h,d,p)=>{var g;c.isBlock&&h>i&&(o+=s);const O=l==null?void 0:l[c.type.name];if(O)return d&&(o+=O({node:c,pos:h,parent:d,index:p,range:e})),!1;c.isText&&(o+=(g=c==null?void 0:c.text)==null?void 0:g.slice(Math.max(i,h)-h,r-h))}),o}function cP(n,e){const t={from:0,to:n.content.size};return aP(n,t,e)}function Av(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function o4(n,e){const t=Wt(e,n.schema),{from:i,to:r}=n.selection,s=[];n.doc.nodesBetween(i,r,o=>{s.push(o)});const l=s.reverse().find(o=>o.type.name===t.name);return l?{...l.attrs}:{}}function uP(n,e){const t=Ng(typeof e=="string"?e:e.name,n.schema);return t==="node"?o4(n,e):t==="mark"?nP(n,e):{}}function a4(n,e=JSON.stringify){const t={};return n.filter(i=>{const r=e(i);return Object.prototype.hasOwnProperty.call(t,r)?!1:t[r]=!0})}function c4(n){const e=a4(n);return e.length===1?e:e.filter((t,i)=>!e.filter((s,l)=>l!==i).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function hP(n){const{mapping:e,steps:t}=n,i=[];return e.maps.forEach((r,s)=>{const l=[];if(r.ranges.length)r.forEach((o,c)=>{l.push({from:o,to:c})});else{const{from:o,to:c}=t[s];if(o===void 0||c===void 0)return;l.push({from:o,to:c})}l.forEach(({from:o,to:c})=>{const h=e.slice(s).map(o,-1),d=e.slice(s).map(c),p=e.invert().map(h,-1),g=e.invert().map(d);i.push({oldRange:{from:p,to:g},newRange:{from:h,to:d}})})}),c4(i)}function Mv(n,e,t){const i=[];return n===e?t.resolve(n).marks().forEach(r=>{const s=t.resolve(n),l=kv(s,r.type);l&&i.push({mark:r,...l})}):t.nodesBetween(n,e,(r,s)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(l=>({from:s,to:s+r.nodeSize,mark:l})))}),i}var u4=(n,e,t,i=20)=>{const r=n.doc.resolve(t);let s=i,l=null;for(;s>0&&l===null;){const o=r.node(s);(o==null?void 0:o.type.name)===e?l=o:s-=1}return[l,s]};function Pu(n,e){return e.nodes[n]||e.marks[n]||null}function Dp(n,e,t){return Object.fromEntries(Object.entries(t).filter(([i])=>{const r=n.find(s=>s.type===e&&s.name===i);return r?r.attribute.keepOnSplit:!1}))}var h4=(n,e=500)=>{let t="";const i=n.parentOffset;return n.parent.nodesBetween(Math.max(0,i-e),i,(r,s,l,o)=>{var c,h;const d=((h=(c=r.type.spec).toText)==null?void 0:h.call(c,{node:r,pos:s,parent:l,index:o}))||r.textContent||"%leaf%";t+=r.isAtom&&!r.isText?d:d.slice(0,Math.max(0,i-s))}),t};function T1(n,e,t={}){const{empty:i,ranges:r}=n.selection,s=e?Ns(e,n.schema):null;if(i)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>lm(p.attrs,t,{strict:!1}));let l=0;const o=[];if(r.forEach(({$from:p,$to:g})=>{const O=p.pos,b=g.pos;n.doc.nodesBetween(O,b,(v,x)=>{if(s&&v.inlineContent&&!v.type.allowsMarkType(s))return!1;if(!v.isText&&!v.marks.length)return;const k=Math.max(O,x),C=Math.min(b,x+v.nodeSize),A=C-k;l+=A,o.push(...v.marks.map(P=>({mark:P,from:k,to:C})))})}),l===0)return!1;const c=o.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>lm(p.mark.attrs,t,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),h=o.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,g)=>p+g.to-g.from,0);return(c>0?c+h:c)>=l}function f4(n,e,t={}){if(!e)return zl(n,null,t)||T1(n,null,t);const i=Ng(e,n.schema);return i==="node"?zl(n,e,t):i==="mark"?T1(n,e,t):!1}var d4=(n,e)=>{const{$from:t,$to:i,$anchor:r}=n.selection;if(e){const s=zg(o=>o.type.name===e)(n.selection);if(!s)return!1;const l=n.doc.resolve(s.pos+1);return r.pos+1===l.end()}return!(i.parentOffset<i.parent.nodeSize-2||t.pos!==i.pos)},p4=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function AM(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Hy(n,e){const{nodeExtensions:t}=fc(e),i=t.find(l=>l.name===n);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},s=tt(xe(i,"group",r));return typeof s!="string"?!1:s.split(" ").includes("list")}function Lg(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var i;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return!/\S/.test((i=n.text)!=null?i:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let r=!0;return n.content.forEach(s=>{r!==!1&&(Lg(s,{ignoreWhitespace:t,checkChildren:e})||(r=!1))}),r}return!1}function fP(n){return n instanceof we}var dP=class pP{constructor(e){this.position=e}static fromJSON(e){return new pP(e.position)}toJSON(){return{position:this.position}}};function m4(n,e){const t=e.mapping.mapResult(n.position);return{position:new dP(t.pos),mapResult:t}}function g4(n){return new dP(n)}function mP(n,e,t){const r=n.state.doc.content.size,s=ws(e,0,r),l=ws(t,0,r),o=n.coordsAtPos(s),c=n.coordsAtPos(l,-1),h=Math.min(o.top,c.top),d=Math.max(o.bottom,c.bottom),p=Math.min(o.left,c.left),g=Math.max(o.right,c.right),O=g-p,b=d-h,k={top:h,bottom:d,left:p,right:g,width:O,height:b,x:p,y:h};return{...k,toJSON:()=>k}}function O4(n,e,t){var i;const{selection:r}=e;let s=null;if(wv(r)&&(s=r.$cursor),s){const o=(i=n.storedMarks)!=null?i:s.marks();return s.parent.type.allowsMarkType(t)&&(!!t.isInSet(o)||!o.some(h=>h.type.excludes(t)))}const{ranges:l}=r;return l.some(({$from:o,$to:c})=>{let h=o.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(o.pos,c.pos,(d,p,g)=>{if(h)return!1;if(d.isInline){const O=!g||g.type.allowsMarkType(t),b=!!t.isInSet(d.marks)||!d.marks.some(v=>v.type.excludes(t));h=O&&b}return!h}),h})}var y4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{const{selection:s}=t,{empty:l,ranges:o}=s,c=Ns(n,i.schema);if(r)if(l){const h=nP(i,c);t.addStoredMark(c.create({...h,...e}))}else o.forEach(h=>{const d=h.$from.pos,p=h.$to.pos;i.doc.nodesBetween(d,p,(g,O)=>{const b=Math.max(O,d),v=Math.min(O+g.nodeSize,p);g.marks.find(k=>k.type===c)?g.marks.forEach(k=>{c===k.type&&t.addMark(b,v,c.create({...k.attrs,...e}))}):t.addMark(b,v,c.create(e))})});return O4(i,t,c)},b4=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),S4=(n,e={})=>({state:t,dispatch:i,chain:r})=>{const s=Wt(n,t.schema);let l;return t.selection.$anchor.sameParent(t.selection.$head)&&(l=t.selection.$anchor.parent.attrs),s.isTextblock?r().command(({commands:o})=>BA(s,{...l,...e})(t)?!0:o.clearNodes()).command(({state:o})=>BA(s,{...l,...e})(o,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},v4=n=>({tr:e,dispatch:t})=>{if(t){const{doc:i}=e,r=ws(n,0,i.content.size),s=we.create(i,r);e.setSelection(s)}return!0},x4=(n,e)=>({tr:t,state:i,dispatch:r})=>{const{selection:s}=i;let l,o;return typeof e=="number"?(l=e,o=e):e&&"from"in e&&"to"in e?(l=e.from,o=e.to):(l=s.from,o=s.to),r&&t.doc.nodesBetween(l,o,(c,h)=>{c.isText||t.setNodeMarkup(h,void 0,{...c.attrs,dir:n})}),!0},k4=n=>({tr:e,dispatch:t})=>{if(t){const{doc:i}=e,{from:r,to:s}=typeof n=="number"?{from:n,to:n}:n,l=Ce.atStart(i).from,o=Ce.atEnd(i).to,c=ws(r,l,o),h=ws(s,l,o),d=Ce.create(i,c,h);e.setSelection(d)}return!0},w4=n=>({state:e,dispatch:t})=>{const i=Wt(n,e.schema);return yZ(i)(e,t)};function MM(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const i=t.filter(r=>e==null?void 0:e.includes(r.type.name));n.tr.ensureMarks(i)}}var T4=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:i,editor:r})=>{const{selection:s,doc:l}=e,{$from:o,$to:c}=s,h=r.extensionManager.attributes,d=Dp(h,o.node().type.name,o.node().attrs);if(s instanceof we&&s.node.isBlock)return!o.parentOffset||!As(l,o.pos)?!1:(i&&(n&&MM(t,r.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,g=o.depth===0?void 0:e4(o.node(-1).contentMatchAt(o.indexAfter(-1)));let O=p&&g?[{type:g,attrs:d}]:void 0,b=As(e.doc,e.mapping.map(o.pos),1,O);if(!O&&!b&&As(e.doc,e.mapping.map(o.pos),1,g?[{type:g}]:void 0)&&(b=!0,O=g?[{type:g,attrs:d}]:void 0),i){if(b&&(s instanceof Ce&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,O),g&&!p&&!o.parentOffset&&o.parent.type!==g)){const v=e.mapping.map(o.before()),x=e.doc.resolve(v);o.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&e.setNodeMarkup(e.mapping.map(o.before()),g)}n&&MM(t,r.extensionManager.splittableMarks),e.scrollIntoView()}return b},C4=(n,e={})=>({tr:t,state:i,dispatch:r,editor:s})=>{var l;const o=Wt(n,i.schema),{$from:c,$to:h}=i.selection,d=i.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(h))return!1;const p=c.node(-1);if(p.type!==o)return!1;const g=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==o||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let k=ne.empty;const C=c.index(-1)?1:c.index(-2)?2:3;for(let H=c.depth-C;H>=c.depth-3;H-=1)k=ne.from(c.node(H).copy(k));const A=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,P={...Dp(g,c.node().type.name,c.node().attrs),...e},E=((l=o.contentMatch.defaultType)==null?void 0:l.createAndFill(P))||void 0;k=k.append(ne.from(o.createAndFill(null,E)||void 0));const D=c.before(c.depth-(C-1));t.replace(D,c.after(-A),new me(k,4-C,0));let $=-1;t.doc.nodesBetween(D,t.doc.content.size,(H,W)=>{if($>-1)return!1;H.isTextblock&&H.content.size===0&&($=W+1)}),$>-1&&t.setSelection(Ce.near(t.doc.resolve($))),t.scrollIntoView()}return!0}const O=h.pos===c.end()?p.contentMatchAt(0).defaultType:null,b={...Dp(g,p.type.name,p.attrs),...e},v={...Dp(g,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const x=O?[{type:o,attrs:b},{type:O,attrs:v}]:[{type:o,attrs:b}];if(!As(t.doc,c.pos,2))return!1;if(r){const{selection:k,storedMarks:C}=i,{splittableMarks:A}=s.extensionManager,P=C||k.$to.parentOffset&&k.$from.marks();if(t.split(c.pos,2,x).scrollIntoView(),!P||!r)return!0;const E=P.filter(D=>A.includes(D.type.name));t.ensureMarks(E)}return!0},Yy=(n,e)=>{const t=zg(l=>l.type===e)(n.selection);if(!t)return!0;const i=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(i===void 0)return!0;const r=n.doc.nodeAt(i);return t.node.type===(r==null?void 0:r.type)&&Vl(n.doc,t.pos)&&n.join(t.pos),!0},Uy=(n,e)=>{const t=zg(l=>l.type===e)(n.selection);if(!t)return!0;const i=n.doc.resolve(t.start).after(t.depth);if(i===void 0)return!0;const r=n.doc.nodeAt(i);return t.node.type===(r==null?void 0:r.type)&&Vl(n.doc,i)&&n.join(i),!0};function A4(n){const e=n.doc,t=e.firstChild;if(!t)return null;const i=e.resolve(1),r=e.resolve(t.nodeSize-1);return Ce.between(i,r)}var M4=(n,e,t,i={})=>({editor:r,tr:s,state:l,dispatch:o,chain:c,commands:h,can:d})=>{const{extensions:p,splittableMarks:g}=r.extensionManager,O=Wt(n,l.schema),b=Wt(e,l.schema),{selection:v,storedMarks:x}=l,{$from:k,$to:C}=v,A=k.blockRange(C),P=x||v.$to.parentOffset&&v.$from.marks();if(!A)return!1;const E=zg(ue=>Hy(ue.type.name,p))(v),D=v.from===0&&v.to===l.doc.content.size,$=l.doc.content.content,H=$.length===1?$[0]:null,W=D&&H&&Hy(H.type.name,p)?{node:H,pos:0}:null,te=E??W,ce=!!E&&A.depth>=1&&A.depth-E.depth<=1,ie=!!W;if((ce||ie)&&te){if(te.node.type===O)return D&&ie?c().command(({tr:ue,dispatch:se})=>{const fe=A4(ue);return fe?(ue.setSelection(fe),se&&se(ue),!0):!1}).liftListItem(b).run():h.liftListItem(b);if(Hy(te.node.type.name,p)&&O.validContent(te.node.content))return c().command(()=>(s.setNodeMarkup(te.pos,O),!0)).command(()=>Yy(s,O)).command(()=>Uy(s,O)).run()}return!t||!P||!o?c().command(()=>d().wrapInList(O,i)?!0:h.clearNodes()).wrapInList(O,i).command(()=>Yy(s,O)).command(()=>Uy(s,O)).run():c().command(()=>{const ue=d().wrapInList(O,i),se=P.filter(fe=>g.includes(fe.type.name));return s.ensureMarks(se),ue?!0:h.clearNodes()}).wrapInList(O,i).command(()=>Yy(s,O)).command(()=>Uy(s,O)).run()},Q4=(n,e={},t={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:s=!1}=t,l=Ns(n,i.schema);return T1(i,l,e)?r.unsetMark(l,{extendEmptyMarkRange:s}):r.setMark(l,e)},E4=(n,e,t={})=>({state:i,commands:r})=>{const s=Wt(n,i.schema),l=Wt(e,i.schema),o=zl(i,s,t);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),o?r.setNode(l,c):r.setNode(s,{...c,...t})},$4=(n,e={})=>({state:t,commands:i})=>{const r=Wt(n,t.schema);return zl(t,r,e)?i.lift(r):i.wrapIn(r,e)},R4=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let i=0;i<t.length;i+=1){const r=t[i];let s;if(r.spec.isInputRules&&(s=r.getState(n))){if(e){const l=n.tr,o=s.transform;for(let c=o.steps.length-1;c>=0;c-=1)l.step(o.steps[c].invert(o.docs[c]));if(s.text){const c=l.doc.resolve(s.from).marks();l.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else l.delete(s.from,s.to)}return!0}}return!1},P4=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:i,ranges:r}=t;return i||e&&r.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},D4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{var s;const{extendEmptyMarkRange:l=!1}=e,{selection:o}=t,c=Ns(n,i.schema),{$from:h,empty:d,ranges:p}=o;if(!r)return!0;if(d&&l){let{from:g,to:O}=o;const b=(s=h.marks().find(x=>x.type===c))==null?void 0:s.attrs,v=kv(h,c,b);v&&(g=v.from,O=v.to),t.removeMark(g,O,c)}else p.forEach(g=>{t.removeMark(g.$from.pos,g.$to.pos,c)});return t.removeStoredMark(c),!0},N4=n=>({tr:e,state:t,dispatch:i})=>{const{selection:r}=t;let s,l;return typeof n=="number"?(s=n,l=n):n&&"from"in n&&"to"in n?(s=n.from,l=n.to):(s=r.from,l=r.to),i&&e.doc.nodesBetween(s,l,(o,c)=>{if(o.isText)return;const h={...o.attrs};delete h.dir,e.setNodeMarkup(c,void 0,h)}),!0},z4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{let s=null,l=null;const o=Ng(typeof n=="string"?n:n.name,i.schema);if(!o)return!1;o==="node"&&(s=Wt(n,i.schema)),o==="mark"&&(l=Ns(n,i.schema));let c=!1;return t.selection.ranges.forEach(h=>{const d=h.$from.pos,p=h.$to.pos;let g,O,b,v;t.selection.empty?i.doc.nodesBetween(d,p,(x,k)=>{s&&s===x.type&&(c=!0,b=Math.max(k,d),v=Math.min(k+x.nodeSize,p),g=k,O=x)}):i.doc.nodesBetween(d,p,(x,k)=>{k<d&&s&&s===x.type&&(c=!0,b=Math.max(k,d),v=Math.min(k+x.nodeSize,p),g=k,O=x),k>=d&&k<=p&&(s&&s===x.type&&(c=!0,r&&t.setNodeMarkup(k,void 0,{...x.attrs,...e})),l&&x.marks.length&&x.marks.forEach(C=>{if(l===C.type&&(c=!0,r)){const A=Math.max(k,d),P=Math.min(k+x.nodeSize,p);t.addMark(A,P,l.create({...C.attrs,...e}))}}))}),O&&(g!==void 0&&r&&t.setNodeMarkup(g,void 0,{...O.attrs,...e}),l&&O.marks.length&&O.marks.forEach(x=>{l===x.type&&r&&t.addMark(b,v,l.create({...x.attrs,...e}))}))}),c},L4=(n,e={})=>({state:t,dispatch:i})=>{const r=Wt(n,t.schema);return hZ(r,e)(t,i)},_4=(n,e={})=>({state:t,dispatch:i})=>{const r=Wt(n,t.schema);return fZ(r,e)(t,i)},B4=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(i=>i.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(i=>i!==e):delete this.callbacks[n]),this}once(n,e){const t=(...i)=>{this.off(n,t),e.apply(this,i)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},_g=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},j4=(n,e)=>{if(xv(e))return e.exec(n);const t=e(n);if(!t)return null;const i=[t.text];return i.index=t.index,i.input=n,i.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(t.replaceWith)),i};function Yd(n){var e;const{editor:t,from:i,to:r,text:s,rules:l,plugin:o}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(i);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let d=!1;const p=h4(h)+s;return l.forEach(g=>{if(d)return;const O=j4(p,g.find);if(!O)return;const b=c.state.tr,v=Pg({state:c.state,transaction:b}),x={from:i-(O[0].length-s.length),to:r},{commands:k,chain:C,can:A}=new Dg({editor:t,state:v});g.handler({state:v,range:x,match:O,commands:k,chain:C,can:A})===null||!b.steps.length||(g.undoable&&b.setMeta(o,{transform:b,from:i,to:r,text:s}),c.dispatch(b),d=!0)}),d}function Z4(n){const{editor:e,rules:t}=n,i=new yt({state:{init(){return null},apply(r,s,l){const o=r.getMeta(i);if(o)return o;const c=r.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=Cv(ne.from(d),l.schema);const{from:p}=c,g=p+d.length;Yd({editor:e,from:p,to:g,text:d,rules:t,plugin:i})}),r.selectionSet||r.docChanged?null:s}},props:{handleTextInput(r,s,l,o){return Yd({editor:e,from:s,to:l,text:o,rules:t,plugin:i})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:s}=r.state.selection;s&&Yd({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:i})}),!1)},handleKeyDown(r,s){if(s.key!=="Enter")return!1;const{$cursor:l}=r.state.selection;return l?Yd({editor:e,from:l.pos,to:l.pos,text:`
`,rules:t,plugin:i}):!1}},isInputRules:!0});return i}function X4(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ud(n){return X4(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function gP(n,e){const t={...n};return Ud(n)&&Ud(e)&&Object.keys(e).forEach(i=>{Ud(e[i])&&Ud(n[i])?t[i]=gP(n[i],e[i]):t[i]=e[i]}),t}var Qv=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...tt(xe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...tt(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>gP(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Go=class OP extends Qv{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new OP(t)}static handleExit({editor:e,mark:t}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const l=r.marks();if(!!!l.find(h=>(h==null?void 0:h.type.name)===t.name))return!1;const c=l.find(h=>(h==null?void 0:h.type.name)===t.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function I4(n){return typeof n=="number"}var V4=class{constructor(n){this.find=n.find,this.handler=n.handler}},q4=(n,e,t)=>{if(xv(e))return[...n.matchAll(e)];const i=e(n,t);return i?i.map(r=>{const s=[r.text];return s.index=r.index,s.input=n,s.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(r.replaceWith)),s}):[]};function H4(n){const{editor:e,state:t,from:i,to:r,rule:s,pasteEvent:l,dropEvent:o}=n,{commands:c,chain:h,can:d}=new Dg({editor:e,state:t}),p=[];return t.doc.nodesBetween(i,r,(O,b)=>{var v,x,k,C,A;if((x=(v=O.type)==null?void 0:v.spec)!=null&&x.code||!(O.isText||O.isTextblock||O.isInline))return;const P=(A=(C=(k=O.content)==null?void 0:k.size)!=null?C:O.nodeSize)!=null?A:0,E=Math.max(i,b),D=Math.min(r,b+P);if(E>=D)return;const $=O.isText?O.text||"":O.textBetween(E-b,D-b,void 0,"￼");q4($,s.find,l).forEach(W=>{if(W.index===void 0)return;const te=E+W.index+1,ce=te+W[0].length,ie={from:t.tr.mapping.map(te),to:t.tr.mapping.map(ce)},ue=s.handler({state:t,range:ie,match:W,commands:c,chain:h,can:d,pasteEvent:l,dropEvent:o});p.push(ue)})}),p.every(O=>O!==null)}var Wd=null,Y4=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function U4(n){const{editor:e,rules:t}=n;let i=null,r=!1,s=!1,l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const c=({state:d,from:p,to:g,rule:O,pasteEvt:b})=>{const v=d.tr,x=Pg({state:d,transaction:v});if(!(!H4({editor:e,state:x,from:Math.max(p-1,0),to:g.b-1,rule:O,pasteEvent:b,dropEvent:o})||!v.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return t.map(d=>new yt({view(p){const g=b=>{var v;i=(v=p.dom.parentElement)!=null&&v.contains(b.target)?p.dom.parentElement:null,i&&(Wd=e)},O=()=>{Wd&&(Wd=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",O),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",O)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(s=i===p.dom.parentElement,o=g,!s){const O=Wd;O!=null&&O.isEditable&&setTimeout(()=>{const b=O.state.selection;b&&O.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(p,g)=>{var O;const b=(O=g.clipboardData)==null?void 0:O.getData("text/html");return l=g,r=!!(b!=null&&b.includes("data-pm-slice")),!1}}},appendTransaction:(p,g,O)=>{const b=p[0],v=b.getMeta("uiEvent")==="paste"&&!r,x=b.getMeta("uiEvent")==="drop"&&!s,k=b.getMeta("applyPasteRules"),C=!!k;if(!v&&!x&&!C)return;if(C){let{text:E}=k;typeof E=="string"?E=E:E=Cv(ne.from(E),O.schema);const{from:D}=k,$=D+E.length,H=Y4(E);return c({rule:d,state:O,from:D,to:{b:$},pasteEvt:H})}const A=g.doc.content.findDiffStart(O.doc.content),P=g.doc.content.findDiffEnd(O.doc.content);if(!(!I4(A)||!P||A===P.b))return c({rule:d,state:O,from:A,to:P,pasteEvt:l})}}))}var Bg=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=oP(n),this.schema=s4(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Pu(e.name,this.schema)},i=xe(e,"addCommands",t);return i?{...n,...i()}:n},{})}get plugins(){const{editor:n}=this;return ch([...this.extensions].reverse()).flatMap(i=>{const r={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:n,type:Pu(i.name,this.schema)},s=[],l=xe(i,"addKeyboardShortcuts",r);let o={};if(i.type==="mark"&&xe(i,"exitable",r)&&(o.ArrowRight=()=>Go.handleExit({editor:n,mark:i})),l){const g=Object.fromEntries(Object.entries(l()).map(([O,b])=>[O,()=>b({editor:n})]));o={...o,...g}}const c=aI(o);s.push(c);const h=xe(i,"addInputRules",r);if(AM(i,n.options.enableInputRules)&&h){const g=h();if(g&&g.length){const O=Z4({editor:n,rules:g}),b=Array.isArray(O)?O:[O];s.push(...b)}}const d=xe(i,"addPasteRules",r);if(AM(i,n.options.enablePasteRules)&&d){const g=d();if(g&&g.length){const O=U4({editor:n,rules:g});s.push(...O)}}const p=xe(i,"addProseMirrorPlugins",r);if(p){const g=p();s.push(...g)}return s})}get attributes(){return lP(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=fc(this.extensions);return Object.fromEntries(e.filter(t=>!!xe(t,"addNodeView")).map(t=>{const i=this.attributes.filter(c=>c.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Wt(t.name,this.schema)},s=xe(t,"addNodeView",r);if(!s)return[];const l=s();if(!l)return[];const o=(c,h,d,p,g)=>{const O=Nh(c,i);return l({node:c,view:h,getPos:d,decorations:p,innerDecorations:g,editor:n,extension:t,HTMLAttributes:O})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return ch([...this.extensions].reverse()).reduceRight((i,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Pu(r.name,this.schema)},l=xe(r,"dispatchTransaction",s);return l?o=>{l.call(s,{transaction:o,next:i})}:i},n)}transformPastedHTML(n){const{editor:e}=this;return ch([...this.extensions]).reduce((i,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Pu(r.name,this.schema)},l=xe(r,"transformPastedHTML",s);return l?(o,c)=>{const h=i(o,c);return l.call(s,h)}:i},n||(i=>i))}get markViews(){const{editor:n}=this,{markExtensions:e}=fc(this.extensions);return Object.fromEntries(e.filter(t=>!!xe(t,"addMarkView")).map(t=>{const i=this.attributes.filter(o=>o.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Ns(t.name,this.schema)},s=xe(t,"addMarkView",r);if(!s)return[];const l=(o,c,h)=>{const d=Nh(o,i);return s()({mark:o,view:c,inline:h,editor:n,extension:t,HTMLAttributes:d,updateAttributes:p=>{cV(o,n,p)}})};return[t.name,l]}))}destroy(){this.extensions.forEach(n=>{let e=n;for(;e.parent;){const t=e.parent;t.child===e&&(t.child=null),e=t}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const i={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Pu(e.name,this.schema)};e.type==="mark"&&((t=tt(xe(e,"keepOnSplit",i)))==null||t)&&this.splittableMarks.push(e.name);const r=xe(e,"onBeforeCreate",i),s=xe(e,"onCreate",i),l=xe(e,"onUpdate",i),o=xe(e,"onSelectionUpdate",i),c=xe(e,"onTransaction",i),h=xe(e,"onFocus",i),d=xe(e,"onBlur",i),p=xe(e,"onDestroy",i);r&&this.editor.on("beforeCreate",r),s&&this.editor.on("create",s),l&&this.editor.on("update",l),o&&this.editor.on("selectionUpdate",o),c&&this.editor.on("transaction",c),h&&this.editor.on("focus",h),d&&this.editor.on("blur",d),p&&this.editor.on("destroy",p)})}};Bg.resolve=oP;Bg.sort=ch;Bg.flatten=Tv;var W4={};vv(W4,{ClipboardTextSerializer:()=>bP,Commands:()=>SP,Delete:()=>vP,Drop:()=>xP,Editable:()=>kP,FocusEvents:()=>TP,Keymap:()=>CP,Paste:()=>AP,Tabindex:()=>MP,TextDirection:()=>QP,focusEventsPluginKey:()=>wP});var Et=class yP extends Qv{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new yP(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},bP=Et.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new yt({key:new Ct("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:i,selection:r}=e,{ranges:s}=r,l=Math.min(...s.map(d=>d.$from.pos)),o=Math.max(...s.map(d=>d.$to.pos)),c=Av(t);return aP(i,{from:l,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),SP=Et.create({name:"commands",addCommands(){return{...F2}}}),vP=Et.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,i,r;const s=()=>{var l,o,c,h;if((h=(c=(o=(l=this.editor.options.coreExtensionOptions)==null?void 0:l.delete)==null?void 0:o.filterTransaction)==null?void 0:c.call(o,n))!=null?h:n.getMeta("y-sync$"))return;const d=iP(n.before,[n,...e]);hP(d).forEach(O=>{d.mapping.mapResult(O.oldRange.from).deletedAfter&&d.mapping.mapResult(O.oldRange.to).deletedBefore&&d.before.nodesBetween(O.oldRange.from,O.oldRange.to,(b,v)=>{const x=v+b.nodeSize-2,k=O.oldRange.from<=v&&x<=O.oldRange.to;this.editor.emit("delete",{type:"node",node:b,from:v,to:x,newFrom:d.mapping.map(v),newTo:d.mapping.map(x),deletedRange:O.oldRange,newRange:O.newRange,partial:!k,editor:this.editor,transaction:n,combinedTransform:d})})});const g=d.mapping;d.steps.forEach((O,b)=>{var v,x;if(O instanceof ir){const k=g.slice(b).map(O.from,-1),C=g.slice(b).map(O.to),A=g.invert().map(k,-1),P=g.invert().map(C),E=k>0?(v=d.doc.nodeAt(k-1))==null?void 0:v.marks.some($=>$.eq(O.mark)):!1,D=(x=d.doc.nodeAt(C))==null?void 0:x.marks.some($=>$.eq(O.mark));this.editor.emit("delete",{type:"mark",mark:O.mark,from:O.from,to:O.to,deletedRange:{from:A,to:P},newRange:{from:k,to:C},partial:!!(D||E),editor:this.editor,transaction:n,combinedTransform:d})}})};(r=(i=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:i.async)==null||r?setTimeout(s,0):s()}}),xP=Et.create({name:"drop",addProseMirrorPlugins(){return[new yt({key:new Ct("tiptapDrop"),props:{handleDrop:(n,e,t,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:i})}}})]}}),kP=Et.create({name:"editable",addProseMirrorPlugins(){return[new yt({key:new Ct("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wP=new Ct("focusEvents"),TP=Et.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new yt({key:wP,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const i=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,t)=>{n.isFocused=!1;const i=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),CP=Et.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:o})=>{const{selection:c,doc:h}=o,{empty:d,$anchor:p}=c,{pos:g,parent:O}=p,b=p.parent.isTextblock&&g>0?o.doc.resolve(g-1):p,v=b.parent.type.spec.isolating,x=p.pos-p.parentOffset,k=v&&b.parent.childCount===1?x===p.pos:$e.atStart(h).from===g;return!d||!O.type.isTextblock||O.textContent.length||!k||k&&p.parent.type.name==="paragraph"?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},s={...i,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return om()||tP()?s:r},addProseMirrorPlugins(){return[new yt({key:new Ct("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(v=>v.getMeta("composition")))return;const i=n.some(v=>v.docChanged)&&!e.doc.eq(t.doc),r=n.some(v=>v.getMeta("preventClearDocument"));if(!i||r)return;const{empty:s,from:l,to:o}=e.selection,c=$e.atStart(e.doc).from,h=$e.atEnd(e.doc).to;if(s||!(l===c&&o===h)||!Lg(t.doc))return;const g=t.tr,O=Pg({state:t,transaction:g}),{commands:b}=new Dg({editor:this.editor,state:O});if(b.clearNodes(),!!g.steps.length)return g}})]}}),AP=Et.create({name:"paste",addProseMirrorPlugins(){return[new yt({key:new Ct("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),MP=Et.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new yt({key:new Ct("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!=null?n:"0"}}}})]}}),QP=Et.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=fc(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new yt({key:new Ct("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),G4=class Ku{constructor(e,t,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,i=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:t,to:i},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Ku(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ku(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ku(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,i)=>{const r=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,l=t.isInline,o=this.pos+i+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(o);if(!r&&!l&&c.depth<=this.depth)return;const h=new Ku(c,this.editor,r,r||l?t:null);r&&(h.actualDepth=this.depth+1),e.push(h)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(t).length>0){const s=r.node.attrs,l=Object.keys(t);for(let o=0;o<l.length;o+=1){const c=l[o];if(s[c]!==t[c])break}}else i=r;r=r.parent}return i}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const s=Object.keys(t);return this.children.forEach(l=>{i&&r.length>0||(l.node.type.name===e&&s.every(c=>t[c]===l.node.attrs[c])&&r.push(l),!(i&&r.length>0)&&(r=r.concat(l.querySelectorAll(e,t,i))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},F4=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;function K4(n,e,t){const i=document.querySelector("style[data-tiptap-style]");if(i!==null)return i;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r),r}var J4=class extends B4{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:i})=>{throw i},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:m4,createMappablePosition:g4},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:i,slice:r,moved:s})=>this.options.onDrop(i,r,s)),this.on("paste",({event:i,slice:r})=>this.options.onPaste(i,r)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=J2(e,this.options.autofocus);this.editorState=Kj.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=K4(F4,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=sP(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],i=this.state.reconfigure({plugins:t});return this.view.updateState(i),i}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(r=>{const s=typeof r=="string"?`${r}$`:r.key;t=t.filter(l=>!l.key.startsWith(s))}),e.length===t.length)return;const i=this.state.reconfigure({plugins:t});return this.view.updateState(i),i}createExtensionManager(){var n,e,t,i;const s=[...this.options.enableCoreExtensions?[kP,bP.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),SP,TP,CP,MP.configure({value:(i=(t=this.options.coreExtensionOptions)==null?void 0:t.tabindex)==null?void 0:i.value}),xP,AP,vP,QP.configure({direction:this.options.textDirection})].filter(l=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[l.name]!==!1:!0):[],...this.options.extensions].filter(l=>["extension","node","mark"].includes(l==null?void 0:l.type));this.extensionManager=new Bg(s,this)}createCommandManager(){this.commandManager=new Dg({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=w1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=w1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,i=e.dispatchTransaction||this.dispatchTransaction.bind(this),r=t?this.extensionManager.dispatchTransaction(i):i,s=e.transformPastedHTML,l=this.extensionManager.transformPastedHTML(s);this.editorView=new W2(n,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:r,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(h=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(h)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),i=!this.state.selection.eq(e.selection),r=t.includes(n),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!r)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:n});const l=t.findLast(h=>h.getMeta("focus")||h.getMeta("blur")),o=l==null?void 0:l.getMeta("focus"),c=l==null?void 0:l.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:l}),c&&this.emit("blur",{editor:this,event:c.event,transaction:l}),!(n.getMeta("preventUpdate")||!t.some(h=>h.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return uP(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,i=typeof n=="string"?e:n;return f4(this.state,t,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Cv(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`

`,textSerializers:t={}}=n||{};return cP(this.state.doc,{blockSeparator:e,textSerializers:{...Av(this.schema),...t}})}get isEmpty(){return Lg(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new G4(e,this)}get $doc(){return this.$pos(0)}};function dc(n){return new _g({find:n.find,handler:({state:e,range:t,match:i})=>{const r=tt(n.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:s}=e,l=i[i.length-1],o=i[0];if(l){const c=o.search(/\S/),h=t.from+o.indexOf(l),d=h+l.length;if(Mv(t.from,t.to,e.doc).filter(O=>O.mark.type.excluded.find(v=>v===n.type&&v!==O.mark.type)).filter(O=>O.to>h).length)return null;d<t.to&&s.delete(d,t.to),h>t.from&&s.delete(t.from+c,h);const g=t.from+c+l.length;s.addMark(t.from+c,g,n.type.create(r||{})),s.removeStoredMark(n.type)}},undoable:n.undoable})}function EP(n){return new _g({find:n.find,handler:({state:e,range:t,match:i})=>{const r=tt(n.getAttributes,void 0,i)||{},{tr:s}=e,l=t.from;let o=t.to;const c=n.type.create(r);if(i[1]){const h=i[0].lastIndexOf(i[1]);let d=l+h;d>o?d=o:o=d+i[1].length;const p=i[0][i[0].length-1];s.insertText(p,l+i[0].length-1),s.replaceWith(d,o,c)}else if(i[0]){const h=n.type.isInline?l:l-1;s.insert(h,n.type.create(r)).delete(s.mapping.map(l),s.mapping.map(o))}s.scrollIntoView()},undoable:n.undoable})}function C1(n){return new _g({find:n.find,handler:({state:e,range:t,match:i})=>{const r=e.doc.resolve(t.from),s=tt(n.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)},undoable:n.undoable})}function pc(n){return new _g({find:n.find,handler:({state:e,range:t,match:i,chain:r})=>{const s=tt(n.getAttributes,void 0,i)||{},l=e.tr.delete(t.from,t.to),c=l.doc.resolve(t.from).blockRange(),h=c&&rv(c,n.type,s);if(!h)return null;if(l.wrap(c,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:O}=n.editor.extensionManager,b=g||p.$to.parentOffset&&p.$from.marks();if(b){const v=b.filter(x=>O.includes(x.type.name));l.ensureMarks(v)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(p,s).run()}const d=l.doc.resolve(t.from-1).nodeBefore;d&&d.type===n.type&&Vl(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(i,d))&&l.join(t.from-1)},undoable:n.undoable})}var eV=n=>"touches"in n,tV=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.clientX-this.startX,h=o.clientY-this.startY;this.handleResize(c,h)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.touches[0];if(!c)return;const h=c.clientX-this.startX,d=c.clientY-this.startY;this.handleResize(h,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(o,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,i,r,s,l;this.node=n.node,this.editor=n.editor,this.element=n.element,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(e=n.options)!=null&&e.min&&(this.minSize={...this.minSize,...n.options.min}),(t=n.options)!=null&&t.max&&(this.maxSize=n.options.max),(i=n==null?void 0:n.options)!=null&&i.directions&&(this.directions=n.options.directions),(r=n.options)!=null&&r.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(s=n.options)!=null&&s.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),(l=n.options)!=null&&l.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!=null?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,e,t){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,e,t):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const e=document.createElement("div");return e.dataset.resizeHandle=n,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(n,e){const t=e.includes("top"),i=e.includes("bottom"),r=e.includes("left"),s=e.includes("right");t&&(n.style.top="0"),i&&(n.style.bottom="0"),r&&(n.style.left="0"),s&&(n.style.right="0"),(e==="top"||e==="bottom")&&(n.style.left="0",n.style.right="0"),(e==="left"||e==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{let e;this.createCustomHandle?e=this.createCustomHandle(n):e=this.createHandle(n),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${n}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(n)),this.createCustomHandle||this.positionHandle(e,n),e.addEventListener("mousedown",t=>this.handleResizeStart(t,n)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,n)),this.handleMap.set(n,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,e=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,e){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=e,eV(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:i,height:r}=this.calculateNewDimensions(this.activeHandle,n,e),s=this.applyConstraints(i,r,t);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(n,e,t){let i=this.startWidth,r=this.startHeight;const s=n.includes("right"),l=n.includes("left"),o=n.includes("bottom"),c=n.includes("top");return s?i=this.startWidth+e:l&&(i=this.startWidth-e),o?r=this.startHeight+t:c&&(r=this.startHeight-t),(n==="right"||n==="left")&&(i=this.startWidth+(s?e:-e)),(n==="top"||n==="bottom")&&(r=this.startHeight+(o?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(i,r,n):{width:i,height:r}}applyConstraints(n,e,t){var i,r,s,l;if(!t){let h=Math.max(this.minSize.width,n),d=Math.max(this.minSize.height,e);return(i=this.maxSize)!=null&&i.width&&(h=Math.min(this.maxSize.width,h)),(r=this.maxSize)!=null&&r.height&&(d=Math.min(this.maxSize.height,d)),{width:h,height:d}}let o=n,c=e;return o<this.minSize.width&&(o=this.minSize.width,c=o/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,o=c*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&o>this.maxSize.width&&(o=this.maxSize.width,c=o/this.aspectRatio),(l=this.maxSize)!=null&&l.height&&c>this.maxSize.height&&(c=this.maxSize.height,o=c*this.aspectRatio),{width:o,height:c}}applyAspectRatio(n,e,t){const i=t==="left"||t==="right",r=t==="top"||t==="bottom";return i?{width:n,height:n/this.aspectRatio}:r?{width:e*this.aspectRatio,height:e}:{width:n,height:n/this.aspectRatio}}};function nV(n,e){const{selection:t}=n,{$from:i}=t;if(t instanceof we){const s=i.index();return i.parent.canReplaceWith(s,s+1,e)}let r=i.depth;for(;r>=0;){const s=i.index(r);if(i.node(r).contentMatchAt(s).matchType(e))return!0;r-=1}return!1}var iV={};vv(iV,{createAtomBlockMarkdownSpec:()=>rV,createBlockMarkdownSpec:()=>sV,createInlineMarkdownSpec:()=>aV,parseAttributes:()=>Ev,parseIndentedBlocks:()=>A1,renderNestedMarkdownContent:()=>Rv,serializeAttributes:()=>$v});function Ev(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],i=n.replace(/["']([^"']*)["']/g,h=>(t.push(h),`__QUOTED_${t.length-1}__`)),r=i.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(r){const h=r.map(d=>d.trim().slice(1));e.class=h.join(" ")}const s=i.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const l=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(i.matchAll(l)).forEach(([,h,d])=>{var p;const g=parseInt(((p=d.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),O=t[g];O&&(e[h]=O.slice(1,-1))});const c=i.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function $v(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(i=>e.push(`.${i}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,i])=>{t==="class"||t==="id"||(i===!0?e.push(t):i!==!1&&i!=null&&e.push(`${t}="${String(i)}"`))}),e.join(" ")}function rV(n){const{nodeName:e,name:t,parseAttributes:i=Ev,serializeAttributes:r=$v,defaultAttributes:s={},requiredAttributes:l=[],allowedAttributes:o}=n,c=t||e,h=d=>{if(!o)return d;const p={};return o.forEach(g=>{g in d&&(p[g]=d[g])}),p};return{parseMarkdown:(d,p)=>{const g={...s,...d.attributes};return p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"block",start(d){var p;const g=new RegExp(`^:::${c}(?:\\s|$)`,"m"),O=(p=d.match(g))==null?void 0:p.index;return O!==void 0?O:-1},tokenize(d,p,g){const O=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),b=d.match(O);if(!b)return;const v=b[1]||"",x=i(v);if(!l.find(C=>!(C in x)))return{type:e,raw:b[0],attributes:x}}},renderMarkdown:d=>{const p=h(d.attrs||{}),g=r(p),O=g?` {${g}}`:"";return`:::${c}${O} :::`}}}function sV(n){const{nodeName:e,name:t,getContent:i,parseAttributes:r=Ev,serializeAttributes:s=$v,defaultAttributes:l={},content:o="block",allowedAttributes:c}=n,h=t||e,d=p=>{if(!c)return p;const g={};return c.forEach(O=>{O in p&&(g[O]=p[O])}),g};return{parseMarkdown:(p,g)=>{let O;if(i){const v=i(p);O=typeof v=="string"?[{type:"text",text:v}]:v}else o==="block"?O=g.parseChildren(p.tokens||[]):O=g.parseInline(p.tokens||[]);const b={...l,...p.attributes};return g.createNode(e,b,O)},markdownTokenizer:{name:e,level:"block",start(p){var g;const O=new RegExp(`^:::${h}`,"m"),b=(g=p.match(O))==null?void 0:g.index;return b!==void 0?b:-1},tokenize(p,g,O){var b;const v=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),x=p.match(v);if(!x)return;const[k,C=""]=x,A=r(C);let P=1;const E=k.length;let D="";const $=/^:::([\w-]*)(\s.*)?/gm,H=p.slice(E);for($.lastIndex=0;;){const W=$.exec(H);if(W===null)break;const te=W.index,ce=W[1];if(!((b=W[2])!=null&&b.endsWith(":::"))){if(ce)P+=1;else if(P-=1,P===0){const ie=H.slice(0,te);D=ie.trim();const ue=p.slice(0,E+te+W[0].length);let se=[];if(D)if(o==="block")for(se=O.blockTokens(ie),se.forEach(fe=>{fe.text&&(!fe.tokens||fe.tokens.length===0)&&(fe.tokens=O.inlineTokens(fe.text))});se.length>0;){const fe=se[se.length-1];if(fe.type==="paragraph"&&(!fe.text||fe.text.trim()===""))se.pop();else break}else se=O.inlineTokens(D);return{type:e,raw:ue,attributes:A,content:D,tokens:se}}}}}},renderMarkdown:(p,g)=>{const O=d(p.attrs||{}),b=s(O),v=b?` {${b}}`:"",x=g.renderChildren(p.content||[],`

`);return`:::${h}${v}

${x}

:::`}}}function lV(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let i=t.exec(n);for(;i!==null;){const[,r,s,l]=i;e[r]=s||l,i=t.exec(n)}return e}function oV(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function aV(n){const{nodeName:e,name:t,getContent:i,parseAttributes:r=lV,serializeAttributes:s=oV,defaultAttributes:l={},selfClosing:o=!1,allowedAttributes:c}=n,h=t||e,d=g=>{if(!c)return g;const O={};return c.forEach(b=>{const v=typeof b=="string"?b:b.name,x=typeof b=="string"?void 0:b.skipIfDefault;if(v in g){const k=g[v];if(x!==void 0&&k===x)return;O[v]=k}}),O},p=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,O)=>{const b={...l,...g.attributes};if(o)return O.createNode(e,b);const v=i?i(g):g.content||"";return v?O.createNode(e,b,[O.createTextNode(v)]):O.createNode(e,b,[])},markdownTokenizer:{name:e,level:"inline",start(g){const O=o?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),b=g.match(O),v=b==null?void 0:b.index;return v!==void 0?v:-1},tokenize(g,O,b){const v=o?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),x=g.match(v);if(!x)return;let k="",C="";if(o){const[,P]=x;C=P}else{const[,P,E]=x;C=P,k=E||""}const A=r(C.trim());return{type:e,raw:x[0],content:k.trim(),attributes:A}}},renderMarkdown:g=>{let O="";i?O=i(g):g.content&&g.content.length>0&&(O=g.content.filter(k=>k.type==="text").map(k=>k.text).join(""));const b=d(g.attrs||{}),v=s(b),x=v?` ${v}`:"";return o?`[${h}${x}]`:`[${h}${x}]${O}[/${h}]`}}}function A1(n,e,t){var i,r,s,l;const o=n.split(`
`),c=[];let h="",d=0;const p=e.baseIndentSize||2;for(;d<o.length;){const g=o[d],O=g.match(e.itemPattern);if(!O){if(c.length>0)break;if(g.trim()===""){d+=1,h=`${h}${g}
`;continue}else return}const b=e.extractItemData(O),{indentLevel:v,mainContent:x}=b;h=`${h}${g}
`;const k=[x];for(d+=1;d<o.length;){const E=o[d];if(E.trim()===""){const $=o.slice(d+1).findIndex(te=>te.trim()!=="");if($===-1)break;if((((r=(i=o[d+1+$].match(/^(\s*)/))==null?void 0:i[1])==null?void 0:r.length)||0)>v){k.push(E),h=`${h}${E}
`,d+=1;continue}else break}if((((l=(s=E.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:l.length)||0)>v)k.push(E),h=`${h}${E}
`,d+=1;else break}let C;const A=k.slice(1);if(A.length>0){const E=A.map(D=>D.slice(v+p)).join(`
`);E.trim()&&(e.customNestedParser?C=e.customNestedParser(E):C=t.blockTokens(E))}const P=e.createToken(b,C);c.push(P)}if(c.length!==0)return{items:c,raw:h}}function Rv(n,e,t,i){if(!n||!Array.isArray(n.content))return"";const r=typeof t=="function"?t(i):t,[s,...l]=n.content,o=e.renderChildren([s]);let c=`${r}${o}`;return l&&l.length>0&&l.forEach((h,d)=>{var p,g;const O=(g=(p=e.renderChild)==null?void 0:p.call(e,h,d+1))!=null?g:e.renderChildren([h]);if(O!=null){const b=O.split(`
`).map(v=>v?e.indent(v):e.indent("")).join(`
`);c+=h.type==="paragraph"?`

${b}`:`
${b}`}}),c}function cV(n,e,t={}){const{state:i}=e,{doc:r,tr:s}=i,l=n;r.descendants((o,c)=>{const h=s.mapping.map(c),d=s.mapping.map(c)+o.nodeSize;let p=null;if(o.marks.forEach(O=>{if(O!==l)return!1;p=O}),!p)return;let g=!1;if(Object.keys(t).forEach(O=>{t[O]!==p.attrs[O]&&(g=!0)}),g){const O=n.type.create({...n.attrs,...t});s.removeMark(h,d,n.type),s.addMark(h,d,O)}}),s.docChanged&&e.view.dispatch(s)}var an=class $P extends Qv{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new $P(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Zo(n){return new V4({find:n.find,handler:({state:e,range:t,match:i,pasteEvent:r})=>{const s=tt(n.getAttributes,void 0,i,r);if(s===!1||s===null)return null;const{tr:l}=e,o=i[i.length-1],c=i[0];let h=t.to;if(o){const d=c.search(/\S/),p=t.from+c.indexOf(o),g=p+o.length;if(Mv(t.from,t.to,e.doc).filter(v=>v.mark.type.excluded.find(k=>k===n.type&&k!==v.mark.type)).filter(v=>v.to>p).length)return null;g<t.to&&l.delete(g,t.to),p>t.from&&l.delete(t.from+d,p),h=t.from+d+o.length,l.addMark(t.from+d,h,n.type.create(s||{})),i.index!==void 0&&i.input!==void 0&&i.index+i[0].length>=i.input.length||l.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:uV,getOwnPropertySymbols:hV}=Object,{hasOwnProperty:fV}=Object.prototype;function Wy(n,e){return function(i,r,s){return n(i,r,s)&&e(i,r,s)}}function Gd(n){return function(t,i,r){if(!t||!i||typeof t!="object"||typeof i!="object")return n(t,i,r);const{cache:s}=r,l=s.get(t),o=s.get(i);if(l&&o)return l===i&&o===t;s.set(t,i),s.set(i,t);const c=n(t,i,r);return s.delete(t),s.delete(i),c}}function dV(n){return n!=null?n[Symbol.toStringTag]:void 0}function QM(n){return uV(n).concat(hV(n))}const pV=Object.hasOwn||((n,e)=>fV.call(n,e));function Fo(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const mV="__v",gV="__o",OV="_owner",{getOwnPropertyDescriptor:EM,keys:$M}=Object;function yV(n,e){return n.byteLength===e.byteLength&&am(new Uint8Array(n),new Uint8Array(e))}function bV(n,e,t){let i=n.length;if(e.length!==i)return!1;for(;i-- >0;)if(!t.equals(n[i],e[i],i,i,n,e,t))return!1;return!0}function SV(n,e){return n.byteLength===e.byteLength&&am(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function vV(n,e){return Fo(n.getTime(),e.getTime())}function xV(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function kV(n,e){return n===e}function RM(n,e,t){const i=n.size;if(i!==e.size)return!1;if(!i)return!0;const r=new Array(i),s=n.entries();let l,o,c=0;for(;(l=s.next())&&!l.done;){const h=e.entries();let d=!1,p=0;for(;(o=h.next())&&!o.done;){if(r[p]){p++;continue}const g=l.value,O=o.value;if(t.equals(g[0],O[0],c,p,n,e,t)&&t.equals(g[1],O[1],g[0],O[0],n,e,t)){d=r[p]=!0;break}p++}if(!d)return!1;c++}return!0}const wV=Fo;function TV(n,e,t){const i=$M(n);let r=i.length;if($M(e).length!==r)return!1;for(;r-- >0;)if(!RP(n,e,t,i[r]))return!1;return!0}function Du(n,e,t){const i=QM(n);let r=i.length;if(QM(e).length!==r)return!1;let s,l,o;for(;r-- >0;)if(s=i[r],!RP(n,e,t,s)||(l=EM(n,s),o=EM(e,s),(l||o)&&(!l||!o||l.configurable!==o.configurable||l.enumerable!==o.enumerable||l.writable!==o.writable)))return!1;return!0}function CV(n,e){return Fo(n.valueOf(),e.valueOf())}function AV(n,e){return n.source===e.source&&n.flags===e.flags}function PM(n,e,t){const i=n.size;if(i!==e.size)return!1;if(!i)return!0;const r=new Array(i),s=n.values();let l,o;for(;(l=s.next())&&!l.done;){const c=e.values();let h=!1,d=0;for(;(o=c.next())&&!o.done;){if(!r[d]&&t.equals(l.value,o.value,l.value,o.value,n,e,t)){h=r[d]=!0;break}d++}if(!h)return!1}return!0}function am(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function MV(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function RP(n,e,t,i){return(i===OV||i===gV||i===mV)&&(n.$$typeof||e.$$typeof)?!0:pV(e,i)&&t.equals(n[i],e[i],i,i,n,e,t)}const QV="[object ArrayBuffer]",EV="[object Arguments]",$V="[object Boolean]",RV="[object DataView]",PV="[object Date]",DV="[object Error]",NV="[object Map]",zV="[object Number]",LV="[object Object]",_V="[object RegExp]",BV="[object Set]",jV="[object String]",ZV={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},XV="[object URL]",IV=Object.prototype.toString;function VV({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:i,areErrorsEqual:r,areFunctionsEqual:s,areMapsEqual:l,areNumbersEqual:o,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:d,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:O,unknownTagComparators:b}){return function(x,k,C){if(x===k)return!0;if(x==null||k==null)return!1;const A=typeof x;if(A!==typeof k)return!1;if(A!=="object")return A==="number"?o(x,k,C):A==="function"?s(x,k,C):!1;const P=x.constructor;if(P!==k.constructor)return!1;if(P===Object)return c(x,k,C);if(Array.isArray(x))return e(x,k,C);if(P===Date)return i(x,k,C);if(P===RegExp)return d(x,k,C);if(P===Map)return l(x,k,C);if(P===Set)return p(x,k,C);const E=IV.call(x);if(E===PV)return i(x,k,C);if(E===_V)return d(x,k,C);if(E===NV)return l(x,k,C);if(E===BV)return p(x,k,C);if(E===LV)return typeof x.then!="function"&&typeof k.then!="function"&&c(x,k,C);if(E===XV)return O(x,k,C);if(E===DV)return r(x,k,C);if(E===EV)return c(x,k,C);if(ZV[E])return g(x,k,C);if(E===QV)return n(x,k,C);if(E===RV)return t(x,k,C);if(E===$V||E===zV||E===jV)return h(x,k,C);if(b){let D=b[E];if(!D){const $=dV(x);$&&(D=b[$])}if(D)return D(x,k,C)}return!1}}function qV({circular:n,createCustomConfig:e,strict:t}){let i={areArrayBuffersEqual:yV,areArraysEqual:t?Du:bV,areDataViewsEqual:SV,areDatesEqual:vV,areErrorsEqual:xV,areFunctionsEqual:kV,areMapsEqual:t?Wy(RM,Du):RM,areNumbersEqual:wV,areObjectsEqual:t?Du:TV,arePrimitiveWrappersEqual:CV,areRegExpsEqual:AV,areSetsEqual:t?Wy(PM,Du):PM,areTypedArraysEqual:t?Wy(am,Du):am,areUrlsEqual:MV,unknownTagComparators:void 0};if(e&&(i=Object.assign({},i,e(i))),n){const r=Gd(i.areArraysEqual),s=Gd(i.areMapsEqual),l=Gd(i.areObjectsEqual),o=Gd(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:r,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:o})}return i}function HV(n){return function(e,t,i,r,s,l,o){return n(e,t,o)}}function YV({circular:n,comparator:e,createState:t,equals:i,strict:r}){if(t)return function(o,c){const{cache:h=n?new WeakMap:void 0,meta:d}=t();return e(o,c,{cache:h,equals:i,meta:d,strict:r})};if(n)return function(o,c){return e(o,c,{cache:new WeakMap,equals:i,meta:void 0,strict:r})};const s={cache:void 0,equals:i,meta:void 0,strict:r};return function(o,c){return e(o,c,s)}}const UV=Hl();Hl({strict:!0});Hl({circular:!0});Hl({circular:!0,strict:!0});Hl({createInternalComparator:()=>Fo});Hl({strict:!0,createInternalComparator:()=>Fo});Hl({circular:!0,createInternalComparator:()=>Fo});Hl({circular:!0,createInternalComparator:()=>Fo,strict:!0});function Hl(n={}){const{circular:e=!1,createInternalComparator:t,createState:i,strict:r=!1}=n,s=qV(n),l=VV(s),o=t?t(l):HV(l);return YV({circular:e,comparator:l,createState:i,equals:o,strict:r})}var Gy={exports:{}},Fy={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var DM;function WV(){if(DM)return Fy;DM=1;var n=uf(),e=bR();function t(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=n.useRef,l=n.useEffect,o=n.useMemo,c=n.useDebugValue;return Fy.useSyncExternalStoreWithSelector=function(h,d,p,g,O){var b=s(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=o(function(){function k(D){if(!C){if(C=!0,A=D,D=g(D),O!==void 0&&v.hasValue){var $=v.value;if(O($,D))return P=$}return P=D}if($=P,i(A,D))return $;var H=g(D);return O!==void 0&&O($,H)?(A=D,$):(A=D,P=H)}var C=!1,A,P,E=p===void 0?null:p;return[function(){return k(d())},E===null?void 0:function(){return k(E())}]},[d,p,g,O]);var x=r(h,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=x},[x]),c(x),x},Fy}var NM;function GV(){return NM||(NM=1,Gy.exports=WV()),Gy.exports}var FV=GV(),KV=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},JV=({contentComponent:n})=>{const e=SR.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return L.jsx(L.Fragment,{children:Object.values(e)})};function eq(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,i){e={...e,[t]:tj.createPortal(i.reactElement,i.element,t)},n.forEach(r=>r())},removeRenderer(t){const i={...e};delete i[t],e=i,n.forEach(r=>r())}}}var tq=class extends Ae.Component{constructor(n){super(n),this.editorContentRef=Ae.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const e=this.props.editor;if(e&&!e.isDestroyed&&((n=e.view.dom)!=null&&n.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=eq(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var n;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return L.jsxs(L.Fragment,{children:[L.jsx("div",{ref:KV(e,this.editorContentRef),...t}),(n==null?void 0:n.contentComponent)&&L.jsx(JV,{contentComponent:n.contentComponent})]})}},nq=Ee.forwardRef((n,e)=>{const t=Ae.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return Ae.createElement(tq,{key:t,innerRef:e,...n})}),PP=Ae.memo(nq),iq=typeof window<"u"?Ee.useLayoutEffect:Ee.useEffect,rq=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function sq(n){var e;const[t]=Ee.useState(()=>new rq(n.editor)),i=FV.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:UV);return iq(()=>t.watch(n.editor),[n.editor,t]),Ee.useDebugValue(i),i}var lq=!1,M1=typeof window>"u",oq=M1||!!(typeof window<"u"&&window.next),aq=class DP{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?M1||oq?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...i)=>{var r,s;return(s=(r=this.options.current).onBeforeCreate)==null?void 0:s.call(r,...i)},onBlur:(...i)=>{var r,s;return(s=(r=this.options.current).onBlur)==null?void 0:s.call(r,...i)},onCreate:(...i)=>{var r,s;return(s=(r=this.options.current).onCreate)==null?void 0:s.call(r,...i)},onDestroy:(...i)=>{var r,s;return(s=(r=this.options.current).onDestroy)==null?void 0:s.call(r,...i)},onFocus:(...i)=>{var r,s;return(s=(r=this.options.current).onFocus)==null?void 0:s.call(r,...i)},onSelectionUpdate:(...i)=>{var r,s;return(s=(r=this.options.current).onSelectionUpdate)==null?void 0:s.call(r,...i)},onTransaction:(...i)=>{var r,s;return(s=(r=this.options.current).onTransaction)==null?void 0:s.call(r,...i)},onUpdate:(...i)=>{var r,s;return(s=(r=this.options.current).onUpdate)==null?void 0:s.call(r,...i)},onContentError:(...i)=>{var r,s;return(s=(r=this.options.current).onContentError)==null?void 0:s.call(r,...i)},onDrop:(...i)=>{var r,s;return(s=(r=this.options.current).onDrop)==null?void 0:s.call(r,...i)},onPaste:(...i)=>{var r,s;return(s=(r=this.options.current).onPaste)==null?void 0:s.call(r,...i)},onDelete:(...i)=>{var r,s;return(s=(r=this.options.current).onDelete)==null?void 0:s.call(r,...i)}};return new J4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(i=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(i)?!0:i==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((r,s)=>{var l;return r===((l=t.extensions)==null?void 0:l[s])}):e[i]===t[i])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?DP.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((i,r)=>i===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function cq(n={},e=[]){const t=Ee.useRef(n);t.current=n;const[i]=Ee.useState(()=>new aq(t)),r=SR.useSyncExternalStore(i.subscribe,i.getEditor,i.getServerSnapshot);return Ee.useDebugValue(r),Ee.useEffect(i.onRender(e)),sq({editor:r,selector:({transactionNumber:s})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&s===0?0:s+1}),r}var Pv=Ee.createContext({editor:null});Pv.Consumer;var NP=()=>Ee.useContext(Pv),uq=Ee.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),hq=()=>Ee.useContext(uq);Ae.forwardRef((n,e)=>{const{onDragStart:t}=hq(),i=n.as||"div";return L.jsx(i,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});Ae.createContext({markViewContentRef:()=>{}});var Dv=Ee.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Dv.displayName="TiptapContext";var fq=()=>Ee.useContext(Dv);function zP({editor:n,instance:e,children:t}){const i=n??e;if(!i)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=Ee.useMemo(()=>({editor:i}),[i]),s=Ee.useMemo(()=>({editor:i}),[i]);return L.jsx(Pv.Provider,{value:s,children:L.jsx(Dv.Provider,{value:r,children:t})})}zP.displayName="Tiptap";function LP({...n}){const{editor:e}=fq();return L.jsx(PP,{editor:e,...n})}LP.displayName="Tiptap.Content";Object.assign(zP,{Content:LP});const _P=["top","right","bottom","left"],zM=["start","end"],LM=_P.reduce((n,e)=>n.concat(e,e+"-"+zM[0],e+"-"+zM[1]),[]),Ir=Math.min,Nn=Math.max,cm=Math.round,_r=n=>({x:n,y:n}),dq={left:"right",right:"left",bottom:"top",top:"bottom"};function Q1(n,e,t){return Nn(n,Ir(e,t))}function zs(n,e){return typeof n=="function"?n(e):n}function Hi(n){return n.split("-")[0]}function sr(n){return n.split("-")[1]}function BP(n){return n==="x"?"y":"x"}function Nv(n){return n==="y"?"height":"width"}function Pr(n){const e=n[0];return e==="t"||e==="b"?"y":"x"}function zv(n){return BP(Pr(n))}function jP(n,e,t){t===void 0&&(t=!1);const i=sr(n),r=zv(n),s=Nv(r);let l=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=hm(l)),[l,hm(l)]}function pq(n){const e=hm(n);return[um(n),e,um(e)]}function um(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const _M=["left","right"],BM=["right","left"],mq=["top","bottom"],gq=["bottom","top"];function Oq(n,e,t){switch(n){case"top":case"bottom":return t?e?BM:_M:e?_M:BM;case"left":case"right":return e?mq:gq;default:return[]}}function yq(n,e,t,i){const r=sr(n);let s=Oq(Hi(n),t==="start",i);return r&&(s=s.map(l=>l+"-"+r),e&&(s=s.concat(s.map(um)))),s}function hm(n){const e=Hi(n);return dq[e]+n.slice(e.length)}function bq(n){return{top:0,right:0,bottom:0,left:0,...n}}function Lv(n){return typeof n!="number"?bq(n):{top:n,right:n,bottom:n,left:n}}function mc(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function jM(n,e,t){let{reference:i,floating:r}=n;const s=Pr(e),l=zv(e),o=Nv(l),c=Hi(e),h=s==="y",d=i.x+i.width/2-r.width/2,p=i.y+i.height/2-r.height/2,g=i[o]/2-r[o]/2;let O;switch(c){case"top":O={x:d,y:i.y-r.height};break;case"bottom":O={x:d,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:p};break;case"left":O={x:i.x-r.width,y:p};break;default:O={x:i.x,y:i.y}}switch(sr(e)){case"start":O[l]-=g*(t&&h?-1:1);break;case"end":O[l]+=g*(t&&h?-1:1);break}return O}async function Sq(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:l,elements:o,strategy:c}=n,{boundary:h="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:g=!1,padding:O=0}=zs(e,n),b=Lv(O),x=o[g?p==="floating"?"reference":"floating":p],k=mc(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(x)))==null||t?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:h,rootBoundary:d,strategy:c})),C=p==="floating"?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),P=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},E=mc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:C,offsetParent:A,strategy:c}):C);return{top:(k.top-E.top+b.top)/P.y,bottom:(E.bottom-k.bottom+b.bottom)/P.y,left:(k.left-E.left+b.left)/P.x,right:(E.right-k.right+b.right)/P.x}}const vq=50,xq=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l}=t,o=l.detectOverflow?l:{...l,detectOverflow:Sq},c=await(l.isRTL==null?void 0:l.isRTL(e));let h=await l.getElementRects({reference:n,floating:e,strategy:r}),{x:d,y:p}=jM(h,i,c),g=i,O=0;const b={};for(let v=0;v<s.length;v++){const x=s[v];if(!x)continue;const{name:k,fn:C}=x,{x:A,y:P,data:E,reset:D}=await C({x:d,y:p,initialPlacement:i,placement:g,strategy:r,middlewareData:b,rects:h,platform:o,elements:{reference:n,floating:e}});d=A??d,p=P??p,b[k]={...b[k],...E},D&&O<vq&&(O++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(h=D.rects===!0?await l.getElementRects({reference:n,floating:e,strategy:r}):D.rects),{x:d,y:p}=jM(h,g,c)),v=-1)}return{x:d,y:p,placement:g,strategy:r,middlewareData:b}},kq=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:l,elements:o,middlewareData:c}=e,{element:h,padding:d=0}=zs(n,e)||{};if(h==null)return{};const p=Lv(d),g={x:t,y:i},O=zv(r),b=Nv(O),v=await l.getDimensions(h),x=O==="y",k=x?"top":"left",C=x?"bottom":"right",A=x?"clientHeight":"clientWidth",P=s.reference[b]+s.reference[O]-g[O]-s.floating[b],E=g[O]-s.reference[O],D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let $=D?D[A]:0;(!$||!await(l.isElement==null?void 0:l.isElement(D)))&&($=o.floating[A]||s.floating[b]);const H=P/2-E/2,W=$/2-v[b]/2-1,te=Ir(p[k],W),ce=Ir(p[C],W),ie=te,ue=$-v[b]-ce,se=$/2-v[b]/2+H,fe=Q1(ie,se,ue),B=!c.arrow&&sr(r)!=null&&se!==fe&&s.reference[b]/2-(se<ie?te:ce)-v[b]/2<0,G=B?se<ie?se-ie:se-ue:0;return{[O]:g[O]+G,data:{[O]:fe,centerOffset:se-fe-G,...B&&{alignmentOffset:G}},reset:B}}});function wq(n,e,t){return(n?[...t.filter(r=>sr(r)===n),...t.filter(r=>sr(r)!==n)]:t.filter(r=>Hi(r)===r)).filter(r=>n?sr(r)===n||(e?um(r)!==r:!1):!0)}const Tq=function(n){return n===void 0&&(n={}),{name:"autoPlacement",options:n,async fn(e){var t,i,r;const{rects:s,middlewareData:l,placement:o,platform:c,elements:h}=e,{crossAxis:d=!1,alignment:p,allowedPlacements:g=LM,autoAlignment:O=!0,...b}=zs(n,e),v=p!==void 0||g===LM?wq(p||null,O,g):g,x=await c.detectOverflow(e,b),k=((t=l.autoPlacement)==null?void 0:t.index)||0,C=v[k];if(C==null)return{};const A=jP(C,s,await(c.isRTL==null?void 0:c.isRTL(h.floating)));if(o!==C)return{reset:{placement:v[0]}};const P=[x[Hi(C)],x[A[0]],x[A[1]]],E=[...((i=l.autoPlacement)==null?void 0:i.overflows)||[],{placement:C,overflows:P}],D=v[k+1];if(D)return{data:{index:k+1,overflows:E},reset:{placement:D}};const $=E.map(te=>{const ce=sr(te.placement);return[te.placement,ce&&d?te.overflows.slice(0,2).reduce((ie,ue)=>ie+ue,0):te.overflows[0],te.overflows]}).sort((te,ce)=>te[1]-ce[1]),W=((r=$.filter(te=>te[2].slice(0,sr(te[0])?2:3).every(ce=>ce<=0))[0])==null?void 0:r[0])||$[0][0];return W!==o?{data:{index:k+1,overflows:E},reset:{placement:W}}:{}}}},Cq=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:s,rects:l,initialPlacement:o,platform:c,elements:h}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...x}=zs(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const k=Hi(r),C=Pr(o),A=Hi(o)===o,P=await(c.isRTL==null?void 0:c.isRTL(h.floating)),E=g||(A||!v?[hm(o)]:pq(o)),D=b!=="none";!g&&D&&E.push(...yq(o,v,b,P));const $=[o,...E],H=await c.detectOverflow(e,x),W=[];let te=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&W.push(H[k]),p){const se=jP(r,l,P);W.push(H[se[0]],H[se[1]])}if(te=[...te,{placement:r,overflows:W}],!W.every(se=>se<=0)){var ce,ie;const se=(((ce=s.flip)==null?void 0:ce.index)||0)+1,fe=$[se];if(fe&&(!(p==="alignment"?C!==Pr(fe):!1)||te.every(he=>Pr(he.placement)===C?he.overflows[0]>0:!0)))return{data:{index:se,overflows:te},reset:{placement:fe}};let B=(ie=te.filter(G=>G.overflows[0]<=0).sort((G,he)=>G.overflows[1]-he.overflows[1])[0])==null?void 0:ie.placement;if(!B)switch(O){case"bestFit":{var ue;const G=(ue=te.filter(he=>{if(D){const z=Pr(he.placement);return z===C||z==="y"}return!0}).map(he=>[he.placement,he.overflows.filter(z=>z>0).reduce((z,J)=>z+J,0)]).sort((he,z)=>he[1]-z[1])[0])==null?void 0:ue[0];G&&(B=G);break}case"initialPlacement":B=o;break}if(r!==B)return{reset:{placement:B}}}return{}}}};function ZM(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function XM(n){return _P.some(e=>n[e]>=0)}const Aq=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:i}=e,{strategy:r="referenceHidden",...s}=zs(n,e);switch(r){case"referenceHidden":{const l=await i.detectOverflow(e,{...s,elementContext:"reference"}),o=ZM(l,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:XM(o)}}}case"escaped":{const l=await i.detectOverflow(e,{...s,altBoundary:!0}),o=ZM(l,t.floating);return{data:{escapedOffsets:o,escaped:XM(o)}}}default:return{}}}}};function ZP(n){const e=Ir(...n.map(s=>s.left)),t=Ir(...n.map(s=>s.top)),i=Nn(...n.map(s=>s.right)),r=Nn(...n.map(s=>s.bottom));return{x:e,y:t,width:i-e,height:r-t}}function Mq(n){const e=n.slice().sort((r,s)=>r.y-s.y),t=[];let i=null;for(let r=0;r<e.length;r++){const s=e[r];!i||s.y-i.y>i.height/2?t.push([s]):t[t.length-1].push(s),i=s}return t.map(r=>mc(ZP(r)))}const Qq=function(n){return n===void 0&&(n={}),{name:"inline",options:n,async fn(e){const{placement:t,elements:i,rects:r,platform:s,strategy:l}=e,{padding:o=2,x:c,y:h}=zs(n,e),d=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(i.reference))||[]),p=Mq(d),g=mc(ZP(d)),O=Lv(o);function b(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&h!=null)return p.find(x=>c>x.left-O.left&&c<x.right+O.right&&h>x.top-O.top&&h<x.bottom+O.bottom)||g;if(p.length>=2){if(Pr(t)==="y"){const te=p[0],ce=p[p.length-1],ie=Hi(t)==="top",ue=te.top,se=ce.bottom,fe=ie?te.left:ce.left,B=ie?te.right:ce.right,G=B-fe,he=se-ue;return{top:ue,bottom:se,left:fe,right:B,width:G,height:he,x:fe,y:ue}}const x=Hi(t)==="left",k=Nn(...p.map(te=>te.right)),C=Ir(...p.map(te=>te.left)),A=p.filter(te=>x?te.left===C:te.right===k),P=A[0].top,E=A[A.length-1].bottom,D=C,$=k,H=$-D,W=E-P;return{top:P,bottom:E,left:D,right:$,width:H,height:W,x:D,y:P}}return g}const v=await s.getElementRects({reference:{getBoundingClientRect:b},floating:i.floating,strategy:l});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Eq=new Set(["left","top"]);async function $q(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),l=Hi(t),o=sr(t),c=Pr(t)==="y",h=Eq.has(l)?-1:1,d=s&&c?-1:1,p=zs(e,n);let{mainAxis:g,crossAxis:O,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof b=="number"&&(O=o==="end"?b*-1:b),c?{x:O*d,y:g*h}:{x:g*h,y:O*d}}const Rq=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:l,middlewareData:o}=e,c=await $q(e,n);return l===((t=o.offset)==null?void 0:t.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:l}}}}},Pq=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r,platform:s}=e,{mainAxis:l=!0,crossAxis:o=!1,limiter:c={fn:k=>{let{x:C,y:A}=k;return{x:C,y:A}}},...h}=zs(n,e),d={x:t,y:i},p=await s.detectOverflow(e,h),g=Pr(Hi(r)),O=BP(g);let b=d[O],v=d[g];if(l){const k=O==="y"?"top":"left",C=O==="y"?"bottom":"right",A=b+p[k],P=b-p[C];b=Q1(A,b,P)}if(o){const k=g==="y"?"top":"left",C=g==="y"?"bottom":"right",A=v+p[k],P=v-p[C];v=Q1(A,v,P)}const x=c.fn({...e,[O]:b,[g]:v});return{...x,data:{x:x.x-t,y:x.y-i,enabled:{[O]:l,[g]:o}}}}}},Dq=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:l,elements:o}=e,{apply:c=()=>{},...h}=zs(n,e),d=await l.detectOverflow(e,h),p=Hi(r),g=sr(r),O=Pr(r)==="y",{width:b,height:v}=s.floating;let x,k;p==="top"||p==="bottom"?(x=p,k=g===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(k=p,x=g==="end"?"top":"bottom");const C=v-d.top-d.bottom,A=b-d.left-d.right,P=Ir(v-d[x],C),E=Ir(b-d[k],A),D=!e.middlewareData.shift;let $=P,H=E;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(H=A),(i=e.middlewareData.shift)!=null&&i.enabled.y&&($=C),D&&!g){const te=Nn(d.left,0),ce=Nn(d.right,0),ie=Nn(d.top,0),ue=Nn(d.bottom,0);O?H=b-2*(te!==0||ce!==0?te+ce:Nn(d.left,d.right)):$=v-2*(ie!==0||ue!==0?ie+ue:Nn(d.top,d.bottom))}await c({...e,availableWidth:H,availableHeight:$});const W=await l.getDimensions(o.floating);return b!==W.width||v!==W.height?{reset:{rects:!0}}:{}}}};function jg(){return typeof window<"u"}function Ec(n){return XP(n)?(n.nodeName||"").toLowerCase():"#document"}function vi(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Ls(n){var e;return(e=(XP(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function XP(n){return jg()?n instanceof Node||n instanceof vi(n).Node:!1}function lr(n){return jg()?n instanceof Element||n instanceof vi(n).Element:!1}function _s(n){return jg()?n instanceof HTMLElement||n instanceof vi(n).HTMLElement:!1}function IM(n){return!jg()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof vi(n).ShadowRoot}function pf(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=or(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&r!=="inline"&&r!=="contents"}function Nq(n){return/^(table|td|th)$/.test(Ec(n))}function Zg(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const zq=/transform|translate|scale|rotate|perspective|filter/,Lq=/paint|layout|strict|content/,mo=n=>!!n&&n!=="none";let Ky;function _v(n){const e=lr(n)?or(n):n;return mo(e.transform)||mo(e.translate)||mo(e.scale)||mo(e.rotate)||mo(e.perspective)||!Bv()&&(mo(e.backdropFilter)||mo(e.filter))||zq.test(e.willChange||"")||Lq.test(e.contain||"")}function _q(n){let e=Ll(n);for(;_s(e)&&!gc(e);){if(_v(e))return e;if(Zg(e))return null;e=Ll(e)}return null}function Bv(){return Ky==null&&(Ky=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ky}function gc(n){return/^(html|body|#document)$/.test(Ec(n))}function or(n){return vi(n).getComputedStyle(n)}function Xg(n){return lr(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ll(n){if(Ec(n)==="html")return n;const e=n.assignedSlot||n.parentNode||IM(n)&&n.host||Ls(n);return IM(e)?e.host:e}function IP(n){const e=Ll(n);return gc(e)?n.ownerDocument?n.ownerDocument.body:n.body:_s(e)&&pf(e)?e:IP(e)}function VP(n,e,t){var i;e===void 0&&(e=[]);const r=IP(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),l=vi(r);return s?(E1(l),e.concat(l,l.visualViewport||[],pf(r)?r:[],[])):e.concat(r,VP(r,[]))}function E1(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function qP(n){const e=or(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=_s(n),s=r?n.offsetWidth:t,l=r?n.offsetHeight:i,o=cm(t)!==s||cm(i)!==l;return o&&(t=s,i=l),{width:t,height:i,$:o}}function HP(n){return lr(n)?n:n.contextElement}function Ja(n){const e=HP(n);if(!_s(e))return _r(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=qP(e);let l=(s?cm(t.width):t.width)/i,o=(s?cm(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const Bq=_r(0);function YP(n){const e=vi(n);return!Bv()||!e.visualViewport?Bq:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jq(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==vi(n)?!1:e}function zh(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=HP(n);let l=_r(1);e&&(i?lr(i)&&(l=Ja(i)):l=Ja(n));const o=jq(s,t,i)?YP(s):_r(0);let c=(r.left+o.x)/l.x,h=(r.top+o.y)/l.y,d=r.width/l.x,p=r.height/l.y;if(s){const g=vi(s),O=i&&lr(i)?vi(i):i;let b=g,v=E1(b);for(;v&&i&&O!==b;){const x=Ja(v),k=v.getBoundingClientRect(),C=or(v),A=k.left+(v.clientLeft+parseFloat(C.paddingLeft))*x.x,P=k.top+(v.clientTop+parseFloat(C.paddingTop))*x.y;c*=x.x,h*=x.y,d*=x.x,p*=x.y,c+=A,h+=P,b=vi(v),v=E1(b)}}return mc({width:d,height:p,x:c,y:h})}function Ig(n,e){const t=Xg(n).scrollLeft;return e?e.left+t:zh(Ls(n)).left+t}function UP(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-Ig(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function Zq(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",l=Ls(i),o=e?Zg(e.floating):!1;if(i===l||o&&s)return t;let c={scrollLeft:0,scrollTop:0},h=_r(1);const d=_r(0),p=_s(i);if((p||!p&&!s)&&((Ec(i)!=="body"||pf(l))&&(c=Xg(i)),p)){const O=zh(i);h=Ja(i),d.x=O.x+i.clientLeft,d.y=O.y+i.clientTop}const g=l&&!p&&!s?UP(l,c):_r(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-c.scrollLeft*h.x+d.x+g.x,y:t.y*h.y-c.scrollTop*h.y+d.y+g.y}}function Xq(n){return Array.from(n.getClientRects())}function Iq(n){const e=Ls(n),t=Xg(n),i=n.ownerDocument.body,r=Nn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Nn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-t.scrollLeft+Ig(n);const o=-t.scrollTop;return or(i).direction==="rtl"&&(l+=Nn(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:l,y:o}}const VM=25;function Vq(n,e){const t=vi(n),i=Ls(n),r=t.visualViewport;let s=i.clientWidth,l=i.clientHeight,o=0,c=0;if(r){s=r.width,l=r.height;const d=Bv();(!d||d&&e==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}const h=Ig(i);if(h<=0){const d=i.ownerDocument,p=d.body,g=getComputedStyle(p),O=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(i.clientWidth-p.clientWidth-O);b<=VM&&(s-=b)}else h<=VM&&(s+=h);return{width:s,height:l,x:o,y:c}}function qq(n,e){const t=zh(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=_s(n)?Ja(n):_r(1),l=n.clientWidth*s.x,o=n.clientHeight*s.y,c=r*s.x,h=i*s.y;return{width:l,height:o,x:c,y:h}}function qM(n,e,t){let i;if(e==="viewport")i=Vq(n,t);else if(e==="document")i=Iq(Ls(n));else if(lr(e))i=qq(e,t);else{const r=YP(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return mc(i)}function WP(n,e){const t=Ll(n);return t===e||!lr(t)||gc(t)?!1:or(t).position==="fixed"||WP(t,e)}function Hq(n,e){const t=e.get(n);if(t)return t;let i=VP(n,[]).filter(o=>lr(o)&&Ec(o)!=="body"),r=null;const s=or(n).position==="fixed";let l=s?Ll(n):n;for(;lr(l)&&!gc(l);){const o=or(l),c=_v(l);!c&&o.position==="fixed"&&(r=null),(s?!c&&!r:!c&&o.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||pf(l)&&!c&&WP(n,l))?i=i.filter(d=>d!==l):r=o,l=Ll(l)}return e.set(n,i),i}function Yq(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const l=[...t==="clippingAncestors"?Zg(e)?[]:Hq(e,this._c):[].concat(t),i],o=qM(e,l[0],r);let c=o.top,h=o.right,d=o.bottom,p=o.left;for(let g=1;g<l.length;g++){const O=qM(e,l[g],r);c=Nn(O.top,c),h=Ir(O.right,h),d=Ir(O.bottom,d),p=Nn(O.left,p)}return{width:h-p,height:d-c,x:p,y:c}}function Uq(n){const{width:e,height:t}=qP(n);return{width:e,height:t}}function Wq(n,e,t){const i=_s(e),r=Ls(e),s=t==="fixed",l=zh(n,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=_r(0);function h(){c.x=Ig(r)}if(i||!i&&!s)if((Ec(e)!=="body"||pf(r))&&(o=Xg(e)),i){const O=zh(e,!0,s,e);c.x=O.x+e.clientLeft,c.y=O.y+e.clientTop}else r&&h();s&&!i&&r&&h();const d=r&&!i&&!s?UP(r,o):_r(0),p=l.left+o.scrollLeft-c.x-d.x,g=l.top+o.scrollTop-c.y-d.y;return{x:p,y:g,width:l.width,height:l.height}}function Jy(n){return or(n).position==="static"}function HM(n,e){if(!_s(n)||or(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Ls(n)===t&&(t=t.ownerDocument.body),t}function GP(n,e){const t=vi(n);if(Zg(n))return t;if(!_s(n)){let r=Ll(n);for(;r&&!gc(r);){if(lr(r)&&!Jy(r))return r;r=Ll(r)}return t}let i=HM(n,e);for(;i&&Nq(i)&&Jy(i);)i=HM(i,e);return i&&gc(i)&&Jy(i)&&!_v(i)?t:i||_q(n)||t}const Gq=async function(n){const e=this.getOffsetParent||GP,t=this.getDimensions,i=await t(n.floating);return{reference:Wq(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Fq(n){return or(n).direction==="rtl"}const Kq={convertOffsetParentRelativeRectToViewportRelativeRect:Zq,getDocumentElement:Ls,getClippingRect:Yq,getOffsetParent:GP,getElementRects:Gq,getClientRects:Xq,getDimensions:Uq,getScale:Ja,isElement:lr,isRTL:Fq},FP=Rq,KP=Tq,JP=Pq,eD=Cq,tD=Dq,nD=Aq,iD=kq,rD=Qq,sD=(n,e,t)=>{const i=new Map,r={platform:Kq,...t},s={...r.platform,_c:i};return xq(n,e,{...r,platform:s})};let $1,R1;if(typeof WeakMap<"u"){let n=new WeakMap;$1=e=>n.get(e),R1=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;$1=i=>{for(let r=0;r<n.length;r+=2)if(n[r]==i)return n[r+1]},R1=(i,r)=>(t==10&&(t=0),n[t++]=i,n[t++]=r)}var Nt=class{constructor(n,e,t,i){this.width=n,this.height=e,this.map=t,this.problems=i}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)continue;const i=e%this.width,r=e/this.width|0;let s=i+1,l=r+1;for(let o=1;s<this.width&&this.map[e+o]==t;o++)s++;for(let o=1;l<this.height&&this.map[e+this.width*o]==t;o++)l++;return{left:i,top:r,right:s,bottom:l}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:i,right:r,top:s,bottom:l}=this.findCell(n);return e=="horiz"?(t<0?i==0:r==this.width)?null:this.map[s*this.width+(t<0?i-1:r)]:(t<0?s==0:l==this.height)?null:this.map[i+this.width*(t<0?s-1:l)]}rectBetween(n,e){const{left:t,right:i,top:r,bottom:s}=this.findCell(n),{left:l,right:o,top:c,bottom:h}=this.findCell(e);return{left:Math.min(t,l),top:Math.min(r,c),right:Math.max(i,o),bottom:Math.max(s,h)}}cellsInRect(n){const e=[],t={};for(let i=n.top;i<n.bottom;i++)for(let r=n.left;r<n.right;r++){const s=i*this.width+r,l=this.map[s];t[l]||(t[l]=!0,!(r==n.left&&r&&this.map[s-1]==l||i==n.top&&i&&this.map[s-this.width]==l)&&e.push(l))}return e}positionAt(n,e,t){for(let i=0,r=0;;i++){const s=r+t.child(i).nodeSize;if(i==n){let l=e+n*this.width;const o=(n+1)*this.width;for(;l<o&&this.map[l]<r;)l++;return l==o?s-1:this.map[l]}r=s}}static get(n){return $1(n)||R1(n,Jq(n))}};function Jq(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=eH(n),t=n.childCount,i=[];let r=0,s=null;const l=[];for(let h=0,d=e*t;h<d;h++)i[h]=0;for(let h=0,d=0;h<t;h++){const p=n.child(h);d++;for(let b=0;;b++){for(;r<i.length&&i[r]!=0;)r++;if(b==p.childCount)break;const v=p.child(b),{colspan:x,rowspan:k,colwidth:C}=v.attrs;for(let A=0;A<k;A++){if(A+h>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:d,n:k-A});break}const P=r+A*e;for(let E=0;E<x;E++){i[P+E]==0?i[P+E]=d:(s||(s=[])).push({type:"collision",row:h,pos:d,n:x-E});const D=C&&C[E];if(D){const $=(P+E)%e*2,H=l[$];H==null||H!=D&&l[$+1]==1?(l[$]=D,l[$+1]=1):H==D&&l[$+1]++}}}r+=x,d+=v.nodeSize}const g=(h+1)*e;let O=0;for(;r<g;)i[r++]==0&&O++;O&&(s||(s=[])).push({type:"missing",row:h,n:O}),d++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const o=new Nt(e,t,i,s);let c=!1;for(let h=0;!c&&h<l.length;h+=2)l[h]!=null&&l[h+1]<t&&(c=!0);return c&&tH(o,l,n),o}function eH(n){let e=-1,t=!1;for(let i=0;i<n.childCount;i++){const r=n.child(i);let s=0;if(t)for(let l=0;l<i;l++){const o=n.child(l);for(let c=0;c<o.childCount;c++){const h=o.child(c);l+h.attrs.rowspan>i&&(s+=h.attrs.colspan)}}for(let l=0;l<r.childCount;l++){const o=r.child(l);s+=o.attrs.colspan,o.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function tH(n,e,t){n.problems||(n.problems=[]);const i={};for(let r=0;r<n.map.length;r++){const s=n.map[r];if(i[s])continue;i[s]=!0;const l=t.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let o=null;const c=l.attrs;for(let h=0;h<c.colspan;h++){const d=e[(r+h)%n.width*2];d!=null&&(!c.colwidth||c.colwidth[h]!=d)&&((o||(o=nH(c)))[h]=d)}o&&n.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:o})}}function nH(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function Qn(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const i=n.nodes[t],r=i.spec.tableRole;r&&(e[r]=i)}}return e}const kl=new Ct("selectingCells");function Xo(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function iH(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function ur(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Vg(n){const e=n.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=Xo(e.$head)||rH(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function rH(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const i=e.type.spec.tableRole;if(i=="cell"||i=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const i=e.type.spec.tableRole;if(i=="cell"||i=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function P1(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function sH(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function jv(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function lD(n,e,t){const i=n.node(-1),r=Nt.get(i),s=n.start(-1),l=r.nextCell(n.pos-s,e,t);return l==null?null:n.node(0).resolve(s+l)}function Io(n,e,t=1){const i={...n,colspan:n.colspan-t};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(e,t),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function oD(n,e,t=1){const i={...n,colspan:n.colspan+t};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<t;r++)i.colwidth.splice(e,0,0)}return i}function lH(n,e,t){const i=Qn(e.type.schema).header_cell;for(let r=0;r<n.height;r++)if(e.nodeAt(n.map[t+r*n.width]).type!=i)return!1;return!0}var gt=class ys extends $e{constructor(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.rectBetween(e.pos-s,t.pos-s),o=e.node(0),c=r.cellsInRect(l).filter(d=>d!=t.pos-s);c.unshift(t.pos-s);const h=c.map(d=>{const p=i.nodeAt(d);if(!p)throw new RangeError(`No cell with offset ${d} found`);const g=s+d+1;return new KR(o.resolve(g),o.resolve(g+p.content.size))});super(h[0].$from,h[0].$to,h),this.$anchorCell=e,this.$headCell=t}map(e,t){const i=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(P1(i)&&P1(r)&&jv(i,r)){const s=this.$anchorCell.node(-1)!=i.node(-1);return s&&this.isRowSelection()?ys.rowSelection(i,r):s&&this.isColSelection()?ys.colSelection(i,r):new ys(i,r)}return Ce.between(i,r)}content(){const e=this.$anchorCell.node(-1),t=Nt.get(e),i=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),s={},l=[];for(let c=r.top;c<r.bottom;c++){const h=[];for(let d=c*t.width+r.left,p=r.left;p<r.right;p++,d++){const g=t.map[d];if(s[g])continue;s[g]=!0;const O=t.findCell(g);let b=e.nodeAt(g);if(!b)throw new RangeError(`No cell with offset ${g} found`);const v=r.left-O.left,x=O.right-r.right;if(v>0||x>0){let k=b.attrs;if(v>0&&(k=Io(k,0,v)),x>0&&(k=Io(k,k.colspan-x,x)),O.left<r.left){if(b=b.type.createAndFill(k),!b)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(k)}`)}else b=b.type.create(k,b.content)}if(O.top<r.top||O.bottom>r.bottom){const k={...b.attrs,rowspan:Math.min(O.bottom,r.bottom)-Math.max(O.top,r.top)};O.top<r.top?b=b.type.createAndFill(k):b=b.type.create(k,b.content)}h.push(b)}l.push(e.child(c).copy(ne.from(h)))}const o=this.isColSelection()&&this.isRowSelection()?e:l;return new me(ne.from(o),1,1)}replace(e,t=me.empty){const i=e.steps.length,r=this.ranges;for(let l=0;l<r.length;l++){const{$from:o,$to:c}=r[l],h=e.mapping.slice(i);e.replace(h.map(o.pos),h.map(c.pos),l?me.empty:t)}const s=$e.findFrom(e.doc.resolve(e.mapping.slice(i).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new me(ne.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),i=Nt.get(t),r=this.$anchorCell.start(-1),s=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let l=0;l<s.length;l++)e(t.nodeAt(s[l]),r+s[l])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const i=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.findCell(e.pos-s),o=r.findCell(t.pos-s),c=e.node(0);return l.top<=o.top?(l.top>0&&(e=c.resolve(s+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(s+r.map[r.width*(r.height-1)+o.right-1]))):(o.top>0&&(t=c.resolve(s+r.map[o.left])),l.bottom<r.height&&(e=c.resolve(s+r.map[r.width*(r.height-1)+l.right-1]))),new ys(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Nt.get(e),i=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-i),s=t.colCount(this.$headCell.pos-i);if(Math.min(r,s)>0)return!1;const l=r+this.$anchorCell.nodeAfter.attrs.colspan,o=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,o)==t.width}eq(e){return e instanceof ys&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.findCell(e.pos-s),o=r.findCell(t.pos-s),c=e.node(0);return l.left<=o.left?(l.left>0&&(e=c.resolve(s+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(s+r.map[r.width*(o.top+1)-1]))):(o.left>0&&(t=c.resolve(s+r.map[o.top*r.width])),l.right<r.width&&(e=c.resolve(s+r.map[r.width*(l.top+1)-1]))),new ys(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new ys(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,i=t){return new ys(e.resolve(t),e.resolve(i))}getBookmark(){return new oH(this.$anchorCell.pos,this.$headCell.pos)}};gt.prototype.visible=!1;$e.jsonID("cell",gt);var oH=class aD{constructor(e,t){this.anchor=e,this.head=t}map(e){return new aD(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),i=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&i.index()<i.parent.childCount&&jv(t,i)?new gt(t,i):$e.near(i,1)}};function aH(n){if(!(n.selection instanceof gt))return null;const e=[];return n.selection.forEachCell((t,i)=>{e.push(xi.node(i,i+t.nodeSize,{class:"selectedCell"}))}),vt.create(n.doc,e)}function cH({$from:n,$to:e}){if(n.pos==e.pos||n.pos<e.pos-6)return!1;let t=n.pos,i=e.pos,r=n.depth;for(;r>=0&&!(n.after(r+1)<n.end(r));r--,t++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,i--);return t==i&&/row|table/.test(n.node(r).type.spec.tableRole)}function uH({$from:n,$to:e}){let t,i;for(let r=n.depth;r>0;r--){const s=n.node(r);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){t=s;break}}for(let r=e.depth;r>0;r--){const s=e.node(r);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){i=s;break}}return t!==i&&e.parentOffset===0}function hH(n,e,t){const i=(e||n).selection,r=(e||n).doc;let s,l;if(i instanceof we&&(l=i.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=gt.create(r,i.from);else if(l=="row"){const o=r.resolve(i.from+1);s=gt.rowSelection(o,o)}else if(!t){const o=Nt.get(i.node),c=i.from+1,h=c+o.map[o.width*o.height-1];s=gt.create(r,c+1,h)}}else i instanceof Ce&&cH(i)?s=Ce.create(r,i.from):i instanceof Ce&&uH(i)&&(s=Ce.create(r,i.$from.start(),i.$from.end()));return s&&(e||(e=n.tr)).setSelection(s),e}const fH=new Ct("fix-tables");function cD(n,e,t,i){const r=n.childCount,s=e.childCount;e:for(let l=0,o=0;l<s;l++){const c=e.child(l);for(let h=o,d=Math.min(r,l+3);h<d;h++)if(n.child(h)==c){o=h+1,t+=c.nodeSize;continue e}i(c,t),o<r&&n.child(o).sameMarkup(c)?cD(n.child(o),c,t+1,i):c.nodesBetween(0,c.content.size,i,t+1),t+=c.nodeSize}}function uD(n,e){let t;const i=(r,s)=>{r.type.spec.tableRole=="table"&&(t=dH(n,r,s,t))};return e?e.doc!=n.doc&&cD(e.doc,n.doc,0,i):n.doc.descendants(i),t}function dH(n,e,t,i){const r=Nt.get(e);if(!r.problems)return i;i||(i=n.tr);const s=[];for(let c=0;c<r.height;c++)s.push(0);for(let c=0;c<r.problems.length;c++){const h=r.problems[c];if(h.type=="collision"){const d=e.nodeAt(h.pos);if(!d)continue;const p=d.attrs;for(let g=0;g<p.rowspan;g++)s[h.row+g]+=h.n;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,Io(p,p.colspan-h.n,h.n))}else if(h.type=="missing")s[h.row]+=h.n;else if(h.type=="overlong_rowspan"){const d=e.nodeAt(h.pos);if(!d)continue;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-h.n})}else if(h.type=="colwidth mismatch"){const d=e.nodeAt(h.pos);if(!d)continue;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,{...d.attrs,colwidth:h.colwidth})}else if(h.type=="zero_sized"){const d=i.mapping.map(t);i.delete(d,d+e.nodeSize)}}let l,o;for(let c=0;c<s.length;c++)s[c]&&(l==null&&(l=c),o=c);for(let c=0,h=t+1;c<r.height;c++){const d=e.child(c),p=h+d.nodeSize,g=s[c];if(g>0){let O="cell";d.firstChild&&(O=d.firstChild.type.spec.tableRole);const b=[];for(let x=0;x<g;x++){const k=Qn(n.schema)[O].createAndFill();k&&b.push(k)}const v=(c==0||l==c-1)&&o==c?h+1:p-1;i.insert(i.mapping.map(v),b)}h=p}return i.setMeta(fH,{fixTables:!0})}function Vr(n){const e=n.selection,t=Vg(n),i=t.node(-1),r=t.start(-1),s=Nt.get(i);return{...e instanceof gt?s.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):s.findCell(t.pos-r),tableStart:r,map:s,table:i}}function hD(n,{map:e,tableStart:t,table:i},r){let s=r>0?-1:0;lH(e,i,r+s)&&(s=r==0||r==e.width?null:0);for(let l=0;l<e.height;l++){const o=l*e.width+r;if(r>0&&r<e.width&&e.map[o-1]==e.map[o]){const c=e.map[o],h=i.nodeAt(c);n.setNodeMarkup(n.mapping.map(t+c),null,oD(h.attrs,r-e.colCount(c))),l+=h.attrs.rowspan-1}else{const c=s==null?Qn(i.type.schema).cell:i.nodeAt(e.map[o+s]).type,h=e.positionAt(l,r,i);n.insert(n.mapping.map(t+h),c.createAndFill())}}return n}function pH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n);e(hD(n.tr,t,t.left))}return!0}function mH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n);e(hD(n.tr,t,t.right))}return!0}function gH(n,{map:e,table:t,tableStart:i},r){const s=n.mapping.maps.length;for(let l=0;l<e.height;){const o=l*e.width+r,c=e.map[o],h=t.nodeAt(c),d=h.attrs;if(r>0&&e.map[o-1]==c||r<e.width-1&&e.map[o+1]==c)n.setNodeMarkup(n.mapping.slice(s).map(i+c),null,Io(d,r-e.colCount(c)));else{const p=n.mapping.slice(s).map(i+c);n.delete(p,p+h.nodeSize)}l+=d.rowspan}}function OH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n),i=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let r=t.right-1;gH(i,t,r),r!=t.left;r--){const s=t.tableStart?i.doc.nodeAt(t.tableStart-1):i.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Nt.get(s)}e(i)}return!0}function yH(n,e,t){var i;const r=Qn(e.type.schema).header_cell;for(let s=0;s<n.width;s++)if(((i=e.nodeAt(n.map[s+t*n.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function fD(n,{map:e,tableStart:t,table:i},r){let s=t;for(let h=0;h<r;h++)s+=i.child(h).nodeSize;const l=[];let o=r>0?-1:0;yH(e,i,r+o)&&(o=r==0||r==e.height?null:0);for(let h=0,d=e.width*r;h<e.width;h++,d++)if(r>0&&r<e.height&&e.map[d]==e.map[d-e.width]){const p=e.map[d],g=i.nodeAt(p).attrs;n.setNodeMarkup(t+p,null,{...g,rowspan:g.rowspan+1}),h+=g.colspan-1}else{var c;const p=o==null?Qn(i.type.schema).cell:(c=i.nodeAt(e.map[d+o*e.width]))===null||c===void 0?void 0:c.type,g=p==null?void 0:p.createAndFill();g&&l.push(g)}return n.insert(s,Qn(i.type.schema).row.create(null,l)),n}function bH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n);e(fD(n.tr,t,t.top))}return!0}function SH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n);e(fD(n.tr,t,t.bottom))}return!0}function vH(n,{map:e,table:t,tableStart:i},r){let s=0;for(let h=0;h<r;h++)s+=t.child(h).nodeSize;const l=s+t.child(r).nodeSize,o=n.mapping.maps.length;n.delete(s+i,l+i);const c=new Set;for(let h=0,d=r*e.width;h<e.width;h++,d++){const p=e.map[d];if(!c.has(p)){if(c.add(p),r>0&&p==e.map[d-e.width]){const g=t.nodeAt(p).attrs;n.setNodeMarkup(n.mapping.slice(o).map(p+i),null,{...g,rowspan:g.rowspan-1}),h+=g.colspan-1}else if(r<e.height&&p==e.map[d+e.width]){const g=t.nodeAt(p),O=g.attrs,b=g.type.create({...O,rowspan:g.attrs.rowspan-1},g.content),v=e.positionAt(r+1,h,t);n.insert(n.mapping.slice(o).map(i+v),b),h+=O.colspan-1}}}}function xH(n,e){if(!ur(n))return!1;if(e){const t=Vr(n),i=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let r=t.bottom-1;vH(i,t,r),r!=t.top;r--){const s=t.tableStart?i.doc.nodeAt(t.tableStart-1):i.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Nt.get(t.table)}e(i)}return!0}function YM(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function kH({width:n,height:e,map:t},i){let r=i.top*n+i.left,s=r,l=(i.bottom-1)*n+i.left,o=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&t[s]==t[s-1]||i.right<n&&t[o]==t[o+1])return!0;s+=n,o+=n}for(let c=i.left;c<i.right;c++){if(i.top>0&&t[r]==t[r-n]||i.bottom<e&&t[l]==t[l+n])return!0;r++,l++}return!1}function UM(n,e){const t=n.selection;if(!(t instanceof gt)||t.$anchorCell.pos==t.$headCell.pos)return!1;const i=Vr(n),{map:r}=i;if(kH(r,i))return!1;if(e){const s=n.tr,l={};let o=ne.empty,c,h;for(let d=i.top;d<i.bottom;d++)for(let p=i.left;p<i.right;p++){const g=r.map[d*r.width+p],O=i.table.nodeAt(g);if(!(l[g]||!O))if(l[g]=!0,c==null)c=g,h=O;else{YM(O)||(o=o.append(O.content));const b=s.mapping.map(g+i.tableStart);s.delete(b,b+O.nodeSize)}}if(c==null||h==null)return!0;if(s.setNodeMarkup(c+i.tableStart,null,{...oD(h.attrs,h.attrs.colspan,i.right-i.left-h.attrs.colspan),rowspan:i.bottom-i.top}),o.size>0){const d=c+1+h.content.size,p=YM(h)?c+1:d;s.replaceWith(p+i.tableStart,d+i.tableStart,o)}s.setSelection(new gt(s.doc.resolve(c+i.tableStart))),e(s)}return!0}function WM(n,e){const t=Qn(n.schema);return wH(({node:i})=>t[i.type.spec.tableRole])(n,e)}function wH(n){return(e,t)=>{const i=e.selection;let r,s;if(i instanceof gt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{var l;if(r=iH(i.$from),!r)return!1;s=(l=Xo(i.$from))===null||l===void 0?void 0:l.pos}if(r==null||s==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(t){let o=r.attrs;const c=[],h=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const d=Vr(e),p=e.tr;for(let O=0;O<d.right-d.left;O++)c.push(h?{...o,colwidth:h&&h[O]?[h[O]]:null}:o);let g;for(let O=d.top;O<d.bottom;O++){let b=d.map.positionAt(O,d.left,d.table);O==d.top&&(b+=r.nodeSize);for(let v=d.left,x=0;v<d.right;v++,x++)v==d.left&&O==d.top||p.insert(g=p.mapping.map(b+d.tableStart,1),n({node:r,row:O,col:v}).createAndFill(c[x]))}p.setNodeMarkup(s,n({node:r,row:d.top,col:d.left}),c[0]),i instanceof gt&&p.setSelection(new gt(p.doc.resolve(i.$anchorCell.pos),g?p.doc.resolve(g):void 0)),t(p)}return!0}}function TH(n,e){return function(t,i){if(!ur(t))return!1;const r=Vg(t);if(r.nodeAfter.attrs[n]===e)return!1;if(i){const s=t.tr;t.selection instanceof gt?t.selection.forEachCell((l,o)=>{l.attrs[n]!==e&&s.setNodeMarkup(o,null,{...l.attrs,[n]:e})}):s.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[n]:e}),i(s)}return!0}}function CH(n){return function(e,t){if(!ur(e))return!1;if(t){const i=Qn(e.schema),r=Vr(e),s=e.tr,l=r.map.cellsInRect(n=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:n=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),o=l.map(c=>r.table.nodeAt(c));for(let c=0;c<l.length;c++)o[c].type==i.header_cell&&s.setNodeMarkup(r.tableStart+l[c],i.cell,o[c].attrs);if(s.steps.length===0)for(let c=0;c<l.length;c++)s.setNodeMarkup(r.tableStart+l[c],i.header_cell,o[c].attrs);t(s)}return!0}}function GM(n,e,t){const i=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let r=0;r<i.length;r++){const s=e.table.nodeAt(i[r]);if(s&&s.type!==t.header_cell)return!1}return!0}function Lh(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?CH(n):function(t,i){if(!ur(t))return!1;if(i){const r=Qn(t.schema),s=Vr(t),l=t.tr,o=GM("row",s,r),c=GM("column",s,r),h=(n==="column"?o:n==="row"&&c)?1:0,d=n=="column"?{left:0,top:h,right:1,bottom:s.map.height}:n=="row"?{left:h,top:0,right:s.map.width,bottom:1}:s,p=n=="column"?c?r.cell:r.header_cell:n=="row"?o?r.cell:r.header_cell:r.cell;s.map.cellsInRect(d).forEach(g=>{const O=g+s.tableStart,b=l.doc.nodeAt(O);b&&l.setNodeMarkup(O,p,b.attrs)}),i(l)}return!0}}Lh("row",{useDeprecatedLogic:!0});Lh("column",{useDeprecatedLogic:!0});const AH=Lh("cell",{useDeprecatedLogic:!0});function MH(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let i=n.index(-1)-1,r=n.before();i>=0;i--){const s=n.node(-1).child(i),l=s.lastChild;if(l)return r-1-l.nodeSize;r-=s.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let i=n.indexAfter(-1),r=n.after();i<t.childCount;i++){const s=t.child(i);if(s.childCount)return r+1;r+=s.nodeSize}}return null}function FM(n){return function(e,t){if(!ur(e))return!1;const i=MH(Vg(e),n);if(i==null)return!1;if(t){const r=e.doc.resolve(i);t(e.tr.setSelection(Ce.between(r,sH(r))).scrollIntoView())}return!0}}function QH(n,e){const t=n.selection.$anchor;for(let i=t.depth;i>0;i--)if(t.node(i).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(i),t.after(i)).scrollIntoView()),!0;return!1}function Fd(n,e){const t=n.selection;if(!(t instanceof gt))return!1;if(e){const i=n.tr,r=Qn(n.schema).cell.createAndFill().content;t.forEachCell((s,l)=>{s.content.eq(r)||i.replace(i.mapping.map(l+1),i.mapping.map(l+s.nodeSize-1),new me(r,0,0))}),i.docChanged&&e(i)}return!0}function EH(n){if(n.size===0)return null;let{content:e,openStart:t,openEnd:i}=n;for(;e.childCount==1&&(t>0&&i>0||e.child(0).type.spec.tableRole=="table");)t--,i--,e=e.child(0).content;const r=e.child(0),s=r.type.spec.tableRole,l=r.type.schema,o=[];if(s=="row")for(let c=0;c<e.childCount;c++){let h=e.child(c).content;const d=c?0:Math.max(0,t-1),p=c<e.childCount-1?0:Math.max(0,i-1);(d||p)&&(h=D1(Qn(l).row,new me(h,d,p)).content),o.push(h)}else if(s=="cell"||s=="header_cell")o.push(t||i?D1(Qn(l).row,new me(e,t,i)).content:e);else return null;return $H(l,o)}function $H(n,e){const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(let l=s.childCount-1;l>=0;l--){const{rowspan:o,colspan:c}=s.child(l).attrs;for(let h=r;h<r+o;h++)t[h]=(t[h]||0)+c}}let i=0;for(let r=0;r<t.length;r++)i=Math.max(i,t[r]);for(let r=0;r<t.length;r++)if(r>=e.length&&e.push(ne.empty),t[r]<i){const s=Qn(n).cell.createAndFill(),l=[];for(let o=t[r];o<i;o++)l.push(s);e[r]=e[r].append(ne.from(l))}return{height:e.length,width:i,rows:e}}function D1(n,e){const t=n.createAndFill();return new sv(t).replace(0,t.content.size,e).doc}function RH({width:n,height:e,rows:t},i,r){if(n!=i){const s=[],l=[];for(let o=0;o<t.length;o++){const c=t[o],h=[];for(let d=s[o]||0,p=0;d<i;p++){let g=c.child(p%c.childCount);d+g.attrs.colspan>i&&(g=g.type.createChecked(Io(g.attrs,g.attrs.colspan,d+g.attrs.colspan-i),g.content)),h.push(g),d+=g.attrs.colspan;for(let O=1;O<g.attrs.rowspan;O++)s[o+O]=(s[o+O]||0)+g.attrs.colspan}l.push(ne.from(h))}t=l,n=i}if(e!=r){const s=[];for(let l=0,o=0;l<r;l++,o++){const c=[],h=t[o%e];for(let d=0;d<h.childCount;d++){let p=h.child(d);l+p.attrs.rowspan>r&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,r-p.attrs.rowspan)},p.content)),c.push(p)}s.push(ne.from(c))}t=s,e=r}return{width:n,height:e,rows:t}}function PH(n,e,t,i,r,s,l){const o=n.doc.type.schema,c=Qn(o);let h,d;if(r>e.width)for(let p=0,g=0;p<e.height;p++){const O=t.child(p);g+=O.nodeSize;const b=[];let v;O.lastChild==null||O.lastChild.type==c.cell?v=h||(h=c.cell.createAndFill()):v=d||(d=c.header_cell.createAndFill());for(let x=e.width;x<r;x++)b.push(v);n.insert(n.mapping.slice(l).map(g-1+i),b)}if(s>e.height){const p=[];for(let b=0,v=(e.height-1)*e.width;b<Math.max(e.width,r);b++){const x=b>=e.width?!1:t.nodeAt(e.map[v+b]).type==c.header_cell;p.push(x?d||(d=c.header_cell.createAndFill()):h||(h=c.cell.createAndFill()))}const g=c.row.create(null,ne.from(p)),O=[];for(let b=e.height;b<s;b++)O.push(g);n.insert(n.mapping.slice(l).map(i+t.nodeSize-2),O)}return!!(h||d)}function KM(n,e,t,i,r,s,l,o){if(l==0||l==e.height)return!1;let c=!1;for(let h=r;h<s;h++){const d=l*e.width+h,p=e.map[d];if(e.map[d-e.width]==p){c=!0;const g=t.nodeAt(p),{top:O,left:b}=e.findCell(p);n.setNodeMarkup(n.mapping.slice(o).map(p+i),null,{...g.attrs,rowspan:l-O}),n.insert(n.mapping.slice(o).map(e.positionAt(l,b,t)),g.type.createAndFill({...g.attrs,rowspan:O+g.attrs.rowspan-l})),h+=g.attrs.colspan-1}}return c}function JM(n,e,t,i,r,s,l,o){if(l==0||l==e.width)return!1;let c=!1;for(let h=r;h<s;h++){const d=h*e.width+l,p=e.map[d];if(e.map[d-1]==p){c=!0;const g=t.nodeAt(p),O=e.colCount(p),b=n.mapping.slice(o).map(p+i);n.setNodeMarkup(b,null,Io(g.attrs,l-O,g.attrs.colspan-(l-O))),n.insert(b+g.nodeSize,g.type.createAndFill(Io(g.attrs,0,l-O))),h+=g.attrs.rowspan-1}}return c}function eQ(n,e,t,i,r){let s=t?n.doc.nodeAt(t-1):n.doc;if(!s)throw new Error("No table found");let l=Nt.get(s);const{top:o,left:c}=i,h=c+r.width,d=o+r.height,p=n.tr;let g=0;function O(){if(s=t?p.doc.nodeAt(t-1):p.doc,!s)throw new Error("No table found");l=Nt.get(s),g=p.mapping.maps.length}PH(p,l,s,t,h,d,g)&&O(),KM(p,l,s,t,c,h,o,g)&&O(),KM(p,l,s,t,c,h,d,g)&&O(),JM(p,l,s,t,o,d,c,g)&&O(),JM(p,l,s,t,o,d,h,g)&&O();for(let b=o;b<d;b++){const v=l.positionAt(b,c,s),x=l.positionAt(b,h,s);p.replace(p.mapping.slice(g).map(v+t),p.mapping.slice(g).map(x+t),new me(r.rows[b-o],0,0))}O(),p.setSelection(new gt(p.doc.resolve(t+l.positionAt(o,c,s)),p.doc.resolve(t+l.positionAt(d-1,h-1,s)))),e(p)}const DH=Sv({ArrowLeft:Kd("horiz",-1),ArrowRight:Kd("horiz",1),ArrowUp:Kd("vert",-1),ArrowDown:Kd("vert",1),"Shift-ArrowLeft":Jd("horiz",-1),"Shift-ArrowRight":Jd("horiz",1),"Shift-ArrowUp":Jd("vert",-1),"Shift-ArrowDown":Jd("vert",1),Backspace:Fd,"Mod-Backspace":Fd,Delete:Fd,"Mod-Delete":Fd});function Np(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function Kd(n,e){return(t,i,r)=>{if(!r)return!1;const s=t.selection;if(s instanceof gt)return Np(t,i,$e.near(s.$headCell,e));if(n!="horiz"&&!s.empty)return!1;const l=dD(r,n,e);if(l==null)return!1;if(n=="horiz")return Np(t,i,$e.near(t.doc.resolve(s.head+e),e));{const o=t.doc.resolve(l),c=lD(o,n,e);let h;return c?h=$e.near(c,1):e<0?h=$e.near(t.doc.resolve(o.before(-1)),-1):h=$e.near(t.doc.resolve(o.after(-1)),1),Np(t,i,h)}}}function Jd(n,e){return(t,i,r)=>{if(!r)return!1;const s=t.selection;let l;if(s instanceof gt)l=s;else{const c=dD(r,n,e);if(c==null)return!1;l=new gt(t.doc.resolve(c))}const o=lD(l.$headCell,n,e);return o?Np(t,i,new gt(l.$anchorCell,o)):!1}}function NH(n,e){const t=n.state.doc,i=Xo(t.resolve(e));return i?(n.dispatch(n.state.tr.setSelection(new gt(i))),!0):!1}function zH(n,e,t){if(!ur(n.state))return!1;let i=EH(t);const r=n.state.selection;if(r instanceof gt){i||(i={width:1,height:1,rows:[ne.from(D1(Qn(n.state.schema).cell,t))]});const s=r.$anchorCell.node(-1),l=r.$anchorCell.start(-1),o=Nt.get(s).rectBetween(r.$anchorCell.pos-l,r.$headCell.pos-l);return i=RH(i,o.right-o.left,o.bottom-o.top),eQ(n.state,n.dispatch,l,o,i),!0}else if(i){const s=Vg(n.state),l=s.start(-1);return eQ(n.state,n.dispatch,l,Nt.get(s.node(-1)).findCell(s.pos-l),i),!0}else return!1}function LH(n,e){var t;if(e.button!=0||e.ctrlKey||e.metaKey)return;const i=tQ(n,e.target);let r;if(e.shiftKey&&n.state.selection instanceof gt)s(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&i&&(r=Xo(n.state.selection.$anchor))!=null&&((t=eb(n,e))===null||t===void 0?void 0:t.pos)!=r.pos)s(r,e),e.preventDefault();else if(!i)return;function s(c,h){let d=eb(n,h);const p=kl.getState(n.state)==null;if(!d||!jv(c,d))if(p)d=c;else return;const g=new gt(c,d);if(p||!n.state.selection.eq(g)){const O=n.state.tr.setSelection(g);p&&O.setMeta(kl,c.pos),n.dispatch(O)}}function l(){n.root.removeEventListener("mouseup",l),n.root.removeEventListener("dragstart",l),n.root.removeEventListener("mousemove",o),kl.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(kl,-1))}function o(c){const h=c,d=kl.getState(n.state);let p;if(d!=null)p=n.state.doc.resolve(d);else if(tQ(n,h.target)!=i&&(p=eb(n,e),!p))return l();p&&s(p,h)}n.root.addEventListener("mouseup",l),n.root.addEventListener("dragstart",l),n.root.addEventListener("mousemove",o)}function dD(n,e,t){if(!(n.state.selection instanceof Ce))return null;const{$head:i}=n.state.selection;for(let r=i.depth-1;r>=0;r--){const s=i.node(r);if((t<0?i.index(r):i.indexAfter(r))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=i.before(r),o=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(o)?l:null}}return null}function tQ(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function eb(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});if(!t)return null;let{inside:i,pos:r}=t;return i>=0&&Xo(n.state.doc.resolve(i))||Xo(n.state.doc.resolve(r))}var _H=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),N1(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,N1(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function N1(n,e,t,i,r,s){let l=0,o=!0,c=e.firstChild;const h=n.firstChild;if(h){for(let p=0,g=0;p<h.childCount;p++){const{colspan:O,colwidth:b}=h.child(p).attrs;for(let v=0;v<O;v++,g++){const x=r==g?s:b&&b[v],k=x?x+"px":"";if(l+=x||i,x||(o=!1),c)c.style.width!=k&&(c.style.width=k),c=c.nextSibling;else{const C=document.createElement("col");C.style.width=k,e.appendChild(C)}}}for(;c;){var d;const p=c.nextSibling;(d=c.parentNode)===null||d===void 0||d.removeChild(c),c=p}o?(t.style.width=l+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=l+"px")}}const yi=new Ct("tableColumnResizing");function BH({handleWidth:n=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:i=_H,lastColumnResizable:r=!0}={}){const s=new yt({key:yi,state:{init(l,o){var c;const h=(c=s.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,d=Qn(o.schema).table.name;return i&&h&&(h[d]=(p,g)=>new i(p,t,g)),new jH(-1,!1)},apply(l,o){return o.apply(l)}},props:{attributes:l=>{const o=yi.getState(l);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,o)=>{ZH(l,o,n,r)},mouseleave:l=>{XH(l)},mousedown:(l,o)=>{IH(l,o,e,t)}},decorations:l=>{const o=yi.getState(l);if(o&&o.activeHandle>-1)return UH(l,o.activeHandle)},nodeViews:{}}});return s}var jH=class zp{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,i=e.getMeta(yi);if(i&&i.setHandle!=null)return new zp(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new zp(t.activeHandle,i.setDragging);if(t.activeHandle>-1&&e.docChanged){let r=e.mapping.map(t.activeHandle,-1);return P1(e.doc.resolve(r))||(r=-1),new zp(r,t.dragging)}return t}};function ZH(n,e,t,i){if(!n.editable)return;const r=yi.getState(n.state);if(r&&!r.dragging){const s=qH(e.target);let l=-1;if(s){const{left:o,right:c}=s.getBoundingClientRect();e.clientX-o<=t?l=nQ(n,e,"left",t):c-e.clientX<=t&&(l=nQ(n,e,"right",t))}if(l!=r.activeHandle){if(!i&&l!==-1){const o=n.state.doc.resolve(l),c=o.node(-1),h=Nt.get(c),d=o.start(-1);if(h.colCount(o.pos-d)+o.nodeAfter.attrs.colspan-1==h.width-1)return}pD(n,l)}}}function XH(n){if(!n.editable)return;const e=yi.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&pD(n,-1)}function IH(n,e,t,i){var r;if(!n.editable)return!1;const s=(r=n.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,l=yi.getState(n.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const o=n.state.doc.nodeAt(l.activeHandle),c=VH(n,l.activeHandle,o.attrs);n.dispatch(n.state.tr.setMeta(yi,{setDragging:{startX:e.clientX,startWidth:c}}));function h(p){s.removeEventListener("mouseup",h),s.removeEventListener("mousemove",d);const g=yi.getState(n.state);g!=null&&g.dragging&&(HH(n,g.activeHandle,iQ(g.dragging,p,t)),n.dispatch(n.state.tr.setMeta(yi,{setDragging:null})))}function d(p){if(!p.which)return h(p);const g=yi.getState(n.state);if(g&&g.dragging){const O=iQ(g.dragging,p,t);rQ(n,g.activeHandle,O,i)}}return rQ(n,l.activeHandle,c,i),s.addEventListener("mouseup",h),s.addEventListener("mousemove",d),e.preventDefault(),!0}function VH(n,e,{colspan:t,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const s=n.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,o=t;if(i)for(let c=0;c<t;c++)i[c]&&(l-=i[c],o--);return l/o}function qH(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function nQ(n,e,t,i){const r=t=="right"?-i:i,s=n.posAtCoords({left:e.clientX+r,top:e.clientY});if(!s)return-1;const{pos:l}=s,o=Xo(n.state.doc.resolve(l));if(!o)return-1;if(t=="right")return o.pos;const c=Nt.get(o.node(-1)),h=o.start(-1),d=c.map.indexOf(o.pos-h);return d%c.width==0?-1:h+c.map[d-1]}function iQ(n,e,t){const i=e.clientX-n.startX;return Math.max(t,n.startWidth+i)}function pD(n,e){n.dispatch(n.state.tr.setMeta(yi,{setHandle:e}))}function HH(n,e,t){const i=n.state.doc.resolve(e),r=i.node(-1),s=Nt.get(r),l=i.start(-1),o=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1,c=n.state.tr;for(let h=0;h<s.height;h++){const d=h*s.width+o;if(h&&s.map[d]==s.map[d-s.width])continue;const p=s.map[d],g=r.nodeAt(p).attrs,O=g.colspan==1?0:o-s.colCount(p);if(g.colwidth&&g.colwidth[O]==t)continue;const b=g.colwidth?g.colwidth.slice():YH(g.colspan);b[O]=t,c.setNodeMarkup(l+p,null,{...g,colwidth:b})}c.docChanged&&n.dispatch(c)}function rQ(n,e,t,i){const r=n.state.doc.resolve(e),s=r.node(-1),l=r.start(-1),o=Nt.get(s).colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1;let c=n.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&N1(s,c.firstChild,c,i,o,t)}function YH(n){return Array(n).fill(0)}function UH(n,e){const t=[],i=n.doc.resolve(e),r=i.node(-1);if(!r)return vt.empty;const s=Nt.get(r),l=i.start(-1),o=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;for(let h=0;h<s.height;h++){const d=o+h*s.width;if((o==s.width-1||s.map[d]!=s.map[d+1])&&(h==0||s.map[d]!=s.map[d-s.width])){var c;const p=s.map[d],g=l+p+r.nodeAt(p).nodeSize-1,O=document.createElement("div");O.className="column-resize-handle",!((c=yi.getState(n))===null||c===void 0)&&c.dragging&&t.push(xi.node(l+p,l+p+r.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),t.push(xi.widget(g,O))}}return vt.create(n.doc,t)}function WH({allowTableNodeSelection:n=!1}={}){return new yt({key:kl,state:{init(){return null},apply(e,t){const i=e.getMeta(kl);if(i!=null)return i==-1?null:i;if(t==null||!e.docChanged)return t;const{deleted:r,pos:s}=e.mapping.mapResult(t);return r?null:s}},props:{decorations:aH,handleDOMEvents:{mousedown:LH},createSelectionBetween(e){return kl.getState(e.state)!=null?e.state.selection:null},handleTripleClick:NH,handleKeyDown:DH,handlePaste:zH},appendTransaction(e,t,i){return hH(i,uD(i,t),n)}})}function GH(n,e){const t=Math.min(n.top,e.top),i=Math.max(n.bottom,e.bottom),r=Math.min(n.left,e.left),l=Math.max(n.right,e.right)-r,o=i-t,c=r,h=t;return new DOMRect(c,h,l,o)}var FH=class{constructor({editor:n,element:e,view:t,pluginKey:i="bubbleMenu",updateDelay:r=250,resizeDelay:s=60,shouldShow:l,appendTo:o,getReferencedVirtualElement:c,options:h}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:p,state:g,from:O,to:b})=>{const{doc:v,selection:x}=g,{empty:k}=x,C=!v.textBetween(O,b).length&&wv(g.selection),A=this.element.contains(document.activeElement);return!(!(p.hasFocus()||A)||k||C||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:p})=>{var g;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}p!=null&&p.relatedTarget&&((g=this.element.parentNode)!=null&&g.contains(p.relatedTarget))||(p==null?void 0:p.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(p,g)=>{const O=!(g!=null&&g.selection.eq(p.state.selection)),b=!(g!=null&&g.doc.eq(p.state.doc));!O&&!b||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(p,O,b,g)},this.updateDelay))},this.updateHandler=(p,g,O,b)=>{const{composing:v}=p;if(v||!g&&!O)return;if(!this.getShouldShow(b)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:p})=>{const g=p.getMeta(this.pluginKey);g==="updatePosition"?this.updatePosition():g&&typeof g=="object"&&g.type==="updateOptions"?this.updateOptions(g.options):g==="hide"?this.hide():g==="show"&&(this.updatePosition(),this.show())};var d;this.editor=n,this.element=e,this.view=t,this.pluginKey=i,this.updateDelay=r,this.resizeDelay=s,this.appendTo=o,this.scrollTarget=(d=h==null?void 0:h.scrollTarget)!=null?d:window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...h},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const n=[];return this.floatingUIOptions.flip&&n.push(eD(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&n.push(JP(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&n.push(FP(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&n.push(iD(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&n.push(tD(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&n.push(KP(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&n.push(nD(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&n.push(rD(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),n}get virtualElement(){var n,e,t;const{selection:i}=this.editor.state,r=(n=this.getReferencedVirtualElement)==null?void 0:n.call(this);if(r)return r;if(!((t=(e=this.view)==null?void 0:e.dom)!=null&&t.parentNode))return;const s=mP(this.view,i.from,i.to);let l={getBoundingClientRect:()=>s,getClientRects:()=>[s]};if(i instanceof we){let o=this.view.nodeDOM(i.from);const c=o.dataset.nodeViewWrapper?o:o.querySelector("[data-node-view-wrapper]");c&&(o=c),o&&(l={getBoundingClientRect:()=>o.getBoundingClientRect(),getClientRects:()=>[o.getBoundingClientRect()]})}if(i instanceof gt){const{$anchorCell:o,$headCell:c}=i,h=o?o.pos:c.pos,d=c?c.pos:o.pos,p=this.view.nodeDOM(h),g=this.view.nodeDOM(d);if(!p||!g)return;const O=p===g?p.getBoundingClientRect():GH(p.getBoundingClientRect(),g.getBoundingClientRect());l={getBoundingClientRect:()=>O,getClientRects:()=>[O]}}return l}updatePosition(){if(!this.isVisible)return;const n=this.virtualElement;n&&sD(n,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:i,middlewareData:r})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((s=r.hide)!=null&&s.referenceHidden||(l=r.hide)!=null&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(n,e){const{state:t}=n,i=t.selection.from!==t.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(n,e);return}const r=!(e!=null&&e.selection.eq(n.state.selection)),s=!(e!=null&&e.doc.eq(n.state.doc));this.updateHandler(n,r,s,e)}getShouldShow(n){var e;const{state:t}=this.view,{selection:i}=t,{ranges:r}=i,s=Math.min(...r.map(c=>c.$from.pos)),l=Math.max(...r.map(c=>c.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:n,from:s,to:l}))||!1}show(){var n;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(n=e??this.view.dom.parentElement)==null||n.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(n){var e;if(n.updateDelay!==void 0&&(this.updateDelay=n.updateDelay),n.resizeDelay!==void 0&&(this.resizeDelay=n.resizeDelay),n.appendTo!==void 0&&(this.appendTo=n.appendTo),n.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=n.getReferencedVirtualElement),n.shouldShow!==void 0&&n.shouldShow&&(this.shouldShow=n.shouldShow),n.options!==void 0){const t=(e=n.options.scrollTarget)!=null?e:window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...n.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},mD=n=>new yt({key:typeof n.pluginKey=="string"?new Ct(n.pluginKey):n.pluginKey,view:e=>new FH({view:e,...n})});Et.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mD({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var KH=class{constructor({editor:n,element:e,view:t,pluginKey:i="floatingMenu",updateDelay:r=250,resizeDelay:s=60,options:l,appendTo:o,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:d,state:p})=>{const{selection:g}=p,{$anchor:O,empty:b}=g,v=O.depth===1,x=O.parent.isTextblock&&!O.parent.type.spec.code&&!O.parent.textContent&&O.parent.childCount===0&&!this.getTextContent(O.parent);return!(!d.hasFocus()||!b||!v||!x||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(d,p,g,O)=>{const{composing:b}=d;if(b||!p&&!g)return;if(!this.getShouldShow(O)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var p;if(this.preventHide){this.preventHide=!1;return}d!=null&&d.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(d.relatedTarget))||(d==null?void 0:d.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:d})=>{const p=d.getMeta(this.pluginKey);p==="updatePosition"?this.updatePosition():p&&typeof p=="object"&&p.type==="updateOptions"?this.updateOptions(p.options):p==="hide"?this.hide():p==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var h;this.editor=n,this.element=e,this.view=t,this.pluginKey=i,this.updateDelay=r,this.resizeDelay=s,this.appendTo=o,this.scrollTarget=(h=l==null?void 0:l.scrollTarget)!=null?h:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(n){return cP(n,{textSerializers:Av(this.editor.schema)})}get middlewares(){const n=[];return this.floatingUIOptions.flip&&n.push(eD(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&n.push(JP(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&n.push(FP(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&n.push(iD(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&n.push(tD(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&n.push(KP(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&n.push(nD(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&n.push(rD(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),n}getShouldShow(n){var e;const{state:t}=this.view,{selection:i}=t,{ranges:r}=i,s=Math.min(...r.map(c=>c.$from.pos)),l=Math.max(...r.map(c=>c.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:n,from:s,to:l})}updateOptions(n){var e;if(n.updateDelay!==void 0&&(this.updateDelay=n.updateDelay),n.resizeDelay!==void 0&&(this.resizeDelay=n.resizeDelay),n.appendTo!==void 0&&(this.appendTo=n.appendTo),n.shouldShow!==void 0&&n.shouldShow&&(this.shouldShow=n.shouldShow),n.options!==void 0){const t=(e=n.options.scrollTarget)!=null?e:window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...n.options}}}updatePosition(){var n,e;if(!((e=(n=this.view)==null?void 0:n.dom)!=null&&e.parentNode))return;const{selection:t}=this.editor.state,i=mP(this.view,t.from,t.to);sD({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:o,middlewareData:c})=>{var h,d;if((h=c.hide)!=null&&h.referenceHidden||(d=c.hide)!=null&&d.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(n,e){const t=!(e!=null&&e.selection.eq(n.state.selection)),i=!(e!=null&&e.doc.eq(n.state.doc));this.updateHandler(n,t,i,e)}show(){var n;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(n=e??this.view.dom.parentElement)==null||n.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},gD=n=>new yt({key:typeof n.pluginKey=="string"?new Ct(n.pluginKey):n.pluginKey,view:e=>new KH({view:e,...n})});Et.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:n,dispatch:e})=>(e&&n.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[gD({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function OD(n,e){return n??new Ct(e)}var JH=typeof window<"u"?Ee.useLayoutEffect:Ee.useEffect,yD=new Set(["left","opacity","position","top","visibility","width"]),eY=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),tY=new Set(["children","className","style"]),nY=new Set(["tabIndex"]),iY=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),rY={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function z1(n,e){return/^on[A-Z]/.test(n)&&typeof e=="function"}function sY(n){return n.startsWith("aria-")||n.startsWith("data-"),n}function lY(n){return n.startsWith("aria-")||n.startsWith("data-")||iY.has(n)}function bD(n){return n.startsWith("--")?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function oY(n){var e;const t=n.endsWith("Capture"),r=(t?n.slice(0,-7):n).slice(2);return{eventName:(e=rY[r])!=null?e:r.toLowerCase(),options:t?{capture:!0}:void 0}}function aY(n,e){let t=e.defaultPrevented,i=!1;const r=Object.create(e);return Object.defineProperties(r,{nativeEvent:{value:e},currentTarget:{value:n},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>t},isPropagationStopped:{value:()=>i},preventDefault:{value:()=>{t=!0,e.preventDefault()}},stopPropagation:{value:()=>{i=!0,e.stopPropagation()}}}),r}function tb(n){return nY.has(n)}function sQ(n,e,t){if(e==="tabIndex"){n.tabIndex=Number(t);return}n[e]=t}function cY(n,e){if(e==="tabIndex"){n.removeAttribute("tabindex");return}const t=n[e];if(typeof t=="boolean"){n[e]=!1;return}if(typeof t=="number"){n[e]=0;return}n[e]=""}function uY(n,e){return typeof e!="number"||e===0||n.startsWith("--")||eY.has(n)?String(e):`${e}px`}function hY(n,e){yD.has(e)||n.style.removeProperty(bD(e))}function fY(n,e,t){yD.has(e)||n.style.setProperty(bD(e),uY(e,t))}function dY(n,e,t){new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{if(tY.has(r)||!lY(r)||z1(r,e[r])||z1(r,t[r]))return;const s=e[r],l=t[r];if(s===l)return;const o=sY(r);if(l==null||l===!1){tb(r)&&cY(n,r),n.removeAttribute(o);return}if(l===!0){tb(r)&&sQ(n,r,!0),n.setAttribute(o,"");return}if(tb(r)){sQ(n,r,l);return}n.setAttribute(o,String(l))})}function pY(n,e,t){if(e!==t){if(t){n.className=t;return}n.removeAttribute("class")}}function mY(n,e,t){const i=e??{},r=t??{};new Set([...Object.keys(i),...Object.keys(r)]).forEach(l=>{const o=i[l],c=r[l];if(o!==c){if(c==null){hY(n,l);return}fY(n,l,c)}})}function gY(n,e,t){e.forEach(({eventName:r,listener:s,options:l})=>{n.removeEventListener(r,s,l)});const i=[];return Object.entries(t).forEach(([r,s])=>{if(!z1(r,s))return;const{eventName:l,options:o}=oY(r),c=h=>{s(aY(n,h))};n.addEventListener(l,c,o),i.push({eventName:l,listener:c,options:o})}),i}function SD(n,e){const t=Ee.useRef({}),i=Ee.useRef([]);JH(()=>{const r=t.current;return pY(n,r.className,e.className),mY(n,r.style,e.style),dY(n,r,e),i.current=gY(n,i.current,e),t.current=e,()=>{i.current.forEach(({eventName:s,listener:l,options:o})=>{n.removeEventListener(s,l,o)}),i.current=[]}},[n,e])}var OY=Ae.forwardRef(({pluginKey:n,editor:e,updateDelay:t,resizeDelay:i,appendTo:r,shouldShow:s=null,getReferencedVirtualElement:l,options:o,children:c,...h},d)=>{const p=Ee.useRef(document.createElement("div")),g=Ee.useRef(OD(n,"bubbleMenu")).current;SD(p.current,h),typeof d=="function"?d(p.current):d&&(d.current=p.current);const{editor:O}=NP(),b=e||O,v={updateDelay:t,resizeDelay:i,appendTo:r,pluginKey:g,shouldShow:s,getReferencedVirtualElement:l,options:o},x=Ee.useRef(v);x.current=v;const[k,C]=Ee.useState(!1),A=Ee.useRef(!0);return Ee.useEffect(()=>{if(b!=null&&b.isDestroyed)return;if(!b){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const P=p.current;P.style.visibility="hidden",P.style.position="absolute";const E=mD({...x.current,editor:b,element:P});b.registerPlugin(E);const D=x.current.pluginKey;return A.current=!0,C(!0),()=>{C(!1),b.unregisterPlugin(D),window.requestAnimationFrame(()=>{P.parentNode&&P.parentNode.removeChild(P)})}},[b]),Ee.useEffect(()=>{if(!(!k||!b||b.isDestroyed)){if(A.current){A.current=!1;return}b.view.dispatch(b.state.tr.setMeta(g,{type:"updateOptions",options:x.current}))}},[k,b,t,i,s,o,r,l,g]),tv.createPortal(c,p.current)}),yY=Ae.forwardRef(({pluginKey:n,editor:e,updateDelay:t,resizeDelay:i,appendTo:r,shouldShow:s=null,options:l,children:o,...c},h)=>{const d=Ee.useRef(document.createElement("div")),p=Ee.useRef(OD(n,"floatingMenu")).current;SD(d.current,c),typeof h=="function"?h(d.current):h&&(h.current=d.current);const{editor:g}=NP(),O=e||g,b={updateDelay:t,resizeDelay:i,appendTo:r,pluginKey:p,shouldShow:s,options:l},v=Ee.useRef(b);v.current=b;const[x,k]=Ee.useState(!1),C=Ee.useRef(!0);return Ee.useEffect(()=>{if(O!=null&&O.isDestroyed)return;if(!O){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const A=d.current;A.style.visibility="hidden",A.style.position="absolute";const P=gD({...v.current,editor:O,element:A});O.registerPlugin(P);const E=v.current.pluginKey;return C.current=!0,k(!0),()=>{k(!1),O.unregisterPlugin(E),window.requestAnimationFrame(()=>{A.parentNode&&A.parentNode.removeChild(A)})}},[O]),Ee.useEffect(()=>{if(!(!x||!O||O.isDestroyed)){if(C.current){C.current=!1;return}O.view.dispatch(O.state.tr.setMeta(p,{type:"updateOptions",options:v.current}))}},[x,O,t,i,s,l,r,p]),tv.createPortal(o,d.current)}),fm=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...i}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,i,t]},bY=/^\s*>\s$/,SY=an.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return fm("blockquote",{...Tt(this.options.HTMLAttributes,n),children:fm("slot",{})})},parseMarkdown:(n,e)=>{var t;const i=(t=e.parseBlockChildren)!=null?t:e.parseChildren;return e.createNode("blockquote",void 0,i(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",i=[];return n.content.forEach((r,s)=>{var l,o;const d=((o=(l=e.renderChild)==null?void 0:l.call(e,r,s))!=null?o:e.renderChildren([r])).split(`
`).map(p=>p.trim()===""?t:`${t} ${p}`);i.push(d.join(`
`))}),i.join(`
${t}
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[pc({find:bY,type:this.type})]}}),vY=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xY=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,kY=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wY=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,TY=Go.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return fm("strong",{...Tt(this.options.HTMLAttributes,n),children:fm("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[dc({find:vY,type:this.type}),dc({find:kY,type:this.type})]},addPasteRules(){return[Zo({find:xY,type:this.type}),Zo({find:wY,type:this.type})]}}),CY=/(^|[^`])`([^`]+)`(?!`)$/,AY=/(^|[^`])`([^`]+)`(?!`)/g,MY=Go.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Tt(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[dc({find:CY,type:this.type})]},addPasteRules(){return[Zo({find:AY,type:this.type})]}}),nb=4,QY=/^```([a-z]+)?[\s\n]$/,EY=/^~~~([a-z]+)?[\s\n]$/,$Y=an.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:nb,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const s=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(l=>l.startsWith(t)).map(l=>l.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Tt(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,i;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&((i=n.raw)==null?void 0:i.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let i="";const r=((t=n.attrs)==null?void 0:t.language)||"";return n.content?i=[`\`\`\`${r}`,e.renderChildren(n.content),"```"].join(`
`):i=`\`\`\`${r}

\`\`\``,i},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:nb,{state:i}=n,{selection:r}=i,{$from:s,empty:l}=r;if(s.parent.type!==this.type)return!1;const o=" ".repeat(t);return l?n.commands.insertContent(o):n.commands.command(({tr:c})=>{const{from:h,to:d}=r,O=i.doc.textBetween(h,d,`
`,`
`).split(`
`).map(b=>o+b).join(`
`);return c.replaceWith(h,d,i.schema.text(O)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:nb,{state:i}=n,{selection:r}=i,{$from:s,empty:l}=r;return s.parent.type!==this.type?!1:l?n.commands.command(({tr:o})=>{var c;const{pos:h}=s,d=s.start(),p=s.end(),O=i.doc.textBetween(d,p,`
`,`
`).split(`
`);let b=0,v=0;const x=h-d;for(let D=0;D<O.length;D+=1){if(v+O[D].length>=x){b=D;break}v+=O[D].length+1}const C=((c=O[b].match(/^ */))==null?void 0:c[0])||"",A=Math.min(C.length,t);if(A===0)return!0;let P=d;for(let D=0;D<b;D+=1)P+=O[D].length+1;return o.delete(P,P+A),h-P<=A&&o.setSelection(Ce.create(o.doc,P)),!0}):n.commands.command(({tr:o})=>{const{from:c,to:h}=r,g=i.doc.textBetween(c,h,`
`,`
`).split(`
`).map(O=>{var b;const v=((b=O.match(/^ */))==null?void 0:b[0])||"",x=Math.min(v.length,t);return O.slice(x)}).join(`
`);return o.replaceWith(c,h,i.schema.text(g)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:i,empty:r}=t;if(!r||i.parent.type!==this.type)return!1;const s=i.parentOffset===i.parent.nodeSize-2,l=i.parent.textContent.endsWith(`

`);return!s||!l?!1:n.chain().command(({tr:o})=>(o.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:i}=e,{$from:r,empty:s}=t;if(!s||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const o=r.after();return o===void 0?!1:i.nodeAt(o)?n.commands.command(({tr:h})=>(h.setSelection($e.near(i.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[C1({find:QY,type:this.type,getAttributes:n=>({language:n[1]})}),C1({find:EY,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new yt({key:new Ct("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),i=e.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,s=r==null?void 0:r.mode;if(!t||!s)return!1;const{tr:l,schema:o}=n.state,c=o.text(t.replace(/\r\n?/g,`
`));return l.replaceSelectionWith(this.type.create({language:s},c)),l.selection.$from.parent.type!==this.type&&l.setSelection(Ce.near(l.doc.resolve(Math.max(0,l.selection.from-2)))),l.setMeta("paste",!0),n.dispatch(l),!0}}})]}}),RY=an.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`

`):""}),PY=an.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Tt(this.options.HTMLAttributes,n)]},renderText(){return`
`},renderMarkdown:()=>`  
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:i})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:r,storedMarks:s}=t;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:l}=this.options,{splittableMarks:o}=i.extensionManager,c=s||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:h,dispatch:d})=>{if(d&&c&&l){const p=c.filter(g=>o.includes(g.type.name));h.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),DY=an.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Tt(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const i=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,r="#".repeat(i);return n.content?`${r} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>C1({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),NY=an.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Tt(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!nV(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:i}=t,r=n();return fP(t)?r.insertContentAt(i.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({state:s,tr:l,dispatch:o})=>{if(o){const{$to:c}=l.selection,h=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?l.setSelection(Ce.create(l.doc,c.pos+1)):c.nodeAfter.isBlock?l.setSelection(we.create(l.doc,c.pos)):l.setSelection(Ce.create(l.doc,c.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=d==null?void 0:d.create();p&&(l.insert(h,p),l.setSelection(Ce.create(l.doc,h+1)))}l.scrollIntoView()}return!0}).run()}}},addInputRules(){return[EP({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),zY=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,LY=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_Y=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,BY=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jY=Go.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Tt(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[dc({find:zY,type:this.type}),dc({find:_Y,type:this.type})]},addPasteRules(){return[Zo({find:LY,type:this.type}),Zo({find:BY,type:this.type})]}});const ZY=" ögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",XY="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",L1="numeric",_1="ascii",B1="alpha",uh="asciinumeric",Ju="alphanumeric",j1="domain",vD="emoji",IY="scheme",VY="slashscheme",ib="whitespace";function qY(n,e){return n in e||(e[n]=[]),e[n]}function To(n,e,t){e[L1]&&(e[uh]=!0,e[Ju]=!0),e[_1]&&(e[uh]=!0,e[B1]=!0),e[uh]&&(e[Ju]=!0),e[B1]&&(e[Ju]=!0),e[Ju]&&(e[j1]=!0),e[vD]&&(e[j1]=!0);for(const i in e){const r=qY(i,t);r.indexOf(n)<0&&r.push(n)}}function HY(n,e){const t={};for(const i in e)e[i].indexOf(n)>=0&&(t[i]=!0);return t}function Gn(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Gn.groups={};Gn.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],s=e.jr[i][1];if(s&&r.test(n))return s}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,i){for(let r=0;r<n.length;r++)this.tt(n[r],e,t,i)},tr(n,e,t,i){i=i||Gn.groups;let r;return e&&e.j?r=e:(r=new Gn(e),t&&i&&To(e,t,i)),this.jr.push([n,r]),r},ts(n,e,t,i){let r=this;const s=n.length;if(!s)return r;for(let l=0;l<s-1;l++)r=r.tt(n[l]);return r.tt(n[s-1],e,t,i)},tt(n,e,t,i){i=i||Gn.groups;const r=this;if(e&&e.j)return r.j[n]=e,e;const s=e;let l,o=r.go(n);if(o?(l=new Gn,Object.assign(l.j,o.j),l.jr.push.apply(l.jr,o.jr),l.jd=o.jd,l.t=o.t):l=new Gn,s){if(i)if(l.t&&typeof l.t=="string"){const c=Object.assign(HY(l.t,i),t);To(s,c,i)}else t&&To(s,t,i);l.t=s}return r.j[n]=l,l}};const Ze=(n,e,t,i,r)=>n.ta(e,t,i,r),Pt=(n,e,t,i,r)=>n.tr(e,t,i,r),lQ=(n,e,t,i,r)=>n.ts(e,t,i,r),oe=(n,e,t,i,r)=>n.tt(e,t,i,r),bs="WORD",Z1="UWORD",xD="ASCIINUMERICAL",kD="ALPHANUMERICAL",_h="LOCALHOST",X1="TLD",I1="UTLD",Lp="SCHEME",Va="SLASH_SCHEME",Zv="NUM",V1="WS",Xv="NL",hh="OPENBRACE",fh="CLOSEBRACE",dm="OPENBRACKET",pm="CLOSEBRACKET",mm="OPENPAREN",gm="CLOSEPAREN",Om="OPENANGLEBRACKET",ym="CLOSEANGLEBRACKET",bm="FULLWIDTHLEFTPAREN",Sm="FULLWIDTHRIGHTPAREN",vm="LEFTCORNERBRACKET",xm="RIGHTCORNERBRACKET",km="LEFTWHITECORNERBRACKET",wm="RIGHTWHITECORNERBRACKET",Tm="FULLWIDTHLESSTHAN",Cm="FULLWIDTHGREATERTHAN",Am="AMPERSAND",Mm="APOSTROPHE",Qm="ASTERISK",yl="AT",Em="BACKSLASH",$m="BACKTICK",Rm="CARET",wl="COLON",Iv="COMMA",Pm="DOLLAR",Ar="DOT",Dm="EQUALS",Vv="EXCLAMATION",zi="HYPHEN",dh="PERCENT",Nm="PIPE",zm="PLUS",Lm="POUND",ph="QUERY",qv="QUOTE",wD="FULLWIDTHMIDDLEDOT",Hv="SEMI",Mr="SLASH",mh="TILDE",_m="UNDERSCORE",TD="EMOJI",Bm="SYM";var CD=Object.freeze({__proto__:null,ALPHANUMERICAL:kD,AMPERSAND:Am,APOSTROPHE:Mm,ASCIINUMERICAL:xD,ASTERISK:Qm,AT:yl,BACKSLASH:Em,BACKTICK:$m,CARET:Rm,CLOSEANGLEBRACKET:ym,CLOSEBRACE:fh,CLOSEBRACKET:pm,CLOSEPAREN:gm,COLON:wl,COMMA:Iv,DOLLAR:Pm,DOT:Ar,EMOJI:TD,EQUALS:Dm,EXCLAMATION:Vv,FULLWIDTHGREATERTHAN:Cm,FULLWIDTHLEFTPAREN:bm,FULLWIDTHLESSTHAN:Tm,FULLWIDTHMIDDLEDOT:wD,FULLWIDTHRIGHTPAREN:Sm,HYPHEN:zi,LEFTCORNERBRACKET:vm,LEFTWHITECORNERBRACKET:km,LOCALHOST:_h,NL:Xv,NUM:Zv,OPENANGLEBRACKET:Om,OPENBRACE:hh,OPENBRACKET:dm,OPENPAREN:mm,PERCENT:dh,PIPE:Nm,PLUS:zm,POUND:Lm,QUERY:ph,QUOTE:qv,RIGHTCORNERBRACKET:xm,RIGHTWHITECORNERBRACKET:wm,SCHEME:Lp,SEMI:Hv,SLASH:Mr,SLASH_SCHEME:Va,SYM:Bm,TILDE:mh,TLD:X1,UNDERSCORE:_m,UTLD:I1,UWORD:Z1,WORD:bs,WS:V1});const ms=/[a-z]/,Nu=new RegExp("\\p{L}","u"),rb=new RegExp("\\p{Emoji}","u"),gs=/\d/,sb=/\s/,oQ="\r",lb=`
`,YY="️",UY="‍",ob="￼";let ep=null,tp=null;function WY(n=[]){const e={};Gn.groups=e;const t=new Gn;ep==null&&(ep=aQ(ZY)),tp==null&&(tp=aQ(XY)),oe(t,"'",Mm),oe(t,"{",hh),oe(t,"}",fh),oe(t,"[",dm),oe(t,"]",pm),oe(t,"(",mm),oe(t,")",gm),oe(t,"<",Om),oe(t,">",ym),oe(t,"（",bm),oe(t,"）",Sm),oe(t,"「",vm),oe(t,"」",xm),oe(t,"『",km),oe(t,"』",wm),oe(t,"＜",Tm),oe(t,"＞",Cm),oe(t,"&",Am),oe(t,"*",Qm),oe(t,"@",yl),oe(t,"`",$m),oe(t,"^",Rm),oe(t,":",wl),oe(t,",",Iv),oe(t,"$",Pm),oe(t,".",Ar),oe(t,"=",Dm),oe(t,"!",Vv),oe(t,"-",zi),oe(t,"%",dh),oe(t,"|",Nm),oe(t,"+",zm),oe(t,"#",Lm),oe(t,"?",ph),oe(t,'"',qv),oe(t,"/",Mr),oe(t,";",Hv),oe(t,"~",mh),oe(t,"_",_m),oe(t,"\\",Em),oe(t,"・",wD);const i=Pt(t,gs,Zv,{[L1]:!0});Pt(i,gs,i);const r=Pt(i,ms,xD,{[uh]:!0}),s=Pt(i,Nu,kD,{[Ju]:!0}),l=Pt(t,ms,bs,{[_1]:!0});Pt(l,gs,r),Pt(l,ms,l),Pt(r,gs,r),Pt(r,ms,r);const o=Pt(t,Nu,Z1,{[B1]:!0});Pt(o,ms),Pt(o,gs,s),Pt(o,Nu,o),Pt(s,gs,s),Pt(s,ms),Pt(s,Nu,s);const c=oe(t,lb,Xv,{[ib]:!0}),h=oe(t,oQ,V1,{[ib]:!0}),d=Pt(t,sb,V1,{[ib]:!0});oe(t,ob,d),oe(h,lb,c),oe(h,ob,d),Pt(h,sb,d),oe(d,oQ),oe(d,lb),Pt(d,sb,d),oe(d,ob,d);const p=Pt(t,rb,TD,{[vD]:!0});oe(p,"#"),Pt(p,rb,p),oe(p,YY,p);const g=oe(p,UY);oe(g,"#"),Pt(g,rb,p);const O=[[ms,l],[gs,r]],b=[[ms,null],[Nu,o],[gs,s]];for(let v=0;v<ep.length;v++)pl(t,ep[v],X1,bs,O);for(let v=0;v<tp.length;v++)pl(t,tp[v],I1,Z1,b);To(X1,{tld:!0,ascii:!0},e),To(I1,{utld:!0,alpha:!0},e),pl(t,"file",Lp,bs,O),pl(t,"mailto",Lp,bs,O),pl(t,"http",Va,bs,O),pl(t,"https",Va,bs,O),pl(t,"ftp",Va,bs,O),pl(t,"ftps",Va,bs,O),To(Lp,{scheme:!0,ascii:!0},e),To(Va,{slashscheme:!0,ascii:!0},e),n=n.sort((v,x)=>v[0]>x[0]?1:-1);for(let v=0;v<n.length;v++){const x=n[v][0],C=n[v][1]?{[IY]:!0}:{[VY]:!0};x.indexOf("-")>=0?C[j1]=!0:ms.test(x)?gs.test(x)?C[uh]=!0:C[_1]=!0:C[L1]=!0,lQ(t,x,x,C)}return lQ(t,"localhost",_h,{ascii:!0}),t.jd=new Gn(Bm),{start:t,tokens:Object.assign({groups:e},CD)}}function AD(n,e){const t=GY(e.replace(/[A-Z]/g,o=>o.toLowerCase())),i=t.length,r=[];let s=0,l=0;for(;l<i;){let o=n,c=null,h=0,d=null,p=-1,g=-1;for(;l<i&&(c=o.go(t[l]));)o=c,o.accepts()?(p=0,g=0,d=o):p>=0&&(p+=t[l].length,g++),h+=t[l].length,s+=t[l].length,l++;s-=p,l-=g,h-=p,r.push({t:d.t,v:e.slice(s-h,s),s:s-h,e:s})}return r}function GY(n){const e=[],t=n.length;let i=0;for(;i<t;){let r=n.charCodeAt(i),s,l=r<55296||r>56319||i+1===t||(s=n.charCodeAt(i+1))<56320||s>57343?n[i]:n.slice(i,i+2);e.push(l),i+=l.length}return e}function pl(n,e,t,i,r){let s;const l=e.length;for(let o=0;o<l-1;o++){const c=e[o];n.j[c]?s=n.j[c]:(s=new Gn(i),s.jr=r.slice(),n.j[c]=s),n=s}return s=new Gn(t),s.jr=r.slice(),n.j[e[l-1]]=s,s}function aQ(n){const e=[],t=[];let i=0,r="0123456789";for(;i<n.length;){let s=0;for(;r.indexOf(n[i+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let l=parseInt(n.substring(i,i+s),10);l>0;l--)t.pop();i+=s}else t.push(n[i]),i++}return e}const Bh={defaultProtocol:"http",events:null,format:cQ,formatHref:cQ,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yv(n,e=null){let t=Object.assign({},Bh);n&&(t=Object.assign(t,n instanceof Yv?n.o:n));const i=t.ignoreTags,r=[];for(let s=0;s<i.length;s++)r.push(i[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=r}Yv.prototype={o:Bh,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const i=e!=null;let r=this.o[n];return r&&(typeof r=="object"?(r=t.t in r?r[t.t]:Bh[n],typeof r=="function"&&i&&(r=r(e,t))):typeof r=="function"&&i&&(r=r(e,t.t,t)),r)},getObj(n,e,t){let i=this.o[n];return typeof i=="function"&&e!=null&&(i=i(e,t.t,t)),i},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function cQ(n){return n}function MD(n,e){this.t="token",this.v=n,this.tk=e}MD.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),i=n.get("format",e,this);return t&&i.length>t?i.substring(0,t)+"…":i},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Bh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),i=n.get("formatHref",t,this),r=n.get("tagName",t,e),s=this.toFormattedString(n),l={},o=n.get("className",t,e),c=n.get("target",t,e),h=n.get("rel",t,e),d=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return l.href=i,o&&(l.class=o),c&&(l.target=c),h&&(l.rel=h),d&&Object.assign(l,d),{tagName:r,attributes:l,content:s,eventListeners:p}}};function qg(n,e){class t extends MD{constructor(r,s){super(r,s),this.t=n}}for(const i in e)t.prototype[i]=e[i];return t.t=n,t}const uQ=qg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),hQ=qg("text"),FY=qg("nl"),np=qg("url",{isLink:!0,toHref(n=Bh.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==_h&&n[1].t===wl}}),Ni=n=>new Gn(n);function KY({groups:n}){const e=n.domain.concat([Am,Qm,yl,Em,$m,Rm,Pm,Dm,zi,Zv,dh,Nm,zm,Lm,Mr,Bm,mh,_m]),t=[Mm,wl,Iv,Ar,Vv,dh,ph,qv,Hv,Om,ym,hh,fh,pm,dm,mm,gm,bm,Sm,vm,xm,km,wm,Tm,Cm],i=[Am,Mm,Qm,Em,$m,Rm,Pm,Dm,zi,hh,fh,dh,Nm,zm,Lm,ph,Mr,Bm,mh,_m],r=Ni(),s=oe(r,mh);Ze(s,i,s),Ze(s,n.domain,s);const l=Ni(),o=Ni(),c=Ni();Ze(r,n.domain,l),Ze(r,n.scheme,o),Ze(r,n.slashscheme,c),Ze(l,i,s),Ze(l,n.domain,l);const h=oe(l,yl);oe(s,yl,h),oe(o,yl,h),oe(c,yl,h);const d=oe(s,Ar);Ze(d,i,s),Ze(d,n.domain,s);const p=Ni();Ze(h,n.domain,p),Ze(p,n.domain,p);const g=oe(p,Ar);Ze(g,n.domain,p);const O=Ni(uQ);Ze(g,n.tld,O),Ze(g,n.utld,O),oe(h,_h,O);const b=oe(p,zi);oe(b,zi,b),Ze(b,n.domain,p),Ze(O,n.domain,p),oe(O,Ar,g),oe(O,zi,b);const v=oe(O,wl);Ze(v,n.numeric,uQ);const x=oe(l,zi),k=oe(l,Ar);oe(x,zi,x),Ze(x,n.domain,l),Ze(k,i,s),Ze(k,n.domain,l);const C=Ni(np);Ze(k,n.tld,C),Ze(k,n.utld,C),Ze(C,n.domain,l),Ze(C,i,s),oe(C,Ar,k),oe(C,zi,x),oe(C,yl,h);const A=oe(C,wl),P=Ni(np);Ze(A,n.numeric,P);const E=Ni(np),D=Ni();Ze(E,e,E),Ze(E,t,D),Ze(D,e,E),Ze(D,t,D),oe(C,Mr,E),oe(P,Mr,E);const $=oe(o,wl),H=oe(c,wl),W=oe(H,Mr),te=oe(W,Mr);Ze(o,n.domain,l),oe(o,Ar,k),oe(o,zi,x),Ze(c,n.domain,l),oe(c,Ar,k),oe(c,zi,x),Ze($,n.domain,E),oe($,Mr,E),oe($,ph,E),Ze(te,n.domain,E),Ze(te,e,E),oe(te,Mr,E);const ce=[[hh,fh],[dm,pm],[mm,gm],[Om,ym],[bm,Sm],[vm,xm],[km,wm],[Tm,Cm]];for(let ie=0;ie<ce.length;ie++){const[ue,se]=ce[ie],fe=oe(E,ue);oe(D,ue,fe),oe(fe,se,E);const B=Ni(np);Ze(fe,e,B);const G=Ni();Ze(fe,t),Ze(B,e,B),Ze(B,t,G),Ze(G,e,B),Ze(G,t,G),oe(B,se,E),oe(G,se,E)}return oe(r,_h,C),oe(r,Xv,FY),{start:r,tokens:CD}}function JY(n,e,t){let i=t.length,r=0,s=[],l=[];for(;r<i;){let o=n,c=null,h=null,d=0,p=null,g=-1;for(;r<i&&!(c=o.go(t[r].t));)l.push(t[r++]);for(;r<i&&(h=c||o.go(t[r].t));)c=null,o=h,o.accepts()?(g=0,p=o):g>=0&&g++,r++,d++;if(g<0)r-=d,r<i&&(l.push(t[r]),r++);else{l.length>0&&(s.push(ab(hQ,e,l)),l=[]),r-=g,d-=g;const O=p.t,b=t.slice(r-d,r);s.push(ab(O,e,b))}}return l.length>0&&s.push(ab(hQ,e,l)),s}function ab(n,e,t){const i=t[0].s,r=t[t.length-1].e,s=e.slice(i,r);return new n(s,t)}const eU=typeof console<"u"&&console&&console.warn||(()=>{}),tU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",wt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function nU(){return Gn.groups={},wt.scanner=null,wt.parser=null,wt.tokenQueue=[],wt.pluginQueue=[],wt.customSchemes=[],wt.initialized=!1,wt}function fQ(n,e=!1){if(wt.initialized&&eU(`linkifyjs: already initialized - will not register custom scheme "${n}" ${tU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);wt.customSchemes.push([n,e])}function iU(){wt.scanner=WY(wt.customSchemes);for(let n=0;n<wt.tokenQueue.length;n++)wt.tokenQueue[n][1]({scanner:wt.scanner});wt.parser=KY(wt.scanner.tokens);for(let n=0;n<wt.pluginQueue.length;n++)wt.pluginQueue[n][1]({scanner:wt.scanner,parser:wt.parser});return wt.initialized=!0,wt}function Uv(n){return wt.initialized||iU(),JY(wt.parser.start,n,AD(wt.scanner.start,n))}Uv.scan=AD;function QD(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const i=new Yv(t),r=Uv(n),s=[];for(let l=0;l<r.length;l++){const o=r[l];o.isLink&&(!e||o.t===e)&&i.check(o)&&s.push(o.toFormattedObject(i))}return s}var Wv="[\0-   ᠎ -\u2029 　]",rU=new RegExp(Wv),sU=new RegExp(`${Wv}$`),lU=new RegExp(Wv,"g");function oU(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function aU(n){return new yt({key:new Ct("autolink"),appendTransaction:(e,t,i)=>{const r=e.some(h=>h.docChanged)&&!t.doc.eq(i.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!r||s)return;const{tr:l}=i,o=iP(t.doc,[...e]);if(hP(o).forEach(({newRange:h})=>{const d=t4(i.doc,h,O=>O.isTextblock);let p,g;if(d.length>1)p=d[0],g=i.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(d.length){const O=i.doc.textBetween(h.from,h.to," "," ");if(!sU.test(O))return;p=d[0],g=i.doc.textBetween(p.pos,h.to,void 0," ")}if(p&&g){const O=g.split(rU).filter(Boolean);if(O.length<=0)return!1;const b=O[O.length-1],v=p.pos+g.lastIndexOf(b);if(!b)return!1;const x=Uv(b).map(k=>k.toObject(n.defaultProtocol));if(!oU(x))return!1;x.filter(k=>k.isLink).map(k=>({...k,from:v+k.start+1,to:v+k.end+1})).filter(k=>i.schema.marks.code?!i.doc.rangeHasMark(k.from,k.to,i.schema.marks.code):!0).filter(k=>n.validate(k.value)).filter(k=>n.shouldAutoLink(k.value)).forEach(k=>{Mv(k.from,k.to,i.doc).some(C=>C.mark.type===n.type)||l.addMark(k.from,k.to,n.type.create({href:k.href}))})}}),!!l.steps.length)return l}})}function cU(n){return new yt({key:new Ct("handleClickLink"),props:{handleClick:(e,t,i)=>{var r,s;if(i.button!==0||!e.editable)return!1;let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{const c=i.target;if(!c)return!1;const h=n.editor.view.dom;l=c.closest("a"),l&&!h.contains(l)&&(l=null)}if(!l)return!1;let o=!1;if(n.enableClickSelection&&(o=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){const c=uP(e.state,n.type.name),h=(r=l.href)!=null?r:c.href,d=(s=l.target)!=null?s:c.target;h&&(window.open(h,d),o=!0)}return o}}})}function uU(n){return new yt({key:new Ct("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{shouldAutoLink:r}=n,{state:s}=e,{selection:l}=s,{empty:o}=l;if(o)return!1;let c="";i.content.forEach(d=>{c+=d.textContent});const h=QD(c,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!h||r!==void 0&&!r(h.value)?!1:n.editor.commands.setMark(n.type,{href:h.href})}}})}function go(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&t.push(r)}),!n||n.replace(lU,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ED=Go.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){fQ(n);return}fQ(n.scheme,n.optionalSlashes)})},onDestroy(){nU()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!go(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const r=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!go(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Tt(this.options.HTMLAttributes,n),0]:["a",Tt(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,i,r,s;const l=(i=(t=n.attrs)==null?void 0:t.href)!=null?i:"",o=(s=(r=n.attrs)==null?void 0:r.title)!=null?s:"",c=e.renderChildren(n);return o?`[${c}](${l} "${o}")`:`[${c}](${l})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:i=>!!go(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:i=>!!go(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Zo({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:i}=this.options,r=QD(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:l=>!!go(l,t),protocols:t,defaultProtocol:i}));r.length&&r.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(aU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!go(r,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(cU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(uU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),hU=Object.defineProperty,fU=(n,e)=>{for(var t in e)hU(n,t,{get:e[t],enumerable:!0})},dU="listItem",dQ="textStyle",pQ=/^\s*([-+*])\s$/,$D=an.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Tt(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dU,this.editor.getAttributes(dQ)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=pc({find:pQ,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=pc({find:pQ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(dQ),editor:this.editor})),[n]}});function pU(n){var e,t;const i=(e=n.tokens)==null?void 0:e[0];return!!(n.text&&((t=n.tokens)==null?void 0:t.length)===1&&(i==null?void 0:i.type)==="list"&&i.ordered&&i.raw===n.text)}function mU(n,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(n)):e.parseInline([{type:"text",raw:n,text:n}])}var RD=an.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Tt(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{var t;if(n.type!=="list_item")return[];const i=(t=e.parseBlockChildren)!=null?t:e.parseChildren;let r=[];if(n.tokens&&n.tokens.length>0){if(pU(n))return{type:"listItem",content:[{type:"paragraph",content:mU(n.text||"",e)}]};if(n.tokens.some(l=>l.type==="paragraph"))r=i(n.tokens);else{const l=n.tokens[0];if(l&&l.type==="text"&&l.tokens&&l.tokens.length>0){if(r=[{type:"paragraph",content:e.parseInline(l.tokens)}],n.tokens.length>1){const c=n.tokens.slice(1),h=i(c);r.push(...h)}}else r=i(n.tokens)}}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(n,e,t)=>Rv(n,e,i=>{var r,s;return i.parentType==="bulletList"?"- ":i.parentType==="orderedList"?`${(((s=(r=i.meta)==null?void 0:r.parentAttrs)==null?void 0:s.start)||1)+i.index}. `:"- "},t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),gU={};fU(gU,{findListItemPos:()=>mf,getNextListDepth:()=>Gv,handleBackspace:()=>q1,handleDelete:()=>H1,hasListBefore:()=>PD,hasListItemAfter:()=>OU,hasListItemBefore:()=>DD,listItemHasSubList:()=>ND,nextListIsDeeper:()=>zD,nextListIsHigher:()=>LD});var mf=(n,e)=>{const{$from:t}=e.selection,i=Wt(n,e.schema);let r=null,s=t.depth,l=t.pos,o=null;for(;s>0&&o===null;)r=t.node(s),r.type===i?o=s:(s-=1,l-=1);return o===null?null:{$pos:e.doc.resolve(l),depth:o}},Gv=(n,e)=>{const t=mf(n,e);if(!t)return!1;const[,i]=u4(e,n,t.$pos.pos+4);return i},PD=(n,e,t)=>{const{$anchor:i}=n.selection,r=Math.max(0,i.pos-2),s=n.doc.resolve(r).node();return!(!s||!t.includes(s.type.name))},DD=(n,e)=>{var t;const{$anchor:i}=e.selection,r=e.doc.resolve(i.pos-2);return!(r.index()===0||((t=r.nodeBefore)==null?void 0:t.type.name)!==n)},ND=(n,e,t)=>{if(!t)return!1;const i=Wt(n,e.schema);let r=!1;return t.descendants(s=>{s.type===i&&(r=!0)}),r},q1=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!zl(n.state,e)&&PD(n.state,e,t)){const{$anchor:o}=n.state.selection,c=n.state.doc.resolve(o.before()-1),h=[];c.node().descendants((g,O)=>{g.type.name===e&&h.push({node:g,pos:O})});const d=h.at(-1);if(!d)return!1;const p=n.state.doc.resolve(c.start()+d.pos+1);return n.chain().cut({from:o.start()-1,to:o.end()+1},p.end()).joinForward().run()}if(!zl(n.state,e)||!p4(n.state))return!1;const i=mf(e,n.state);if(!i)return!1;const s=n.state.doc.resolve(i.$pos.pos-2).node(i.depth),l=ND(e,n.state,s);return DD(e,n.state)&&!l?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},zD=(n,e)=>{const t=Gv(n,e),i=mf(n,e);return!i||!t?!1:t>i.depth},LD=(n,e)=>{const t=Gv(n,e),i=mf(n,e);return!i||!t?!1:t<i.depth},H1=(n,e)=>{if(!zl(n.state,e)||!d4(n.state,e))return!1;const{selection:t}=n.state,{$from:i,$to:r}=t;return!t.empty&&i.sameParent(r)?!1:zD(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():LD(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},OU=(n,e)=>{var t;const{$anchor:i}=e.selection,r=e.doc.resolve(i.pos-i.parentOffset-2);return!(r.index()===r.parent.childCount-1||((t=r.nodeAfter)==null?void 0:t.type.name)!==n)},_D=Et.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&H1(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&H1(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:i})=>{n.state.schema.nodes[t]!==void 0&&q1(n,t,i)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:i})=>{n.state.schema.nodes[t]!==void 0&&q1(n,t,i)&&(e=!0)}),e}}}}),mQ=/^(\s*)(\d+)\.\s+(.*)$/,yU=/^\s/;function bU(n){const e=n.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function SU(n){const e=[],t=[];let i=!1;return n.forEach(r=>{if(i){t.push(r);return}if(r.trim()===""){i=!0,t.push(r);return}if(e.length>0&&bU(r)){i=!0,t.push(r);return}e.push(r)}),{paragraphLines:e,blockLines:t}}function vU(n){const e=[];let t=0,i=0;for(;t<n.length;){const r=n[t],s=r.match(mQ);if(!s)break;const[,l,o,c]=s,h=l.length,d=[c];let p=t+1;const g=[r];let O=!1;for(;p<n.length;){const b=n[p];if(b.match(mQ))break;if(b.trim()==="")g.push(b),d.push(""),O=!0,p+=1;else if(b.match(yU))g.push(b),d.push(b.slice(h+2)),p+=1;else{if(O)break;g.push(b),d.push(b),p+=1}}e.push({indent:h,number:parseInt(o,10),content:d.join(`
`).trim(),contentLines:d,raw:g.join(`
`)}),i=p,t=p}return[e,i]}function BD(n,e,t){const i=[];let r=0;for(;r<n.length;){const s=n[r];if(s.indent===e){const{paragraphLines:l,blockLines:o}=SU(s.contentLines),c=l.join(`
`).trim(),h=[];c&&h.push({type:"paragraph",raw:c,tokens:t.inlineTokens(c)});const d=o.join(`
`).trim();if(d){const O=t.blockTokens(d);h.push(...O)}let p=r+1;const g=[];for(;p<n.length&&n[p].indent>e;)g.push(n[p]),p+=1;if(g.length>0){const O=Math.min(...g.map(v=>v.indent)),b=BD(g,O,t);h.push({type:"list",ordered:!0,start:g[0].number,items:b,raw:g.map(v=>v.raw).join(`
`)})}i.push({type:"list_item",raw:s.raw,tokens:h}),r=p}else r+=1}return i}function xU(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const i=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(r=>{if(r.type==="paragraph"||r.type==="list"||r.type==="blockquote"||r.type==="code")i.push(...e.parseChildren([r]));else if(r.type==="text"&&r.tokens){const s=e.parseChildren([r]);i.push({type:"paragraph",content:s})}else{const s=e.parseChildren([r]);s.length>0&&i.push(...s)}}),{type:"listItem",content:i}})}var kU="listItem",gQ="textStyle",OQ=/^(\d+)\.\s$/,jD=an.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Tt(this.options.HTMLAttributes,t),0]:["ol",Tt(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,i=n.items?xU(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const e=n.match(/^(\s*)(\d+)\.\s+/),t=e==null?void 0:e.index;return t!==void 0?t:-1},tokenize:(n,e,t)=>{var i;const r=n.split(`
`),[s,l]=vU(r);if(s.length===0)return;const o=BD(s,0,t);return o.length===0?void 0:{type:"list",ordered:!0,start:((i=s[0])==null?void 0:i.number)||1,items:o,raw:r.slice(0,l).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(kU,this.editor.getAttributes(gQ)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=pc({find:OQ,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=pc({find:OQ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(gQ)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),wU=/^\s*(\[([( |x])?\])\s$/,ZD=an.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",Tt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const i=e.parseChildren(n.nestedTokens);t.push(...i)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Rv(n,e,r)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:i})=>{const r=document.createElement("li"),s=document.createElement("label"),l=document.createElement("span"),o=document.createElement("input"),c=document.createElement("div"),h=p=>{var g,O;o.ariaLabel=((O=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:O.call(g,p,o.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};h(n),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",p=>p.preventDefault()),o.addEventListener("change",p=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:g}=p.target;i.isEditable&&typeof t=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:O})=>{const b=t();if(typeof b!="number")return!1;const v=O.doc.nodeAt(b);return O.setNodeMarkup(b,void 0,{...v==null?void 0:v.attrs,checked:g}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,g)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,g])=>{r.setAttribute(p,g)}),r.dataset.checked=n.attrs.checked,o.checked=n.attrs.checked,s.append(o,l),r.append(s,c),Object.entries(e).forEach(([p,g])=>{r.setAttribute(p,g)});let d=new Set(Object.keys(e));return{dom:r,contentDOM:c,update:p=>{if(p.type!==this.type)return!1;r.dataset.checked=p.attrs.checked,o.checked=p.attrs.checked,h(p);const g=i.extensionManager.attributes,O=Nh(p,g),b=new Set(Object.keys(O)),v=this.options.HTMLAttributes;return d.forEach(x=>{b.has(x)||(x in v?r.setAttribute(x,v[x]):r.removeAttribute(x))}),Object.entries(O).forEach(([x,k])=>{k==null?x in v?r.setAttribute(x,v[x]):r.removeAttribute(x):r.setAttribute(x,k)}),d=b,!0}}}},addInputRules(){return[pc({find:wU,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),XD=an.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",Tt(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const i=s=>{const l=A1(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,c)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:c}),customNestedParser:i},t);return l?[{type:"taskList",raw:l.raw,items:l.items}]:t.blockTokens(s)},r=A1(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,l)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:l}),customNestedParser:i},t);if(r)return{type:"taskList",raw:r.raw,items:r.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Et.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push($D.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(RD.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(_D.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(jD.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(ZD.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(XD.configure(this.options.taskList)),n}});var ip="&nbsp;",cb=" ",TU=an.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Tt(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const i=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===ip||t[0].text===ip||t[0].raw===cb||t[0].text===cb)&&i.length===1&&i[0].type==="text"&&(i[0].text===ip||i[0].text===cb)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,i)},renderMarkdown:(n,e,t)=>{var i,r;if(!n)return"";const s=Array.isArray(n.content)?n.content:[];if(s.length===0){const l=Array.isArray((i=t==null?void 0:t.previousNode)==null?void 0:i.content)?t.previousNode.content:[];return((r=t==null?void 0:t.previousNode)==null?void 0:r.type)==="paragraph"&&l.length===0?ip:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),CU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,AU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MU=Go.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Tt(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[dc({find:CU,type:this.type})]},addPasteRules(){return[Zo({find:AU,type:this.type})]}}),QU=an.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),EU=Go.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",Tt(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:t.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function $U(n={}){return new yt({view(e){return new RU(e,n)}})}class RU{constructor(e,t){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=t.width)!==null&&i!==void 0?i:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let s=l=>{this[r](l)};return e.dom.addEventListener(r,s),{name:r,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,i,r=this.editorView.dom,s=r.getBoundingClientRect(),l=s.width/r.offsetWidth,o=s.height/r.offsetHeight;if(t){let p=e.nodeBefore,g=e.nodeAfter;if(p||g){let O=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(O){let b=O.getBoundingClientRect(),v=p?b.bottom:b.top;p&&g&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*o;i={left:b.left,right:b.right,top:v-x,bottom:v+x}}}}if(!i){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*l;i={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let h,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")h=-pageXOffset,d=-pageYOffset;else{let p=c.getBoundingClientRect(),g=p.width/c.offsetWidth,O=p.height/c.offsetHeight;h=p.left-c.scrollLeft*g,d=p.top-c.scrollTop*O}this.element.style.left=(i.left-h)/l+"px",this.element.style.top=(i.top-d)/o+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=i&&i.type.spec.disableDropCursor,s=typeof r=="function"?r(this.editorView,t,e):r;if(t&&!s){let l=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=YR(this.editorView.state.doc,l,this.editorView.dragging.slice);o!=null&&(l=o)}this.setCursor(l),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Dt extends $e{constructor(e){super(e,e)}map(e,t){let i=e.resolve(t.map(this.head));return Dt.valid(i)?new Dt(i):$e.near(i)}content(){return me.empty}eq(e){return e instanceof Dt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Dt(e.resolve(t.pos))}getBookmark(){return new Fv(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!PU(e)||!DU(e))return!1;let i=t.type.spec.allowGapCursor;if(i!=null)return i;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,i=!1){e:for(;;){if(!i&&Dt.valid(e))return e;let r=e.pos,s=null;for(let l=e.depth;;l--){let o=e.node(l);if(t>0?e.indexAfter(l)<o.childCount:e.index(l)>0){s=o.child(t>0?e.indexAfter(l):e.index(l)-1);break}else if(l==0)return null;r+=t;let c=e.doc.resolve(r);if(Dt.valid(c))return c}for(;;){let l=t>0?s.firstChild:s.lastChild;if(!l){if(s.isAtom&&!s.isText&&!we.isSelectable(s)){e=e.doc.resolve(r+s.nodeSize*t),i=!1;continue e}break}s=l,r+=t;let o=e.doc.resolve(r);if(Dt.valid(o))return o}return null}}}Dt.prototype.visible=!1;Dt.findFrom=Dt.findGapCursorFrom;$e.jsonID("gapcursor",Dt);class Fv{constructor(e){this.pos=e}map(e){return new Fv(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Dt.valid(t)?new Dt(t):$e.near(t)}}function ID(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function PU(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),i=n.node(e);if(t==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||ID(r.type))return!0;if(r.inlineContent)return!1}}return!0}function DU(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),i=n.node(e);if(t==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||ID(r.type))return!0;if(r.inlineContent)return!1}}return!0}function NU(){return new yt({props:{decorations:BU,createSelectionBetween(n,e,t){return e.pos==t.pos&&Dt.valid(t)?new Dt(t):null},handleClick:LU,handleKeyDown:zU,handleDOMEvents:{beforeinput:_U}}})}const zU=Sv({ArrowLeft:rp("horiz",-1),ArrowRight:rp("horiz",1),ArrowUp:rp("vert",-1),ArrowDown:rp("vert",1)});function rp(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,s){let l=i.selection,o=e>0?l.$to:l.$from,c=l.empty;if(l instanceof Ce){if(!s.endOfTextblock(t)||o.depth==0)return!1;c=!1,o=i.doc.resolve(e>0?o.after():o.before())}let h=Dt.findGapCursorFrom(o,e,c);return h?(r&&r(i.tr.setSelection(new Dt(h))),!0):!1}}function LU(n,e,t){if(!n||!n.editable)return!1;let i=n.state.doc.resolve(e);if(!Dt.valid(i))return!1;let r=n.posAtCoords({left:t.clientX,top:t.clientY});return r&&r.inside>-1&&we.isSelectable(n.state.doc.nodeAt(r.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Dt(i))),!0)}function _U(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Dt))return!1;let{$from:t}=n.state.selection,i=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!i)return!1;let r=ne.empty;for(let l=i.length-1;l>=0;l--)r=ne.from(i[l].createAndFill(null,r));let s=n.state.tr.replace(t.pos,t.pos,new me(r,0,0));return s.setSelection(Ce.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function BU(n){if(!(n.selection instanceof Dt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",vt.create(n.doc,[xi.widget(n.selection.head,e,{key:"gapcursor"})])}var jm=200,on=function(){};on.prototype.append=function(e){return e.length?(e=on.from(e),!this.length&&e||e.length<jm&&this.leafAppend(e)||this.length<jm&&e.leafPrepend(this)||this.appendInner(e)):this};on.prototype.prepend=function(e){return e.length?on.from(e).append(this):this};on.prototype.appendInner=function(e){return new jU(this,e)};on.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?on.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};on.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};on.prototype.forEach=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)};on.prototype.map=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(s,l){return r.push(e(s,l))},t,i),r};on.from=function(e){return e instanceof on?e:e&&e.length?new VD(e):on.empty};var VD=(function(n){function e(i){n.call(this),this.values=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,s){return r==0&&s==this.length?this:new e(this.values.slice(r,s))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,s,l,o){for(var c=s;c<l;c++)if(r(this.values[c],o+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,l,o){for(var c=s-1;c>=l;c--)if(r(this.values[c],o+c)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=jm)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=jm)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(on);on.empty=new VD([]);var jU=(function(n){function e(t,i){n.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,s,l){var o=this.left.length;if(r<o&&this.left.forEachInner(i,r,Math.min(s,o),l)===!1||s>o&&this.right.forEachInner(i,Math.max(r-o,0),Math.min(this.length,s)-o,l+o)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,s,l){var o=this.left.length;if(r>o&&this.right.forEachInvertedInner(i,r-o,Math.max(s,o)-o,l+o)===!1||s<o&&this.left.forEachInvertedInner(i,Math.min(r,o),s,l)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var s=this.left.length;return r<=s?this.left.slice(i,r):i>=s?this.right.slice(i-s,r-s):this.left.slice(i,s).append(this.right.slice(0,r-s))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e})(on);const ZU=500;class tr{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,s;t&&(r=this.remapping(i,this.items.length),s=r.maps.length);let l=e.tr,o,c,h=[],d=[];return this.items.forEach((p,g)=>{if(!p.step){r||(r=this.remapping(i,g+1),s=r.maps.length),s--,d.push(p);return}if(r){d.push(new Qr(p.map));let O=p.step.map(r.slice(s)),b;O&&l.maybeStep(O).doc&&(b=l.mapping.maps[l.mapping.maps.length-1],h.push(new Qr(b,void 0,void 0,h.length+d.length))),s--,b&&r.appendMap(b,s)}else l.maybeStep(p.step);if(p.selection)return o=r?p.selection.map(r.slice(s)):p.selection,c=new tr(this.items.slice(0,i).append(d.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:l,selection:o}}addTransform(e,t,i,r){let s=[],l=this.eventCount,o=this.items,c=!r&&o.length?o.get(o.length-1):null;for(let d=0;d<e.steps.length;d++){let p=e.steps[d].invert(e.docs[d]),g=new Qr(e.mapping.maps[d],p,t),O;(O=c&&c.merge(g))&&(g=O,d?s.pop():o=o.slice(0,o.length-1)),s.push(g),t&&(l++,t=void 0),r||(c=g)}let h=l-i.depth;return h>IU&&(o=XU(o,h),l-=h),new tr(o.append(s),l)}remapping(e,t){let i=new Mh;return this.items.forEach((r,s)=>{let l=r.mirrorOffset!=null&&s-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,l)},e,t),i}addMaps(e){return this.eventCount==0?this:new tr(this.items.append(e.map(t=>new Qr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-t),s=e.mapping,l=e.steps.length,o=this.eventCount;this.items.forEach(g=>{g.selection&&o--},r);let c=t;this.items.forEach(g=>{let O=s.getMirror(--c);if(O==null)return;l=Math.min(l,O);let b=s.maps[O];if(g.step){let v=e.steps[O].invert(e.docs[O]),x=g.selection&&g.selection.map(s.slice(c+1,O));x&&o++,i.push(new Qr(b,v,x))}else i.push(new Qr(b))},r);let h=[];for(let g=t;g<l;g++)h.push(new Qr(s.maps[g]));let d=this.items.slice(0,r).append(h).append(i),p=new tr(d,o);return p.emptyItemCount()>ZU&&(p=p.compress(this.items.length-i.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),i=t.maps.length,r=[],s=0;return this.items.forEach((l,o)=>{if(o>=e)r.push(l),l.selection&&s++;else if(l.step){let c=l.step.map(t.slice(i)),h=c&&c.getMap();if(i--,h&&t.appendMap(h,i),c){let d=l.selection&&l.selection.map(t.slice(i));d&&s++;let p=new Qr(h.invert(),c,d),g,O=r.length-1;(g=r.length&&r[O].merge(p))?r[O]=g:r.push(p)}}else l.map&&i--},this.items.length,0),new tr(on.from(r.reverse()),s)}}tr.empty=new tr(on.empty,0);function XU(n,e){let t;return n.forEach((i,r)=>{if(i.selection&&e--==0)return t=r,!1}),n.slice(t)}class Qr{constructor(e,t,i,r){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Qr(t.getMap().invert(),t,this.selection)}}}let bl=class{constructor(e,t,i,r,s){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=r,this.prevComposition=s}};const IU=20;function VU(n,e,t,i){let r=t.getMeta(Do),s;if(r)return r.historyState;t.getMeta(YU)&&(n=new bl(n.done,n.undone,null,0,-1));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(Do))return l.getMeta(Do).redo?new bl(n.done.addTransform(t,void 0,i,_p(e)),n.undone,yQ(t.mapping.maps),n.prevTime,n.prevComposition):new bl(n.done,n.undone.addTransform(t,void 0,i,_p(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let o=t.getMeta("composition"),c=n.prevTime==0||!l&&n.prevComposition!=o&&(n.prevTime<(t.time||0)-i.newGroupDelay||!qU(t,n.prevRanges)),h=l?ub(n.prevRanges,t.mapping):yQ(t.mapping.maps);return new bl(n.done.addTransform(t,c?e.selection.getBookmark():void 0,i,_p(e)),tr.empty,h,t.time,o??n.prevComposition)}else return(s=t.getMeta("rebased"))?new bl(n.done.rebased(t,s),n.undone.rebased(t,s),ub(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new bl(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ub(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function qU(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((i,r)=>{for(let s=0;s<e.length;s+=2)i<=e[s+1]&&r>=e[s]&&(t=!0)}),t}function yQ(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((i,r,s,l)=>e.push(s,l));return e}function ub(n,e){if(!n)return null;let t=[];for(let i=0;i<n.length;i+=2){let r=e.map(n[i],1),s=e.map(n[i+1],-1);r<=s&&t.push(r,s)}return t}function HU(n,e,t){let i=_p(e),r=Do.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,i);if(!s)return null;let l=s.selection.resolve(s.transform.doc),o=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),r,i),c=new bl(t?o:s.remaining,t?s.remaining:o,null,0,-1);return s.transform.setSelection(l).setMeta(Do,{redo:t,historyState:c})}let hb=!1,bQ=null;function _p(n){let e=n.plugins;if(bQ!=e){hb=!1,bQ=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){hb=!0;break}}return hb}const Do=new Ct("history"),YU=new Ct("closeHistory");function UU(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new yt({key:Do,state:{init(){return new bl(tr.empty,tr.empty,null,0,-1)},apply(e,t,i){return VU(t,i,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let i=t.inputType,r=i=="historyUndo"?HD:i=="historyRedo"?YD:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function qD(n,e){return(t,i)=>{let r=Do.getState(t);if(!r||(n?r.undone:r.done).eventCount==0)return!1;if(i){let s=HU(r,t,n);s&&i(e?s.scrollIntoView():s)}return!0}}const HD=qD(!1,!0),YD=qD(!0,!0);Et.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const i=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(i)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new yt({key:new Ct("characterCount"),appendTransaction:(e,t,i)=>{if(n)return;const r=this.options.limit;if(r==null||r===0){n=!0;return}const s=this.storage.characters({node:i.doc});if(s>r){const l=s-r,o=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const h=i.tr.deleteRange(o,c);return n=!0,h}n=!0},filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||i===0||i===null||i===void 0)return!0;const r=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=i||r>i&&s>i&&s<=r)return!0;if(r>i&&s>i&&s>r||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,c=s-i,h=o-c,d=o;return e.deleteRange(h,d),!(this.storage.characters({node:e.doc})>i)}})]}});var WU=Et.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[$U(this.options)]}});Et.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yt({key:new Ct("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:i}=this.editor,{anchor:r}=e,s=[];if(!t||!i)return vt.create(n,[]);let l=0;this.options.mode==="deepest"&&n.descendants((c,h)=>{if(c.isText)return;if(!(r>=h&&r<=h+c.nodeSize-1))return!1;l+=1});let o=0;return n.descendants((c,h)=>{if(c.isText||!(r>=h&&r<=h+c.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&l-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";s.push(xi.node(h,h+c.nodeSize,{class:this.options.className}))}),vt.create(n,s)}}})]}});var GU=Et.create({name:"gapCursor",addProseMirrorPlugins(){return[NU()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=tt(xe(n,"allowGapCursor",t)))!=null?e:null}}}),SQ="placeholder";function FU(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var KU=Et.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:SQ,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const n=this.options.dataAttribute?`data-${FU(this.options.dataAttribute)}`:`data-${SQ}`;return[new yt({key:new Ct("placeholder"),props:{decorations:({doc:e,selection:t})=>{const i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,s=[];if(!i)return null;const l=this.editor.isEmpty;return e.descendants((o,c)=>{const h=r>=c&&r<=c+o.nodeSize,d=!o.isLeaf&&Lg(o);if(!o.type.isTextblock)return this.options.includeChildren;if((h||!this.options.showOnlyCurrent)&&d){const p=[this.options.emptyNodeClass];l&&p.push(this.options.emptyEditorClass);const g=xi.node(c,c+o.nodeSize,{class:p.join(" "),[n]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:c,hasAnchor:h}):this.options.placeholder});s.push(g)}return this.options.includeChildren}),vt.create(e,s)}}})]}});Et.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new yt({key:new Ct("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||fP(t.selection)||n.view.dragging?null:vt.create(t.doc,[xi.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var JU="skipTrailingNode";function vQ({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var e6=Et.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new Ct(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",i=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(t).includes(r.name));return[new yt({key:e,appendTransaction:(r,s,l)=>{const{doc:o,tr:c,schema:h}=l,d=e.getState(l),p=o.content.size,g=h.nodes[t];if(!r.some(O=>O.getMeta(JU))&&d)return c.insert(p,g.create())},state:{init:(r,s)=>{const l=s.tr.doc.lastChild;return!vQ({node:l,types:i})},apply:(r,s)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return s;const l=r.doc.lastChild;return!vQ({node:l,types:i})}}})]}}),t6=Et.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>HD(n,e),redo:()=>({state:n,dispatch:e})=>YD(n,e)}},addProseMirrorPlugins(){return[UU(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),n6=Et.create({name:"starterKit",addExtensions(){var n,e,t,i;const r=[];return this.options.bold!==!1&&r.push(TY.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(SY.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push($D.configure(this.options.bulletList)),this.options.code!==!1&&r.push(MY.configure(this.options.code)),this.options.codeBlock!==!1&&r.push($Y.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(RY.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(WU.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(GU.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(PY.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(DY.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(t6.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(NY.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(jY.configure(this.options.italic)),this.options.listItem!==!1&&r.push(RD.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(_D.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&r.push(ED.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&r.push(jD.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(TU.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(MU.configure(this.options.strike)),this.options.text!==!1&&r.push(QU.configure(this.options.text)),this.options.underline!==!1&&r.push(EU.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&r.push(e6.configure((i=this.options)==null?void 0:i.trailingNode)),r}}),i6=n6,r6=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,s6=an.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",Tt(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,i,r,s,l;const o=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",c=(r=(i=n.attrs)==null?void 0:i.alt)!=null?r:"",h=(l=(s=n.attrs)==null?void 0:s.title)!=null?l:"";return h?`![${c}](${o} "${h}")`:`![${c}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:i}=this.options.resize;return({node:r,getPos:s,HTMLAttributes:l,editor:o})=>{const c=document.createElement("img");Object.entries(l).forEach(([p,g])=>{if(g!=null)switch(p){case"width":case"height":break;default:c.setAttribute(p,g);break}}),c.src=l.src;const h=new tV({element:c,editor:o,node:r,getPos:s,onResize:(p,g)=>{c.style.width=`${p}px`,c.style.height=`${g}px`},onCommit:(p,g)=>{const O=s();O!==void 0&&this.editor.chain().setNodeSelection(O).updateAttributes(this.name,{width:p,height:g}).run()},onUpdate:(p,g,O)=>p.type===r.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:i===!0}}),d=h.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",c.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},h}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[EP({find:r6,type:this.type,getAttributes:n=>{const[,,e,t,i]=n;return{src:t,alt:e,title:i}}})]}});function Zm(n){return n==="left"||n==="right"||n==="center"?n:null}function l6(n){const e=(n.style.textAlign||"").trim().toLowerCase(),t=(n.getAttribute("align")||"").trim().toLowerCase();return Zm(e||t)}function o6(n){return Zm(n==null?void 0:n.align)}function UD(){return{default:null,parseHTML:n=>l6(n),renderHTML:n=>n.align?{style:`text-align: ${n.align}`}:{}}}var WD=an.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{var e,t;const i=n.getAttribute("colwidth"),r=i?i.split(",").map(s=>parseInt(s,10)):null;if(!r){const s=(e=n.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),l=Array.from(((t=n.parentElement)==null?void 0:t.children)||[]).indexOf(n);if(l&&l>-1&&s&&s[l]){const o=s[l].getAttribute("width");return o?[parseInt(o,10)]:null}}return r}},align:UD()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",Tt(this.options.HTMLAttributes,n),0]}}),GD=an.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(i=>parseInt(i,10)):null}},align:UD()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",Tt(this.options.HTMLAttributes,n),0]}}),FD=an.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",Tt(this.options.HTMLAttributes,n),0]}});function Y1(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function xQ(n,e,t,i,r,s){var l;let o=0,c=!0,h=e.firstChild;const d=n.firstChild;if(d!==null)for(let g=0,O=0;g<d.childCount;g+=1){const{colspan:b,colwidth:v}=d.child(g).attrs;for(let x=0;x<b;x+=1,O+=1){const k=r===O?s:v&&v[x],C=k?`${k}px`:"";if(o+=k||i,k||(c=!1),h){if(h.style.width!==C){const[A,P]=Y1(i,k);h.style.setProperty(A,P)}h=h.nextSibling}else{const A=document.createElement("col"),[P,E]=Y1(i,k);A.style.setProperty(P,E),e.appendChild(A)}}}for(;h;){const g=h.nextSibling;(l=h.parentNode)==null||l.removeChild(h),h=g}const p=n.attrs.style&&typeof n.attrs.style=="string"&&/\bwidth\s*:/i.test(n.attrs.style);c&&!p?(t.style.width=`${o}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${o}px`)}var a6=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),n.attrs.style&&(this.table.style.cssText=n.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),xQ(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!==this.node.type?!1:(this.node=n,xQ(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){const e=n.target,t=this.dom.contains(e),i=this.contentDOM.contains(e);return!!(t&&!i&&(n.type==="attributes"||n.type==="childList"||n.type==="characterData"))}};function c6(n,e,t,i){let r=0,s=!0;const l=[],o=n.firstChild;if(!o)return{};for(let p=0,g=0;p<o.childCount;p+=1){const{colspan:O,colwidth:b}=o.child(p).attrs;for(let v=0;v<O;v+=1,g+=1){const x=t===g?i:b&&b[v];r+=x||e,x||(s=!1);const[k,C]=Y1(e,x);l.push(["col",{style:`${k}: ${C}`}])}}const c=s?`${r}px`:"",h=s?"":`${r}px`;return{colgroup:["colgroup",{},...l],tableWidth:c,tableMinWidth:h}}function kQ(n,e){return n.createAndFill()}function u6(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const i=n.nodes[t];i.spec.tableRole&&(e[i.spec.tableRole]=i)}),n.cached.tableNodeTypes=e,e}function h6(n,e,t,i,r){const s=u6(n),l=[],o=[];for(let h=0;h<t;h+=1){const d=kQ(s.cell);if(d&&o.push(d),i){const p=kQ(s.header_cell);p&&l.push(p)}}const c=[];for(let h=0;h<e;h+=1)c.push(s.row.createChecked(null,i&&h===0?l:o));return s.table.createChecked(null,c)}function f6(n){return n instanceof gt}var sp=({editor:n})=>{const{selection:e}=n.state;if(!f6(e))return!1;let t=0;const i=rP(e.ranges[0].$from,s=>s.type.name==="table");return i==null||i.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},d6="";function p6(n){return(n||"").replace(/\s+/g," ").trim()}function m6(n,e,t={}){var i;const r=(i=t.cellLineSeparator)!=null?i:d6;if(!n||!n.content||n.content.length===0)return"";const s=[];n.content.forEach(v=>{const x=[];v.content&&v.content.forEach(k=>{let C="";k.content&&Array.isArray(k.content)&&k.content.length>1?C=k.content.map($=>e.renderChildren($)).join(r):C=k.content?e.renderChildren(k.content):"";const A=p6(C),P=k.type==="tableHeader",E=o6(k.attrs);x.push({text:A,isHeader:P,align:E})}),s.push(x)});const l=s.reduce((v,x)=>Math.max(v,x.length),0);if(l===0)return"";const o=new Array(l).fill(0);s.forEach(v=>{var x;for(let k=0;k<l;k+=1){const A=(((x=v[k])==null?void 0:x.text)||"").length;A>o[k]&&(o[k]=A),o[k]<3&&(o[k]=3)}});const c=(v,x)=>v+" ".repeat(Math.max(0,x-v.length)),h=s[0],d=h.some(v=>v.isHeader),p=new Array(l).fill(null);s.forEach(v=>{var x;for(let k=0;k<l;k+=1)!p[k]&&((x=v[k])!=null&&x.align)&&(p[k]=v[k].align)});let g=`
`;const O=new Array(l).fill(0).map((v,x)=>d&&h[x]&&h[x].text||"");return g+=`| ${O.map((v,x)=>c(v,o[x])).join(" | ")} |
`,g+=`| ${o.map((v,x)=>{const k=Math.max(3,v),C=p[x];return C==="left"?`:${"-".repeat(k)}`:C==="right"?`${"-".repeat(k)}:`:C==="center"?`:${"-".repeat(k)}:`:"-".repeat(k)}).join(" | ")} |
`,(d?s.slice(1):s).forEach(v=>{g+=`| ${new Array(l).fill(0).map((x,k)=>c(v[k]&&v[k].text||"",o[k])).join(" | ")} |
`}),g}var g6=m6,KD=an.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:a6,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:i,tableMinWidth:r}=c6(n,this.options.cellMinWidth),s=e.style;function l(){return s||(i?`width: ${i}`:`min-width: ${r}`)}const o=["table",Tt(this.options.HTMLAttributes,e,{style:l()}),t,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(n,e)=>{const t=[],i=Array.isArray(n.align)?n.align:[];if(n.header){const r=[];n.header.forEach((s,l)=>{var o;const c=Zm((o=i[l])!=null?o:s.align),h=c?{align:c}:{};r.push(e.createNode("tableHeader",h,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),t.push(e.createNode("tableRow",{},r))}return n.rows&&n.rows.forEach(r=>{const s=[];r.forEach((l,o)=>{var c;const h=Zm((c=i[o])!=null?c:l.align),d=h?{align:h}:{};s.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(l.tokens)}]))}),t.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,t)},renderMarkdown:(n,e)=>g6(n,e),addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:i,dispatch:r,editor:s})=>{const l=h6(s.schema,n,e,t);if(r){const o=i.selection.from+1;i.replaceSelectionWith(l).scrollIntoView().setSelection(Ce.near(i.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>pH(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>mH(n,e),deleteColumn:()=>({state:n,dispatch:e})=>OH(n,e),addRowBefore:()=>({state:n,dispatch:e})=>bH(n,e),addRowAfter:()=>({state:n,dispatch:e})=>SH(n,e),deleteRow:()=>({state:n,dispatch:e})=>xH(n,e),deleteTable:()=>({state:n,dispatch:e})=>QH(n,e),mergeCells:()=>({state:n,dispatch:e})=>UM(n,e),splitCell:()=>({state:n,dispatch:e})=>WM(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>Lh("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>Lh("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>AH(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>UM(n,e)?!0:WM(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:i})=>TH(n,e)(t,i),goToNextCell:()=>({state:n,dispatch:e})=>FM(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>FM(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&uD(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const i=gt.create(e.doc,n.anchorCell,n.headCell);e.setSelection(i)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:sp,"Mod-Backspace":sp,Delete:sp,"Mod-Delete":sp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BH({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],WH({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const n=this.options.resizable&&this.editor.isEditable,e=this.options.View;return n||!e?null:({node:t,view:i})=>new e(t,this.options.cellMinWidth,i)},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:tt(xe(n,"tableRole",e))}}});Et.create({name:"tableKit",addExtensions(){const n=[];return this.options.table!==!1&&n.push(KD.configure(this.options.table)),this.options.tableCell!==!1&&n.push(WD.configure(this.options.tableCell)),this.options.tableHeader!==!1&&n.push(GD.configure(this.options.tableHeader)),this.options.tableRow!==!1&&n.push(FD.configure(this.options.tableRow)),n}});function U1(){return U1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},U1.apply(null,arguments)}function O6(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let W1=[],JD=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?JD:W1).push(t=t+n[e])})();function y6(n){if(n<768)return!1;for(let e=0,t=W1.length;;){let i=e+t>>1;if(n<W1[i])t=i;else if(n>=JD[i])e=i+1;else return!0;if(e==t)return!1}}function wQ(n){return n>=127462&&n<=127487}const TQ=8205;function b6(n,e,t=!0,i=!0){return(t?eN:S6)(n,e,i)}function eN(n,e,t){if(e==n.length)return e;e&&tN(n.charCodeAt(e))&&nN(n.charCodeAt(e-1))&&e--;let i=fb(n,e);for(e+=CQ(i);e<n.length;){let r=fb(n,e);if(i==TQ||r==TQ||t&&y6(r))e+=CQ(r),i=r;else if(wQ(r)){let s=0,l=e-2;for(;l>=0&&wQ(fb(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function S6(n,e,t){for(;e>0;){let i=eN(n,e-2,t);if(i<e)return i;e--}return 0}function fb(n,e){let t=n.charCodeAt(e);if(!nN(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return tN(i)?(t-55296<<10)+(i-56320)+65536:t}function tN(n){return n>=56320&&n<57344}function nN(n){return n>=55296&&n<56320}function CQ(n){return n<65536?1:2}class Ge{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Oc(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Er.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Oc(this,e,t);let i=[];return this.decompose(e,t,i,0),Er.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new gh(this),s=new gh(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new gh(this,e)}iterRange(e,t=this.length){return new iN(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new rN(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ge.empty:e.length<=32?new Zt(e):Er.from(Zt.split(e,[]))}}class Zt extends Ge{constructor(e,t=v6(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new x6(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new Zt(AQ(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=Bp(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new Zt(o,l.length+s.length));else{let c=o.length>>1;i.push(new Zt(o.slice(0,c)),new Zt(o.slice(c)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof Zt))return super.replace(e,t,i);[e,t]=Oc(this,e,t);let r=Bp(this.text,Bp(i.text,AQ(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new Zt(r,s):Er.from(Zt.split(r,[]),s)}sliceString(e,t=this.length,i=`
`){[e,t]=Oc(this,e,t);let r="";for(let s=0,l=0;s<=t&&l<this.text.length;l++){let o=this.text[l],c=s+o.length;s>e&&l&&(r+=i),e<c&&t>s&&(r+=o.slice(Math.max(0,e-s),t-s)),s=c+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new Zt(i,r)),i=[],r=-1);return r>-1&&t.push(new Zt(i,r)),t}}class Er extends Ge{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.children[s],o=r+l.length,c=i+l.lines-1;if((t?c:o)>=e)return l.lineInner(e,t,i,r);r=o+1,i=c+1}}decompose(e,t,i,r){for(let s=0,l=0;l<=t&&s<this.children.length;s++){let o=this.children[s],c=l+o.length;if(e<=c&&t>=l){let h=r&((l<=e?1:0)|(c>=t?2:0));l>=e&&c<=t&&!h?i.push(o):o.decompose(e-l,t-l,i,h)}l=c+1}}replace(e,t,i){if([e,t]=Oc(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let l=this.children[r],o=s+l.length;if(e>=s&&t<=o){let c=l.replace(e-s,t-s,i),h=this.lines-l.lines+c.lines;if(c.lines<h>>4&&c.lines>h>>6){let d=this.children.slice();return d[r]=c,new Er(d,this.length-(t-e)+i.length)}return super.replace(s,o,c)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
`){[e,t]=Oc(this,e,t);let r="";for(let s=0,l=0;s<this.children.length&&l<=t;s++){let o=this.children[s],c=l+o.length;l>e&&s&&(r+=i),e<c&&t>l&&(r+=o.sliceString(e-l,t-l,i)),l=c+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Er))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let c=this.children[r],h=e.children[s];if(c!=h)return i+c.scanIdentical(h,t);i+=c.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let b of e)b.flatten(O);return new Zt(O,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],c=0,h=-1,d=[];function p(O){let b;if(O.lines>s&&O instanceof Er)for(let v of O.children)p(v);else O.lines>l&&(c>l||!c)?(g(),o.push(O)):O instanceof Zt&&c&&(b=d[d.length-1])instanceof Zt&&O.lines+b.lines<=32?(c+=O.lines,h+=O.length+1,d[d.length-1]=new Zt(b.text.concat(O.text),b.length+1+O.length)):(c+O.lines>r&&g(),c+=O.lines,h+=O.length+1,d.push(O))}function g(){c!=0&&(o.push(d.length==1?d[0]:Er.from(d,h)),h=-1,c=d.length=0)}for(let O of e)p(O);return g(),o.length==1?o[0]:new Er(o,t)}}Ge.empty=new Zt([""],0);function v6(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Bp(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s<n.length&&r<=i;s++){let o=n[s],c=r+o.length;c>=t&&(c>i&&(o=o.slice(0,i-r)),r<t&&(o=o.slice(t-r)),l?(e[e.length-1]+=o,l=!1):e.push(o)),r=c+1}return e}function AQ(n,e,t){return Bp(n,[""],e,t)}class gh{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Zt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof Zt?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Zt){let c=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=r.children[l+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof Zt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class iN{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new gh(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class rN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ge.prototype[Symbol.iterator]=function(){return this.iter()},gh.prototype[Symbol.iterator]=iN.prototype[Symbol.iterator]=rN.prototype[Symbol.iterator]=function(){return this});let x6=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function Oc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function sn(n,e,t=!0,i=!0){return b6(n,e,t,i)}function k6(n){return n>=56320&&n<57344}function w6(n){return n>=55296&&n<56320}function Fn(n,e){let t=n.charCodeAt(e);if(!w6(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return k6(i)?(t-55296<<10)+(i-56320)+65536:t}function Kv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function $r(n){return n<65536?1:2}const G1=/\r\n?|\n/;var bn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(bn||(bn={}));class Br{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let s=this.sections[t++],l=this.sections[t++];l<0?(e(i,r,s),r+=s):r+=l,i+=s}}iterChangedRanges(e,t=!1){F1(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new Br(e)}composeDesc(e){return this.empty?e:e.empty?this:sN(this,e)}mapDesc(e,t=!1){return e.empty?this:K1(this,e,t)}mapPos(e,t=-1,i=bn.Simple){let r=0,s=0;for(let l=0;l<this.sections.length;){let o=this.sections[l++],c=this.sections[l++],h=r+o;if(c<0){if(h>e)return s+(e-r);s+=o}else{if(i!=bn.Simple&&h>=e&&(i==bn.TrackDel&&r<e&&h>e||i==bn.TrackBefore&&r<e||i==bn.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!o)return e==r||t<0?s:s+c;s+=c}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let s=this.sections[i++],l=this.sections[i++],o=r+s;if(l>=0&&r<=t&&o>=e)return r<e&&o>t?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Br(e)}static create(e){return new Br(e)}}class Jt extends Br{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return F1(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return K1(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r<t.length;r+=2){let l=t[r],o=t[r+1];if(o>=0){t[r]=o,t[r+1]=l;let c=r>>1;for(;i.length<c;)i.push(Ge.empty);i.push(l?e.slice(s,s+l):Ge.empty)}s+=l}return new Jt(t,i)}compose(e){return this.empty?e:e.empty?this:sN(this,e,!0)}map(e,t=!1){return e.empty?this:K1(this,e,t,!0)}iterChanges(e,t=!1){F1(this,e,t)}get desc(){return Br.create(this.sections)}filter(e){let t=[],i=[],r=[],s=new jh(this);e:for(let l=0,o=0;;){let c=l==e.length?1e9:e[l++];for(;o<c||o==c&&s.len==0;){if(s.done)break e;let d=Math.min(s.len,c-o);Cn(r,d,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Cn(t,d,p),p>0&&Ql(i,t,s.text),s.forward(d),o+=d}let h=e[l++];for(;o<h;){if(s.done)break e;let d=Math.min(s.len,h-o);Cn(t,d,-1),Cn(r,d,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(d),o+=d}}return{changes:new Jt(t,i),filtered:Br.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function c(d=!1){if(!d&&!r.length)return;l<t&&Cn(r,t-l,-1);let p=new Jt(r,s);o=o?o.compose(p.map(o)):p,r=[],s=[],l=0}function h(d){if(Array.isArray(d))for(let p of d)h(p);else if(d instanceof Jt){if(d.length!=t)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${t})`);c(),o=o?o.compose(d.map(o)):d}else{let{from:p,to:g=p,insert:O}=d;if(p>g||p<0||g>t)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${t})`);let b=O?typeof O=="string"?Ge.of(O.split(i||G1)):O:Ge.empty,v=b.length;if(p==g&&v==0)return;p<l&&c(),p>l&&Cn(r,p-l,-1),Cn(r,g-p,v),Ql(s,r,b),l=g}}return h(e),c(!o),o}static empty(e){return new Jt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,o)=>o&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<r;)i.push(Ge.empty);i[r]=Ge.of(s.slice(1)),t.push(s[0],i[r].length)}}}return new Jt(t,i)}static createSet(e,t){return new Jt(e,t)}}function Cn(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function Ql(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Ge.empty);n.push(t)}}function F1(n,e,t){let i=n.inserted;for(let r=0,s=0,l=0;l<n.sections.length;){let o=n.sections[l++],c=n.sections[l++];if(c<0)r+=o,s+=o;else{let h=r,d=s,p=Ge.empty;for(;h+=o,d+=c,c&&i&&(p=p.append(i[l-2>>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],c=n.sections[l++];e(r,h,s,d,p),r=h,s=d}}}function K1(n,e,t,i=!1){let r=[],s=i?[]:null,l=new jh(n),o=new jh(e);for(let c=-1;;){if(l.done&&o.len||o.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);Cn(r,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||c==l.i||l.off==0&&(o.len<l.len||o.len==l.len&&!t))){let h=o.len;for(Cn(r,o.ins,-1);h;){let d=Math.min(l.len,h);l.ins>=0&&c<l.i&&l.len<=d&&(Cn(r,0,l.ins),s&&Ql(s,r,l.text),c=l.i),l.forward(d),h-=d}o.next()}else if(l.ins>=0){let h=0,d=l.len;for(;d;)if(o.ins==-1){let p=Math.min(d,o.len);h+=p,d-=p,o.forward(p)}else if(o.ins==0&&o.len<d)d-=o.len,o.next();else break;Cn(r,h,c<l.i?l.ins:0),s&&c<l.i&&Ql(s,r,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&o.done)return s?Jt.createSet(r,s):Br.create(r);throw new Error("Mismatched change set lengths")}}}function sN(n,e,t=!1){let i=[],r=t?[]:null,s=new jh(n),l=new jh(e);for(let o=!1;;){if(s.done&&l.done)return r?Jt.createSet(i,r):Br.create(i);if(s.ins==0)Cn(i,s.len,0,o),s.next();else if(l.len==0&&!l.done)Cn(i,0,l.ins,o),r&&Ql(r,i,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,l.len),h=i.length;if(s.ins==-1){let d=l.ins==-1?-1:l.off?0:l.ins;Cn(i,c,d,o),r&&d&&Ql(r,i,l.text)}else l.ins==-1?(Cn(i,s.off?0:s.len,c,o),r&&Ql(r,i,s.textBit(c))):(Cn(i,s.off?0:s.len,l.off?0:l.ins,o),r&&!l.off&&Ql(r,i,l.text));o=(s.ins>c||l.ins>=0&&l.len>c)&&(o||i.length>h),s.forward2(c),l.forward(c)}}}}class jh{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Ge.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Ge.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Co{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new Co(i,r,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return Y.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Y.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Y.range(e.anchor,e.head)}static create(e,t,i){return new Co(e,t,i)}}class Y{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Y.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Y([this.main],0)}addRange(e,t=!0){return Y.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,Y.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Y(e.ranges.map(t=>Co.fromJSON(t)),e.main)}static single(e,t=e){return new Y([Y.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Y.normalized(e.slice(),t);i=s.to}return new Y(e,t)}static cursor(e,t=0,i,r){return Co.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r,s){let l=(i??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=t&&(s=t<e?1:-1),t<e?Co.create(t,e,48|l):Co.create(e,t,(s?s<0?8:16:0)|l)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],l=e[r-1];if(s.empty?s.from<=l.to:s.from<l.to){let o=l.from,c=Math.max(s.to,l.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?Y.range(c,o):Y.range(o,c))}}return new Y(e,t)}}function lN(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Jv=0;class ge{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Jv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ge(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:ex),!!e.static,e.enables)}of(e){return new jp([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new jp(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new jp(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function ex(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class jp{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Jv++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,c=!1,h=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?h=!0:(((t=e[p.id])!==null&&t!==void 0?t:1)&1)==0&&d.push(e[p.id]);return{create(p){return p.values[l]=i(p),1},update(p,g){if(c&&g.docChanged||h&&(g.docChanged||g.selection)||J1(p,d)){let O=i(p);if(o?!MQ(O,p.values[l],r):!r(O,p.values[l]))return p.values[l]=O,1}return 0},reconfigure:(p,g)=>{let O,b=g.config.address[s];if(b!=null){let v=Im(g,b);if(this.dependencies.every(x=>x instanceof ge?g.facet(x)===p.facet(x):x instanceof xn?g.field(x,!1)==p.field(x,!1):!0)||(o?MQ(O=i(p),v,r):r(O=i(p),v)))return p.values[l]=v,0}else O=i(p);return p.values[l]=O,1}}}}function MQ(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function J1(n,e){let t=!1;for(let i of e)Oh(n,i)&1&&(t=!0);return t}function T6(n,e,t){let i=t.map(c=>n[c.id]),r=t.map(c=>c.type),s=i.filter(c=>!(c&1)),l=n[e.id]>>1;function o(c){let h=[];for(let d=0;d<i.length;d++){let p=Im(c,i[d]);if(r[d]==2)for(let g of p)h.push(g);else h.push(p)}return e.combine(h)}return{create(c){for(let h of i)Oh(c,h);return c.values[l]=o(c),1},update(c,h){if(!J1(c,s))return 0;let d=o(c);return e.compare(d,c.values[l])?0:(c.values[l]=d,1)},reconfigure(c,h){let d=J1(c,i),p=h.config.facets[e.id],g=h.facet(e);if(p&&!d&&ex(t,p))return c.values[l]=g,0;let O=o(c);return e.compare(O,g)?(c.values[l]=g,0):(c.values[l]=O,1)}}}const lp=ge.define({static:!0});class xn{constructor(e,t,i,r,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new xn(Jv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(lp).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>{let s=i.facet(lp),l=r.facet(lp),o;return(o=s.find(c=>c.field==this))&&o!=l.find(c=>c.field==this)?(i.values[t]=o.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,lp.of({field:this,create:e})]}get extension(){return this}}const So={lowest:4,low:3,default:2,high:1,highest:0};function zu(n){return e=>new oN(e,n)}const Bs={highest:zu(So.highest),high:zu(So.high),default:zu(So.default),low:zu(So.low),lowest:zu(So.lowest)};class oN{constructor(e,t){this.inner=e,this.prec=t}}class Hg{of(e){return new eS(this,e)}reconfigure(e){return Hg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class eS{constructor(e,t){this.compartment=e,this.inner=t}}class Xm{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let g of C6(e,t,l))g instanceof xn?r.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let o=Object.create(null),c=[],h=[];for(let g of r)o[g.id]=h.length<<1,h.push(O=>g.slot(O));let d=i==null?void 0:i.config.facets;for(let g in s){let O=s[g],b=O[0].facet,v=d&&d[g]||[];if(O.every(x=>x.type==0))if(o[b.id]=c.length<<1|1,ex(v,O))c.push(i.facet(b));else{let x=b.combine(O.map(k=>k.value));c.push(i&&b.compare(x,i.facet(b))?i.facet(b):x)}else{for(let x of O)x.type==0?(o[x.id]=c.length<<1|1,c.push(x.value)):(o[x.id]=h.length<<1,h.push(k=>x.dynamicSlot(k)));o[b.id]=h.length<<1,h.push(x=>T6(x,b,O))}}let p=h.map(g=>g(o));return new Xm(e,l,p,o,c,s)}}function C6(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let c=r.get(l);if(c!=null){if(c<=o)return;let h=i[c].indexOf(l);h>-1&&i[c].splice(h,1),l instanceof eS&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let h of l)s(h,o);else if(l instanceof eS){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),s(h,o)}else if(l instanceof oN)s(l.inner,l.prec);else if(l instanceof xn)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof jp)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,So.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,o)}}return s(n,So.default),i.reduce((l,o)=>l.concat(o))}function Oh(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Im(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const aN=ge.define(),tS=ge.define({combine:n=>n.some(e=>e),static:!0}),cN=ge.define({combine:n=>n.length?n[0]:void 0,static:!0}),uN=ge.define(),hN=ge.define(),fN=ge.define(),dN=ge.define({combine:n=>n.length?n[0]:!1});class qr{constructor(e,t){this.type=e,this.value=t}static define(){return new A6}}class A6{of(e){return new qr(this,e)}}class M6{constructor(e){this.map=e}of(e){return new Pe(this,e)}}class Pe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Pe(this.type,t)}is(e){return this.type==e}static define(e={}){return new M6(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Pe.reconfigure=Pe.define();Pe.appendConfig=Pe.define();class Ut{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&lN(i,t.newLength),s.some(o=>o.type==Ut.time)||(this.annotations=s.concat(Ut.time.of(Date.now())))}static create(e,t,i,r,s,l){return new Ut(e,t,i,r,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Ut.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ut.time=qr.define();Ut.userEvent=qr.define();Ut.addToHistory=qr.define();Ut.remote=qr.define();function Q6(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i<n.length&&(r==e.length||e[r]>=n[i]))s=n[i++],l=n[i++];else if(r<e.length)s=e[r++],l=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function pN(n,e,t){var i;let r,s,l;return t?(r=e.changes,s=Jt.empty(e.changes.length),l=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),l=n.changes.compose(r)),{changes:l,selection:e.selection?e.selection.map(s):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:Pe.mapEffects(n.effects,r).concat(Pe.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function nS(n,e,t){let i=e.selection,r=ec(e.annotations);return e.userEvent&&(r=r.concat(Ut.userEvent.of(e.userEvent))),{changes:e.changes instanceof Jt?e.changes:Jt.of(e.changes||[],t,n.facet(cN)),selection:i&&(i instanceof Y?i:Y.single(i.anchor,i.head)),effects:ec(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function mN(n,e,t){let i=nS(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let l=!!e[s].sequential;i=pN(i,nS(n,e[s],l?i.changes.newLength:n.doc.length),l)}let r=Ut.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return $6(t?E6(r):r)}function E6(n){let e=n.startState,t=!0;for(let r of e.facet(uN)){let s=r(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Q6(t,s))}if(t!==!0){let r,s;if(t===!1)s=n.changes.invertedDesc,r=Jt.empty(e.doc.length);else{let l=n.changes.filter(t);r=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}n=Ut.create(e,r,n.selection&&n.selection.map(s),Pe.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let i=e.facet(hN);for(let r=i.length-1;r>=0;r--){let s=i[r](n);s instanceof Ut?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Ut?n=s[0]:n=mN(e,ec(s),!1)}return n}function $6(n){let e=n.startState,t=e.facet(fN),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=pN(i,nS(e,s,n.changes.newLength),!0))}return i==n?n:Ut.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const R6=[];function ec(n){return n==null?R6:Array.isArray(n)?n:[n]}var Qt=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Qt||(Qt={}));const P6=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let iS;try{iS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function D6(n){if(iS)return iS.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||P6.test(t)))return!0}return!1}function N6(n){return e=>{if(!/\S/.test(e))return Qt.Space;if(D6(e))return Qt.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Qt.Word;return Qt.Other}}class Ye{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Oh(this,o<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Oh(this,i),Im(this,i)}update(...e){return mN(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let o of e.effects)o.is(Hg.reconfigure)?(t&&(r=new Map,t.compartments.forEach((c,h)=>r.set(h,c)),t=null),r.set(o.value.compartment,o.value.extension)):o.is(Pe.reconfigure)?(t=null,i=o.value):o.is(Pe.appendConfig)&&(t=null,i=ec(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=Xm.resolve(i,r,this),s=new Ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(c,h)=>h.reconfigure(c,this),null).values);let l=e.startState.facet(tS)?e.newSelection:e.newSelection.asSingle();new Ye(t,e.newDoc,l,s,(o,c)=>c.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Y.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=ec(i.effects);for(let o=1;o<t.ranges.length;o++){let c=e(t.ranges[o]),h=this.changes(c.changes),d=h.map(r);for(let g=0;g<o;g++)s[g]=s[g].map(d);let p=r.mapDesc(h,!0);s.push(c.range.map(p)),r=r.compose(d),l=Pe.mapEffects(l,d).concat(Pe.mapEffects(ec(c.effects),p))}return{changes:r,selection:Y.create(s,t.mainIndex),effects:l}}changes(e=[]){return e instanceof Jt?e:Jt.of(e,this.doc.length,this.facet(Ye.lineSeparator))}toText(e){return Ge.of(e.split(this.facet(Ye.lineSeparator)||G1))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Oh(this,t),Im(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof xn&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let l=i[s],o=e[s];r.push(l.init(c=>l.spec.fromJSON(o,c)))}}return Ye.create({doc:e.doc,selection:Y.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Xm.resolve(e.extensions||[],new Map),i=e.doc instanceof Ge?e.doc:Ge.of((e.doc||"").split(t.staticFacet(Ye.lineSeparator)||G1)),r=e.selection?e.selection instanceof Y?e.selection:Y.single(e.selection.anchor,e.selection.head):Y.single(0);return lN(r,i.length),t.staticFacet(tS)||(r=r.asSingle()),new Ye(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ye.tabSize)}get lineBreak(){return this.facet(Ye.lineSeparator)||`
`}get readOnly(){return this.facet(dN)}phrase(e,...t){for(let i of this.facet(Ye.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(aN))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return N6(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let c=sn(t,l,!1);if(s(t.slice(c,l))!=Qt.Word)break;l=c}for(;o<r;){let c=sn(t,o);if(s(t.slice(o,c))!=Qt.Word)break;o=c}return l==o?null:Y.range(l+i,o+i)}}Ye.allowMultipleSelections=tS;Ye.tabSize=ge.define({combine:n=>n.length?n[0]:4});Ye.lineSeparator=cN;Ye.readOnly=dN;Ye.phrases=ge.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ye.languageData=aN;Ye.changeFilter=uN;Ye.transactionFilter=hN;Ye.transactionExtender=fN;Hg.reconfigure=Pe.define();function Hr(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class _l{eq(e){return this==e}range(e,t=e){return rS.create(e,t,this)}}_l.prototype.startSide=_l.prototype.endSide=0;_l.prototype.point=!1;_l.prototype.mapMode=bn.TrackDel;function tx(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let rS=class gN{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new gN(e,t,i)}};function sS(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class nx{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let c=l+o>>1,h=s[c]-e||(i?this.value[c].endSide:this.value[c].startSide)-t;if(c==l)return h>=0?l:o;h>=0?o=c:l=c+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);s<l;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let i=[],r=[],s=[],l=-1,o=-1;for(let c=0;c<this.value.length;c++){let h=this.value[c],d=this.from[c]+e,p=this.to[c]+e,g,O;if(d==p){let b=t.mapPos(d,h.startSide,h.mapMode);if(b==null||(g=O=b,h.startSide!=h.endSide&&(O=t.mapPos(d,h.endSide),O<g)))continue}else if(g=t.mapPos(d,h.startSide),O=t.mapPos(p,h.endSide),g>O||g==O&&h.startSide>0&&h.endSide<=0)continue;(O-g||h.endSide-h.startSide)<0||(l<0&&(l=g),h.point&&(o=Math.max(o,O-g)),i.push(h),r.push(g-l),s.push(O-l))}return{mapped:i.length?new nx(r,s,i,o):null,pos:l}}}class Ve{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new Ve(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(sS)),this.isEmpty)return t.length?Ve.of(t):this;let o=new ON(this,null,-1).goto(0),c=0,h=[],d=new Rs;for(;o.value||c<t.length;)if(c<t.length&&(o.from-t[c].from||o.startSide-t[c].value.startSide)>=0){let p=t[c++];d.addInner(p.from,p.to,p.value)||h.push(p)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(c==t.length||this.chunkEnd(o.chunkIndex)<t[c].from)&&(!l||r>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&d.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!l||r>o.to||s<o.from||l(o.from,o.to,o.value))&&(d.addInner(o.from,o.to,o.value)||h.push(rS.create(o.from,o.to,o.value))),o.next());return d.finishInner(this.nextLayer.isEmpty&&!h.length?Ve.empty:this.nextLayer.update({add:h,filter:l,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let l=0;l<this.chunk.length;l++){let o=this.chunkPos[l],c=this.chunk[l],h=e.touchesRange(o,o+c.length);if(h===!1)r=Math.max(r,c.maxPoint),t.push(c),i.push(e.mapPos(o));else if(h===!0){let{mapped:d,pos:p}=c.map(o,e);d&&(r=Math.max(r,d.maxPoint),t.push(d),i.push(p))}}let s=this.nextLayer.map(e);return t.length==0?s:new Ve(i,t,s||Ve.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],l=this.chunk[r];if(t>=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Zh.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Zh.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),o=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),c=QQ(l,o,i),h=new Lu(l,c,s),d=new Lu(o,c,s);i.iterGaps((p,g,O)=>EQ(h,p,d,g,O,r)),i.empty&&i.length==0&&EQ(h,0,d,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(d=>!d.isEmpty&&t.indexOf(d)<0),l=t.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=QQ(s,l),c=new Lu(s,o,0).goto(i),h=new Lu(l,o,0).goto(i);for(;;){if(c.to!=h.to||!lS(c.active,h.active)||c.point&&(!h.point||!tx(c.point,h.point)))return!1;if(c.to>r)return!0;c.next(),h.next()}}static spans(e,t,i,r,s=-1){let l=new Lu(e,null,s).goto(t),o=t,c=l.openStart;for(;;){let h=Math.min(l.to,i);if(l.point){let d=l.activeForPoint(l.to),p=l.pointFrom<t?d.length+1:l.point.startSide<0?d.length:Math.min(d.length,c);r.point(o,h,l.point,d,p,l.pointRank),c=Math.min(l.openEnd(h),d.length)}else h>o&&(r.span(o,h,l.active,c),c=l.openEnd(h));if(l.to>i)return c+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new Rs;for(let r of e instanceof rS?[e]:t?z6(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return Ve.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=Ve.empty;r=r.nextLayer)t=new Ve(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}Ve.empty=new Ve([],[],null,-1);function z6(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(sS(e,i)>0)return n.slice().sort(sS);e=i}return n}Ve.empty.nextLayer=Ve.empty;class Rs{finishChunk(e){this.chunks.push(new nx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Rs)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Ve.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ve.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function QQ(n,e,t){let i=new Map;for(let s of n)for(let l=0;l<s.chunk.length;l++)s.chunk[l].maxPoint<=0&&i.set(s.chunk[l],s.chunkPos[l]);let r=new Set;for(let s of e)for(let l=0;l<s.chunk.length;l++){let o=i.get(s.chunk[l]);o!=null&&(t?t.mapPos(o):o)==s.chunkPos[l]&&!(t!=null&&t.touchesRange(o,o+s.chunk[l].length))&&r.add(s.chunk[l])}return r}class ON{constructor(e,t,i,r=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Zh{constructor(e){this.heap=e}static from(e,t=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let l=e[s];!l.isEmpty;l=l.nextLayer)l.maxPoint>=i&&r.push(new ON(l,t,i,s));return r.length==1?r[0]:new Zh(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)db(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)db(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),db(this.heap,0)}}}function db(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1<n.length&&r.compare(n[i+1])>=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class Lu{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Zh.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){op(this.active,e),op(this.activeTo,e),op(this.activeRank,e),this.minActive=$Q(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;ap(this.active,t,i),ap(this.activeTo,t,r),ap(this.activeRank,t,s),e&&ap(e,t,this.cursor.from),this.minActive=$Q(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&op(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function EQ(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,c=i-e,h=!!s.boundChange;for(let d=!1;;){let p=n.to+c-t.to,g=p||n.endSide-t.endSide,O=g<0?n.to+c:t.to,b=Math.min(O,l);if(n.point||t.point?(n.point&&t.point&&tx(n.point,t.point)&&lS(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,b,n.point,t.point),d=!1):(d&&s.boundChange(o),b>o&&!lS(n.active,t.active)&&s.compareRange(o,b,n.active,t.active),h&&b<l&&(p||n.openEnd(O)!=t.openEnd(O))&&(d=!0)),O>l)break;o=O,g<=0&&n.next(),g>=0&&t.next()}}function lS(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!tx(n[t],e[t]))return!1;return!0}function op(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function ap(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function $Q(n,e){let t=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||n[r].endSide-n[t].endSide)<0&&(t=r,i=e[r]);return t}function ar(n,e,t=n.length){let i=0;for(let r=0;r<t&&r<n.length;)n.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=sn(n,r));return i}function oS(n,e,t,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=sn(n,r)}return i===!0?-1:n.length}const aS="ͼ",RQ=typeof Symbol>"u"?"__"+aS:Symbol.for(aS),cS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),PQ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Bl{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,c,h){let d=[],p=/^@(\w+)\b/.exec(l[0]),g=p&&p[1]=="keyframes";if(p&&o==null)return c.push(l[0]+";");for(let O in o){let b=o[O];if(/&/.test(O))s(O.split(/,\s*/).map(v=>l.map(x=>v.replace(/&/,x))).reduce((v,x)=>v.concat(x)),b,c);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");s(r(O),b,d,g)}else b!=null&&d.push(O.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+b+";")}(d.length||g)&&c.push((i&&!p&&!h?l.map(i):l).join(", ")+" {"+d.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=PQ[RQ]||1;return PQ[RQ]=e+1,aS+e.toString(36)}static mount(e,t,i){let r=e[cS],s=i&&i.nonce;r?s&&r.setNonce(s):r=new L6(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let DQ=new Map;class L6{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=DQ.get(i);if(s)return e[cS]=s;this.sheet=new r.CSSStyleSheet,DQ.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[cS]=this}mount(e,t){let i=this.sheet,r=0,s=0;for(let l=0;l<e.length;l++){let o=e[l],c=this.modules.indexOf(o);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,o),i)for(let h=0;h<o.rules.length;h++)i.insertRule(o.rules[h],r++)}else{for(;s<c;)r+=this.modules[s++].rules.length;r+=o.rules.length,s++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
`;this.styleTag.textContent=l;let o=t.head||t;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}function ut(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;e<arguments.length;e++)yN(n,arguments[e]);return n}function yN(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)yN(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Dn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},uS=typeof document<"u"?document:{documentElement:{style:{}}};const hS=/Edge\/(\d+)/.exec(Dn.userAgent),bN=/MSIE \d/.test(Dn.userAgent),fS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Dn.userAgent),Yg=!!(bN||fS||hS),NQ=!Yg&&/gecko\/(\d+)/i.test(Dn.userAgent),pb=!Yg&&/Chrome\/(\d+)/.exec(Dn.userAgent),zQ="webkitFontSmoothing"in uS.documentElement.style,dS=!Yg&&/Apple Computer/.test(Dn.vendor),LQ=dS&&(/Mobile\/\w+/.test(Dn.userAgent)||Dn.maxTouchPoints>2);var Oe={mac:LQ||/Mac/.test(Dn.platform),windows:/Win/.test(Dn.platform),linux:/Linux|X11/.test(Dn.platform),ie:Yg,ie_version:bN?uS.documentMode||6:fS?+fS[1]:hS?+hS[1]:0,gecko:NQ,gecko_version:NQ?+(/Firefox\/(\d+)/.exec(Dn.userAgent)||[0,0])[1]:0,chrome:!!pb,chrome_version:pb?+pb[1]:0,ios:LQ,android:/Android\b/.test(Dn.userAgent),webkit:zQ,webkit_version:zQ?+(/\bAppleWebKit\/(\d+)/.exec(Dn.userAgent)||[0,0])[1]:0,safari:dS,safari_version:dS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Dn.userAgent)||[0,0])[1]:0,tabSize:uS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ix(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Vm=Object.create(null);function rx(n,e,t){if(n==e)return!0;n||(n=Vm),e||(e=Vm);let i=Object.keys(n),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function _6(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function _Q(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function B6(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class hr{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var vn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(vn||(vn={}));class ke extends _l{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new gf(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Vo(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=SN(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new Vo(e,i,r,t,e.widget||null,!0)}static line(e){return new Of(e)}static set(e,t=!1){return Ve.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ke.none=Ve.empty;class gf extends ke{constructor(e){let{start:t,end:i}=SN(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?ix(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Vm}eq(e){return this==e||e instanceof gf&&this.tagName==e.tagName&&rx(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}gf.prototype.point=!1;class Of extends ke{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Of&&this.spec.class==e.spec.class&&rx(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Of.prototype.mapMode=bn.TrackBefore;Of.prototype.point=!0;class Vo extends ke{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?bn.TrackBefore:bn.TrackAfter:bn.TrackDel}get type(){return this.startSide!=this.endSide?vn.WidgetRange:this.startSide<=0?vn.WidgetBefore:vn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Vo&&j6(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Vo.prototype.point=!0;function SN(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function j6(n,e){return n==e||!!(n&&e&&n.compare(e))}function tc(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class Xh extends _l{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof Xh&&this.tagName==e.tagName&&rx(this.attributes,e.attributes)}static create(e){return new Xh(e.tagName,e.attributes||Vm,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return Ve.of(e,t)}}Xh.prototype.startSide=Xh.prototype.endSide=-1;function Ih(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function pS(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function yh(n,e){if(!e.anchorNode)return!1;try{return pS(n,e.anchorNode)}catch{return!1}}function bh(n){return n.nodeType==3?qh(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Sh(n,e,t,i){return t?BQ(n,e,t,i,-1)||BQ(n,e,t,i,1):!1}function jl(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function qm(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function BQ(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:Ps(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=jl(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?Ps(n):0}else return!1}}function Ps(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Vh(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Z6(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function vN(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function X6(n,e,t,i,r,s,l,o){let c=n.ownerDocument,h=c.defaultView||window;for(let d=n,p=!1;d&&!p;)if(d.nodeType==1){let g,O=d==c.body,b=1,v=1;if(O)g=Z6(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let C=d.getBoundingClientRect();({scaleX:b,scaleY:v}=vN(d,C)),g={left:C.left,right:C.left+d.clientWidth*b,top:C.top,bottom:C.top+d.clientHeight*v}}let x=0,k=0;if(r=="nearest")e.top<g.top+l?(k=e.top-(g.top+l),t>0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+l)):e.bottom>g.bottom-l&&(k=e.bottom-g.bottom+l,t<0&&e.top-k<g.top&&(k=e.top-(g.top+l)));else{let C=e.bottom-e.top,A=g.bottom-g.top;k=(r=="center"&&C<=A?e.top+C/2-A/2:r=="start"||r=="center"&&t<0?e.top-l:e.bottom-A+l)-g.top}if(i=="nearest"?e.left<g.left+s?(x=e.left-(g.left+s),t>0&&e.right>g.right+x&&(x=e.right-g.right+s)):e.right>g.right-s&&(x=e.right-g.right+s,t<0&&e.left<g.left+x&&(x=e.left-(g.left+s))):x=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==o?e.left-s:e.right-(g.right-g.left)+s)-g.left,x||k)if(O)h.scrollBy(x,k);else{let C=0,A=0;if(k){let P=d.scrollTop;d.scrollTop+=k/v,A=(d.scrollTop-P)*v}if(x){let P=d.scrollLeft;d.scrollLeft+=x/b,C=(d.scrollLeft-P)*b}e={left:e.left-C,top:e.top-A,right:e.right-C,bottom:e.bottom-A},C&&Math.abs(C-x)<1&&(i="nearest"),A&&Math.abs(A-k)<1&&(r="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function xN(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class I6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Ps(t):0),i,Math.min(e.focusOffset,i?Ps(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let yo=null;Oe.safari&&Oe.safari_version>=26&&(yo=!1);function kN(n){if(n.setActive)return n.setActive();if(yo)return n.focus(yo);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(yo==null?{get preventScroll(){return yo={preventScroll:!0},!0}}:void 0),!yo){yo=!1;for(let t=0;t<e.length;){let i=e[t++],r=e[t++],s=e[t++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let jQ;function qh(n,e,t=e){let i=jQ||(jQ=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function nc(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,n.dispatchEvent(s);let l=new KeyboardEvent("keyup",r);return l.synthetic=!0,n.dispatchEvent(l),s.defaultPrevented||l.defaultPrevented}function V6(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function q6(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Ps(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable=="false"?i--:(t=r,i=Ps(t))}else{if(t==n)return!0;i=jl(t),t=t.parentNode}}function wN(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function TN(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=Ps(t)}else if(t.parentNode&&!qm(t))i=jl(t),t=t.parentNode;else return null}}function CN(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!qm(t))i=jl(t)+1,t=t.parentNode;else return null}}class rr{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new rr(e.parentNode,jl(e),t)}static after(e,t){return new rr(e.parentNode,jl(e)+1,t)}}var mt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(mt||(mt={}));const qo=mt.LTR,sx=mt.RTL;function AN(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const H6=AN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Y6=AN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),mS=Object.create(null),vr=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);mS[e]=t,mS[t]=-e}function MN(n){return n<=247?H6[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?Y6[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const U6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Dr{get dir(){return this.level%2?sx:qo}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,r){let s=-1;for(let l=0;l<e.length;l++){let o=e[l];if(o.from<=t&&o.to>=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.from<t:o.to>t:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function QN(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],r=e[t];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!QN(i.inner,r.inner))return!1}return!0}const dt=[];function W6(n,e,t,i,r){for(let s=0;s<=i.length;s++){let l=s?i[s-1].to:e,o=s<i.length?i[s].from:t,c=s?256:r;for(let h=l,d=c,p=c;h<o;h++){let g=MN(n.charCodeAt(h));g==512?g=d:g==8&&p==4&&(g=16),dt[h]=g==4?2:g,g&7&&(p=g),d=g}for(let h=l,d=c,p=c;h<o;h++){let g=dt[h];if(g==128)h<o-1&&d==dt[h+1]&&d&24?g=dt[h]=d:dt[h]=256;else if(g==64){let O=h+1;for(;O<o&&dt[O]==64;)O++;let b=h&&d==8||O<t&&dt[O]==8?p==1?1:8:256;for(let v=h;v<O;v++)dt[v]=b;h=O-1}else g==8&&p==1&&(dt[h]=1);d=g,g&7&&(p=g)}}}function G6(n,e,t,i,r){let s=r==1?2:1;for(let l=0,o=0,c=0;l<=i.length;l++){let h=l?i[l-1].to:e,d=l<i.length?i[l].from:t;for(let p=h,g,O,b;p<d;p++)if(O=mS[g=n.charCodeAt(p)])if(O<0){for(let v=o-3;v>=0;v-=3)if(vr[v+1]==-O){let x=vr[v+2],k=x&2?r:x&4?x&1?s:r:0;k&&(dt[p]=dt[vr[v]]=k),o=v;break}}else{if(vr.length==189)break;vr[o++]=p,vr[o++]=g,vr[o++]=c}else if((b=dt[p])==2||b==1){let v=b==r;c=v?0:1;for(let x=o-3;x>=0;x-=3){let k=vr[x+2];if(k&2)break;if(v)vr[x+2]|=2;else{if(k&4)break;vr[x+2]|=4}}}}}function F6(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=r<t.length?t[r].from:e;for(let c=l;c<o;){let h=dt[c];if(h==256){let d=c+1;for(;;)if(d==o){if(r==t.length)break;d=t[r++].to,o=r<t.length?t[r].from:e}else if(dt[d]==256)d++;else break;let p=s==1,g=(d<e?dt[d]:i)==1,O=p==g?p?1:2:i;for(let b=d,v=r,x=v?t[v-1].to:n;b>c;)b==x&&(b=t[--v].from,x=v?t[v-1].to:n),dt[--b]=O;c=d}else s=h,c++}}}function gS(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let c=e,h=0;c<t;){let d=!0,p=!1;if(h==s.length||c<s[h].from){let v=dt[c];v!=o&&(d=!1,p=v==16)}let g=!d&&o==1?[]:null,O=d?i:i+1,b=c;e:for(;;)if(h<s.length&&b==s[h].from){if(p)break e;let v=s[h];if(!d)for(let x=v.to,k=h+1;;){if(x==t)break e;if(k<s.length&&s[k].from==x)x=s[k++].to;else{if(dt[x]==o)break e;break}}if(h++,g)g.push(v);else{v.from>c&&l.push(new Dr(c,v.from,O));let x=v.direction==qo!=!(O%2);OS(n,x?i+1:i,r,v.inner,v.from,v.to,l),c=v.to}b=v.to}else{if(b==t||(d?dt[b]!=o:dt[b]==o))break;b++}g?gS(n,c,b,i+1,r,g,l):c<b&&l.push(new Dr(c,b,O)),c=b}else for(let c=t,h=s.length;c>e;){let d=!0,p=!1;if(!h||c>s[h-1].to){let v=dt[c-1];v!=o&&(d=!1,p=v==16)}let g=!d&&o==1?[]:null,O=d?i:i+1,b=c;e:for(;;)if(h&&b==s[h-1].to){if(p)break e;let v=s[--h];if(!d)for(let x=v.from,k=h;;){if(x==e)break e;if(k&&s[k-1].to==x)x=s[--k].from;else{if(dt[x-1]==o)break e;break}}if(g)g.push(v);else{v.to<c&&l.push(new Dr(v.to,c,O));let x=v.direction==qo!=!(O%2);OS(n,x?i+1:i,r,v.inner,v.from,v.to,l),c=v.from}b=v.from}else{if(b==e||(d?dt[b-1]!=o:dt[b-1]==o))break;b--}g?gS(n,b,c,i+1,r,g,l):b<c&&l.push(new Dr(b,c,O)),c=b}}function OS(n,e,t,i,r,s,l){let o=e%2?2:1;W6(n,r,s,i,o),G6(n,r,s,i,o),F6(r,s,i,o),gS(n,r,s,e,t,i,l)}function K6(n,e,t){if(!n)return[new Dr(0,0,e==sx?1:0)];if(e==qo&&!t.length&&!U6.test(n))return EN(n.length);if(t.length)for(;n.length>dt.length;)dt[dt.length]=256;let i=[],r=e==qo?0:1;return OS(n,r,r,t,0,n.length,i),i}function EN(n){return[new Dr(0,n,0)]}let $N="";function J6(n,e,t,i,r){var s;let l=i.head-n.from,o=Dr.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=e[o],h=c.side(r,t);if(l==h){let g=o+=r?1:-1;if(g<0||g>=e.length)return null;c=e[o=g],l=c.side(!r,t),h=c.side(r,t)}let d=sn(n.text,l,c.forward(r,t));(d<c.from||d>c.to)&&(d=h),$N=n.text.slice(Math.min(l,d),Math.max(l,d));let p=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return p&&d==h&&p.level+(r?0:1)<c.level?Y.cursor(p.side(!r,t)+n.from,p.forward(r,t)?1:-1,p.level):Y.cursor(d+n.from,c.forward(r,t)?-1:1,c.level)}function eW(n,e,t){for(let i=e;i<t;i++){let r=MN(n.charCodeAt(i));if(r==1)return qo;if(r==2||r==4)return sx}return qo}const RN=ge.define(),PN=ge.define(),DN=ge.define(),NN=ge.define(),yS=ge.define(),zN=ge.define(),LN=ge.define(),lx=ge.define(),ox=ge.define(),_N=ge.define({combine:n=>n.some(e=>e)}),BN=ge.define({combine:n=>n.some(e=>e)}),jN=ge.define();class ic{constructor(e,t,i,r,s,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new ic(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ic(Y.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const cp=Pe.define({map:(n,e)=>n.map(e)}),ZN=Pe.define();function ei(n,e,t){let i=n.facet(NN);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const xs=ge.define({combine:n=>n.length?n[0]:!0});let tW=0;const Ua=ge.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class Lt{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Ua.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ua.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new Lt(tW++,e,i,r,o=>{let c=[];return l&&c.push(Ug.of(h=>{let d=h.plugin(o);return d?l(d):ke.none})),s&&c.push(s(o)),c})}static fromClass(e,t){return Lt.define((i,r)=>new e(i,r),t)}}class mb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(ei(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ei(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){ei(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const XN=ge.define(),ax=ge.define(),Ug=ge.define(),IN=ge.define(),cx=ge.define(),yf=ge.define(),VN=ge.define();function ZQ(n,e){let t=n.state.facet(VN);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return Ve.spans(i,e.from,e.to,{point(){},span(s,l,o,c){let h=s-e.from,d=l-e.from,p=r;for(let g=o.length-1;g>=0;g--,c--){let O=o[g].spec.bidiIsolate,b;if(O==null&&(O=eW(e.text,h,d)),c>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==O)b.to=d,p=b.inner;else{let v={from:h,to:d,direction:O,inner:[]};p.push(v),p=v.inner}}}}),r}const qN=ge.define();function ux(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(qN)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const eh=ge.define();class Bi{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Bi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let r=0,s=0,l=0;;){let o=r<e.length?e[r].fromB:1e9,c=s<t.length?t[s]:1e9,h=Math.min(o,c);if(h==1e9)break;let d=h+l,p=h,g=d;for(;;)if(s<t.length&&t[s]<=p){let O=t[s+1];s+=2,p=Math.max(p,O);for(let b=r;b<e.length&&e[b].fromB<=p;b++)l=e[b].toA-e[b].toB;g=Math.max(g,O+l)}else if(r<e.length&&e[r].fromB<=p){let O=e[r++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),l=O.toA-O.toB}else break;i.push(new Bi(d,g,h,p))}return i}}class Hm{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Jt.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,c)=>r.push(new Bi(s,l,o,c))),this.changedRanges=r}static create(e,t,i){return new Hm(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const nW=[];class zt{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return nW}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&_6(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=jl(this.dom),r=this.length?e>0:t>0;return new rr(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Gg)return e;return null}static get(e){return e.cmTile}}class Wg extends zt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,s=(e==null?void 0:e.node)==t?e:null,l=0;for(let o of this.children){if(o.sync(e),l+=o.length+o.breakAfter,r=i?i.nextSibling:t.firstChild,s&&r!=o.dom&&(s.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=XQ(r);else t.insertBefore(o.dom,r);i=o.dom}for(r=i?i.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=XQ(r);this.length=l}}function XQ(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Gg extends Wg{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=zt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,r=t.pop()}else{let l=i.children[r++];if(l instanceof Qs)t.push(r),i=l,r=0;else{let o=s+l.length,c=e(l,s);if(c!==void 0)return c;s=o+l.breakAfter}}}resolveBlock(e,t){let i,r=-1,s,l=-1;if(this.blockTiles((o,c)=>{let h=c+o.length;if(e>=c&&e<=h){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(i=void 0)}(c<e||e==h&&(t<-1?o.length:o.covers(1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,r=e-c),(h>e||e==c&&(t>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,l=e-c)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&t<0||!s?{tile:i,offset:r}:{tile:s,offset:l}}}class Qs extends Wg{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new Qs(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class yc extends Wg{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new yc(t||document.createElement("div"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,s=-1,l=null,o=-1;function c(d,p){for(let g=0,O=0;g<d.children.length&&O<=p;g++){let b=d.children[g],v=O+b.length;v>=p&&(b.isComposite()?c(b,p-O):(!l||l.isHidden&&(t>0||i&&rW(l,b)))&&(v>p||b.flags&32)?(l=b,o=p-O):(O<p||b.flags&16&&!b.isHidden)&&(r=b,s=p-O)),O=v}}c(this,e);let h=(t<0?r:l)||r||l;return h?{tile:h,offset:h==r?s:o}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):iW(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new rr(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let l=i.tile.parent,o=!1;for(let c of l.children){if(o)return new rr(c.dom,0);c==i.tile&&(o=!0)}}return new rr(this.dom,0)}}function iW(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=bh(e);return t[t.length-1]||null}function rW(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Jn extends Wg{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Jn(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class Ao extends zt{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?Oe.chrome||Oe.gecko||(e?(r--,l=1):s<i&&(s++,l=-1)):t<0?r--:s<i&&s++;let o=qh(this.dom,r,s).getClientRects();if(!o.length)return null;let c=o[(l?l<0:t>=0)?0:o.length-1];return Oe.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(o,h=>h.width)||c),l?Vh(c,l<0):c||null}static of(e,t){let i=new Ao(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class Ho extends zt{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return Vh(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),l=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=o?s.length-1:0;l=s[c],!(e>0?c==0:c==s.length-1||l.top<l.bottom);c+=o?-1:1);return Vh(l,!o)}}get overrideDOMText(){if(!this.length)return Ge.empty;let{root:e}=this;if(!e)return Ge.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,r,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new Ho(s,i,e,r)}}class Ym extends zt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Ge.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class sW{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:s,beforeBreak:l,parents:o}=this;for(;e||t>0;)if(r.isComposite())if(l){if(!e)break;i&&i.break(),e--,l=!1}else if(s==r.children.length){if(!e&&!o.length)break;i&&i.leave(r),l=!!r.breakAfter,{tile:r,index:s}=o.pop(),s++}else{let c=r.children[s],h=c.breakAfter;(t>0?c.length<=e:c.length<e)&&(!i||i.skip(c,0,c.length)!==!1||!c.isComposite)?(l=!!h,s++,e-=c.length):(o.push({tile:r,index:s}),r=c,s=0,i&&c.isComposite()&&i.enter(c))}else if(s==r.length)l=!!r.breakAfter,{tile:r,index:s}=o.pop(),s++;else if(e){let c=Math.min(e,r.length-s);i&&i.skip(r,s,s+c),e-=c,s+=c}else break;return this.tile=r,this.index=s,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class lW{constructor(e,t,i,r){this.from=e,this.to=t,this.wrapper=i,this.rank=r}}class oW{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,r){var s;this.flushBuffer();let l=this.ensureMarks(t,i),o=l.lastChild;if(o&&o.isText()&&!(o.flags&8)&&o.length+e.length<512){this.cache.reused.set(o,2);let c=l.children[l.children.length-1]=new Ao(o.dom,o.text+e);c.parent=l}else l.append(r||Ao.of(e,(s=this.cache.find(Ao))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?gb(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=i;for(let o=t.marks.length-1;o>=0;o--){let c=t.marks[o],h=r.lastChild;if(h instanceof Jn&&h.mark.eq(c.mark))h.dom!=c.dom&&h.setDOM(gb(c.dom)),r=h;else{if(this.cache.reused.get(c)){let p=zt.get(c.dom);p&&p.setDOM(gb(c.dom))}let d=Jn.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=zt.get(e.text);s&&this.cache.reused.set(s,2);let l=new Ao(e.text,e.text.nodeValue);l.flags|=8,this.pos=e.range.toB,r.append(l)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=HN);let r=yc.start(e,t||((i=this.cache.find(yc))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let l=e[s],o;if(t>0&&(o=r.lastChild)&&o instanceof Jn&&o.mark.eq(l))r=o,t--;else{let c=Jn.of(l,(i=this.cache.find(Jn,h=>h.mark.eq(l)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!IQ(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&IQ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ob,0,32)||new Ho(Ob.toDOM(),0,Ob,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,i=new lW(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.from<this.pos&&r instanceof Qs&&r.wrapper.eq(i.wrapper))t=r;else{let s=Qs.of(i.wrapper,(e=this.cache.find(Qs,l=>l.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(Ym,void 0,1);return i&&(i.flags=t),i||new Ym(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class aW{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=r;let o=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const Um=[Ho,yc,Ao,Jn,Ym,Qs,Gg];for(let n=0;n<Um.length;n++)Um[n].bucket=n;class cW{constructor(e){this.view=e,this.buckets=Um.map(()=>[]),this.index=Um.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,s=this.buckets[r],l=this.index[r];for(let o=s.length-1;o>=0;o--){let c=(o+l)%s.length,h=s[c];if((!t||t(h))&&!this.reused.has(h))return s.splice(c,1),c<l&&this.index[r]--,this.reused.set(h,i),h}return null}findWidget(e,t,i){let r=this.buckets[0];if(r.length)for(let s=0,l=0;;s++){if(s==r.length){if(l)return null;l=1,s=0}let o=r[s];if(!this.reused.has(o)&&(l==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==i?(this.reused.set(o,1),o):(this.reused.set(o,2),new Ho(o.dom,t,e,o.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class uW{constructor(e,t,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new cW(e),this.text=new aW(e.state.doc),this.builder=new oW(this.cache,new Gg(e,e.contentDOM),Ve.iter(i)),this.cache.reused.set(t,2),this.old=new sW(t),this.reuseWalker={skip:(l,o,c)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,s=0,l=0;;){let o=l<e.length?e[l++]:null,c=o?o.fromA:this.old.root.length;if(c>r){let h=c-r;this.preserve(h,!l,!o),r=c,s+=h}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let r=dW(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(l,o,c)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(c-o);else{let h=c>0||o<l.length?Ho.of(l.widget,this.view,c-o,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,s),s=r.length)}else if(l.isText())this.builder.ensureLine(null),!o&&c==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,r,s,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(o,c),r,s)),s=r.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof Ym)this.cache.add(l);else if(l instanceof Jn)this.builder.ensureLine(null),this.builder.addMark(l,r,s),this.cache.reused.set(l,1),s=r.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof Jn&&r.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?r.length&&(r.length=s=0):l instanceof Jn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,s=0,l=Ve.spans(this.decorations,e,t,{point:(o,c,h,d,p,g)=>{if(h instanceof Vo){if(this.disallowBlockEffectsFor[g]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,p>d.length)r.continueWidget(c-o);else{let O=h.widget||(h.block?bc.block:bc.inline),b=hW(h),v=this.cache.findWidget(O,c-o,b)||Ho.of(O,this.view,c-o,b);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(v)):(r.ensureLine(i),r.addInlineWidget(v,d,p))}i=null}else i=fW(i,h);c>o&&this.text.skip(c-o)},span:(o,c,h,d)=>{for(let p=o;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(g,h,p==o?d:h.length),p+=g.length),i=null}}});r.addLineStartIfNotCovered(i),this.openWidget=l>s,this.openMarks=l}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=zt.get(r);if(r==this.view.contentDOM)break;s instanceof Jn?t.push(s):s!=null&&s.isLine()?i=s:s instanceof Qs||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new yc(r,HN):i||t.push(Jn.of(new gf({tagName:r.nodeName.toLowerCase(),attributes:B6(r)}),r)))}return{line:i,marks:t}}}function IQ(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function hW(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const HN={class:"cm-line"};function fW(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&ix(t,n),i&&(n.class+=" "+i)),n}function dW(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Jn&&e.push(i.mark)}return e}function gb(n){let e=zt.get(n);return e&&e.setDOM(n.cloneNode()),n}class bc extends hr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}bc.inline=new bc("span");bc.block=new bc("div");const Ob=new class extends hr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class VQ{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ke.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Gg(e,e.contentDOM),this.updateInner([new Bi(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!xW(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?mW(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;i=new Bi(d,p,e.changes.mapPos(d,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Oe.ie||Oe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.blockWrappers;this.updateDeco();let c=yW(l,this.decorations,e.changes);c.length&&(i=Bi.extendWithRanges(i,c));let h=SW(o,this.blockWrappers,e.changes);return h.length&&(i=Bi.extendWithRanges(i,h)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let l=this.tile,o=new uW(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&zt.get(t.text)&&o.cache.reused.set(zt.get(t.text),2),this.tile=o.run(e,t),bS(l,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Oe.chrome||Oe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof yb&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(ZN)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,l=!s&&!(this.view.state.facet(xs)||i.tabIndex>-1)&&yh(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||t||l))return;let o=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,h,d;if(c.empty?d=h=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),h=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Oe.gecko&&c.empty&&!this.hasComposition&&pW(h)){let g=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(g,h.node.childNodes[h.offset]||null)),h=d=new rr(g,0),o=!0}let p=this.view.observer.selectionRange;(o||!p.focusNode||(!Sh(h.node,h.offset,p.anchorNode,p.anchorOffset)||!Sh(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&i.contains(p.focusNode)&&vW(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=Ih(this.view.root);if(g)if(c.empty){if(Oe.gecko){let O=gW(h.node,h.offset);if(O&&O!=3){let b=(O==1?TN:CN)(h.node,h.offset);b&&(h=new rr(b.node,b.offset))}}g.collapse(h.node,h.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(h.node,h.offset);try{g.extend(d.node,d.offset)}catch{}}else{let O=document.createRange();c.anchor>c.head&&([h,d]=[d,h]),O.setEnd(d.node,d.offset),O.setStart(h.node,h.offset),g.removeAllRanges(),g.addRange(O)}l&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,d)),this.impreciseAnchor=h.precise?null:new rr(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new rr(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Sh(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Ih(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=this.lineAt(t.head,t.assoc);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let c=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!c||!h||c.bottom>h.top)return;let d=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(d.node,d.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=t.from&&i.collapse(r,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let l=Ps(e)==0?0:t==0?-1:1;for(;;){let o=e.parentNode;if(o==i.dom)break;l==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?l=-1:l=1),e=o}l<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!zt.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let l=0,o=r;;l++){let c=i.children[l];if(c.dom==s)return o;o+=c.length+c.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,s=!1,l,o=-1,c=!1;return this.tile.blockTiles((h,d)=>{if(h.isWidget()){if(h.flags&32&&d>=e)return!0;h.flags&16&&(s=!0)}else{let p=d+h.length;if(d<=e&&(i=h,r=e-d,s=p<e),p>=e&&!l&&(l=h,o=e-d,c=d>e),d>e&&l)return!0}}),!i&&!l?this.domAtPos(e,t):(s&&l?i=null:c&&i&&(l=null),i&&t<0||!l?i.domIn(r,t):l.domIn(o,t))}coordsAt(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof yb?null:i.coordsInWidget(r,t,!0):i.coordsIn(r,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,l){if(s.isComposite())for(let o of s.children){if(o.length>=l){let c=r(o,l);if(c)return c}if(l-=o.length,l<0)break}else if(s.isText()&&l<s.length){let o=sn(s.text,l);if(o==l)return null;let c=qh(s.dom,l,o).getClientRects();for(let h=0;h<c.length;h++){let d=c[h];if(h==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return r(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,l=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,c=this.view.textDirection==mt.LTR,h=0,d=(p,g,O)=>{for(let b=0;b<p.children.length&&!(g>r);b++){let v=p.children[b],x=g+v.length,k=v.dom.getBoundingClientRect(),{height:C}=k;if(O&&!b&&(h+=k.top-O.top),v instanceof Qs)x>i&&d(v,g,k);else if(g>=i&&(h>0&&t.push(-h),t.push(C+h),h=0,l)){let A=v.dom.lastChild,P=A?bh(A):[];if(P.length){let E=P[P.length-1],D=c?E.right-k.left:k.right-E.left;D>o&&(o=D,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=x)}}O&&b==p.children.length-1&&(h+=O.bottom-k.bottom),g=x+v.breakAfter}};return d(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?mt.RTL:mt.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let o=0,c;for(let h of l.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let d=bh(h.dom);if(d.length!=1)return;o+=d[0].width,c=d[0].height}if(o)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:o/l.length,textHeight:c}}});if(e)return e;let t=document.createElement("div"),i,r,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let l=bh(t.firstChild)[0];i=t.getBoundingClientRect().height,r=l&&l.width?l.width/27:7,s=l&&l.height?l.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.view.state.doc.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(ke.replace({widget:new yb(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return ke.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ug).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(cx).map((s,l)=>{let o=typeof s=="function";return o&&(i=!0),o?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(Ve.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(IN).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var t;if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(jN))try{if(d(this.view,e.range,e))return!0}catch(p){ei(this.view.state,p,"scroll handler")}let{range:i}=e,r=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),s;if(!r)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let l=ux(this.view),o={left:r.left-l.left,top:r.top-l.top,right:r.right+l.right,bottom:r.bottom+l.bottom},{offsetWidth:c,offsetHeight:h}=this.view.scrollDOM;if(X6(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==mt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let d=this.view.docView.lineAt(i.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){bS(this.tile)}}function bS(n,e){let t=e==null?void 0:e.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)bS(i,e)}}function pW(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function YN(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=TN(t.focusNode,t.focusOffset),r=CN(t.focusNode,t.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let o=zt.get(r.node);if(!o||o.isText()&&o.text!=r.node.nodeValue)s=r;else if(n.docView.lastCompositionAfterCursor){let c=zt.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(n.docView.lastCompositionAfterCursor=s!=i,!s)return null;let l=e-s.offset;return{from:l,to:l+s.node.nodeValue.length,node:s.node}}function mW(n,e,t){let i=YN(n,t);if(!i)return null;let{node:r,from:s,to:l}=i,o=r.nodeValue;if(/[\n\r]/.test(o)||n.state.doc.sliceString(i.from,i.to)!=o)return null;let c=e.invertedDesc;return{range:new Bi(c.mapPos(s),c.mapPos(l),s,l),text:r}}function gW(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let OW=class{constructor(){this.changes=[]}compareRange(e,t){tc(e,t,this.changes)}comparePoint(e,t){tc(e,t,this.changes)}boundChange(e){tc(e,e,this.changes)}};function yW(n,e,t){let i=new OW;return Ve.compare(n,e,t,i),i.changes}class bW{constructor(){this.changes=[]}compareRange(e,t){tc(e,t,this.changes)}comparePoint(){}boundChange(e){tc(e,e,this.changes)}}function SW(n,e,t){let i=new bW;return Ve.compare(n,e,t,i),i.changes}function vW(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function xW(n,e){let t=!1;return e&&n.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(t=!0)}),t}class yb extends hr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function kW(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return Y.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=sn(r.text,s,!1):o=sn(r.text,s);let c=i(r.text.slice(l,o));for(;l>0;){let h=sn(r.text,l,!1);if(i(r.text.slice(h,l))!=c)break;l=h}for(;o<r.length;){let h=sn(r.text,o);if(i(r.text.slice(o,h))!=c)break;o=h}return Y.range(l+r.from,o+r.from)}function wW(n,e,t,i,r){let s=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,c=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=c*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+oS(l,s,n.state.tabSize)}function SS(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==vn.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function TW(n,e,t,i){let r=SS(n,e.head,e.assoc||-1),s=!i||r.type!=vn.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),c=n.posAtCoords({x:t==(o==mt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(c!=null)return Y.cursor(c,t?-1:1)}return Y.cursor(t?r.to:r.from,t?-1:1)}function qQ(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,c=null;;){let h=J6(r,s,l,o,t),d=$N;if(!h){if(r.number==(t?n.state.doc.lines:1))return o;d=`
`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),h=n.visualLineSide(r,!t)}if(c){if(!c(d))return o}else{if(!i)return h;c=i(d)}o=h}}function CW(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==Qt.Space&&(r=l),r==l}}function AW(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return Y.cursor(r,e.assoc);let l=e.goalColumn,o,c=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),d=n.documentTop;if(h)l==null&&(l=h.left-c.left),o=s<0?h.top:h.bottom;else{let b=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(c.right-c.left,n.defaultCharacterWidth*(r-b.from))),o=(s<0?b.top:b.bottom)+d}let p=c.left+l,g=n.viewState.heightOracle.textHeight>>1,O=i??g;for(let b=0;;b+=g){let v=o+(O+b)*s,x=vS(n,{x:p,y:v},!1,s);if(t?v>c.bottom:v<c.top)return Y.cursor(x.pos,x.assoc);let k=n.coordsAtPos(x.pos,x.assoc),C=k?(k.top+k.bottom)/2:0;if(!k||(t?C>o:C<o))return Y.cursor(x.pos,x.assoc,void 0,l)}}function vh(n,e,t){for(;;){let i=0;for(let r of n)r.between(e-1,e+1,(s,l,o)=>{if(e>s&&e<l){let c=i||t||(e-s<l-e?-1:1);e=c<0?s:l,i=c}});if(!i)return e}}function UN(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let l=vh(n,r.from,0);l!=r.from&&(s=Y.cursor(l,-1))}else{let l=vh(n,r.from,-1),o=vh(n,r.to,1);(l!=r.from||o!=r.to)&&(s=Y.range(r.from==r.anchor?l:o,r.from==r.head?l:o))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?Y.create(t,e.mainIndex):e}function bb(n,e,t){let i=vh(n.state.facet(yf).map(r=>r(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:Y.cursor(i,i<t.from?1:-1)}class Rr{constructor(e,t){this.pos=e,this.assoc=t}}function vS(n,e,t,i){let r=n.contentDOM.getBoundingClientRect(),s=r.top+n.viewState.paddingTop,{x:l,y:o}=e,c=o-s,h;for(;;){if(c<0)return new Rr(0,1);if(c>n.viewState.docHeight)return new Rr(n.state.doc.length,-1);if(h=n.elementAtHeight(c),i==null)break;if(h.type==vn.Text){if(i<0?h.to<n.viewport.from:h.from>n.viewport.to)break;let g=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(g&&(i<0?g.top<=c+s:g.bottom>=c+s))break}let p=n.viewState.heightOracle.textHeight/2;c=i>0?h.bottom+p:h.top-p}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==vn.Text){let p=wW(n,r,h,l,o);return new Rr(p,p==h.from?1:-1)}}if(h.type!=vn.Text)return c<(h.top+h.bottom)/2?new Rr(h.from,1):new Rr(h.to,-1);let d=n.docView.lineAt(h.from,2);return(!d||d.length!=h.length)&&(d=n.docView.lineAt(h.from,-2)),new MW(n,l,o,n.textDirectionAt(h.from)).scanTile(d,h.from)}class MW{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Dr.find(r,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Dr.find(r,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<t)}scan(e,t,i=!1){let r=0,s=e.length-1,l=new Set,o=this.bidiIn(e[0],e[s]),c,h,d=-1,p=1e9,g;e:for(;r<s;){let b=s-r,v=r+s>>1;t:if(l.has(v)){let k=r+Math.floor(Math.random()*b);for(let C=0;C<b;C++){if(!l.has(k)){v=k;break t}k++,k==s&&(k=r)}break e}l.add(v);let x=t(v);if(x)for(let k=0;k<x.length;k++){let C=x[k],A=0;if(!(C.width==0&&x.length>1)){if(C.bottom<this.y)(!c||c.bottom<C.bottom)&&(c=C),A=1;else if(C.top>this.y)(!h||h.top>C.top)&&(h=C),A=-1;else{let P=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,E=Math.abs(P);E<p&&(d=v,p=E,g=C),P&&(A=P<0==(this.baseDir==mt.LTR)?-1:1)}A==-1&&(!o||this.baseDirAt(e[v],1))?s=v:A==1&&(!o||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!g){let b=c&&(!h||this.y-c.bottom<h.top-this.y)?c:h;return this.y=(b.top+b.bottom)/2,this.scan(e,t,!0)}if(p&&!i){let{top:b,bottom:v}=g;if(c&&c.bottom>(b+b+v)/3)return this.y=c.bottom-1,this.scan(e,t,!0);if(h&&h.top<(b+v+v)/3)return this.y=h.top+1,this.scan(e,t,!0)}let O=(o?this.dirAt(e[d],1):this.baseDir)==mt.LTR;return{i:d,after:this.x>(g.left+g.right)/2==O}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=sn(e.text,s))i.push(t+s);i.push(t+e.length);let r=this.scan(i,s=>{let l=i[s]-t,o=i[s+1]-t;return qh(e.dom,l,o).getClientRects()});return r.after?new Rr(i[r.i+1],-1):new Rr(i[r.i],1)}scanTile(e,t){if(!e.length)return new Rr(t,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,t);if(o.isComposite())return this.scanTile(o,t)}let i=[t];for(let o=0,c=t;o<e.children.length;o++)i.push(c+=e.children[o].length);let r=this.scan(i,o=>{let c=e.children[o];return c.flags&48?null:(c.dom.nodeType==1?c.dom:qh(c.dom,0,c.length)).getClientRects()}),s=e.children[r.i],l=i[r.i];return s.isText()?this.scanText(s,l):s.isComposite()?this.scanTile(s,l):r.after?new Rr(i[r.i+1],-1):new Rr(l,1)}}const qa="";class QW{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qa}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let l=zt.get(r),o=r.nextSibling;if(o==t){l!=null&&l.breakAfter&&!o&&i!=this.view.contentDOM&&this.lineBreak();break}let c=zt.get(o);(l&&c?l.breakAfter:(l?l.breakAfter:qm(r))||qm(o)&&(r.nodeName!="BR"||l!=null&&l.isWidget())&&this.text.length>s)&&!$W(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=l-1);i=s+l}}readNode(e){let t=zt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(EW(e,i.node,i.offset)?t:0))}}function EW(n,e,t){for(;;){if(!e||t<Ps(e))return!1;if(e==n)return!0;t=jl(e)+1,e=e.parentNode}}function $W(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=zt.get(n);if(!(i!=null&&i.isWidget()))return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class HQ{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class RW{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=WN(e.docView.tile,t,i,0))){let c=s||l?[]:DW(e),h=new QW(c,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=NW(c,this.bounds.from)}else{let c=e.observer.selectionRange,h=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!pS(e.contentDOM,c.focusNode)?o.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!pS(e.contentDOM,c.anchorNode)?o.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),p=e.viewport;if((Oe.ios||Oe.chrome)&&o.main.empty&&h!=d&&(p.from>0||p.to<e.state.doc.length)){let g=Math.min(h,d),O=Math.max(h,d),b=p.from-g,v=p.to-O;(b==0||b==1||g==0)&&(v==0||v==-1||O==e.state.doc.length)&&(h=0,d=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Y.range(d,h));else if(e.lineWrapping&&d==h&&!(o.main.empty&&o.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let g=e.coordsAtPos(h,-1),O=0;g&&(O=e.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=Y.create([Y.cursor(h,O)])}else this.newSel=Y.single(d,h)}}}function WN(n,e,t,i){if(n.isComposite()){let r=-1,s=-1,l=-1,o=-1;for(let c=0,h=i,d=i;c<n.children.length;c++){let p=n.children[c],g=h+p.length;if(h<e&&g>t)return WN(p,e,t,h);if(g>=e&&r==-1&&(r=c,s=h),h>t&&p.dom.parentNode==n.dom){l=c,o=d;break}d=g,h=g+p.breakAfter}return{from:s,to:o<0?i+n.length:o,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:l<n.children.length&&l>=0?n.children[l].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function GN(n,e){let t,{newSel:i}=e,{state:r}=n,s=r.selection.main,l=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:c}=e.bounds,h=s.from,d=null;(l===8||Oe.android&&e.text.length<c-o)&&(h=s.to,d="end");let p=r.doc.sliceString(o,c,qa),g,O;!s.empty&&s.from>=o&&s.to<=c&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-o)==e.text.slice(0,s.from-o)&&p.slice(s.to-o)==e.text.slice(g=e.text.length-(p.length-(s.to-o)))?t={from:s.from,to:s.to,insert:Ge.of(e.text.slice(s.from-o,g).split(qa))}:(O=FN(p,e.text,h-o,d))&&(Oe.chrome&&l==13&&O.toB==O.from+2&&e.text.slice(O.from,O.toB)==qa+qa&&O.toB--,t={from:o+O.from,to:o+O.toA,insert:Ge.of(e.text.slice(O.from,O.toB).split(qa))})}else i&&(!n.hasFocus&&r.facet(xs)||Wm(i,s))&&(i=null);if(!t&&!i)return!1;if((Oe.mac||Oe.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=Y.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:Ge.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:r.toText(n.inputState.insertingText)}:Oe.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
 `&&n.lineWrapping&&(i&&(i=Y.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Ge.of([" "])}),t)return hx(n,t,i,l);if(i&&!Wm(i,s)){let o=!1,c="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),c=n.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=UN(r.facet(yf).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:o,userEvent:c}),!0}else return!1}function hx(n,e,t,i=-1){if(Oe.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Oe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&nc(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&nc(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&nc(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,o=()=>l||(l=PW(n,e,t));return n.state.facet(zN).some(c=>c(n,e.from,e.to,s,o))||n.dispatch(o()),!0}function PW(n,e,t){let i,r=n.state,s=r.selection.main,l=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let c=e.from<s.from?-1:1,h=c<0?s.from:s.to,d=vh(r.facet(yf).map(p=>p(n)),h,c);e.from==d&&(l=d)}if(l>-1)i={changes:e,selection:Y.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let c=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(c+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let c=r.changes(e),h=t&&t.main.to<=c.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=n.state.sliceDoc(e.from,e.to),p,g=t&&YN(n,t.main.head);if(g){let b=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-b}}else p=n.state.doc.lineAt(s.head);let O=s.to-e.to;i=r.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:c,range:h||b.map(c)};let v=b.to-O,x=v-d.length;if(n.state.sliceDoc(x,v)!=d||v>=p.from&&x<=p.to)return{range:b};let k=r.changes({from:x,to:v,insert:e.insert}),C=b.to-s.to;return{changes:k,range:h?Y.range(Math.max(0,h.anchor+C),Math.max(0,h.head+C)):b.map(k)}})}else i={changes:c,selection:h&&r.selection.replaceRange(h)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:o,scrollIntoView:!0})}function FN(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s<r&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&n.length==e.length)return null;let l=n.length,o=e.length;for(;l>0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let c=Math.max(0,s-Math.min(l,o));t-=l+c-s}if(l<s&&n.length<e.length){let c=t<=s&&t>=l?s-t:0;s-=c,o=s+(o-l),l=s}else if(o<s){let c=t<=s&&t>=o?s-t:0;s-=c,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function DW(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new HQ(t,i)),(r!=t||s!=i)&&e.push(new HQ(r,s))),e}function NW(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?Y.single(t+e,i+e):null}function Wm(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class zW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&FW(e.contentDOM.ownerDocument)}handleEvent(e){!VW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=LW(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&JN.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=KN.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||_W.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,nc(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function YQ(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){ei(t.state,r)}}}function LW(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,s=r&&r.plugin.domEventHandlers,l=r&&r.plugin.domEventObservers;if(s)for(let o in s){let c=s[o];c&&t(o).handlers.push(YQ(i.value,c))}if(l)for(let o in l){let c=l[o];c&&t(o).observers.push(YQ(i.value,c))}}for(let i in cr)t(i).handlers.push(cr[i]);for(let i in ii)t(i).observers.push(ii[i]);return e}const KN=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_W="dthko",JN=[16,17,18,20,91,92,224,225],up=6;function hp(n){return Math.max(0,n)*.7+8}function BW(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class jW{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=xN(e.contentDOM),this.atoms=e.state.facet(yf).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ye.allowMultipleSelections)&&ZW(e,t),this.dragging=IW(e,t)&&nz(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&BW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let c=ux(this.view);e.clientX-c.left<=r+up?t=-hp(r-e.clientX):e.clientX+c.right>=l-up&&(t=hp(e.clientX-l)),e.clientY-c.top<=s+up?i=-hp(s-e.clientY):e.clientY+c.bottom>=o-up&&(i=hp(e.clientY-o)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=UN(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function ZW(n,e){let t=n.state.facet(RN);return t.length?t[0](e):Oe.mac?e.metaKey:e.ctrlKey}function XW(n,e){let t=n.state.facet(PN);return t.length?t[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function IW(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Ih(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let l=r[s];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function VW(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=zt.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const cr=Object.create(null),ii=Object.create(null),ez=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function qW(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),tz(n,t.value)},50)}function Fg(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function tz(n,e){e=Fg(n.state,lx,e);let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(xS!=null&&t.selection.ranges.every(c=>c.empty)&&xS==s.toString()){let c=-1;i=t.changeByRange(h=>{let d=t.doc.lineAt(h.from);if(d.from==c)return{range:h};c=d.from;let p=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:d.from,insert:p},range:Y.cursor(h.from+p.length)}})}else l?i=t.changeByRange(c=>{let h=s.line(r++);return{changes:{from:c.from,to:c.to,insert:h.text},range:Y.cursor(c.from+h.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ii.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};ii.wheel=ii.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};cr.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ii.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};ii.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};cr.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(DN))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=YW(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new jW(n,e,t,i)),i&&n.observer.ignore(()=>{kN(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function UQ(n,e,t,i){if(i==1)return Y.cursor(e,t);if(i==2)return kW(n.state,e,t);{let r=n.docView.lineAt(e,t),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return o<n.state.doc.length&&o==s.to&&o++,Y.range(l,o)}}const HW=Oe.ie&&Oe.ie_version<=11;let WQ=null,GQ=0,FQ=0;function nz(n){if(!HW)return n.detail;let e=WQ,t=FQ;return WQ=n,FQ=Date.now(),GQ=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(GQ+1)%3:1}function YW(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=nz(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let c=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,d=UQ(n,c.pos,c.assoc,i);if(t.pos!=c.pos&&!l){let p=UQ(n,t.pos,t.assoc,i),g=Math.min(p.from,d.from),O=Math.max(p.to,d.to);d=g<d.from?Y.range(g,O,d.assoc):Y.range(O,g,d.assoc)}return l?r.replaceRange(r.main.extend(d.from,d.to,d.assoc)):o&&i==1&&r.ranges.length>1&&(h=UW(r,c.pos))?h:o?r.addRange(d):Y.create([d])}}}function UW(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:r}=n.ranges[t];if(i<=e&&r>=e)return Y.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}cr.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=Y.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Fg(n.state,ox,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};cr.dragend=n=>(n.inputState.draggedContent=null,!1);function KQ(n,e,t,i){if(t=Fg(n.state,lx,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&XW(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},c=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}cr.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&KQ(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l<t.length;l++){let o=new FileReader;o.onerror=s,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return KQ(n,e,i,!0),!0}return!1};cr.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=ez?null:e.clipboardData;return t?(tz(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(qW(n),!1)};function WW(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function GW(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:Fg(n,ox,e.join(n.lineBreak)),ranges:t,linewise:i}}let xS=null;cr.copy=cr.cut=(n,e)=>{if(!yh(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=GW(n.state);if(!t&&!r)return!1;xS=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=ez?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(WW(n,t),!1)};const iz=qr.define();function rz(n,e){let t=[];for(let i of n.facet(LN)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:iz.of(!0)}):null}function sz(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=rz(n.state,e);t?n.dispatch(t):n.update([])}},10)}ii.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),sz(n)};ii.blur=n=>{n.observer.clearSelectionRange(),sz(n)};ii.compositionstart=ii.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ii.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Oe.chrome&&Oe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ii.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};cr.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let o=l[0],c=n.posAtDOM(o.startContainer,o.startOffset),h=n.posAtDOM(o.endContainer,o.endOffset);return hx(n,{from:c,to:h,insert:n.state.toText(s)},null),!0}}let r;if(Oe.chrome&&Oe.android&&(r=KN.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ii.compositionend(n,e),20),!1};const JQ=new Set;function FW(n){JQ.has(n)||(JQ.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const eE=["pre-wrap","normal","pre-line","break-spaces"];let Sc=!1;function tE(){Sc=!1}class KW{constructor(e){this.lineWrapping=e,this.doc=Ge.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return eE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,i,r,s,l){let o=eE.indexOf(e)>-1,c=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let h=0;h<l.length;h++){let d=l[h];d<0?h++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class JW{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class nr{constructor(e,t,i,r,s){this.from=e,this.length=t,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?vn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Vo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new nr(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var St=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(St||(St={}));const Zp=.001;class Ln{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Zp&&(Sc=!0),this.height=e)}replace(e,t,i){return Ln.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:c,toA:h,fromB:d,toB:p}=r[o],g=s.lineAt(c,St.ByPosNoHeight,i.setDoc(t),0,0),O=g.to>=h?g:s.lineAt(h,St.ByPosNoHeight,i,0,0);for(p+=O.to-h,h=O.to;o>0&&g.from<=r[o-1].toA;)c=r[o-1].fromA,d=r[o-1].fromB,o--,c<g.from&&(g=s.lineAt(c,St.ByPosNoHeight,i,0,0));d+=g.from-c,c=g.from;let b=fx.build(i.setDoc(l),e,d,p);s=Gm(s,s.replace(c,h,b))}return s.updateHeight(i,0)}static empty(){return new pi(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,r=0,s=0;for(;;)if(t==i)if(r>s*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r<s){let o=e[t++];o&&(r+=o.size)}else{let o=e[--i];o&&(s+=o.size)}let l=0;return e[t-1]==null?(l=1,t--):e[t]==null&&(l=1,i++),new t7(Ln.of(e.slice(0,t)),l,Ln.of(e.slice(i)))}}function Gm(n,e){return n==e?n:(n.constructor!=e.constructor&&(Sc=!0),e)}Ln.prototype.size=1;const e7=ke.replace({});class lz extends Ln{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new nr(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new nr(r,0,i,this.spaceAbove,e7):this.mainBlock(i,r)}lineAt(e,t,i,r,s){let l=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(l):l}forEachLine(e,t,i,r,s,l){e<=s+this.length&&t>=s&&l(this.lineAt(0,St.ByPos,i,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class pi extends lz{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new nr(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof pi||r instanceof gn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof gn?r=new pi(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Ln.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class gn extends Ln{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*s);l=c/s,this.length>s+1&&(o=(this.height-c)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:c}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),d=t.doc.lineAt(h),p=o+d.length*c,g=Math.max(i,e-p/2);return new nr(d.from,d.length,g,p,0)}else{let h=Math.max(0,Math.min(l-s,Math.floor((e-i)/o))),{from:d,length:p}=t.doc.line(s+h);return new nr(d,p,i+o*h,o,0)}}lineAt(e,t,i,r,s){if(t==St.ByHeight)return this.blockAt(e,i,r,s);if(t==St.ByPosNoHeight){let{from:O,to:b}=i.doc.lineAt(e);return new nr(O,b-O,0,0,0)}let{firstLine:l,perLine:o,perChar:c}=this.heightMetrics(i,s),h=i.doc.lineAt(e),d=o+h.length*c,p=h.number-l,g=r+o*p+c*(h.from-s-p);return new nr(h.from,h.length,Math.max(r,Math.min(g,r+this.height-d)),d,0)}forEachLine(e,t,i,r,s,l){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:o,perLine:c,perChar:h}=this.heightMetrics(i,s);for(let d=e,p=r;d<=t;){let g=i.doc.lineAt(d);if(d==e){let b=g.number-o;p+=c*b+h*(e-s-b)}let O=c+h*g.length;l(new nr(g.from,g.length,p,O,0)),p+=O,d=g.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let s=i[i.length-1];s instanceof gn?i[i.length-1]=new gn(s.length+r):i.push(null,new gn(r-1))}if(e>0){let s=i[0];s instanceof gn?i[0]=new gn(e+s.length):i.unshift(new gn(e-1),null)}return Ln.of(i)}decomposeLeft(e,t){t.push(new gn(e-1),null)}decomposeRight(e,t){t.push(null,new gn(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),c=-1;for(r.from>t&&l.push(new gn(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let d=e.doc.lineAt(o).length;l.length&&l.push(null);let p=r.heights[r.index++],g=0;p<0&&(g=-p,p=r.heights[r.index++]),c==-1?c=p:Math.abs(p-c)>=Zp&&(c=-2);let O=new pi(d,p,g);O.outdated=!1,l.push(O),o+=d+1}o<=s&&l.push(null,new gn(s-o).updateHeight(e,o));let h=Ln.of(l);return(c<0||Math.abs(h.height-this.height)>=Zp||Math.abs(c-this.heightMetrics(e,t).perLine)>=Zp)&&(Sc=!0),Gm(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class t7 extends Ln{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,t,i,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,i,r,s){let l=r+this.left.height,o=s+this.left.length+this.break,c=t==St.ByHeight?e<l:e<o,h=c?this.left.lineAt(e,t,i,r,s):this.right.lineAt(e,t,i,l,o);if(this.break||(c?h.to<o:h.from>o))return h;let d=t==St.ByPosNoHeight?St.ByPosNoHeight:St.ByPos;return c?h.join(this.right.lineAt(o,d,i,l,o)):this.left.lineAt(o,d,i,r,s).join(h)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,t,i,r,s,l),t>=c&&this.right.forEachLine(e,t,i,o,c,l);else{let h=this.lineAt(c,St.ByPos,i,r,s);e<h.from&&this.left.forEachLine(e,h.from-1,i,r,s,l),h.to>=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,o,c,l)}}replace(e,t,i){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&nE(s,l-1),t<this.length){let o=s.length;this.decomposeRight(t,s),nE(s,o)}return Ln.of(s)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ln.of(this.break?[e,null,t]:[e,t]):(this.left=Gm(this.left,e),this.right=Gm(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,c=null;return r&&r.from<=t+s.length&&r.more?c=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?c=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),c?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function nE(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof gn&&(i=n[e+1])instanceof gn&&n.splice(e-1,3,new gn(t.length+1+i.length))}const n7=5;class fx{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof pi?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new pi(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let l=t-e;i.block?this.addBlock(new lz(l,r,i)):(l||s||r>=n7)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new pi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new gn(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof pi)return e;let t=new pi(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof pi)&&!this.isCovered?this.nodes.push(new pi(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof pi&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,t,i,r){let s=new fx(i,e);return Ve.spans(t,i,r,s,0),s.finish(i)}}function i7(n,e,t){let i=new r7;return Ve.compare(n,e,t,i,0),i.changes}class r7{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,r){(e<t||i&&i.heightRelevant||r&&r.heightRelevant)&&tc(e,t,this.changes,5)}}function s7(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,r=i.defaultView||window,s=Math.max(0,t.left),l=Math.min(r.innerWidth,t.right),o=Math.max(0,t.top),c=Math.min(r.innerHeight,t.bottom);for(let h=n.parentNode;h&&h!=i.body;)if(h.nodeType==1){let d=h,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();s=Math.max(s,g.left),l=Math.min(l,g.right),o=Math.max(o,g.top),c=Math.min(h==n.parentNode?r.innerHeight:c,g.bottom)}h=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,c)-(t.top+e)}}function l7(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function o7(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Sb{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=t[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return ke.replace({widget:new a7(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class a7 extends hr{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class iE{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(ax).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new KW(i),this.stateDeco=sE(t),this.heightMap=Ln.empty().applyChanges(this.stateDeco,Ge.empty,this.heightOracle.setDoc(t.doc),[new Bi(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ke.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new fp(s,l))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?rE:new dx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(th(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=sE(this.state);let r=e.changedRanges,s=Bi.extendWithRanges(r,i7(i,this.stateDeco,e?e.changes:Jt.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);tE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||Sc)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(BN)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?mt.RTL:mt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=t.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,d=0;if(o.width&&o.height){let{scaleX:E,scaleY:D}=vN(t,o);(E>.005&&Math.abs(this.scaleX-E)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=E,this.scaleY=D,h|=16,l=c=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let O=xN(this.view.contentDOM,!1).y;O!=this.scrollParent&&(this.scrollParent=O,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=wN(this.scrollParent||e.win);let v=(this.printing?o7:s7)(t,this.paddingTop),x=v.top-this.pixelViewport.top,k=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(c=!0)),!this.inView&&!this.scrollTarget&&!l7(e.dom))return 0;let A=o.width;if((this.contentDOMWidth!=A||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),c){let E=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(E)&&(l=!0),l||r.lineWrapping&&Math.abs(A-this.contentDOMWidth)>r.charWidth){let{lineHeight:D,charWidth:$,textHeight:H}=e.docView.measureTextSize();l=D>0&&r.refresh(s,D,$,H,Math.max(5,A/$),E),l&&(e.docView.minWidth=0,h|=16)}x>0&&k>0?d=Math.max(x,k):x<0&&k<0&&(d=Math.min(x,k)),tE();for(let D of this.viewports){let $=D.from==this.viewport.from?E:e.docView.measureVisibleLineHeights(D);this.heightMap=(l?Ln.empty().applyChanges(this.stateDeco,Ge.empty,this.heightOracle,[new Bi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new JW(D.from,$))}Sc&&(h|=2)}let P=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(h&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,c=new fp(r.lineAt(l-i*1e3,St.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,St.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(h<c.from||h>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(h,St.ByPos,s,0,0),g;t.y=="center"?g=(p.top+p.bottom)/2-d/2:t.y=="start"||t.y=="nearest"&&h<c.from?g=p.top:g=p.bottom-d,c=new fp(r.lineAt(g-1e3/2,St.ByHeight,s,0,0).from,r.lineAt(g+d+1e3/2,St.ByHeight,s,0,0).to)}}return c}mapViewport(e,t){let i=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new fp(this.heightMap.lineAt(i,St.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,St.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,St.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,St.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:o}=this;return(e==0||r<=l-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||s>=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let r of e)t.touchesRange(r.from,r.to)||i.push(new Sb(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,l=r<<1;if(this.defaultTextDirection!=mt.LTR&&!i)return[];let o=[],c=(d,p,g,O)=>{if(p-d<s)return;let b=this.state.selection.main,v=[b.from];b.empty||v.push(b.to);for(let k of v)if(k>d&&k<p){c(d,k-10,g,O),c(k+10,p,g,O);return}let x=u7(e,k=>k.from>=g.from&&k.to<=g.to&&Math.abs(k.from-d)<s&&Math.abs(k.to-p)<s&&!v.some(C=>k.from<C&&k.to>C));if(!x){if(p<g.to&&t&&i&&t.visibleRanges.some(A=>A.from<=p&&A.to>=p)){let A=t.moveToLineBoundary(Y.cursor(p),!1,!0).head;A>d&&(p=A)}let k=this.gapSize(g,d,p,O),C=i||k<2e6?k:2e6;x=new Sb(d,p,k,C)}o.push(x)},h=d=>{if(d.length<l||d.type!=vn.Text)return;let p=c7(d.from,d.to,this.stateDeco);if(p.total<l)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,b;if(i){let v=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,k;if(g!=null){let C=pp(p,g),A=((this.visibleBottom-this.visibleTop)/2+v)/d.height;x=C-A,k=C+A}else x=(this.visibleTop-d.top-v)/d.height,k=(this.visibleBottom-d.top+v)/d.height;O=dp(p,x),b=dp(p,k)}else{let v=p.total*this.heightOracle.charWidth,x=r*this.heightOracle.charWidth,k=0;if(v>2e6)for(let D of e)D.from>=d.from&&D.from<d.to&&D.size!=D.displaySize&&D.from*this.heightOracle.charWidth+k<this.pixelViewport.left&&(k=D.size-D.displaySize);let C=this.pixelViewport.left+k,A=this.pixelViewport.right+k,P,E;if(g!=null){let D=pp(p,g),$=((A-C)/2+x)/v;P=D-$,E=D+$}else P=(C-x)/v,E=(A+x)/v;O=dp(p,P),b=dp(p,E)}O>d.from&&c(d.from,O,d,p),b<d.to&&c(b,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(h):h(d);return o}gapSize(e,t,i,r){let s=pp(r,i)-pp(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Sb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ke.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Ve.spans(t,this.viewport.from,this.viewport.to,{span(s,l){i.push({from:s,to:l})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let l=this.visibleRanges[s],o=i[s];(l.from!=o.from||l.to!=o.to)&&(r|=4,e&&e.mapPos(l.from,-1)==o.from&&e.mapPos(l.to,1)==o.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||th(this.heightMap.lineAt(e,St.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||th(this.heightMap.lineAt(this.scaler.fromDOM(e),St.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return th(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class fp{constructor(e,t){this.from=e,this.to=t}}function c7(n,e,t){let i=[],r=n,s=0;return Ve.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function dp({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function pp(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function u7(n,e){for(let t of n)if(e(t))return t}const rE={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function sE(n){let e=n.facet(Ug).filter(i=>typeof i!="function"),t=n.facet(cx).filter(i=>typeof i!="function");return t.length&&e.push(Ve.join(t)),e}class dx{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:c})=>{let h=t.lineAt(o,St.ByPos,e,0,0).top,d=t.lineAt(c,St.ByPos,e,0,0).bottom;return r+=d-h,{from:o,to:c,top:h,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof dx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function th(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new nr(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>th(r,e)):n._content)}const mp=ge.define({combine:n=>n.join(" ")}),kS=ge.define({combine:n=>n.indexOf(!0)>-1}),wS=Bl.newName(),oz=Bl.newName(),az=Bl.newName(),cz={"&light":"."+oz,"&dark":"."+az};function TS(n,e,t){return new Bl(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const h7=TS("."+wS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},cz),f7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},vb=Oe.ie&&Oe.ie_version<=11;class d7{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new I6,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Oe.ie&&Oe.ie_version<=11||Oe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new m7(e),e.state.facet(xs)&&(e.contentDOM.editContext=this.editContext.editContext)),vb&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(xs)?i.root.activeElement!=this.dom:!yh(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Sh(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Ih(e.root);if(!t)return!1;let i=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&p7(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=yh(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&q6(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,f7),vb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),vb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&nc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&yh(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new RW(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=GN(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Wm(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=lE(t,e.previousSibling||e.target.previousSibling,-1),r=lE(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(xs)!=e.state.facet(xs)&&(e.view.contentDOM.editContext=e.state.facet(xs)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function lE(n,e,t){for(;e;){let i=zt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function oE(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor,1);return Sh(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function p7(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return oE(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?oE(n,t):null}class m7{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:l}=r,o=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let h=c-o>i.text.length;o==this.from&&s<this.from?o=s:c==this.to&&s>this.to&&(c=s);let d=FN(e.state.sliceDoc(o,c),i.text,(h?r.from:r.to)-o,h?"end":null);if(!d){let g=Y.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Wm(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+o,to:d.toA+o,insert:Ge.of(i.text.slice(d.from,d.toB).split(`
`))};if((Oe.mac||Oe.android)&&p.from==l-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:o,to:c,insert:Ge.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);hx(e,p,Y.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let l=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);l<o;l++){let c=e.coordsForChar(l);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(o)){let c=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(c<h){let d=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;r.push(ke.mark({attributes:{style:d}}).range(c,h))}}}e.dispatch({effects:ZN.of(ke.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Ih(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,l,o,c,h)=>{if(i)return;let d=h.length-(l-s);if(r&&l>=r.to)if(r.from==s&&r.to==l&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=d,this.to+=d;return}else r=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||l>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),h.toString()),this.to+=d}t+=d}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class de{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||V6(e.parent)||document,this.viewState=new iE(this,e.state||Ye.create(e)),e.scrollTo&&e.scrollTo.is(cp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ua).map(r=>new mb(r));for(let r of this.plugins)r.update(this);this.observer=new d7(this),this.inputState=new zW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new VQ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Ut?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,c=null;e.some(g=>g.annotation(iz))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=rz(s,l),c||(o=1));let h=this.observer.delayedAndroidKey,d=null;if(h?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ye.phrases)!=this.state.facet(Ye.phrases))return this.setState(s);r=Hm.create(this,s,e),r.flags|=o;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection,{x:b,y:v}=this.state.facet(de.cursorScrollMargin);p=new ic(O.empty?O:Y.cursor(O.head,O.head>O.anchor?-1:1),"nearest","nearest",v,b)}for(let O of g.effects)O.is(cp)&&(p=O.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=Fm.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(eh)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(mp)!=r.state.facet(mp)&&(this.viewState.mustMeasureContent=!0),(t||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(yS))try{g(r)}catch(O){ei(this.state,O,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!GN(this,d)&&h.force&&nc(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new iE(this,e),this.plugins=e.facet(Ua).map(i=>new mb(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new VQ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ua),i=e.state.facet(Ua);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new mb(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){ei(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(wN(i||this.win))s=-1,l=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(r);s=O.from,l=O.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];c&4||([this.measureRequests,h]=[h,this.measureRequests]);let d=h.map(O=>{try{return O.read(this)}catch(b){return ei(this.state,b),aE}}),p=Hm.create(this,this.state,[]),g=!1;p.flags|=c,t?t.flags|=c:t=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<h.length;O++)if(d[O]!=aE)try{let b=h[O];b.write&&b.write(d[O],this)}catch(b){ei(this.state,b)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-l)/this.scaleY;if((b>1||b<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+b,i?i.scrollTop+=b:this.win.scrollBy(0,b),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(yS))o(t)}get themeClasses(){return wS+" "+(this.state.facet(kS)?az:oz)+" "+this.state.facet(mp)}updateAttrs(){let e=cE(this,XN,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(xs)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),cE(this,ax,t);let i=this.observer.ignore(()=>{let r=_Q(this.contentDOM,this.contentAttrs,t),s=_Q(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(de.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(eh);let e=this.state.facet(de.cspNonce);Bl.mount(this.root,this.styleModules.concat(h7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return bb(this,e,qQ(this,e,t,i))}moveByGroup(e,t){return bb(this,e,qQ(this,e,t,i=>CW(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return Y.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return TW(this,e,t,i)}moveVertically(e,t,i){return bb(this,e,AW(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=vS(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),vS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[Dr.find(s,e-r.from,-1,t)];return Vh(i,l.dir==mt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(_N)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>g7)return EN(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||QN(s.isolates,i=ZQ(this,e))))return s.order;i||(i=ZQ(this,e));let r=K6(e.text,t,i);return this.bidiCache.push(new Fm(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{kN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,r,s,l;return cp.of(new ic(typeof e=="number"?Y.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(r=t.x)!==null&&r!==void 0?r:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(l=t.xMargin)!==null&&l!==void 0?l:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return cp.of(new ic(Y.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Lt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Lt.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Bl.newName(),r=[mp.of(i),eh.of(TS(`.${i}`,e))];return t&&t.dark&&r.push(kS.of(!0)),r}static baseTheme(e){return Bs.lowest(eh.of(TS("."+wS,e,cz)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&zt.get(i)||zt.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}de.styleModule=eh;de.inputHandler=zN;de.clipboardInputFilter=lx;de.clipboardOutputFilter=ox;de.scrollHandler=jN;de.focusChangeEffect=LN;de.perLineTextDirection=_N;de.exceptionSink=NN;de.updateListener=yS;de.editable=xs;de.mouseSelectionStyle=DN;de.dragMovesSelection=PN;de.clickAddsSelectionRange=RN;de.decorations=Ug;de.blockWrappers=IN;de.outerDecorations=cx;de.atomicRanges=yf;de.bidiIsolatedRanges=VN;de.cursorScrollMargin=ge.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});de.scrollMargins=qN;de.darkTheme=kS;de.cspNonce=ge.define({combine:n=>n.length?n[0]:""});de.contentAttributes=ax;de.editorAttributes=XN;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Pe.define();const g7=4096,aE={};class Fm{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:mt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let l=e[s];l.dir==r&&!t.touchesRange(l.from,l.to)&&i.push(new Fm(t.mapPos(l.from,1),t.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return i}}function cE(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&ix(l,t)}return t}const O7=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function y7(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let c=0;c<t.length-1;++c){const h=t[c];if(/^(cmd|meta|m)$/i.test(h))o=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))l=!0;else if(/^mod$/i.test(h))e=="mac"?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),o&&(i="Meta-"+i),l&&(i="Shift-"+i),i}function gp(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const b7=Bs.default(de.domEventHandlers({keydown(n,e){return hz(uz(e.state),n,e,"editor")}})),$c=ge.define({enables:b7}),uE=new WeakMap;function uz(n){let e=n.facet($c),t=uE.get(e);return t||uE.set(e,t=x7(e.reduce((i,r)=>i.concat(r),[]))),t}function S7(n,e,t){return hz(uz(n.state),e,n,t)}let Tl=null;const v7=4e3;function x7(n,e=O7){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let c=i[l];if(c==null)i[l]=o;else if(c!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,c,h,d)=>{var p,g;let O=t[l]||(t[l]=Object.create(null)),b=o.split(/ (?!$)/).map(k=>y7(k,e));for(let k=1;k<b.length;k++){let C=b.slice(0,k).join(" ");r(C,!0),O[C]||(O[C]={preventDefault:!0,stopPropagation:!1,run:[A=>{let P=Tl={view:A,prefix:C,scope:l};return setTimeout(()=>{Tl==P&&(Tl=null)},v7),!0}]})}let v=b.join(" ");r(v,!1);let x=O[v]||(O[v]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&x.run.push(c),h&&(x.preventDefault=!0),d&&(x.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let d=t[h]||(t[h]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let g in d)d[g].run.push(O=>p(O,CS))}let c=l[e]||l.key;if(c)for(let h of o)s(h,c,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(h,"Shift-"+c,l.shift,l.preventDefault,l.stopPropagation)}return t}let CS=null;function hz(n,e,t,i){CS=e;let r=G2(e),s=Fn(r,0),l=$r(s)==r.length&&r!=" ",o="",c=!1,h=!1,d=!1;Tl&&Tl.view==t&&Tl.scope==i&&(o=Tl.prefix+" ",JN.indexOf(e.keyCode)<0&&(h=!0,Tl=null));let p=new Set,g=x=>{if(x){for(let k of x.run)if(!p.has(k)&&(p.add(k),k(t)))return x.stopPropagation&&(d=!0),!0;x.preventDefault&&(x.stopPropagation&&(d=!0),h=!0)}return!1},O=n[i],b,v;return O&&(g(O[o+gp(r,e,!l)])?c=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=$s[e.keyCode])&&b!=r?(g(O[o+gp(b,e,!0)])||e.shiftKey&&(v=Ph[e.keyCode])!=r&&v!=b&&g(O[o+gp(v,e,!1)]))&&(c=!0):l&&e.shiftKey&&g(O[o+gp(r,e,!0)])&&(c=!0),!c&&g(O._any)&&(c=!0)),h&&(c=!0),c&&d&&e.stopPropagation(),CS=null,c}class No{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=fz(e);return[new No(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return k7(e,t,i)}}function fz(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==mt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function hE(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),l=(r.top+r.bottom)/2,o=n.posAtCoords({x:s.left+1,y:l}),c=n.posAtCoords({x:s.right-1,y:l});return o==null||c==null?i:{from:Math.max(i.from,Math.min(o,c)),to:Math.min(i.to,Math.max(o,c))}}function k7(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==mt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),c=fz(n),h=l.querySelector(".cm-line"),d=h&&window.getComputedStyle(h),p=o.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=o.right-(d?parseInt(d.paddingRight):0),O=SS(n,i,1),b=SS(n,r,-1),v=O.type==vn.Text?O:null,x=b.type==vn.Text?b:null;if(v&&(n.lineWrapping||O.widgetLineBreaks)&&(v=hE(n,i,1,v)),x&&(n.lineWrapping||b.widgetLineBreaks)&&(x=hE(n,r,-1,x)),v&&x&&v.from==x.from&&v.to==x.to)return C(A(t.from,t.to,v));{let E=v?A(t.from,null,v):P(O,!1),D=x?A(null,t.to,x):P(b,!0),$=[];return(v||O).to<(x||b).from-(v&&x?1:0)||O.widgetLineBreaks>1&&E.bottom+n.defaultLineHeight/2<D.top?$.push(k(p,E.bottom,g,D.top)):E.bottom<D.top&&n.elementAtHeight((E.bottom+D.top)/2).type==vn.Text&&(E.bottom=D.top=(E.bottom+D.top)/2),C(E).concat($).concat(C(D))}function k(E,D,$,H){return new No(e,E-c.left,D-c.top,Math.max(0,$-E),H-D)}function C({top:E,bottom:D,horizontal:$}){let H=[];for(let W=0;W<$.length;W+=2)H.push(k($[W],E,$[W+1],D));return H}function A(E,D,$){let H=1e9,W=-1e9,te=[];function ce(se,fe,B,G,he){let z=n.coordsAtPos(se,se==$.to?-2:2),J=n.coordsAtPos(B,B==$.from?2:-2);!z||!J||(H=Math.min(z.top,J.top,H),W=Math.max(z.bottom,J.bottom,W),he==mt.LTR?te.push(s&&fe?p:z.left,s&&G?g:J.right):te.push(!s&&G?p:J.left,!s&&fe?g:z.right))}let ie=E??$.from,ue=D??$.to;for(let se of n.visibleRanges)if(se.to>ie&&se.from<ue)for(let fe=Math.max(se.from,ie),B=Math.min(se.to,ue);;){let G=n.state.doc.lineAt(fe);for(let he of n.bidiSpans(G)){let z=he.from+G.from,J=he.to+G.from;if(z>=B)break;J>fe&&ce(Math.max(z,fe),E==null&&z<=ie,Math.min(J,B),D==null&&J>=ue,he.dir)}if(fe=G.to+1,fe>=B)break}return te.length==0&&ce(ie,E==null,ue,D==null,n.textDirection),{top:H,bottom:W,horizontal:te}}function P(E,D){let $=o.top+(D?E.top:E.bottom);return{top:$,bottom:$,horizontal:[]}}}function w7(n,e){return n.constructor==e.constructor&&n.eq(e)}class T7{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Xp)!=e.state.facet(Xp)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Xp);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!w7(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,Oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Xp=ge.define();function dz(n){return[Lt.define(e=>new T7(e,n)),Xp.of(n)]}const vc=ge.define({combine(n){return Hr(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function C7(n={}){return[vc.of(n),A7,M7,Q7,BN.of(!0)]}function pz(n){return n.startState.facet(vc)!=n.state.facet(vc)}const A7=dz({above:!0,markers(n){let{state:e}=n,t=e.facet(vc),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor&&!(s&&Oe.ios&&t.iosSelectionHandles)){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:Y.cursor(r.head,r.assoc);for(let c of No.forRange(n,l,o))i.push(c)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=pz(n);return t&&fE(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){fE(e.state,n)},class:"cm-cursorLayer"});function fE(n,e){e.style.animationDuration=n.facet(vc).cursorBlinkRate+"ms"}const M7=dz({above:!1,markers(n){let e=[],{main:t,ranges:i}=n.state.selection;for(let r of i)if(!r.empty)for(let s of No.forRange(n,"cm-selectionBackground",r))e.push(s);if(Oe.ios&&!t.empty&&n.state.facet(vc).iosSelectionHandles){for(let r of No.forRange(n,"cm-selectionHandle cm-selectionHandle-start",Y.cursor(t.from,1)))e.push(r);for(let r of No.forRange(n,"cm-selectionHandle cm-selectionHandle-end",Y.cursor(t.to,1)))e.push(r)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||pz(n)},class:"cm-selectionLayer"}),Q7=Bs.highest(de.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),mz=Pe.define({map(n,e){return n==null?null:e.mapPos(n)}}),nh=xn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(mz)?i.value:t,n)}}),E7=Lt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(nh);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(nh)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(nh),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(nh)!=n&&this.view.dispatch({effects:mz.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $7(){return[nh,E7]}function dE(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function R7(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class P7{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,c,h,d)=>r(d,h,h+o[0].length,o,c);else if(typeof i=="function")this.addMatch=(o,c,h,d)=>{let p=i(o,c,h);p&&d(h,h+o[0].length,p)};else if(i)this.addMatch=(o,c,h,d)=>d(h,h+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new Rs,i=t.add.bind(t);for(let{from:r,to:s}of R7(e,this.maxLength))dE(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,c)=>{c>=e.view.viewport.from&&o<=e.view.viewport.to&&(i=Math.min(o,i),r=Math.max(c,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>=l){let c=e.state.doc.lineAt(l),h=c.to<o?e.state.doc.lineAt(o):c,d=Math.max(s.from,c.from),p=Math.min(s.to,h.to);if(this.boundary){for(;l>c.from;l--)if(this.boundary.test(c.text[l-1-c.from])){d=l;break}for(;o<h.to;o++)if(this.boundary.test(h.text[o-h.from])){p=o;break}}let g=[],O,b=(v,x,k)=>g.push(k.range(v,x));if(c==h)for(this.regexp.lastIndex=d-c.from;(O=this.regexp.exec(c.text))&&O.index<p-c.from;)this.addMatch(O,e,O.index+c.from,b);else dE(e.state.doc,this.regexp,d,p,(v,x)=>this.addMatch(x,e,v,b));t=t.update({filterFrom:d,filterTo:p,filter:(v,x)=>v<d||x>p,add:g})}}return t}}const AS=/x/.unicode!=null?"gu":"g",D7=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,AS),N7={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let xb=null;function z7(){var n;if(xb==null&&typeof document<"u"&&document.body){let e=document.body.style;xb=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return xb||!1}const Ip=ge.define({combine(n){let e=Hr(n,{render:null,specialChars:D7,addSpecialChars:null});return(e.replaceTabs=!z7())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,AS)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,AS)),e}});function L7(n={}){return[Ip.of(n),_7()]}let pE=null;function _7(){return pE||(pE=Lt.fromClass(class{constructor(n){this.view=n,this.decorations=ke.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ip)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new P7({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Fn(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,c=ar(l.text,o,i-l.from);return ke.replace({widget:new X7((o-c%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=ke.replace({widget:new Z7(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ip);n.startState.facet(Ip)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const B7="•";function j7(n){return n>=32?B7:n==10?"␤":String.fromCharCode(9216+n)}class Z7 extends hr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=j7(this.code),i=e.state.phrase("Control character")+" "+(N7[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class X7 extends hr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="	",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function I7(){return q7}const V7=ke.line({class:"cm-activeLine"}),q7=Lt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(V7.range(r.from)),e=r.from)}return ke.set(t)}},{decorations:n=>n.decorations});class H7 extends hr{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?bh(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=Vh(t[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function Y7(n){let e=Lt.fromClass(class{constructor(t){this.view=t,this.placeholder=n?ke.set([ke.widget({widget:new H7(n),side:1}).range(0)]):ke.none}get decorations(){return this.view.state.doc.length?ke.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,de.contentAttributes.of({"aria-placeholder":n})]:e}const MS=2e3;function U7(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>MS||t.off>MS||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let c=i;c<=r;c++){let h=n.doc.line(c);h.length<=o&&s.push(Y.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let c=i;c<=r;c++){let h=n.doc.line(c),d=oS(h.text,l,n.tabSize,!0);if(d<0)s.push(Y.cursor(h.to));else{let p=oS(h.text,o,n.tabSize);s.push(Y.range(h.from+d,h.from+p))}}}return s}function W7(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function mE(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>MS?-1:r==i.length?W7(n,e.clientX):ar(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function G7(n,e){let t=mE(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=mE(n,r);if(!o)return i;let c=U7(n.state,t,o);return c.length?l?Y.create(c.concat(i.ranges)):Y.create(c):i}}:null}function F7(n){let e=(t=>t.altKey&&t.button==0);return de.mouseSelectionStyle.of((t,i)=>e(i)?G7(t,i):null)}const K7={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},J7={style:"cursor: crosshair"};function e8(n={}){let[e,t]=K7[n.key||"Alt"],i=Lt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,de.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?J7:null})]}const Op="-10000px";class gz{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let s=null;this.tooltipViews=this.tooltips.map(l=>s=i(l,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let l=[],o=t?[]:null;for(let c=0;c<s.length;c++){let h=s[c],d=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==h.create&&(d=p)}if(d<0)l[c]=this.createTooltipView(h,c?l[c-1]:null),o&&(o[c]=!!h.above);else{let p=l[c]=this.tooltipViews[d];o&&(o[c]=t[d]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)l.indexOf(c)<0&&(this.removeTooltipView(c),(i=c.destroy)===null||i===void 0||i.call(c));return t&&(o.forEach((c,h)=>t[h]=c),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function t8(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const kb=ge.define({combine:n=>{var e,t,i;return{position:Oe.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||t8}}}),gE=new WeakMap,px=Lt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(kb);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new gz(n,mx,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(kb);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Op,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Oe.safari){let l=s.getBoundingClientRect();t=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=ux(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,l)=>{let o=this.manager.tooltipViews[l];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(kb).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o<this.manager.tooltips.length;o++){let c=this.manager.tooltips[o],h=this.manager.tooltipViews[o],{dom:d}=h,p=n.pos[o],g=n.size[o];if(!p||c.clip!==!1&&(p.bottom<=Math.max(t.top,i.top)||p.top>=Math.min(t.bottom,i.bottom)||p.right<Math.max(t.left,i.left)-.1||p.left>Math.min(t.right,i.right)+.1)){d.style.top=Op;continue}let O=c.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=O?7:0,v=g.right-g.left,x=(e=gE.get(h))!==null&&e!==void 0?e:g.bottom-g.top,k=h.offset||i8,C=this.view.textDirection==mt.LTR,A=g.width>i.right-i.left?C?i.left:i.right-g.width:C?Math.max(i.left,Math.min(p.left-(O?14:0)+k.x,i.right-v)):Math.min(Math.max(i.left,p.left-v+(O?14:0)-k.x),i.right-v),P=this.above[o];!c.strictSide&&(P?p.top-x-b-k.y<i.top:p.bottom+x+b+k.y>i.bottom)&&P==i.bottom-p.bottom>p.top-i.top&&(P=this.above[o]=!P);let E=(P?p.top-i.top:i.bottom-p.bottom)-b;if(E<x&&h.resize!==!1){if(E<this.view.defaultLineHeight){d.style.top=Op;continue}gE.set(h,x),d.style.height=(x=E)/s+"px"}else d.style.height&&(d.style.height="");let D=P?p.top-x-b-k.y:p.bottom+b+k.y,$=A+v;if(h.overlap!==!0)for(let H of l)H.left<$&&H.right>A&&H.top<D+x&&H.bottom>D&&(D=P?H.top-x-2-b:H.bottom+b+2);if(this.position=="absolute"?(d.style.top=(D-n.parent.top)/s+"px",OE(d,(A-n.parent.left)/r)):(d.style.top=D/s+"px",OE(d,A/r)),O){let H=p.left+(C?k.x:-k.x)-(A+14-7);O.style.left=H/r+"px"}h.overlap!==!0&&l.push({left:A,top:D,right:$,bottom:D+x}),d.classList.toggle("cm-tooltip-above",P),d.classList.toggle("cm-tooltip-below",!P),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Op}},{eventObservers:{scroll(){this.maybeMeasure()}}});function OE(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const n8=de.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i8={x:0,y:0},mx=ge.define({enables:[px,n8]}),Km=ge.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Kg{static create(e){return new Kg(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new gz(e,Km,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const r8=mx.compute([Km],n=>{let e=n.facet(Km);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:Kg.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Oz=ge.define();class s8{constructor(e,t,i,r,s,l){this.view=e,this.source=t,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=l,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let l=e.coordsAtPos(r);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=o&&o.dir==mt.RTL?-1:1;s=t.x<l.left?-c:c}this.activateHover(e,r,s)}activateHover(e,t,i,r){let s=this.source(e,t,i),l=o=>{if(o&&!(Array.isArray(o)&&!o.length)){let c=Array.isArray(o)?o:[o];r&&this.locked.set(c,r),e.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let o=this.pending={pos:t};s.then(c=>{this.pending==o&&(this.pending=null,l(c))},c=>ei(e.state,c,"hover tooltip"))}else l(s)}get tooltip(){let e=this.view.plugin(px),t=e?e.manager.tooltips.findIndex(i=>i.create==Kg.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!l8(s.dom,e)||this.pending){let{pos:l}=r[0]||this.pending,o=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!o8(this.view,l,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const yp=4;function l8(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),l;if(l=n.querySelector(".cm-tooltip-arrow")){let o=l.getBoundingClientRect();r=Math.min(o.top,r),s=Math.max(o.bottom,s)}return e.clientX>=t-yp&&e.clientX<=i+yp&&e.clientY>=r-yp&&e.clientY<=s+yp}function o8(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.right<i||l.top>r||Math.min(l.bottom,o)<r)return!1;let c=n.posAtCoords({x:i,y:r},!1);return c>=e&&c<=t}function a8(n,e={}){let t=Pe.define(),i=new WeakMap,r=xn.define({create(){return[]},update(l,o){let c=i.get(l);if(l.length&&(e.hideOnChange&&(o.docChanged||o.selection)?l=[]:c&&c(o)?l=[]:e.hideOn&&(l=l.filter(h=>!e.hideOn(o,h)))),o.docChanged&&l.length){let h=[];for(let d of l){let p=o.changes.mapPos(d.pos,-1,bn.TrackDel);if(p!=null){let g=Object.assign(Object.create(null),d);g.pos=p,g.end!=null&&(g.end=o.changes.mapPos(g.end)),h.push(g)}}l=h}for(let h of o.effects)h.is(t)&&(l=h.value,c=void 0),(h.is(u8)&&!h.value||h.value==r)&&(l=[]);return l.length&&c&&i.set(l,c),l},provide:l=>Km.from(l)});const s=Lt.define(l=>new s8(l,n,r,i,t,e.hoverTime||300));return{active:r,extension:[r,s,Oz.of(s),r8]}}function c8(n,e,t,i={}){var r;let s=n.state.facet(Oz).map(l=>n.plugin(l)).filter(l=>!!l);if(i.tooltip&&i.tooltip.active){let l=s.find(o=>o.field==i.tooltip.active);l&&(s=[l])}for(let l of s)l.activateHover(n,e,t,(r=i.until)!==null&&r!==void 0?r:(()=>!1))}function yz(n,e){let t=n.plugin(px);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const u8=Pe.define(),yE=ge.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function gx(n,e){let t=n.plugin(bz),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const bz=Lt.fromClass(class{constructor(n){this.input=n.state.facet(Hh),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(yE);this.top=new bp(n,!0,e.topContainer),this.bottom=new bp(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(yE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new bp(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new bp(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Hh);if(t!=this.input){let i=t.filter(c=>c),r=[],s=[],l=[],o=[];for(let c of i){let h=this.specs.indexOf(c),d;h<0?(d=c(n.view),o.push(d)):(d=this.panels[h],d.update&&d.update(n)),r.push(d),(d.top?s:l).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let c of o)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class bp{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=bE(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=bE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function bE(n){let e=n.nextSibling;return n.remove(),e}const Hh=ge.define({enables:bz});function h8(n,e){let t,i=new Promise(l=>t=l),r=l=>f8(l,e,t);n.state.field(wb,!1)?n.dispatch({effects:Sz.of(r)}):n.dispatch({effects:Pe.appendConfig.of(wb.init(()=>[r]))});let s=vz.of(r);return{close:s,result:i.then(l=>((n.win.queueMicrotask||(c=>n.win.setTimeout(c,10)))(()=>{n.state.field(wb).indexOf(r)>-1&&n.dispatch({effects:s})}),l))}}const wb=xn.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(Sz)?n=[t.value].concat(n):t.is(vz)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Hh.computeN([n],e=>e.field(n))}),Sz=Pe.define(),vz=Pe.define();function f8(n,e,t){let i=e.content?e.content(n,()=>l(null)):null;if(!i){if(i=ut("form"),e.input){let o=ut("input",e.input);/^(text|password|number|email|tel|url)$/.test(o.type)&&o.classList.add("cm-textfield"),o.name||(o.name="input"),i.appendChild(ut("label",(e.label||"")+": ",o))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(ut("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let o=0;o<r.length;o++){let c=r[o];c.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),l(null)):h.keyCode==13&&(h.preventDefault(),l(c))}),c.addEventListener("submit",h=>{h.preventDefault(),l(c)})}let s=ut("div",i,ut("button",{onclick:()=>l(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function l(o){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(o)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let o;typeof e.focus=="string"?o=i.querySelector(e.focus):o=i.querySelector("input")||i.querySelector("button"),o&&"select"in o?o.select():o&&"focus"in o&&o.focus()}}}}class Ds extends _l{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ds.prototype.elementClass="";Ds.prototype.toDOM=void 0;Ds.prototype.mapMode=bn.TrackBefore;Ds.prototype.startSide=Ds.prototype.endSide=-1;Ds.prototype.point=!0;const Vp=ge.define(),d8=ge.define(),p8={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},xh=ge.define();function m8(n){return[xz(),xh.of({...p8,...n})]}const SE=ge.define({combine:n=>n.some(e=>e)});function xz(n){return[g8]}const g8=Lt.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(xh).map(e=>new xE(n,e)),this.fixed=!n.state.facet(SE);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(SE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Ve.iter(this.view.state.facet(Vp),this.view.viewport.from),i=[],r=this.gutters.map(s=>new O8(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==vn.Text&&l){QS(t,i,o.from);for(let c of r)c.line(this.view,o,i);l=!1}else if(o.widget)for(let c of r)c.widget(this.view,o)}else if(s.type==vn.Text){QS(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(xh),t=n.state.facet(xh),i=n.docChanged||n.heightChanged||n.viewportChanged||!Ve.eq(n.startState.facet(Vp),n.state.facet(Vp),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new xE(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==mt.LTR?{left:i,right:r}:{right:i,left:r}})});function vE(n){return Array.isArray(n)?n:[n]}function QS(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class O8{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Ve.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new kz(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];QS(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(d8)){let l=s(e,t.widget,t);l&&(r||(r=[])).push(l)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class xE{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();l=(c.top+c.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=vE(t.markers(e)),t.initialSpacer&&(this.spacer=new kz(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=vE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!Ve.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class kz{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),y8(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,c=s<t.length?t[s++]:null,h=!1;if(c){let d=c.elementClass;d&&(i+=" "+d);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(c)){o=p,h=!0;break}}else o=this.markers.length;for(;l<o;){let d=this.markers[l++];if(d.toDOM){d.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!c)break;c.toDOM&&(h?r=r.nextSibling:this.dom.insertBefore(c.toDOM(e),r)),h&&l++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function y8(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const b8=ge.define(),S8=ge.define(),Wa=ge.define({combine(n){return Hr(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let s=i[r],l=t[r];i[r]=s?(o,c,h)=>s(o,c,h)||l(o,c,h):l}return i}})}});class Tb extends Ds{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Cb(n,e){return n.state.facet(Wa).formatNumber(e,n.state)}const v8=xh.compute([Wa],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(b8)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new Tb(Cb(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(S8)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Wa)!=e.state.facet(Wa),initialSpacer(e){return new Tb(Cb(e,kE(e.state.doc.lines)))},updateSpacer(e,t){let i=Cb(t.view,kE(t.view.state.doc.lines));return i==e.number?e:new Tb(i)},domEventHandlers:n.facet(Wa).domEventHandlers,side:"before"}));function x8(n={}){return[Wa.of(n),xz(),v8]}function kE(n){let e=9;for(;e<n;)e=e*10+9;return e}const k8=new class extends Ds{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},w8=Vp.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(k8.range(r)))}return Ve.of(e)});function T8(){return w8}const wz=1024;let C8=0;class ji{constructor(e,t){this.from=e,this.to=t}}class De{constructor(e={}){this.id=C8++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=en.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}De.closedBy=new De({deserialize:n=>n.split(" ")});De.openedBy=new De({deserialize:n=>n.split(" ")});De.group=new De({deserialize:n=>n.split(" ")});De.isolate=new De({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});De.contextHash=new De({perNode:!0});De.lookAhead=new De({perNode:!0});De.mounted=new De({perNode:!0});class rc{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[De.mounted.id]}}const A8=Object.create(null);class en{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):A8,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new en(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(De.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(De.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}en.none=new en("",Object.create(null),0,8);class bf{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let s of e){let l=s(i);if(l){r||(r=Object.assign({},i.props));let o=l[1],c=l[0];c.combine&&c.id in r&&(o=c.combine(r[c.id],o)),r[c.id]=o}}t.push(r?new en(i.name,r,i.id,i.flags):i)}return new bf(t)}}const Sp=new WeakMap,wE=new WeakMap;var nt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(nt||(nt={}));class et{constructor(e,t,i,r,s){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,o]of s)this.props[typeof l=="number"?l:l.id]=o}}toString(){let e=rc.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Jm(this.topNode,e)}cursorAt(e,t=0,i=0){let r=Sp.get(this)||this.topNode,s=new Jm(r);return s.moveTo(e,t),Sp.set(this,s._tree),s}get topNode(){return new An(this,0,0,null)}resolve(e,t=0){let i=Yh(Sp.get(this)||this.topNode,e,t,!1);return Sp.set(this,i),i}resolveInner(e,t=0){let i=Yh(wE.get(this)||this.topNode,e,t,!0);return wE.set(this,i),i}resolveStack(e,t=0){return E8(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:s=this.length}=e,l=e.mode||0,o=(l&nt.IncludeAnonymous)>0;for(let c=this.cursor(l|nt.IncludeAnonymous);;){let h=!1;if(c.from<=s&&c.to>=r&&(!o&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;h=!0}for(;h&&i&&(o||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:bx(en.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new et(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new et(en.none,t,i,r)))}static build(e){return $8(e)}}et.empty=new et(en.none,[],[],0);class Ox{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ox(this.buffer,this.index)}}class Zl{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return en.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let l=[];for(;e<i;)l.push(this.childString(e)),e=this.buffer[e+3];return s+"("+l.join(",")+")"}findChild(e,t,i,r,s){let{buffer:l}=this,o=-1;for(let c=e;c!=t&&!(Tz(s,r,l[c+1],l[c+2])&&(o=c,i>0));c=l[c+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,c=0;o<t;){s[c++]=r[o++],s[c++]=r[o++]-i;let h=s[c++]=r[o++]-i;s[c++]=r[o++]-e,l=Math.max(l,h)}return new Zl(s,l,this.set)}}function Tz(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Yh(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let l=!i&&n instanceof An&&n.index<0?null:n.parent;if(!l)return n;n=l}let s=i?0:nt.IgnoreOverlays;if(i)for(let l=n,o=l.parent;o;l=o,o=l.parent)l instanceof An&&l.index<0&&((r=o.enter(e,t,s))===null||r===void 0?void 0:r.from)!=l.from&&(n=o);for(;;){let l=n.enter(e,t,s);if(!l)return n;n=l}}class Cz{cursor(e=0){return new Jm(this,e)}getChild(e,t=null,i=null){let r=TE(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return TE(this,e,t,i)}resolve(e,t=0){return Yh(this,e,t,!1)}resolveInner(e,t=0){return Yh(this,e,t,!0)}matchContext(e){return ES(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class An extends Cz{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,s=0){for(let l=this;;){for(let{children:o,positions:c}=l._tree,h=t>0?o.length:-1;e!=h;e+=t){let d=o[e],p=c[e]+l.from,g;if(!(!(s&nt.EnterBracketed&&d instanceof et&&(g=rc.get(d))&&!g.overlay&&g.bracketed&&i>=p&&i<=p+d.length)&&!Tz(r,i,p,p+d.length))){if(d instanceof Zl){if(s&nt.ExcludeBuffers)continue;let O=d.findChild(0,d.buffer.length,t,i-p,r);if(O>-1)return new Nr(new M8(l,d,e,p),null,O)}else if(s&nt.IncludeAnonymous||!d.type.isAnonymous||yx(d)){let O;if(!(s&nt.IgnoreMounts)&&(O=rc.get(d))&&!O.overlay)return new An(O.tree,p,e,l);let b=new An(d,p,e,l);return s&nt.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(t<0?d.children.length-1:0,t,i,r,s)}}}if(s&nt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&nt.IgnoreOverlays)&&(r=rc.get(this._tree))&&r.overlay){let s=e-this.from,l=i&nt.EnterBracketed&&r.bracketed;for(let{from:o,to:c}of r.overlay)if((t>0||l?o<=s:o<s)&&(t<0||l?c>=s:c>s))return new An(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function TE(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let l=!1;!l;)if(l=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function ES(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class M8{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class Nr extends Cz{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new Nr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&nt.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Nr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Nr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Nr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new et(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Az(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let l=n[s];(l.from>t.from||l.to<t.to)&&(t=l,e=s)}let i=t instanceof An&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new Q8(r,t)}class Q8{constructor(e,t){this.heads=e,this.node=t}get next(){return Az(this.heads)}}function E8(n,e,t){let i=n.resolveInner(e,t),r=null;for(let s=i instanceof An?i:i.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(r||(r=[i])).push(l.resolve(e,t)),s=l}else{let l=rc.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let o=new An(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Yh(o,e,t,!1))}}return r?Az(r):i}class Jm{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~nt.EnterBracketed,e instanceof An)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof An?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&nt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&nt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&nt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&nt.IncludeAnonymous||o instanceof Zl||!o.type.isAnonymous||yx(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)t=new Nr(this.buffer,t,this.stack[r]);return this.bufferNode=new Nr(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return ES(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return ES(this._tree,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function yx(n){return n.children.some(e=>e instanceof Zl||!e.type.isAnonymous||yx(e))}function $8(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=wz,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new Ox(t,t.length):t,c=i.types,h=0,d=0;function p(E,D,$,H,W,te){let{id:ce,start:ie,end:ue,size:se}=o,fe=d,B=h;if(se<0)if(o.next(),se==-1){let Q=s[ce];$.push(Q),H.push(ie-E);return}else if(se==-3){h=ce;return}else if(se==-4){d=ce;return}else throw new RangeError(`Unrecognized record size: ${se}`);let G=c[ce],he,z,J=ie-E;if(ue-ie<=r&&(z=x(o.pos-D,W))){let Q=new Uint16Array(z.size-z.skip),j=o.pos-z.size,F=Q.length;for(;o.pos>j;)F=k(z.start,Q,F);he=new Zl(Q,ue-z.start,i),J=z.start-E}else{let Q=o.pos-se;o.next();let j=[],F=[],le=ce>=l?ce:-1,ye=0,Re=ue;for(;o.pos>Q;)le>=0&&o.id==le&&o.size>=0?(o.end<=Re-r&&(b(j,F,ie,ye,o.end,Re,le,fe,B),ye=j.length,Re=o.end),o.next()):te>2500?g(ie,Q,j,F):p(ie,Q,j,F,le,te+1);if(le>=0&&ye>0&&ye<j.length&&b(j,F,ie,ye,ie,Re,le,fe,B),j.reverse(),F.reverse(),le>-1&&ye>0){let je=O(G,B);he=bx(G,j,F,0,j.length,0,ue-ie,je,je)}else he=v(G,j,F,ue-ie,fe-ue,B)}$.push(he),H.push(J)}function g(E,D,$,H){let W=[],te=0,ce=-1;for(;o.pos>D;){let{id:ie,start:ue,end:se,size:fe}=o;if(fe>4)o.next();else{if(ce>-1&&ue<ce)break;ce<0&&(ce=se-r),W.push(ie,ue,se),te++,o.next()}}if(te){let ie=new Uint16Array(te*4),ue=W[W.length-2];for(let se=W.length-3,fe=0;se>=0;se-=3)ie[fe++]=W[se],ie[fe++]=W[se+1]-ue,ie[fe++]=W[se+2]-ue,ie[fe++]=fe;$.push(new Zl(ie,W[2]-ue,i)),H.push(ue-E)}}function O(E,D){return($,H,W)=>{let te=0,ce=$.length-1,ie,ue;if(ce>=0&&(ie=$[ce])instanceof et){if(!ce&&ie.type==E&&ie.length==W)return ie;(ue=ie.prop(De.lookAhead))&&(te=H[ce]+ie.length+ue)}return v(E,$,H,W,te,D)}}function b(E,D,$,H,W,te,ce,ie,ue){let se=[],fe=[];for(;E.length>H;)se.push(E.pop()),fe.push(D.pop()+$-W);E.push(v(i.types[ce],se,fe,te-W,ie-te,ue)),D.push(W-$)}function v(E,D,$,H,W,te,ce){if(te){let ie=[De.contextHash,te];ce=ce?[ie].concat(ce):[ie]}if(W>25){let ie=[De.lookAhead,W];ce=ce?[ie].concat(ce):[ie]}return new et(E,D,$,H,ce)}function x(E,D){let $=o.fork(),H=0,W=0,te=0,ce=$.end-r,ie={size:0,start:0,skip:0};e:for(let ue=$.pos-E;$.pos>ue;){let se=$.size;if($.id==D&&se>=0){ie.size=H,ie.start=W,ie.skip=te,te+=4,H+=4,$.next();continue}let fe=$.pos-se;if(se<0||fe<ue||$.start<ce)break;let B=$.id>=l?4:0,G=$.start;for($.next();$.pos>fe;){if($.size<0)if($.size==-3||$.size==-4)B+=4;else break e;else $.id>=l&&(B+=4);$.next()}W=G,H+=se,te+=B}return(D<0||H==E)&&(ie.size=H,ie.start=W,ie.skip=te),ie.size>4?ie:void 0}function k(E,D,$){let{id:H,start:W,end:te,size:ce}=o;if(o.next(),ce>=0&&H<l){let ie=$;if(ce>4){let ue=o.pos-(ce-4);for(;o.pos>ue;)$=k(E,D,$)}D[--$]=ie,D[--$]=te-E,D[--$]=W-E,D[--$]=H}else ce==-3?h=H:ce==-4&&(d=H);return $}let C=[],A=[];for(;o.pos>0;)p(n.start||0,n.bufferStart||0,C,A,-1,0);let P=(e=n.length)!==null&&e!==void 0?e:C.length?A[0]+C[0].length:0;return new et(c[n.topID],C.reverse(),A.reverse(),P)}const CE=new WeakMap;function qp(n,e){if(!n.isAnonymous||e instanceof Zl||e.type!=n)return 1;let t=CE.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof et)){t=1;break}t+=qp(n,i)}CE.set(e,t)}return t}function bx(n,e,t,i,r,s,l,o,c){let h=0;for(let b=i;b<r;b++)h+=qp(n,e[b]);let d=Math.ceil(h*1.5/8),p=[],g=[];function O(b,v,x,k,C){for(let A=x;A<k;){let P=A,E=v[A],D=qp(n,b[A]);for(A++;A<k;A++){let $=qp(n,b[A]);if(D+$>=d)break;D+=$}if(A==P+1){if(D>d){let $=b[P];O($.children,$.positions,0,$.children.length,v[P]+C);continue}p.push(b[P])}else{let $=v[A-1]+b[A-1].length-E;p.push(bx(n,b,v,P,A,E,$,null,c))}g.push(E+C-s)}}return O(e,t,i,r,0),(o||c)(p,g,l)}class Mz{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Nr?this.setBuffer(e.context.buffer,e.index,t):e instanceof An&&this.map.set(e.tree,t)}get(e){return e instanceof Nr?this.getBuffer(e.context.buffer,e.index):e instanceof An?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Es{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new Es(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,c=0,h=0;;o++){let d=o<t.length?t[o]:null,p=d?d.fromA:1e9;if(p-c>=i)for(;l&&l.from<p;){let g=l;if(c>=g.from||p<=g.to||h){let O=Math.max(g.from,c)-h,b=Math.min(g.to,p)-h;g=O>=b?null:new Es(O,b,g.tree,g.offset+h,o>0,!!d)}if(g&&r.push(g),l.to>p)break;l=s<e.length?e[s++]:null}if(!d)break;c=d.toA,h=d.toA-d.toB}return r}}class Sx{startParse(e,t,i){return typeof e=="string"&&(e=new R8(e)),i=i?i.length?i.map(r=>new ji(r.from,r.to)):[new ji(0,0)]:[new ji(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class R8{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Qz(n){return(e,t,i,r)=>new D8(e,n,t,i,r)}class AE{constructor(e,t,i,r,s,l){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=r,this.target=s,this.from=l}}function ME(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class P8{constructor(e,t,i,r,s,l,o,c){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.bracketed=l,this.target=o,this.prev=c,this.depth=0,this.ranges=[]}}const $S=new De({perNode:!0});class D8{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new et(i.type,i.children,i.positions,i.length,i.propValues.concat([[$S,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[De.mounted.id]=new rc(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new L8(this.fragments),t=null,i=null,r=new Jm(new An(this.baseTree,this.ranges[0].from,0,null),nt.IncludeAnonymous|nt.IgnoreMounts);e:for(let s,l;;){let o=!0,c;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(h)for(let d of h.mount.overlay){let p=d.from+h.pos,g=d.to+h.pos;p>=r.from&&g<=r.to&&!t.ranges.some(O=>O.from<g&&O.to>p)&&t.ranges.push({from:p,to:g})}}o=!1}else if(i&&(l=N8(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(z8(r),t&&t.depth++,i&&i.depth++);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new P8(s.parser,s.overlay,h,this.inner.length,r.from,!!s.bracketed,r.tree,t);else{let d=$E(this.ranges,s.overlay||(r.from<r.to?[new ji(r.from,r.to)]:[]));d.length&&ME(d),(d.length||!s.overlay)&&this.inner.push(new AE(s.parser,d.length?s.parser.startParse(this.input,RE(h,d),d):s.parser.startParse(""),s.overlay?s.overlay.map(p=>new ji(p.from-r.from,p.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):o=!1}}else if(t&&(c=t.predicate(r))&&(c===!0&&(c=new ji(r.from,r.to)),c.from<c.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==c.from?t.ranges[h]={from:t.ranges[h].from,to:c.to}:t.ranges.push(c)}if(o&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=$E(this.ranges,t.ranges);h.length&&(ME(h),this.inner.splice(t.index,0,new AE(t.parser,t.parser.startParse(this.input,RE(t.mounts,h),h),t.ranges.map(d=>new ji(d.from-t.start,d.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function N8(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function QE(n,e,t,i,r,s){if(e<t){let l=n.buffer[e+1];i.push(n.slice(e,t,l)),r.push(l-s)}}function z8(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let r=n.tree,s=r.children.indexOf(i),l=r.children[s],o=l.buffer,c=[s];function h(d,p,g,O,b,v){let x=t[v],k=[],C=[];QE(l,d,x,k,C,O);let A=o[x+1],P=o[x+2];c.push(k.length);let E=v?h(x+4,o[x+3],l.set.types[o[x]],A,P-A,v-1):e.toTree();return k.push(E),C.push(A-O),QE(l,o[x+3],p,k,C,O),new et(g,k,C,b)}r.children[s]=h(0,o.length,en.none,0,l.length,t.length-1);for(let d of c){let p=n.tree.children[d],g=n.tree.positions[d];n.yield(new An(p,g+n.from,d,n._tree))}}class EE{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(nt.IncludeAnonymous|nt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)if(!(t.to>=e&&t.enter(i,1,nt.IgnoreOverlays|nt.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof et)t=t.children[0];else break}return!1}}let L8=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop($S))!==null&&t!==void 0?t:i.to,this.inner=new EE(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop($S))!==null&&e!==void 0?e:t.to,this.inner=new EE(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(De.mounted);if(l&&l.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let c=this.fragments[o];if(c.from>=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:l})}}}return r}};function $E(n,e){let t=null,i=e;for(let r=1,s=0;r<n.length;r++){let l=n[r-1].to,o=n[r].from;for(;s<i.length;s++){let c=i[s];if(c.from>=o)break;c.to<=l||(t||(i=t=e.slice()),c.from<l?(t[s]=new ji(c.from,l),c.to>o&&t.splice(s+1,0,new ji(o,c.to))):c.to>o?t[s--]=new ji(o,c.to):t.splice(s--,1))}}return i}function _8(n,e,t,i){let r=0,s=0,l=!1,o=!1,c=-1e9,h=[];for(;;){let d=r==n.length?1e9:l?n[r].to:n[r].from,p=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let g=Math.max(c,t),O=Math.min(d,p,i);g<O&&h.push(new ji(g,O))}if(c=Math.min(d,p),c==1e9)break;d==c&&(l?(l=!1,r++):l=!0),p==c&&(o?(o=!1,s++):o=!0)}return h}function RE(n,e){let t=[];for(let{pos:i,mount:r,frag:s}of n){let l=i+(r.overlay?r.overlay[0].from:0),o=l+r.tree.length,c=Math.max(s.from,l),h=Math.min(s.to,o);if(r.overlay){let d=r.overlay.map(g=>new ji(g.from+i,g.to+i)),p=_8(e,d,c,h);for(let g=0,O=c;;g++){let b=g==p.length,v=b?h:p[g].from;if(v>O&&t.push(new Es(O,v,r.tree,-l,s.from>=O||s.openStart,s.to<=v||s.openEnd)),b)break;O=p[g].to}}else t.push(new Es(c,h,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}let B8=0;class gi{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=B8++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof gi&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new gi(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new eg(e);return i=>i.modified.indexOf(t)>-1?i:eg.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let j8=0;class eg{constructor(e){this.name=e,this.instances=[],this.id=j8++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&Z8(t,o.modified));if(i)return i;let r=[],s=new gi(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=X8(t);for(let o of e.set)if(!o.modified.length)for(let c of l)r.push(eg.get(o,c));return s}}function Z8(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function X8(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function Rc(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let p=0;;){if(o=="..."&&p>0&&p+3==r.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!g)throw new RangeError("Invalid path: "+r);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==r.length)break;let O=r[p++];if(p==r.length&&O=="!"){l=0;break}if(O!="/")throw new RangeError("Invalid path: "+r);o=r.slice(p)}let c=s.length-1,h=s[c];if(!h)throw new RangeError("Invalid path: "+r);let d=new Uh(i,l,c>0?s.slice(0,c):null);e[h]=d.sort(e[h])}}return Ez.add(e)}const Ez=new De({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Uh(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}});class Uh{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Uh.empty=new Uh([],2,null);function $z(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let l of s.tag)t[l.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let l=r;for(let o of s)for(let c of o.set){let h=t[c.id];if(h){l=l?l+" "+h:h;break}}return l},scope:i}}function I8(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function V8(n,e,t,i=0,r=n.length){let s=new q8(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class q8{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:l,from:o,to:c}=e;if(o>=i||c<=t)return;l.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(l)));let h=r,d=H8(e)||Uh.empty,p=I8(s,d.tags);if(p&&(h&&(h+=" "),h+=p,d.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(t,o),h),d.opaque)return;let g=e.tree&&e.tree.prop(De.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+o,1),b=this.highlighters.filter(x=>!x.scope||x.scope(g.tree.type)),v=e.firstChild();for(let x=0,k=o;;x++){let C=x<g.overlay.length?g.overlay[x]:null,A=C?C.from+o:c,P=Math.max(t,k),E=Math.min(i,A);if(P<E&&v)for(;e.from<E&&(this.highlightRange(e,P,E,r,s),this.startSpan(Math.min(E,e.to),h),!(e.to>=A||!e.nextSibling())););if(!C||A>i)break;k=C.to+o,k>t&&(this.highlightRange(O.cursor(),Math.max(t,C.from+o),Math.min(i,k),"",b),this.startSpan(Math.min(i,k),h))}v&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function H8(n){let e=n.type.prop(Ez);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const pe=gi.define,vp=pe(),Sl=pe(),PE=pe(Sl),DE=pe(Sl),vl=pe(),xp=pe(vl),Ab=pe(vl),Tr=pe(),Oo=pe(Tr),xr=pe(),kr=pe(),RS=pe(),_u=pe(RS),kp=pe(),M={comment:vp,lineComment:pe(vp),blockComment:pe(vp),docComment:pe(vp),name:Sl,variableName:pe(Sl),typeName:PE,tagName:pe(PE),propertyName:DE,attributeName:pe(DE),className:pe(Sl),labelName:pe(Sl),namespace:pe(Sl),macroName:pe(Sl),literal:vl,string:xp,docString:pe(xp),character:pe(xp),attributeValue:pe(xp),number:Ab,integer:pe(Ab),float:pe(Ab),bool:pe(vl),regexp:pe(vl),escape:pe(vl),color:pe(vl),url:pe(vl),keyword:xr,self:pe(xr),null:pe(xr),atom:pe(xr),unit:pe(xr),modifier:pe(xr),operatorKeyword:pe(xr),controlKeyword:pe(xr),definitionKeyword:pe(xr),moduleKeyword:pe(xr),operator:kr,derefOperator:pe(kr),arithmeticOperator:pe(kr),logicOperator:pe(kr),bitwiseOperator:pe(kr),compareOperator:pe(kr),updateOperator:pe(kr),definitionOperator:pe(kr),typeOperator:pe(kr),controlOperator:pe(kr),punctuation:RS,separator:pe(RS),bracket:_u,angleBracket:pe(_u),squareBracket:pe(_u),paren:pe(_u),brace:pe(_u),content:Tr,heading:Oo,heading1:pe(Oo),heading2:pe(Oo),heading3:pe(Oo),heading4:pe(Oo),heading5:pe(Oo),heading6:pe(Oo),contentSeparator:pe(Tr),list:pe(Tr),quote:pe(Tr),emphasis:pe(Tr),strong:pe(Tr),link:pe(Tr),monospace:pe(Tr),strikethrough:pe(Tr),inserted:pe(),deleted:pe(),changed:pe(),invalid:pe(),meta:kp,documentMeta:pe(kp),annotation:pe(kp),processingInstruction:pe(kp),definition:gi.defineModifier("definition"),constant:gi.defineModifier("constant"),function:gi.defineModifier("function"),standard:gi.defineModifier("standard"),local:gi.defineModifier("local"),special:gi.defineModifier("special")};for(let n in M){let e=M[n];e instanceof gi&&(e.name=n)}$z([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var Mb;const Mo=new De;function vx(n){return ge.define({combine:n?e=>e.concat(n):void 0})}const xx=new De;class Zi{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ye.prototype.hasOwnProperty("tree")||Object.defineProperty(Ye.prototype,"tree",{get(){return Ot(this)}}),this.parser=t,this.extension=[Xl.of(this),Ye.languageData.of((s,l,o)=>{let c=NE(s,l,o),h=c.type.prop(Mo);if(!h)return[];let d=s.facet(h),p=c.type.prop(xx);if(p){let g=c.resolve(l-c.from,o);for(let O of p)if(O.test(g,s)){let b=s.facet(O.facet);return O.type=="replace"?b:b.concat(d)}}return d})].concat(i)}isActiveAt(e,t,i=-1){return NE(e,t,i).type.prop(Mo)==this.data}findRegions(e){let t=e.facet(Xl);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(Mo)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(De.mounted);if(o){if(o.tree.prop(Mo)==this.data){if(o.overlay)for(let c of o.overlay)i.push({from:c.from+l,to:c.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let c=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>c)return}}for(let c=0;c<s.children.length;c++){let h=s.children[c];h instanceof et&&r(h,s.positions[c]+l)}};return r(Ot(e),0),i}get allowsNesting(){return!0}}Zi.setState=Pe.define();function NE(n,e,t){let i=n.facet(Xl),r=Ot(n).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,t,nt.ExcludeBuffers|nt.EnterBracketed))s.type.isTop&&(r=s);return r}class xc extends Zi{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=vx(e.languageData);return new xc(t,e.parser.configure({props:[Mo.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new xc(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ot(n){let e=n.field(Zi.state,!1);return e?e.tree:et.empty}class Y8{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Bu=null;class Wh{constructor(e,t,i=[],r,s,l,o,c){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Wh(e,t,[],et.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Y8(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=et.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Es.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Es.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Bu;Bu=this;try{return e()}finally{Bu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=zE(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((h,d,p,g)=>c.push({fromA:h,toA:d,fromB:p,toB:g})),i=Es.applyChanges(i,c),r=et.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let d=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);d<p&&o.push({from:d,to:p})}}}return new Wh(this.parser,t,i,r,s,l,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=zE(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Sx{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let c=Bu;if(c){for(let h of r)c.tempSkipped.push(h);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=l,new et(en.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Bu}}function zE(n,e,t){return Es.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class kc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new kc(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Wh.create(e.facet(Xl).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new kc(i)}}Zi.state=xn.define({create:kc.init,update(n,e){for(let t of e.effects)if(t.is(Zi.setState))return t.value;return e.startState.facet(Xl)!=e.state.facet(Xl)?kc.init(e.state):n.apply(e)}});let Rz=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Rz=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Qb=typeof navigator<"u"&&(!((Mb=navigator.scheduling)===null||Mb===void 0)&&Mb.isInputPending)?()=>navigator.scheduling.isInputPending():null,U8=Lt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Zi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Zi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Rz(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(Zi.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!Qb?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<r&&i.doc.length>r+1e3,c=s.context.work(()=>Qb&&Qb()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Zi.setState.of(new kc(s.context))})),this.chunkBudget>0&&!(c&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ei(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Xl=ge.define({combine(n){return n.length?n[0]:null},enables:n=>[Zi.state,U8,de.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Gh{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class tg{constructor(e,t,i,r,s,l=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new tg(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let l=t.indexOf(s);if(l>-1&&(s.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+s.length])))return r}return null}}const W8=ge.define(),Pc=ge.define({combine:n=>{if(!n.length)return"  ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function ng(n){let e=n.facet(Pc);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Fh(n,e){let t="",i=n.tabSize,r=n.facet(Pc)[0];if(r=="	"){for(;e>=i;)t+="	",e-=i;r=" "}for(let s=0;s<e;s++)t+=r;return t}function kx(n,e){n instanceof Ye&&(n=new Jg(n));for(let i of n.state.facet(W8)){let r=i(n,e);if(r!==void 0)return r}let t=Ot(n.state);return t.length>=e?G8(n,t,e):null}class Jg{constructor(e,t={}){this.state=e,this.options=t,this.unit=ng(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.countColumn(i,e-r),l=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return l>-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return ar(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Sf=new De;function G8(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l&&!(l.from<i.node.from||l.to>i.node.to||l.from==i.node.from&&l.type==i.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return Pz(i,n,t)}function Pz(n,e,t){for(let i=n;i;i=i.next){let r=K8(i.node);if(r)return r(wx.create(e,t,i))}return 0}function F8(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function K8(n){let e=n.type.prop(Sf);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(De.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>Dz(l,!0,1,void 0,s&&!F8(l)?r.from:void 0)}return n.parent==null?J8:null}function J8(){return 0}class wx extends Jg{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new wx(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(e9(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Pz(this.context.next,this.base,this.pos)}}function e9(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function t9(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let c=e.childAfter(o);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=l)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}o=c.to}}function n9({closing:n,align:e=!0,units:t=1}){return i=>Dz(i,e,t,n)}function Dz(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,c=e?t9(n):null;return c?o?n.column(c.from):n.column(c.to):n.baseIndent+(o?0:n.unit*t)}const i9=n=>n.baseIndent;function Hp({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const r9=200;function s9(){return Ye.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+r9)return n;let s=t.sliceString(r.from,i);if(!e.some(h=>h.test(s)))return n;let{state:l}=n,o=-1,c=[];for(let{head:h}of l.selection.ranges){let d=l.doc.lineAt(h);if(d.from==o)continue;o=d.from;let p=kx(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],O=Fh(l,p);g!=O&&c.push({from:d.from,to:d.from+g.length,insert:O})}return c.length?[n,{changes:c,sequential:!0}]:n})}const Nz=ge.define(),Dc=new De;function zz(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function l9(n,e,t){let i=Ot(n);if(i.length<t)return null;let r=i.resolveStack(t,1),s=null;for(let l=r;l;l=l.next){let o=l.node;if(o.to<=t||o.from>t)continue;if(s&&o.from<e)break;let c=o.type.prop(Dc);if(c&&(o.to<i.length-50||i.length==n.doc.length||!o9(o))){let h=c(o,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(s=h)}}return s}function o9(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function ig(n,e,t){for(let i of n.facet(Nz)){let r=i(n,e,t);if(r)return r}return l9(n,e,t)}function Lz(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const eO=Pe.define({map:Lz}),vf=Pe.define({map:Lz});function _z(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Yo=xn.define({create(){return ke.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=LE(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(eO)&&!a9(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Zz),r=i?ke.replace({widget:new m9(i(e.state,t.value))}):_E;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(vf)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=LE(n,e.selection.main.head)),n},provide:n=>de.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],r=n[t++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(_E.range(i,r))}return ke.set(e,!0)}});function LE(n,e,t=e){let i=!1;return n.between(e,t,(r,s)=>{r<t&&s>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):n}function rg(n,e,t){var i;let r=null;return(i=n.field(Yo,!1))===null||i===void 0||i.between(e,t,(s,l)=>{(!r||r.from>s)&&(r={from:s,to:l})}),r}function a9(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function Bz(n,e){return n.field(Yo,!1)?e:e.concat(Pe.appendConfig.of(Xz()))}const c9=n=>{for(let e of _z(n)){let t=ig(n.state,e.from,e.to);if(t)return n.dispatch({effects:Bz(n.state,[eO.of(t),jz(n,t)])}),!0}return!1},u9=n=>{if(!n.state.field(Yo,!1))return!1;let e=[];for(let t of _z(n)){let i=rg(n.state,t.from,t.to);i&&e.push(vf.of(i),jz(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function jz(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return de.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const h9=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let r=n.lineBlockAt(i),s=ig(e,r.from,r.to);s&&t.push(eO.of(s)),i=(s?n.lineBlockAt(s.to):r).to+1}return t.length&&n.dispatch({effects:Bz(n.state,t)}),!!t.length},f9=n=>{let e=n.state.field(Yo,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(vf.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},d9=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:c9},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:u9},{key:"Ctrl-Alt-[",run:h9},{key:"Ctrl-Alt-]",run:f9}],p9={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Zz=ge.define({combine(n){return Hr(n,p9)}});function Xz(n){return[Yo,y9]}function Iz(n,e){let{state:t}=n,i=t.facet(Zz),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),c=rg(n.state,o.from,o.to);c&&n.dispatch({effects:vf.of(c)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const _E=ke.replace({widget:new class extends hr{toDOM(n){return Iz(n,null)}}});class m9 extends hr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Iz(e,this.value)}}const g9={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Eb extends Ds{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function O9(n={}){let e={...g9,...n},t=new Eb(e,!0),i=new Eb(e,!1),r=Lt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Xl)!=l.state.facet(Xl)||l.startState.field(Yo,!1)!=l.state.field(Yo,!1)||Ot(l.startState)!=Ot(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new Rs;for(let c of l.viewportLineBlocks){let h=rg(l.state,c.from,c.to)?i:ig(l.state,c.from,c.to)?t:null;h&&o.add(c.from,c.from,h)}return o.finish()}}),{domEventHandlers:s}=e;return[r,m8({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||Ve.empty},initialSpacer(){return new Eb(e,!1)},domEventHandlers:{...s,click:(l,o,c)=>{if(s.click&&s.click(l,o,c))return!0;let h=rg(l.state,o.from,o.to);if(h)return l.dispatch({effects:vf.of(h)}),!0;let d=ig(l.state,o.from,o.to);return d?(l.dispatch({effects:eO.of(d)}),!0):!1}}}),Xz()]}const y9=de.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class xf{constructor(e,t){this.specs=e;let i;function r(o){let c=Bl.newName();return(i||(i=Object.create(null)))["."+c]=o,c}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof Zi?o=>o.prop(Mo)==l.data:l?o=>o==l:void 0,this.style=$z(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new Bl(i):null,this.themeType=t.themeType}static define(e,t){return new xf(e,t||{})}}const PS=ge.define(),Vz=ge.define({combine(n){return n.length?[n[0]]:null}});function $b(n){let e=n.facet(PS);return e.length?e:n.facet(Vz)}function qz(n,e){let t=[S9],i;return n instanceof xf&&(n.module&&t.push(de.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Vz.of(n)):i?t.push(PS.computeN([de.darkTheme],r=>r.facet(de.darkTheme)==(i=="dark")?[n]:[])):t.push(PS.of(n)),t}class b9{constructor(e){this.markCache=Object.create(null),this.tree=Ot(e.state),this.decorations=this.buildDeco(e,$b(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Ot(e.state),i=$b(e.state),r=i!=$b(e.startState),{viewport:s}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&l>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return ke.none;let i=new Rs;for(let{from:r,to:s}of e.visibleRanges)V8(this.tree,t,(l,o,c)=>{i.add(l,o,this.markCache[c]||(this.markCache[c]=ke.mark({class:c})))},r,s);return i.finish()}}const S9=Bs.high(Lt.fromClass(b9,{decorations:n=>n.decorations})),v9=xf.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),x9=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Hz=1e4,Yz="()[]{}",Uz=ge.define({combine(n){return Hr(n,{afterCursor:!0,brackets:Yz,maxScanDistance:Hz,renderMatch:T9})}}),k9=ke.mark({class:"cm-matchingBracket"}),w9=ke.mark({class:"cm-nonmatchingBracket"});function T9(n){let e=[],t=n.matched?k9:w9;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function BE(n){let e=[],t=n.facet(Uz);for(let i of n.selection.ranges){if(!i.empty)continue;let r=zr(n,i.head,-1,t)||i.head>0&&zr(n,i.head-1,1,t)||t.afterCursor&&(zr(n,i.head,1,t)||i.head<n.doc.length&&zr(n,i.head+1,-1,t));r&&(e=e.concat(t.renderMatch(r,n)))}return ke.set(e,!0)}const C9=Lt.fromClass(class{constructor(n){this.paused=!1,this.decorations=BE(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=BE(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),A9=[C9,x9];function M9(n={}){return[Uz.of(n),A9]}const Wz=new De;function DS(n,e,t){let i=n.prop(e<0?De.openedBy:De.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function NS(n){let e=n.type.prop(Wz);return e?e(n.node):n}function zr(n,e,t,i={}){let r=i.maxScanDistance||Hz,s=i.brackets||Yz,l=Ot(n),o=l.resolveInner(e,t);for(let c=o;c;c=c.parent){let h=DS(c.type,t,s);if(h&&c.from<c.to){let d=NS(c);if(d&&(t>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return Q9(n,e,t,c,d,h,s)}}return E9(n,e,t,l,o.type,r,s)}function Q9(n,e,t,i,r,s,l){let o=i.parent,c={from:r.from,to:r.to},h=0,d=o==null?void 0:o.cursor();if(d&&(t<0?d.childBefore(i.from):d.childAfter(i.to)))do if(t<0?d.to<=i.from:d.from>=i.to){if(h==0&&s.indexOf(d.type.name)>-1&&d.from<d.to){let p=NS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(DS(d.type,t,l))h++;else if(DS(d.type,-t,l)){if(h==0){let p=NS(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(t<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function E9(n,e,t,i,r,s,l){if(t<0?!e:e==n.doc.length)return null;let o=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),c=l.indexOf(o);if(c<0||c%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},d=n.doc.iterRange(e,t>0?n.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=s;){let O=d.value;t<0&&(g+=O.length);let b=e+g*t;for(let v=t>0?0:O.length-1,x=t>0?O.length:-1;v!=x;v+=t){let k=l.indexOf(O[v]);if(!(k<0||i.resolveInner(b+v,1).type!=r))if(k%2==0==t>0)p++;else{if(p==1)return{start:h,end:{from:b+v,to:b+v+1},matched:k>>1==c>>1};p--}}t>0&&(g+=O.length)}return d.done?{start:h,matched:!1}:null}const $9=Object.create(null),jE=[en.none],ZE=[],XE=Object.create(null),R9=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])R9[n]=P9($9,e);function Rb(n,e){ZE.indexOf(n)>-1||(ZE.push(n),console.warn(e))}function P9(n,e){let t=[];for(let o of e.split(" ")){let c=[];for(let h of o.split(".")){let d=n[h]||M[h];d?typeof d=="function"?c.length?c=c.map(d):Rb(h,`Modifier ${h} used at start of tag`):c.length?Rb(h,`Tag ${h} used as modifier`):c=Array.isArray(d)?d:[d]:Rb(h,`Unknown highlighting tag ${h}`)}for(let h of c)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(o=>o.id),s=XE[r];if(s)return s.id;let l=XE[r]=en.define({id:jE.length,name:i,props:[Rc({[i]:t})]});return jE.push(l),l.id}mt.RTL,mt.LTR;const D9=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Cx(n.state,t.from);return i.line?N9(n):i.block?L9(n):!1};function Tx(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const N9=Tx(j9,0),z9=Tx(Gz,0),L9=Tx((n,e)=>Gz(n,e,B9(e)),0);function Cx(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const ju=50;function _9(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-ju,i),l=n.sliceDoc(r,r+ju),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,h=s.length-o;if(s.slice(h-e.length,h)==e&&l.slice(c,c+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+c,margin:c&&1}};let d,p;r-i<=2*ju?d=p=n.sliceDoc(i,r):(d=n.sliceDoc(i,i+ju),p=n.sliceDoc(r-ju,r));let g=/^\s*/.exec(d)[0].length,O=/\s*$/.exec(p)[0].length,b=p.length-O-t.length;return d.slice(g,g+e.length)==e&&p.slice(b,b+t.length)==t?{open:{pos:i+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:r-O-t.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function B9(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Gz(n,e,t=e.selection.ranges){let i=t.map(s=>Cx(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>_9(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;l<r.length;l++)if(o=r[l]){let c=i[l],{open:h,close:d}=o;s.push({from:h.pos-c.open.length,to:h.pos+h.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function j9(n,e,t=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:l}of t){let o=i.length,c=1e9,h;for(let d=s;d<=l;){let p=e.doc.lineAt(d);if(h==null&&(h=Cx(e,p.from).line,!h))continue e;if(p.from>r&&(s==l||l>p.from)){r=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,b=p.text.slice(g,g+h.length)==h?g:-1;g<p.text.length&&g<c&&(c=g),i.push({line:p,comment:b,token:h,indent:g,empty:O,single:!1})}d=p.to+1}if(c<1e9)for(let d=o;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=c);i.length==o+1&&(i[o].single=!0)}if(n!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:h,empty:d,single:p}of i)(p||!d)&&s.push({from:o.from+h,insert:c+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:c}of i)if(o>=0){let h=l.from+o,d=h+c.length;l.text[d-l.from]==" "&&d++,s.push({from:h,to:d})}return{changes:s}}return null}const zS=qr.define(),Z9=qr.define(),X9=ge.define(),Fz=ge.define({combine(n){return Hr(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Kz=xn.define({create(){return Lr.empty},update(n,e){let t=e.state.facet(Fz),i=e.annotation(zS);if(i){let c=ti.fromTransaction(e,i.selection),h=i.side,d=h==0?n.undone:n.done;return c?d=sg(d,d.length,t.minDepth,c):d=tL(d,e.startState.selection),new Lr(h==0?i.rest:d,h==0?d:i.rest)}let r=e.annotation(Z9);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(Ut.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=ti.fromTransaction(e),l=e.annotation(Ut.time),o=e.annotation(Ut.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Lr(n.done.map(ti.fromJSON),n.undone.map(ti.fromJSON))}});function I9(n={}){return[Kz,Fz.of(n),de.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Jz:e.inputType=="historyRedo"?LS:null;return i?(e.preventDefault(),i(t)):!1}})]}function tO(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Kz,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const Jz=tO(0,!1),LS=tO(1,!1),V9=tO(0,!0),q9=tO(1,!0);class ti{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new ti(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ti(e.changes&&Jt.fromJSON(e.changes),[],e.mapped&&Br.fromJSON(e.mapped),e.startSelection&&Y.fromJSON(e.startSelection),e.selectionsAfter.map(Y.fromJSON))}static fromTransaction(e,t){let i=Xi;for(let r of e.startState.facet(X9)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new ti(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xi)}static selection(e){return new ti(void 0,Xi,void 0,void 0,e)}}function sg(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function H9(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let c=0;c<t.length;){let h=t[c++],d=t[c++];o>=h&&l<=d&&(i=!0)}}),i}function Y9(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function eL(n,e){return n.length?e.length?n.concat(e):n:e}const Xi=[],U9=200;function tL(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-U9));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),sg(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ti.selection([e])]}function W9(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Pb(n,e){if(!n.length)return n;let t=n.length,i=Xi;for(;t;){let r=G9(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[ti.selection(i)]:Xi}function G9(n,e,t){let i=eL(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xi,t);if(!n.changes)return ti.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new ti(r,Pe.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const F9=/^(input\.type|delete)($|\.)/;class Lr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Lr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||F9.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,H9(o.changes,e.changes))||i=="input.type.compose")?l=sg(l,l.length-1,r.minDepth,new ti(e.changes.compose(o.changes),eL(Pe.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,Xi)):l=sg(l,l.length,r.minDepth,e),new Lr(l,Xi,t,i)}addSelection(e,t,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Xi;return s.length>0&&t-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Y9(s[s.length-1],e)?this:new Lr(tL(this.done,e),this.undone,t,i)}addMapping(e){return new Lr(Pb(this.done,e),Pb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],l=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(i&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:zS.of({side:e,rest:W9(r),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=r.length==1?Xi:r.slice(0,r.length-1);return s.mapped&&(o=Pb(o,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:zS.of({side:e,rest:o,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Lr.empty=new Lr(Xi,Xi);const K9=[{key:"Mod-z",run:Jz,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:LS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:LS,preventDefault:!0},{key:"Mod-u",run:V9,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:q9,preventDefault:!0}];function Nc(n,e){return Y.create(n.ranges.map(e),n.mainIndex)}function fr(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function dr({state:n,dispatch:e},t){let i=Nc(n.selection,t);return i.eq(n.selection,!0)?!1:(e(fr(n,i)),!0)}function nO(n,e){return Y.cursor(e?n.to:n.from)}function nL(n,e){return dr(n,t=>t.empty?n.moveByChar(t,e):nO(t,e))}function $n(n){return n.textDirectionAt(n.state.selection.main.head)==mt.LTR}const iL=n=>nL(n,!$n(n)),rL=n=>nL(n,$n(n));function sL(n,e){return dr(n,t=>t.empty?n.moveByGroup(t,e):nO(t,e))}const J9=n=>sL(n,!$n(n)),eG=n=>sL(n,$n(n));function tG(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function iO(n,e,t){let i=Ot(n).resolveInner(e.head),r=t?De.closedBy:De.openedBy;for(let c=e.head;;){let h=t?i.childAfter(c):i.childBefore(c);if(!h)break;tG(n,h,r)?i=h:c=t?h.to:h.from}let s=i.type.prop(r),l,o;return s&&(l=t?zr(n,i.from,1):zr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,Y.cursor(o,t?-1:1)}const nG=n=>dr(n,e=>iO(n.state,e,!$n(n))),iG=n=>dr(n,e=>iO(n.state,e,$n(n)));function lL(n,e){return dr(n,t=>{if(!t.empty)return nO(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const oL=n=>lL(n,!1),aL=n=>lL(n,!0);function cL(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,r;if(e){for(let s of n.state.facet(de.scrollMargins)){let l=s(n);l!=null&&l.top&&(t=Math.max(l==null?void 0:l.top,t)),l!=null&&l.bottom&&(i=Math.max(l==null?void 0:l.bottom,i))}r=n.scrollDOM.clientHeight-t-i}else r=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,r-5)}}function uL(n,e){let t=cL(n),{state:i}=n,r=Nc(i.selection,l=>l.empty?n.moveVertically(l,e,t.height):nO(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),c=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>c&&l.bottom<h&&(s=de.scrollIntoView(r.main.head,{y:"start",yMargin:l.top-c}))}return n.dispatch(fr(i,r),{effects:s}),!0}const IE=n=>uL(n,!1),_S=n=>uL(n,!0);function Yl(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=Y.cursor(i.from+s))}return r}const rG=n=>dr(n,e=>Yl(n,e,!0)),sG=n=>dr(n,e=>Yl(n,e,!1)),lG=n=>dr(n,e=>Yl(n,e,!$n(n))),oG=n=>dr(n,e=>Yl(n,e,$n(n))),aG=n=>dr(n,e=>Y.cursor(n.lineBlockAt(e.head).from,1)),cG=n=>dr(n,e=>Y.cursor(n.lineBlockAt(e.head).to,-1));function uG(n,e,t){let i=!1,r=Nc(n.selection,s=>{let l=zr(n,s.head,-1)||zr(n,s.head,1)||s.head>0&&zr(n,s.head-1,1)||s.head<n.doc.length&&zr(n,s.head+1,-1);if(!l||!l.end)return s;i=!0;let o=l.start.from==s.head?l.end.to:l.end.from;return Y.cursor(o)});return i?(e(fr(n,r)),!0):!1}const hG=({state:n,dispatch:e})=>uG(n,e);function Yi(n,e){let t=Nc(n.state.selection,i=>{let r=e(i);return Y.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(fr(n.state,t)),!0)}function hL(n,e){return Yi(n,t=>n.moveByChar(t,e))}const fL=n=>hL(n,!$n(n)),dL=n=>hL(n,$n(n));function pL(n,e){return Yi(n,t=>n.moveByGroup(t,e))}const fG=n=>pL(n,!$n(n)),dG=n=>pL(n,$n(n)),pG=n=>Yi(n,e=>iO(n.state,e,!$n(n))),mG=n=>Yi(n,e=>iO(n.state,e,$n(n)));function mL(n,e){return Yi(n,t=>n.moveVertically(t,e))}const gL=n=>mL(n,!1),OL=n=>mL(n,!0);function yL(n,e){return Yi(n,t=>n.moveVertically(t,e,cL(n).height))}const VE=n=>yL(n,!1),qE=n=>yL(n,!0),gG=n=>Yi(n,e=>Yl(n,e,!0)),OG=n=>Yi(n,e=>Yl(n,e,!1)),yG=n=>Yi(n,e=>Yl(n,e,!$n(n))),bG=n=>Yi(n,e=>Yl(n,e,$n(n))),SG=n=>Yi(n,e=>Y.cursor(n.lineBlockAt(e.head).from)),vG=n=>Yi(n,e=>Y.cursor(n.lineBlockAt(e.head).to)),HE=({state:n,dispatch:e})=>(e(fr(n,{anchor:0})),!0),YE=({state:n,dispatch:e})=>(e(fr(n,{anchor:n.doc.length})),!0),UE=({state:n,dispatch:e})=>(e(fr(n,{anchor:n.selection.main.anchor,head:0})),!0),WE=({state:n,dispatch:e})=>(e(fr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),xG=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),kG=({state:n,dispatch:e})=>{let t=rO(n).map(({from:i,to:r})=>Y.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:Y.create(t),userEvent:"select"})),!0},wG=({state:n,dispatch:e})=>{let t=Nc(n.selection,i=>{let r=Ot(n),s=r.resolveStack(i.from,1);if(i.empty){let l=r.resolveStack(i.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:o}=l;if((o.from<i.from&&o.to>=i.to||o.to>i.to&&o.from<=i.from)&&l.next)return Y.range(o.to,o.from)}return i});return t.eq(n.selection)?!1:(e(fr(n,t)),!0)};function bL(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let l=t.doc.lineAt(s.head);if(e?l.to<n.state.doc.length:l.from>0)for(let o=s;;){let c=n.moveVertically(o,e);if(c.head<l.from||c.head>l.to){r.some(h=>h.head==c.head)||r.push(c);break}else{if(c.head==o.head)break;o=c}}}return r.length==i.ranges.length?!1:(n.dispatch(fr(t,Y.create(r,r.length-1))),!0)}const TG=n=>bL(n,!1),CG=n=>bL(n,!0),AG=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=Y.create([t.main]):t.main.empty||(i=Y.create([Y.cursor(t.main.head)])),i?(e(fr(n,i)),!0):!1};function kf(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let c=e(s);c<l?(t="delete.backward",c=wp(n,c,!1)):c>l&&(t="delete.forward",c=wp(n,c,!0)),l=Math.min(l,c),o=Math.max(o,c)}else l=wp(n,l,!1),o=wp(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:Y.cursor(l,l<s.head?-1:1)}});return r.changes.empty?!1:(n.dispatch(i.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?de.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function wp(n,e,t){if(n instanceof de)for(let i of n.state.facet(de.atomicRanges).map(r=>r(n)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=t?s:r)});return e}const SL=(n,e,t)=>kf(n,i=>{let r=i.from,{state:s}=n,l=s.doc.lineAt(r),o,c;if(t&&!e&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,r-l.from))){if(o[o.length-1]=="	")return r-1;let h=ar(o,s.tabSize),d=h%ng(s)||ng(s);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)r--;c=r}else c=sn(l.text,r-l.from,e,e)+l.from,c==r&&l.number!=(e?s.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,r-l.from))&&(c=sn(l.text,c-l.from,!1,!1)+l.from);return c}),BS=n=>SL(n,!1,!0),vL=n=>SL(n,!0,!1),xL=(n,e)=>kf(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let c=sn(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=l(h);if(o!=null&&d!=o)break;(h!=" "||i!=t.head)&&(o=d),i=c}return i}),kL=n=>xL(n,!1),MG=n=>xL(n,!0),QG=n=>kf(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),EG=n=>kf(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),$G=n=>kf(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),RG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Ge.of(["",""])},range:Y.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},PG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:sn(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:sn(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:Y.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function rO(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function wL(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of rO(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let c of s.ranges)r.push(Y.range(Math.min(n.doc.length,c.anchor+o),Math.min(n.doc.length,c.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let c of s.ranges)r.push(Y.range(c.anchor-o,c.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:Y.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const DG=({state:n,dispatch:e})=>wL(n,e,!1),NG=({state:n,dispatch:e})=>wL(n,e,!0);function TL(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of rO(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const zG=({state:n,dispatch:e})=>TL(n,e,!1),LG=({state:n,dispatch:e})=>TL(n,e,!0),_G=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(rO(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Nc(e.selection,r=>{let s;if(n.lineWrapping){let l=n.lineBlockAt(r.head),o=n.coordsAtPos(r.head,r.assoc||1);o&&(s=l.bottom+n.documentTop-o.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function BG(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Ot(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(De.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const GE=CL(!1),jG=CL(!0);function CL(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),c=!n&&s==l&&BG(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new Jg(e,{simulateBreak:s,simulateDoubleBreak:!!c}),d=kx(h,s);for(d==null&&(d=ar(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));l<o.to&&/\s/.test(o.text[l-o.from]);)l++;c?{from:s,to:l}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let p=["",Fh(e,d)];return c&&p.push(Fh(e,h.lineIndent(o.from,-1))),{changes:{from:s,to:l,insert:Ge.of(p)},range:Y.cursor(s+1+p[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ax(n,e){let t=-1;return n.changeByRange(i=>{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:Y.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const ZG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Jg(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=Ax(n,(s,l,o)=>{let c=kx(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let h=/^\s*/.exec(s.text)[0],d=Fh(n,c);(h!=d||o.from<s.from+h.length)&&(t[s.from]=c,l.push({from:s.from,to:s.from+h.length,insert:d}))});return r.changes.empty||e(n.update(r,{userEvent:"indent"})),!0},AL=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ax(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Pc)})}),{userEvent:"input.indent"})),!0),ML=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ax(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=ar(r,n.tabSize),l=0,o=Fh(n,Math.max(0,s-ng(n)));for(;l<r.length&&l<o.length&&r.charCodeAt(l)==o.charCodeAt(l);)l++;i.push({from:t.from+l,to:t.from+r.length,insert:o.slice(l)})}),{userEvent:"delete.dedent"})),!0),XG=n=>(n.setTabFocusMode(),!0),IG=[{key:"Ctrl-b",run:iL,shift:fL,preventDefault:!0},{key:"Ctrl-f",run:rL,shift:dL},{key:"Ctrl-p",run:oL,shift:gL},{key:"Ctrl-n",run:aL,shift:OL},{key:"Ctrl-a",run:aG,shift:SG},{key:"Ctrl-e",run:cG,shift:vG},{key:"Ctrl-d",run:vL},{key:"Ctrl-h",run:BS},{key:"Ctrl-k",run:QG},{key:"Ctrl-Alt-h",run:kL},{key:"Ctrl-o",run:RG},{key:"Ctrl-t",run:PG},{key:"Ctrl-v",run:_S}],VG=[{key:"ArrowLeft",run:iL,shift:fL,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:J9,shift:fG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:lG,shift:yG,preventDefault:!0},{key:"ArrowRight",run:rL,shift:dL,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:eG,shift:dG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:oG,shift:bG,preventDefault:!0},{key:"ArrowUp",run:oL,shift:gL,preventDefault:!0},{mac:"Cmd-ArrowUp",run:HE,shift:UE},{mac:"Ctrl-ArrowUp",run:IE,shift:VE},{key:"ArrowDown",run:aL,shift:OL,preventDefault:!0},{mac:"Cmd-ArrowDown",run:YE,shift:WE},{mac:"Ctrl-ArrowDown",run:_S,shift:qE},{key:"PageUp",run:IE,shift:VE},{key:"PageDown",run:_S,shift:qE},{key:"Home",run:sG,shift:OG,preventDefault:!0},{key:"Mod-Home",run:HE,shift:UE},{key:"End",run:rG,shift:gG,preventDefault:!0},{key:"Mod-End",run:YE,shift:WE},{key:"Enter",run:GE,shift:GE},{key:"Mod-a",run:xG},{key:"Backspace",run:BS,shift:BS,preventDefault:!0},{key:"Delete",run:vL,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:kL,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:MG,preventDefault:!0},{mac:"Mod-Backspace",run:EG,preventDefault:!0},{mac:"Mod-Delete",run:$G,preventDefault:!0}].concat(IG.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),qG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nG,shift:pG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:iG,shift:mG},{key:"Alt-ArrowUp",run:DG},{key:"Shift-Alt-ArrowUp",run:zG},{key:"Alt-ArrowDown",run:NG},{key:"Shift-Alt-ArrowDown",run:LG},{key:"Mod-Alt-ArrowUp",run:TG},{key:"Mod-Alt-ArrowDown",run:CG},{key:"Escape",run:AG},{key:"Mod-Enter",run:jG},{key:"Alt-l",mac:"Ctrl-l",run:kG},{key:"Mod-i",run:wG,preventDefault:!0},{key:"Mod-[",run:ML},{key:"Mod-]",run:AL},{key:"Mod-Alt-\\",run:ZG},{key:"Shift-Mod-k",run:_G},{key:"Shift-Mod-\\",run:hG},{key:"Mod-/",run:D9},{key:"Alt-A",run:z9},{key:"Ctrl-m",mac:"Shift-Alt-m",run:XG}].concat(VG),HG={key:"Tab",run:AL,shift:ML},FE=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class wc{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(FE(o)):FE,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Fn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Kv(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=$r(e);let r=this.normalize(t);if(r.length)for(let s=0,l=i,o=!0;;s++){let c=r.charCodeAt(s),h=this.match(c,l,o,this.bufferPos+this.bufferStart,s==r.length-1);if(h)return this.value=h,this;if(s==r.length-1)break;o&&s<t.length&&t.charCodeAt(s)==c?l++:o=!1}}}match(e,t,i,r,s){let l=null;for(let o=0;o<this.matches.length;){let c=this.matches[o],h=!1;this.query.charCodeAt(c.index)==e&&(c.index==this.query.length-1?l={from:c.from,to:r,precise:s&&c.precise}:(c.index++,h=!0)),h?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:t,to:r,precise:i&&s}:this.matches.push({from:t,index:1,precise:i})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(wc.prototype[Symbol.iterator]=function(){return this});const QL={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Mx="gm"+(/x/.unicode==null?"":"u");class EL{constructor(e,t,i,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=QL,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new $L(e,t,i,r,s);this.re=new RegExp(t,Mx+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=e.iter();let l=e.lineAt(r);this.curLineStart=l.from,this.matchPos=lg(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=lg(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<r||i>this.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Db=new WeakMap;class sc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let r=Db.get(e);if(!r||r.from>=i||r.to<=t){let o=new sc(t,e.sliceString(t,i));return Db.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to<i&&(s+=e.sliceString(r.to,i)),Db.set(e,new sc(l,s)),new sc(t,s.slice(t-l,i-l))}}class $L{constructor(e,t,i,r,s){this.text=e,this.to=s,this.done=!1,this.value=QL,this.matchPos=lg(e,r),this.re=new RegExp(t,Mx+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=sc.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,precise:!0,match:t},this.matchPos=lg(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=sc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(EL.prototype[Symbol.iterator]=$L.prototype[Symbol.iterator]=function(){return this});function YG(n){try{return new RegExp(n,Mx),!0}catch{return!1}}function lg(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}const UG=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:r}=h8(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let l=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!l){n.dispatch({effects:i});return}let o=e.doc.lineAt(e.selection.main.head),[,c,h,d,p]=l,g=d?+d.slice(1):0,O=h?+h:o.number;if(h&&p){let x=O/100;c&&(x=x*(c=="-"?-1:1)+o.number/e.doc.lines),O=Math.round(e.doc.lines*x)}else h&&c&&(O=O*(c=="-"?-1:1)+o.number);let b=e.doc.line(Math.max(1,Math.min(e.doc.lines,O))),v=Y.cursor(b.from+Math.max(0,Math.min(g,b.length)));n.dispatch({effects:[i,de.scrollIntoView(v.from,{y:"center"})],selection:v})}),!0},WG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},GG=ge.define({combine(n){return Hr(n,WG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function FG(n){return[nF,tF]}const KG=ke.mark({class:"cm-selectionMatch"}),JG=ke.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function KE(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Qt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Qt.Word)}function eF(n,e,t,i){return n(e.sliceDoc(t,t+1))==Qt.Word&&n(e.sliceDoc(i-1,i))==Qt.Word}const tF=Lt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(GG),{state:t}=n,i=t.selection;if(i.ranges.length>1)return ke.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return ke.none;let c=t.wordAt(r.head);if(!c)return ke.none;l=t.charCategorizer(r.head),s=t.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c<e.minSelectionLength||c>200)return ke.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(KE(l,t,r.from,r.to)&&eF(l,t,r.from,r.to)))return ke.none}else if(s=t.sliceDoc(r.from,r.to),!s)return ke.none}let o=[];for(let c of n.visibleRanges){let h=new wc(t.doc,s,c.from,c.to);for(;!h.next().done;){let{from:d,to:p}=h.value;if((!l||KE(l,t,d,p))&&(r.empty&&d<=r.from&&p>=r.to?o.push(JG.range(d,p)):(d>=r.to||p<=r.from)&&o.push(KG.range(d,p)),o.length>e.maxMatches))return ke.none}}return ke.set(o)}},{decorations:n=>n.decorations}),nF=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),iF=({state:n,dispatch:e})=>{let{selection:t}=n,i=Y.create(t.ranges.map(r=>n.wordAt(r.head)||Y.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function rF(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new wc(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new wc(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(c=>c.from==o.value.from))continue;if(s){let c=n.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const sF=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return iF({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=rF(n,i);return r?(e(n.update({selection:n.selection.addRange(Y.range(r.from,r.to),!1),effects:de.scrollIntoView(r.to)})),!0):!1},zc=ge.define({combine(n){return Hr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bF(e),scrollToMatch:e=>de.scrollIntoView(e)})}});class RL{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||YG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
`:i=="r"?"\r":i=="t"?"	":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new hF(this):new aF(this)}getCursor(e,t=0,i){let r=e.doc?e:Ye.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Ya(this,r,t,i):Ha(this,r,t,i)}}class PL{constructor(e){this.spec=e}}function lF(n,e,t){return(i,r,s,l)=>{if(t&&!t(i,r,s,l))return!1;let o=i>=l&&r<=l+s.length?s.slice(i-l,r-l):e.doc.sliceString(i,r);return n(o,e,i,r)}}function Ha(n,e,t,i){let r;return n.wholeWord&&(r=oF(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(r=lF(n.test,e,r)),new wc(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),r)}function oF(n,e){return(t,i,r,s)=>((s>t||s+r.length<i)&&(s=Math.max(0,t-2),r=n.sliceString(s,Math.min(n.length,i+2))),(e(og(r,t-s))!=Qt.Word||e(ag(r,t-s))!=Qt.Word)&&(e(ag(r,i-s))!=Qt.Word||e(og(r,i-s))!=Qt.Word))}class aF extends PL{constructor(e){super(e)}nextMatch(e,t,i){let r=Ha(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Ha(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),l=Ha(this.spec,e,s,r),o=null;for(;!l.nextOverlapping().done;)o=l.value;if(o)return o;if(s==t)return null;r-=1e4}}prevMatch(e,t,i){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=i)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Ha(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Ha(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function cF(n,e,t){return(i,r,s)=>(!t||t(i,r,s))&&n(s[0],e,i,r)}function Ya(n,e,t,i){let r;return n.wholeWord&&(r=uF(e.charCategorizer(e.selection.main.head))),n.test&&(r=cF(n.test,e,r)),new EL(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:r},t,i)}function og(n,e){return n.slice(sn(n,e,!1),e)}function ag(n,e){return n.slice(e,sn(n,e))}function uF(n){return(e,t,i)=>!i[0].length||(n(og(i.input,i.index))!=Qt.Word||n(ag(i.input,i.index))!=Qt.Word)&&(n(ag(i.input,i.index+i[0].length))!=Qt.Word||n(og(i.input,i.index+i[0].length))!=Qt.Word)}class hF extends PL{nextMatch(e,t,i){let r=Ya(this.spec,e,i,e.doc.length).next();return r.done&&(r=Ya(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=Ya(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+i.slice(r)}return t})}matchAll(e,t){let i=Ya(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Ya(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Kh=Pe.define(),Qx=Pe.define(),Nl=xn.define({create(n){return new Nb(jS(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Kh)?n=new Nb(t.value.create(),n.panel):t.is(Qx)&&(n=new Nb(n.query,t.value?Ex:null));return n},provide:n=>Hh.from(n,e=>e.panel)});class Nb{constructor(e,t){this.query=e,this.panel=t}}const fF=ke.mark({class:"cm-searchMatch"}),dF=ke.mark({class:"cm-searchMatch cm-searchMatch-selected"}),pF=Lt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Nl))}update(n){let e=n.state.field(Nl);(e!=n.startState.field(Nl)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return ke.none;let{view:t}=this,i=new Rs;for(let r=0,s=t.visibleRanges,l=s.length;r<l;r++){let{from:o,to:c}=s[r];for(;r<l-1&&c>s[r+1].from-500;)c=s[++r].to;n.highlight(t.state,o,c,(h,d)=>{let p=t.state.selection.ranges.some(g=>g.from==h&&g.to==d);i.add(h,d,p?dF:fF)})}return i.finish()}},{decorations:n=>n.decorations});function wf(n){return e=>{let t=e.state.field(Nl,!1);return t&&t.query.spec.valid?n(e,t):zL(e)}}const cg=wf((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=Y.single(i.from,i.to),s=n.state.facet(zc);return n.dispatch({selection:r,effects:[$x(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),NL(n),!0}),ug=wf((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=Y.single(r.from,r.to),l=n.state.facet(zc);return n.dispatch({selection:s,effects:[$x(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),NL(n),!0}),mF=wf((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:Y.create(t.map(i=>Y.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),gF=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new wc(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(Y.range(o.value.from,o.value.to))}return e(n.update({selection:Y.create(s,l),userEvent:"select.search.matches"})),!0},JE=wf((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=s,o=[],c,h,d=[];l.precise?l.from==i&&l.to==r&&(h=t.toText(e.getReplacement(l)),o.push({from:l.from,to:l.to,insert:h}),d.push(de.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):l=e.nextMatch(t,l.from,l.to);let p=n.state.changes(o);return l&&(c=Y.single(l.from,l.to).map(p),d.push($x(n,l)),d.push(t.facet(zc).scrollToMatch(c.main,n))),n.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),OF=wf((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let r of e.matchAll(n.state,1e9)){let{from:s,to:l,precise:o}=r;o&&t.push({from:s,to:l,insert:e.getReplacement(r)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:de.announce.of(i),userEvent:"input.replace.all"}),!0});function Ex(n){return n.state.facet(zc).createPanel(n)}function jS(n,e){var t,i,r,s,l;let o=n.selection.main,c=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!c)return e;let h=n.facet(zc);return new RL({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:h.wholeWord})}function DL(n){let e=gx(n,Ex);return e&&e.dom.querySelector("[main-field]")}function NL(n){let e=DL(n);e&&e==n.root.activeElement&&e.select()}const zL=n=>{let e=n.state.field(Nl,!1);if(e&&e.panel){let t=DL(n);if(t&&t!=n.root.activeElement){let i=jS(n.state,e.query.spec);i.valid&&n.dispatch({effects:Kh.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Qx.of(!0),e?Kh.of(jS(n.state,e.query.spec)):Pe.appendConfig.of(vF)]});return!0},LL=n=>{let e=n.state.field(Nl,!1);if(!e||!e.panel)return!1;let t=gx(n,Ex);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Qx.of(!1)}),!0},yF=[{key:"Mod-f",run:zL,scope:"editor search-panel"},{key:"F3",run:cg,shift:ug,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:cg,shift:ug,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:LL,scope:"editor search-panel"},{key:"Mod-Shift-l",run:gF},{key:"Mod-Alt-g",run:UG},{key:"Mod-d",run:sF,preventDefault:!0}];class bF{constructor(e){this.view=e;let t=this.query=e.state.field(Nl).query.spec;this.commit=this.commit.bind(this),this.searchField=ut("input",{value:t.search,placeholder:hi(e,"Find"),"aria-label":hi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ut("input",{value:t.replace,placeholder:hi(e,"Replace"),"aria-label":hi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ut("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ut("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ut("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return ut("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=ut("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>cg(e),[hi(e,"next")]),i("prev",()=>ug(e),[hi(e,"previous")]),i("select",()=>mF(e),[hi(e,"all")]),ut("label",null,[this.caseField,hi(e,"match case")]),ut("label",null,[this.reField,hi(e,"regexp")]),ut("label",null,[this.wordField,hi(e,"by word")]),...e.state.readOnly?[]:[ut("br"),this.replaceField,i("replace",()=>JE(e),[hi(e,"replace")]),i("replaceAll",()=>OF(e),[hi(e,"replace all")])],ut("button",{name:"close",onclick:()=>LL(e),"aria-label":hi(e,"close"),type:"button"},["×"])])}commit(){let e=new RL({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Kh.of(e)}))}keydown(e){S7(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ug:cg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),JE(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Kh)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(zc).top}}function hi(n,e){return n.state.phrase(e)}const Tp=30,Cp=/[\s\.,:;?!]/;function $x(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-Tp),l=Math.min(r,t+Tp),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let c=0;c<Tp;c++)if(!Cp.test(o[c+1])&&Cp.test(o[c])){o=o.slice(c);break}}if(l!=r){for(let c=o.length-1;c>o.length-Tp;c--)if(!Cp.test(o[c-1])&&Cp.test(o[c])){o=o.slice(0,c);break}}return de.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const SF=de.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vF=[Nl,Bs.low(pF),SF];class Rx{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Ot(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(BL(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function e$(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function xF(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;s<r.length;s++)t[r[s]]=!0}let i=e$(e)+e$(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function _L(n){let e=n.map(r=>typeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:xF(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function kF(n,e){return t=>{for(let i=Ot(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class t${constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function zo(n){return n.selection.main.from}function BL(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Px=qr.define();function wF(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return{...n.changeByRange(o=>{if(o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i))return{range:o};let c=n.toText(e);return{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:c},range:Y.cursor(o.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const n$=new WeakMap;function TF(n){if(!Array.isArray(n))return n;let e=n$.get(n);return e||n$.set(n,e=_L(n)),e}const hg=Pe.define(),Jh=Pe.define();class CF{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Fn(e,t),r=$r(i);this.chars.push(i);let s=e.slice(t,t+r),l=s.toUpperCase();this.folded.push(Fn(l==s?s.toLowerCase():l,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:r,precise:s,byWord:l}=this;if(t.length==1){let C=Fn(e,0),A=$r(C),P=A==e.length?0:-100;if(C!=t[0])if(C==i[0])P+=-200;else return null;return this.ret(P,[0,A])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,h=0;if(o<0){for(let C=0,A=Math.min(e.length,200);C<A&&h<c;){let P=Fn(e,C);(P==t[h]||P==i[h])&&(r[h++]=C),C+=$r(P)}if(h<c)return null}let d=0,p=0,g=!1,O=0,b=-1,v=-1,x=/[a-z]/.test(e),k=!0;for(let C=0,A=Math.min(e.length,200),P=0;C<A&&p<c;){let E=Fn(e,C);o<0&&(d<c&&E==t[d]&&(s[d++]=C),O<c&&(E==t[O]||E==i[O]?(O==0&&(b=C),v=C+1,O++):O=0));let D,$=E<255?E>=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(D=Kv(E))!=D.toLowerCase()?1:D!=D.toUpperCase()?2:0;(!C||$==1&&x||P==0&&$!=0)&&(t[p]==E||i[p]==E&&(g=!0)?l[p++]=C:l.length&&(k=!1)),P=$,C+=$r(E)}return p==c&&l[0]==0&&k?this.result(-100+(g?-200:0),l,e):O==c&&b==0?this.ret(-200-e.length+(v==e.length?0:-100),[0,v]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):O==c?this.ret(-900-e.length,[b,v]):p==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),l,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?$r(Fn(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}class AF{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const rn=ge.define({combine(n){return Hr(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:MF,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>i$(e(i),t(i)),optionClass:(e,t)=>i=>i$(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function i$(n,e){return n?e?n+" "+e:n:e}function MF(n,e,t,i,r,s){let l=n.textDirection==mt.RTL,o=l,c=!1,h="top",d,p,g=e.left-r.left,O=r.right-e.right,b=i.right-i.left,v=i.bottom-i.top;if(o&&g<Math.min(b,O)?o=!1:!o&&O<Math.min(b,g)&&(o=!0),b<=(o?g:O))d=Math.max(r.top,Math.min(t.top,r.bottom-v))-e.top,p=Math.min(400,o?g:O);else{c=!0,p=Math.min(400,(l?e.right:r.right-e.left)-30);let C=r.bottom-e.bottom;C>=v||C>e.top?d=t.bottom-e.top:(h="bottom",d=e.bottom-t.top)}let x=(e.bottom-e.top)/s.offsetHeight,k=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${d/x}px; max-width: ${p/k}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":o?"left":"right")}}const Dx=Pe.define();function QF(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,c=0;for(let h=0;h<s.length;){let d=s[h++],p=s[h++];d>c&&l.appendChild(document.createTextNode(o.slice(c,d)));let g=l.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(o.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<o.length&&l.appendChild(document.createTextNode(o.slice(c))),l},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function zb(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class EF{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(rn);this.optionContent=QF(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=zb(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:h}=e.state.field(t).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),c.preventDefault();return}if(c.target==this.list){let d=this.list.classList.contains("cm-completionListIncompleteTop")&&c.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&c.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(e.dispatch({effects:Dx.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(rn).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Jh.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=zb(s.length,l,e.state.facet(rn).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=zb(t.options.length,t.selected,this.view.state.facet(rn).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:s}=r;if(!s)return;let l=typeof s=="string"?document.createTextNode(s):s(r);if(!l)return;"then"in l?l.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>ei(this.view.state,o,"completion info")):(this.addInfoPane(l,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&RF(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(rn).positionInfo(this.view,t,r,i,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",l=>{l.target==r&&l.preventDefault()});let s=null;for(let l=i.from;l<i.to;l++){let{completion:o,match:c}=e[l],{section:h}=o;if(h){let g=typeof h=="string"?h:h.name;if(g!=s&&(l>i.from||i.from==0))if(s=g,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let O=r.appendChild(document.createElement("completion-section"));O.textContent=g}}const d=r.appendChild(document.createElement("li"));d.id=t+"-"+l,d.setAttribute("role","option");let p=this.optionClass(o);p&&(d.className=p);for(let g of this.optionContent){let O=g(o,this.view.state,this.view,c);O&&d.appendChild(O)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function $F(n,e){return t=>new EF(t,n,e)}function RF(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/r:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function r$(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function PF(n,e){let t=[],i=null,r=null,s=d=>{t.push(d);let{section:p}=d.completion;if(p){i||(i=[]);let g=typeof p=="string"?p:p.name;i.some(O=>O.name==g)||i.push(typeof p=="string"?{name:g}:p)}},l=e.facet(rn);for(let d of n)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)s(new t$(g,d.source,p?p(g):[],1e9-t.length));else{let g=e.sliceDoc(d.from,d.to),O,b=l.filterStrict?new AF(g):new CF(g);for(let v of d.result.options)if(O=b.match(v.label)){let x=v.displayLabel?p?p(v,O.matched):[]:O.matched,k=O.score+(v.boost||0);if(s(new t$(v,d.source,x,k)),typeof v.section=="object"&&v.section.rank==="dynamic"){let{name:C}=v.section;r||(r=Object.create(null)),r[C]=Math.max(k,r[C]||-1e9)}}}}if(i){let d=Object.create(null),p=0,g=(O,b)=>(O.rank==="dynamic"&&b.rank==="dynamic"?r[b.name]-r[O.name]:0)||(typeof O.rank=="number"?O.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(O.name<b.name?-1:1);for(let O of i.sort(g))p-=1e5,d[O.name]=p;for(let O of t){let{section:b}=O.completion;b&&(O.score+=d[typeof b=="string"?b:b.name])}}let o=[],c=null,h=l.compareCompletions;for(let d of t.sort((p,g)=>g.score-p.score||h(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?o.push(d):r$(d.completion)>r$(c)&&(o[o.length-1]=d),c=d.completion}return o}class Ga{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Ga(this.options,s$(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s,l){if(r&&!l&&e.some(h=>h.isPending))return r.setDisabled();let o=PF(e,t);if(!o.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let c=t.facet(rn).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let h=r.options[r.selected].completion;for(let d=0;d<o.length;d++)if(o[d].completion==h){c=d;break}}return new Ga(o,s$(i,c),{pos:e.reduce((h,d)=>d.hasResult()?Math.min(h,d.from):h,1e8),create:BF,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(e){return new Ga(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ga(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class fg{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new fg(LF,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(rn),s=(i.override||t.languageDataAt("autocomplete",zo(t)).map(TF)).map(c=>(this.active.find(d=>d.source==c)||new Ii(c,this.active.some(d=>d.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((c,h)=>c==this.active[h])&&(s=this.active);let l=this.open,o=e.effects.some(c=>c.is(Nx));l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!DF(s,this.active)||o?l=Ga.build(s,t,this.id,l,i,o):l&&l.disabled&&!s.some(c=>c.isPending)&&(l=null),!l&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Ii(c.source,0):c));for(let c of e.effects)c.is(Dx)&&(l=l&&l.setSelected(c.value,this.id));return s==this.active&&l==this.open?this:new fg(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?NF:zF}}function DF(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let r=t==n.length,s=i==e.length;if(r||s)return r==s;if(n[t++].result!=e[i++].result)return!1}}const NF={"aria-autocomplete":"list"},zF={};function s$(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const LF=[];function jL(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(Px);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ii{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=jL(e,t),r=this;(i&8||i&16&&this.touches(e))&&(r=new Ii(r.source,0)),i&4&&r.state==0&&(r=new Ii(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(hg))r=new Ii(r.source,1,s.value);else if(s.is(Jh))r=new Ii(r.source,0);else if(s.is(Nx))for(let l of s.value)l.source==r.source&&(r=l);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(zo(e.state))}}class lc extends Ii{constructor(e,t,i,r,s,l){super(e,3,t),this.limit=i,this.result=r,this.from=s,this.to=l}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=zo(e.state);if(o>l||!r||t&2&&(zo(e.startState)==this.from||o<this.limit))return new Ii(this.source,t&4?1:0);let c=e.changes.mapPos(this.limit);return _F(r.validFor,e.state,s,l)?new lc(this.source,this.explicit,c,r,s,l):r.update&&(r=r.update(r,s,l,new Rx(e.state,o,!1)))?new lc(this.source,this.explicit,c,r,r.from,(i=r.to)!==null&&i!==void 0?i:zo(e.state)):new Ii(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new lc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ii(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function _F(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):BL(n,!0).test(r)}const Nx=Pe.define({map(n,e){return n.map(t=>t.map(e))}}),Kn=xn.define({create(){return fg.start()},update(n,e){return n.update(e)},provide:n=>[mx.from(n,e=>e.tooltip),de.contentAttributes.from(n,e=>e.attrs)]});function zx(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Kn).active.find(r=>r.source==e.source);return i instanceof lc?(typeof t=="string"?n.dispatch({...wF(n.state,t,i.from,i.to),annotations:Px.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const BF=$F(Kn,zx);function Ap(n,e="option"){return t=>{let i=t.state.field(Kn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(rn).interactionDelay)return!1;let r=1,s;e=="page"&&(s=yz(t,i.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=i.open.options,o=i.open.selected>-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:Dx.of(o)}),!0}}const jF=n=>{let e=n.state.field(Kn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(rn).interactionDelay?!1:zx(n,e.open.options[e.open.selected])},Lb=n=>n.state.field(Kn,!1)?(n.dispatch({effects:hg.of(!0)}),!0):!1,ZF=n=>{let e=n.state.field(Kn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Jh.of(null)}),!0)};class XF{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const IF=50,VF=1e3,qF=Lt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Kn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Kn),t=n.state.facet(rn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Kn)==e)return;let i=n.transactions.some(s=>{let l=jL(s,t);return l&8||(s.selection||s.docChanged)&&!(l&3)});for(let s=0;s<this.running.length;s++){let l=this.running[s];if(i||l.context.abortOnDocChange&&n.docChanged||l.updates.length+n.transactions.length>IF&&Date.now()-l.time>VF){for(let o of l.context.abortListeners)try{o()}catch(c){ei(this.view.state,c)}l.context.abortListeners=null,this.running.splice(s--,1)}else l.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(l=>l.is(hg)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(l=>l.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Kn);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=zo(e),i=new Rx(e,t,n.explicit,this.view),r=new XF(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Jh.of(null)}),ei(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(rn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(rn),i=this.view.state.field(Kn);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let o=zo(s.updates.length?s.updates[0].startState:this.view.state),c=Math.min(o,s.done.from+(s.active.explicit?0:1)),h=new lc(s.active.source,s.active.explicit,c,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:o);for(let d of s.updates)h=h.update(d,t);if(h.hasResult()){e.push(h);continue}}let l=i.active.find(o=>o.source==s.active.source);if(l&&l.isPending)if(s.done==null){let o=new Ii(s.active.source,0);for(let c of s.updates)o=o.update(c,t);o.isPending||e.push(o)}else this.startQuery(l)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Nx.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Kn,!1);if(e&&e.tooltip&&this.view.state.facet(rn).closeOnBlur){let t=e.open&&yz(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Jh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:hg.of(!1)}),20),this.composing=0}}}),HF=typeof navigator=="object"&&/Win/.test(navigator.platform),YF=Bs.highest(de.domEventHandlers({keydown(n,e){let t=e.state.field(Kn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(HF&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],r=t.active.find(l=>l.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&zx(e,i),!1}})),ZL=de.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class UF{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class Lx{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,bn.TrackDel),i=e.mapPos(this.to,1,bn.TrackDel);return t==null||i==null?null:new Lx(this.field,t,i)}}class _x{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let h=l,d=/^\t*/.exec(c)[0].length;for(let p=0;p<d;p++)h+=e.facet(Pc);r.push(t+h.length-d),c=h+c.slice(d)}i.push(c),t+=c.length+1}let o=this.fieldPositions.map(c=>new Lx(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let o=s[1]?+s[1]:null,c=s[2]||s[3]||"",h=-1,d=c.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<t.length;p++)(o!=null?t[p].seq==o:d&&t[p].name==d)&&(h=p);if(h<0){let p=0;for(;p<t.length&&(o==null||t[p].seq!=null&&t[p].seq<o);)p++;t.splice(p,0,{seq:o,name:d}),h=p;for(let g of r)g.field>=h&&g.field++}for(let p of r)if(p.line==i.length&&p.from>s.index){let g=s[2]?3+(s[1]||"").length:2;p.from-=g,p.to-=g}r.push(new UF(h,i.length,s.index,s.index+d.length)),l=l.slice(0,s.index)+c+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(o,c,h)=>{for(let d of r)d.line==i.length&&d.from>h&&(d.from--,d.to--);return c}),i.push(l)}return new _x(i,r)}}let WF=ke.widget({widget:new class extends hr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),GF=ke.mark({class:"cm-snippetField"});class Lc{constructor(e,t){this.ranges=e,this.active=t,this.deco=ke.set(e.map(i=>(i.from==i.to?WF:GF).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new Lc(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Tf=Pe.define({map(n,e){return n&&n.map(e)}}),FF=Pe.define(),ef=xn.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Tf))return t.value;if(t.is(FF)&&n)return new Lc(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>de.decorations.from(n,e=>e?e.deco:ke.none)});function Bx(n,e){return Y.create(n.filter(t=>t.field==e).map(t=>Y.range(t.from,t.to)))}function KF(n){let e=_x.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),{main:c}=t.state.selection,h={changes:{from:r,to:s==c.from?c.to:s,insert:Ge.of(l)},scrollIntoView:!0,annotations:i?[Px.of(i),Ut.userEvent.of("input.complete")]:void 0};if(o.length&&(h.selection=Bx(o,0)),o.some(d=>d.field>0)){let d=new Lc(o,0),p=h.effects=[Tf.of(d)];t.state.field(ef,!1)===void 0&&p.push(Pe.appendConfig.of([ef,iK,rK,ZL]))}t.dispatch(t.state.update(h))}}function XL(n){return({state:e,dispatch:t})=>{let i=e.field(ef,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:Bx(i.ranges,r),effects:Tf.of(s?null:new Lc(i.ranges,r)),scrollIntoView:!0})),!0}}const JF=({state:n,dispatch:e})=>n.field(ef,!1)?(e(n.update({effects:Tf.of(null)})),!0):!1,eK=XL(1),tK=XL(-1),nK=[{key:"Tab",run:eK,shift:tK},{key:"Escape",run:JF}],l$=ge.define({combine(n){return n.length?n[0]:nK}}),iK=Bs.highest($c.compute([l$],n=>n.facet(l$)));function Un(n,e){return{...e,apply:KF(n)}}const rK=de.domEventHandlers({mousedown(n,e){let t=e.state.field(ef,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:Bx(t.ranges,r.field),effects:Tf.of(t.ranges.some(s=>s.field>r.field)?new Lc(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),tf={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Qo=Pe.define({map(n,e){let t=e.mapPos(n,-1,bn.TrackAfter);return t??void 0}}),jx=new class extends _l{};jx.startSide=1;jx.endSide=-1;const IL=xn.define({create(){return Ve.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(Qo)&&(n=n.update({add:[jx.range(t.value,t.value+1)]}));return n}});function sK(){return[oK,IL]}const _b="()[]{}<>«»»«［］｛｝";function VL(n){for(let e=0;e<_b.length;e+=2)if(_b.charCodeAt(e)==n)return _b.charAt(e+1);return Kv(n<128?n:n+1)}function qL(n,e){return n.languageDataAt("closeBrackets",e)[0]||tf}const lK=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),oK=de.inputHandler.of((n,e,t,i)=>{if((lK?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&$r(Fn(i,0))==1||e!=r.from||t!=r.to)return!1;let s=uK(n.state,i);return s?(n.dispatch(s),!0):!1}),aK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=qL(n,n.selection.main.head).brackets||tf.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=hK(n.doc,l.head);for(let c of i)if(c==o&&sO(n.doc,l.head)==VL(Fn(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:Y.cursor(l.head-c.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},cK=[{key:"Backspace",run:aK}];function uK(n,e){let t=qL(n,n.selection.main.head),i=t.brackets||tf.brackets;for(let r of i){let s=VL(Fn(r,0));if(e==r)return s==r?pK(n,r,i.indexOf(r+r+r)>-1,t):fK(n,r,s,t.before||tf.before);if(e==s&&HL(n,n.selection.main.from))return dK(n,r,s)}return null}function HL(n,e){let t=!1;return n.field(IL).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function sO(n,e){let t=n.sliceString(e,e+2);return t.slice(0,$r(Fn(t,0)))}function hK(n,e){let t=n.sliceString(e-2,e);return $r(Fn(t,0))==t.length?t:t.slice(1)}function fK(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:Qo.of(l.to+e.length),range:Y.range(l.anchor+e.length,l.head+e.length)};let o=sO(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:Qo.of(l.head+e.length),range:Y.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function dK(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&sO(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:Y.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function pK(n,e,t,i){let r=i.stringPrefixes||tf.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Qo.of(o.to+e.length),range:Y.range(o.anchor+e.length,o.head+e.length)};let c=o.head,h=sO(n.doc,c),d;if(h==e){if(o$(n,c))return{changes:{insert:e+e,from:c},effects:Qo.of(c+e.length),range:Y.cursor(c+e.length)};if(HL(n,c)){let g=t&&n.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Y.cursor(c+g.length)}}}else{if(t&&n.sliceDoc(c-2*e.length,c)==e+e&&(d=a$(n,c-2*e.length,r))>-1&&o$(n,d))return{changes:{insert:e+e+e+e,from:c},effects:Qo.of(c+e.length),range:Y.cursor(c+e.length)};if(n.charCategorizer(c)(h)!=Qt.Word&&a$(n,c,r)>-1&&!mK(n,c,e,r))return{changes:{insert:e+e,from:c},effects:Qo.of(c+e.length),range:Y.cursor(c+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function o$(n,e){let t=Ot(n).resolveInner(e+1);return t.parent&&t.from==e}function mK(n,e,t,i){let r=Ot(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),c=o.indexOf(t);if(!c||c>-1&&i.indexOf(o.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>t.length+c;){if(n.sliceDoc(d.to-t.length,d.to)==t)return!1;d=d.firstChild}return!0}let h=r.to==e&&r.parent;if(!h)break;r=h}return!1}function a$(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Qt.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=Qt.Word)return s}return-1}function gK(n={}){return[YF,Kn,rn.of(n),qF,OK,ZL]}const YL=[{key:"Ctrl-Space",run:Lb},{mac:"Alt-`",run:Lb},{mac:"Alt-i",run:Lb},{key:"Escape",run:ZF},{key:"ArrowDown",run:Ap(!0)},{key:"ArrowUp",run:Ap(!1)},{key:"PageDown",run:Ap(!0,"page")},{key:"PageUp",run:Ap(!1,"page")},{key:"Enter",run:jF}],OK=Bs.highest($c.computeN([rn],n=>n.facet(rn).defaultKeymap?[YL]:[]));class c${constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class vo{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=i.facet(nf).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((O,b)=>O.from-b.from||O.to-b.to),l=new Rs,o=[],c=0,h=i.doc.iter(),d=0,p=i.doc.length;for(let O=0;;){let b=O==s.length?null:s[O];if(!b&&!o.length)break;let v,x;if(o.length)v=c,x=o.reduce((A,P)=>Math.min(A,P.to),b&&b.from>v?b.from:1e8);else{if(v=b.from,v>p)break;x=b.to,o.push(b),O++}for(;O<s.length;){let A=s[O];if(A.from==v&&(A.to>A.from||A.to==v))o.push(A),O++,x=Math.min(A.to,x);else{x=Math.min(A.from,x);break}}x=Math.min(x,p);let k=!1;if(o.some(A=>A.from==v&&(A.to==x||x==p))&&(k=v==x,!k&&x-v<10)){let A=v-(d+h.value.length);A>0&&(h.next(A),d=v);for(let P=v;;){if(P>=x){k=!0;break}if(!h.lineBreak&&d+h.value.length>P)break;P=d+h.value.length,d+=h.value.length,h.next()}}let C=EK(o);if(k)l.add(v,v,ke.widget({widget:new CK(C),diagnostics:o.slice()}));else{let A=o.reduce((P,E)=>E.markClass?P+" "+E.markClass:P,"");l.add(v,x,ke.mark({class:"cm-lintRange cm-lintRange-"+C+A,diagnostics:o.slice(),inclusiveEnd:o.some(P=>P.to>x)}))}if(c=x,c==p)break;for(let A=0;A<o.length;A++)o[A].to<=c&&o.splice(A--,1)}let g=l.finish();return new vo(g,t,Il(g))}}function Il(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!i)i=new c$(r,s,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new c$(i.from,s,i.diagnostic)}}),i}function yK(n,e){let t=e.pos,i=e.end||t,r=n.state.facet(nf).hideOn(n,t,i);if(r!=null)return r;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(l=>l.is(UL))||n.changes.touchesRange(s.from,Math.max(s.to,i)))}function bK(n,e){return n.field(bi,!1)?e:e.concat(Pe.appendConfig.of($K))}const UL=Pe.define(),Zx=Pe.define(),WL=Pe.define(),bi=xn.define({create(){return new vo(ke.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,r=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=Il(t,n.selected.diagnostic,s)||Il(t,null,s)}!t.size&&r&&e.state.facet(nf).autoPanel&&(r=null),n=new vo(t,r,i)}for(let t of e.effects)if(t.is(UL)){let i=e.state.facet(nf).autoPanel?t.value.length?rf.open:null:n.panel;n=vo.init(t.value,i,e.state)}else t.is(Zx)?n=new vo(n.diagnostics,t.value?rf.open:null,n.selected):t.is(WL)&&(n=new vo(n.diagnostics,n.panel,t.value));return n},provide:n=>[Hh.from(n,e=>e.panel),de.decorations.from(n,e=>e.diagnostics)]}),SK=ke.mark({class:"cm-lintRange cm-lintRange-active"});function vK(n,e,t){let{diagnostics:i}=n.state.field(bi),r,s=-1,l=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(c,h,{spec:d})=>{if(e>=c&&e<=h&&(c==h||(e>c||t>0)&&(e<h||t<0)))return r=d.diagnostics,s=c,l=h,!1});let o=n.state.facet(nf).tooltipFilter;return r&&o&&(r=o(r,n.state)),r?{pos:s,end:l,above:n.state.doc.lineAt(s).to<l,create(){return{dom:xK(n,r)}}}:null}function xK(n,e){return ut("ul",{class:"cm-tooltip-lint"},e.map(t=>FL(n,t,!1)))}const kK=n=>{let e=n.state.field(bi,!1);(!e||!e.panel)&&n.dispatch({effects:bK(n.state,[Zx.of(!0)])});let t=gx(n,rf.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},u$=n=>{let e=n.state.field(bi,!1);return!e||!e.panel?!1:(n.dispatch({effects:Zx.of(!1)}),!0)},wK=n=>{let e=n.state.field(bi,!1);if(!e)return!1;let t=n.state.selection.main,i=Il(e.diagnostics,null,t.to+1);return!i&&(i=Il(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),c8(n,i.from,1,{tooltip:KL,until:r=>r.docChanged||r.newSelection.main.head<i.from||r.newSelection.main.head>i.to}),!0)},TK=[{key:"Mod-Shift-m",run:kK,preventDefault:!0},{key:"F8",run:wK}],nf=ge.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Hr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:h$,tooltipFilter:h$,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,r,s)=>e(i,r,s)||t(i,r,s):e:t,autoPanel:(e,t)=>e||t})}}});function h$(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function GL(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let r=t[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function FL(n,e,t){var i;let r=t?GL(e.actions):[];return ut("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ut("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,c=O=>{if(O.preventDefault(),o)return;o=!0;let b=Il(n.state.field(bi).diagnostics,e);b&&s.apply(n,b.from,b.to)},{name:h}=s,d=r[l]?h.indexOf(r[l]):-1,p=d<0?h:[h.slice(0,d),ut("u",h.slice(d,d+1)),h.slice(d+1)],g=s.markClass?" "+s.markClass:"";return ut("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${h}${d<0?"":` (access key "${r[l]})"`}.`},p)}),e.source&&ut("div",{class:"cm-diagnosticSource"},e.source))}class CK extends hr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ut("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class f${constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=FL(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class rf{constructor(e){this.view=e,this.items=[];let t=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)u$(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=GL(s.actions);for(let o=0;o<l.length;o++)if(l[o].toUpperCase().charCodeAt(0)==r.keyCode){let c=Il(this.view.state.field(bi).diagnostics,s);c&&s.actions[o].apply(e,c.from,c.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=ut("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=ut("div",{class:"cm-panel-lint"},this.list,ut("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>u$(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(bi).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(bi),i=0,r=!1,s=null,l=new Set;for(e.between(0,this.view.state.doc.length,(o,c,{spec:h})=>{for(let d of h.diagnostics){if(l.has(d))continue;l.add(d);let p=-1,g;for(let O=i;O<this.items.length;O++)if(this.items[O].diagnostic==d){p=O;break}p<0?(g=new f$(this.view,d),this.items.splice(i,0,g),r=!0):(g=this.items[p],p>i&&(this.items.splice(i,p-i),r=!0)),t&&g.diagnostic==t.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),s=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new f$(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:c})=>{let h=c.height/this.list.offsetHeight;o.top<c.top?this.list.scrollTop-=(c.top-o.top)/h:o.bottom>c.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(bi),i=Il(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:WL.of(i)})}static open(e){return new rf(e)}}function AK(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Mp(n){return AK(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const MK=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Mp("#f11")},".cm-lintRange-warning":{backgroundImage:Mp("orange")},".cm-lintRange-info":{backgroundImage:Mp("#999")},".cm-lintRange-hint":{backgroundImage:Mp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function QK(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function EK(n){let e="hint",t=1;for(let i of n){let r=QK(i.severity);r>t&&(t=r,e=i.severity)}return e}const KL=a8(vK,{hideOn:yK}),$K=[bi,de.decorations.compute([bi],n=>{let{selected:e,panel:t}=n.field(bi);return!e||!t||e.from==e.to?ke.none:ke.set([SK.range(e.from,e.to)])}),KL,MK];var d$=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,i=[];e.closeBracketsKeymap!==!1&&(i=i.concat(cK)),e.defaultKeymap!==!1&&(i=i.concat(qG)),e.searchKeymap!==!1&&(i=i.concat(yF)),e.historyKeymap!==!1&&(i=i.concat(K9)),e.foldKeymap!==!1&&(i=i.concat(d9)),e.completionKeymap!==!1&&(i=i.concat(YL)),e.lintKeymap!==!1&&(i=i.concat(TK));var r=[];return e.lineNumbers!==!1&&r.push(x8()),e.highlightActiveLineGutter!==!1&&r.push(T8()),e.highlightSpecialChars!==!1&&r.push(L7()),e.history!==!1&&r.push(I9()),e.foldGutter!==!1&&r.push(O9()),e.drawSelection!==!1&&r.push(C7()),e.dropCursor!==!1&&r.push($7()),e.allowMultipleSelections!==!1&&r.push(Ye.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(s9()),e.syntaxHighlighting!==!1&&r.push(qz(v9,{fallback:!0})),e.bracketMatching!==!1&&r.push(M9()),e.closeBrackets!==!1&&r.push(sK()),e.autocompletion!==!1&&r.push(gK()),e.rectangularSelection!==!1&&r.push(F7()),t!==!1&&r.push(e8()),e.highlightActiveLine!==!1&&r.push(I7()),e.highlightSelectionMatches!==!1&&r.push(FG()),e.tabSize&&typeof e.tabSize=="number"&&r.push(Pc.of(" ".repeat(e.tabSize))),r.concat([$c.of(i.flat())]).filter(Boolean)};const RK="#e5c07b",p$="#e06c75",PK="#56b6c2",DK="#ffffff",Yp="#abb2bf",ZS="#7d8799",NK="#61afef",zK="#98c379",m$="#d19a66",LK="#c678dd",_K="#21252b",g$="#2c313a",O$="#282c34",Bb="#353a42",BK="#3E4451",y$="#528bff",jK=de.theme({"&":{color:Yp,backgroundColor:O$},".cm-content":{caretColor:y$},".cm-cursor, .cm-dropCursor":{borderLeftColor:y$},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:BK},".cm-panels":{backgroundColor:_K,color:Yp},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:O$,color:ZS,border:"none"},".cm-activeLineGutter":{backgroundColor:g$},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Bb},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Bb,borderBottomColor:Bb},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:g$,color:Yp}}},{dark:!0}),ZK=xf.define([{tag:M.keyword,color:LK},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:p$},{tag:[M.function(M.variableName),M.labelName],color:NK},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:m$},{tag:[M.definition(M.name),M.separator],color:Yp},{tag:[M.typeName,M.className,M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:RK},{tag:[M.operator,M.operatorKeyword,M.url,M.escape,M.regexp,M.link,M.special(M.string)],color:PK},{tag:[M.meta,M.comment],color:ZS},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.link,color:ZS,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:p$},{tag:[M.atom,M.bool,M.special(M.variableName)],color:m$},{tag:[M.processingInstruction,M.string,M.inserted],color:zK},{tag:M.invalid,color:DK}]),XK=[jK,qz(ZK)];var IK=de.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),VK=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:r=!1,theme:s="light",placeholder:l="",basicSetup:o=!0}=e,c=[];switch(t&&c.unshift($c.of([HG])),o&&(typeof o=="boolean"?c.unshift(d$()):c.unshift(d$(o))),l&&c.unshift(Y7(l)),s){case"light":c.push(IK);break;case"dark":c.push(XK);break;case"none":break;default:c.push(s);break}return i===!1&&c.push(de.editable.of(!1)),r&&c.push(Ye.readOnly.of(!0)),[...c]},qK=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class HK{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class b${constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var jb=null,YK=()=>typeof window>"u"?new b$:(jb||(jb=new b$),jb),S$=qr.define(),UK=200,WK=[];function GK(n){var{value:e,selection:t,onChange:i,onStatistics:r,onCreateEditor:s,onUpdate:l,extensions:o=WK,autoFocus:c,theme:h="light",height:d=null,minHeight:p=null,maxHeight:g=null,width:O=null,minWidth:b=null,maxWidth:v=null,placeholder:x="",editable:k=!0,readOnly:C=!1,indentWithTab:A=!0,basicSetup:P=!0,root:E,initialState:D}=n,[$,H]=Ee.useState(),[W,te]=Ee.useState(),[ce,ie]=Ee.useState(),ue=Ee.useState(()=>({current:null}))[0],se=Ee.useState(()=>({current:null}))[0],fe=de.theme({"&":{height:d,minHeight:p,maxHeight:g,width:O,minWidth:b,maxWidth:v},"& .cm-scroller":{height:"100% !important"}}),B=de.updateListener.of(z=>{if(z.docChanged&&typeof i=="function"&&!z.transactions.some(j=>j.annotation(S$))){ue.current?ue.current.reset():(ue.current=new HK(()=>{if(se.current){var j=se.current;se.current=null,j()}ue.current=null},UK),YK().add(ue.current));var J=z.state.doc,Q=J.toString();i(Q,z)}r&&r(qK(z))}),G=VK({theme:h,editable:k,readOnly:C,placeholder:x,indentWithTab:A,basicSetup:P}),he=[B,fe,...G];return l&&typeof l=="function"&&he.push(de.updateListener.of(l)),he=he.concat(o),Ee.useLayoutEffect(()=>{if($&&!ce){var z={doc:e,selection:t,extensions:he},J=D?Ye.fromJSON(D.json,z,D.fields):Ye.create(z);if(ie(J),!W){var Q=new de({state:J,parent:$,root:E});te(Q),s&&s(Q,J)}}return()=>{W&&(ie(void 0),te(void 0))}},[$,ce]),Ee.useEffect(()=>{n.container&&H(n.container)},[n.container]),Ee.useEffect(()=>()=>{W&&(W.destroy(),te(void 0)),ue.current&&(ue.current.cancel(),ue.current=null)},[W]),Ee.useEffect(()=>{c&&W&&W.focus()},[c,W]),Ee.useEffect(()=>{W&&W.dispatch({effects:Pe.reconfigure.of(he)})},[h,o,d,p,g,O,b,v,x,k,C,A,P,i,l]),Ee.useEffect(()=>{if(e!==void 0){var z=W?W.state.doc.toString():"";if(W&&e!==z){var J=ue.current&&!ue.current.isDone,Q=()=>{W&&e!==W.state.doc.toString()&&W.dispatch({changes:{from:0,to:W.state.doc.toString().length,insert:e||""},annotations:[S$.of(!0)]})};J?se.current=Q:Q()}}},[e,W]),{state:ce,setState:ie,view:W,setView:te,container:$,setContainer:H}}var FK=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],JL=Ee.forwardRef((n,e)=>{var{className:t,value:i="",selection:r,extensions:s=[],onChange:l,onStatistics:o,onCreateEditor:c,onUpdate:h,autoFocus:d,theme:p="light",height:g,minHeight:O,maxHeight:b,width:v,minWidth:x,maxWidth:k,basicSetup:C,placeholder:A,indentWithTab:P,editable:E,readOnly:D,root:$,initialState:H}=n,W=O6(n,FK),te=Ee.useRef(null),{state:ce,view:ie,container:ue,setContainer:se}=GK({root:$,value:i,autoFocus:d,theme:p,height:g,minHeight:O,maxHeight:b,width:v,minWidth:x,maxWidth:k,basicSetup:C,placeholder:A,indentWithTab:P,editable:E,readOnly:D,selection:r,onChange:l,onStatistics:o,onCreateEditor:c,onUpdate:h,extensions:s,initialState:H});Ee.useImperativeHandle(e,()=>({editor:te.current,state:ce,view:ie}),[te,ue,ce,ie]);var fe=Ee.useCallback(G=>{te.current=G,se(G)},[se]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof p=="string"?"cm-theme-"+p:"cm-theme";return L.jsx("div",U1({ref:fe,className:""+B+(t?" "+t:"")},W))});JL.displayName="CodeMirror";class dg{static create(e,t,i,r,s){let l=r+(r<<8)+e+(t<<4)|0;return new dg(e,t,i,l,s,[],[])}constructor(e,t,i,r,s,l,o){this.type=e,this.value=t,this.from=i,this.hash=r,this.end=s,this.children=l,this.positions=o,this.hashProp=[[De.contextHash,r]]}addChild(e,t){e.prop(De.contextHash)!=this.hash&&(e=new et(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new et(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,l)=>new et(en.none,r,s,l,this.hashProp)})}}var ae;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(ae||(ae={}));class KK{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class JK{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return kh(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let r=t;r<e;r++)i+=this.text.charCodeAt(r)==9?4-i%4:1;return i}findColumn(e){let t=0;for(let i=0;t<this.text.length&&i<e;t++)i+=this.text.charCodeAt(t)==9?4-i%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function v$(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let i=(n.type==ae.OrderedList?Vx:Ix)(t,e,!1);return i>0&&(n.type!=ae.BulletList||Xx(t,e,!1)<0)&&t.text.charCodeAt(t.pos+i-1)==n.value}const e3={[ae.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(We(ae.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Ui(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[ae.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[ae.OrderedList]:v$,[ae.BulletList]:v$,[ae.Document](){return!0}};function Ui(n){return n==32||n==9||n==10||n==13}function kh(n,e=0){for(;e<n.length&&Ui(n.charCodeAt(e));)e++;return e}function x$(n,e,t){for(;e>t&&Ui(n.charCodeAt(e-1));)e--;return e}function t3(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function n3(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function Xx(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let i=1;for(let r=n.pos+1;r<n.text.length;r++){let s=n.text.charCodeAt(r);if(s==n.next)i++;else if(!Ui(s))return-1}return t&&n.next==45&&s3(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(c3.SetextHeading)>-1||i<3?-1:1}function i3(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function Ix(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Ui(n.text.charCodeAt(n.pos+1)))&&(!t||i3(e,ae.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function Vx(n,e,t){let i=n.pos,r=n.next;for(;r>=48&&r<=57;){i++;if(i==n.text.length)return-1;r=n.text.charCodeAt(i)}return i==n.pos||i>n.pos+9||r!=46&&r!=41||i<n.text.length-1&&!Ui(n.text.charCodeAt(i+1))||t&&!i3(e,ae.OrderedList)&&(n.skipSpace(i+1)==n.text.length||i>n.pos+1||n.next!=49)?-1:i+1-n.pos}function r3(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function s3(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&Ui(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const XS=/^[ \t]*$/,l3=/-->/,o3=/\?>/,IS=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,l3],[/^\s*<\?/,o3],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,XS],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,XS]];function a3(n,e,t){if(n.next!=60)return-1;let i=n.text.slice(n.pos);for(let r=0,s=IS.length-(t?1:0);r<s;r++)if(IS[r][0].test(i))return r;return-1}function k$(n,e){let t=n.countIndent(e,n.pos,n.indent),i=n.countIndent(n.skipSpace(e),e,t);return i>=t+5?t+1:i}function ml(n,e,t){let i=n.length-1;i>=0&&n[i].to==e&&n[i].type==ae.CodeText?n[i].to=t:n.push(We(ae.CodeText,e,t))}const Qp={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let i=e.findColumn(t),r=n.lineStart+i,s=n.lineStart+e.text.length,l=[],o=[];for(ml(l,r,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){ml(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c)}else{if(e.indent<t)break;{if(o.length){for(let h of o)h.type==ae.CodeText?ml(l,h.from,h.to):l.push(h);o=[]}ml(l,n.lineStart-1,n.lineStart);for(let h of e.markers)l.push(h);s=n.lineStart+e.text.length;let c=n.lineStart+e.findColumn(e.baseIndent+4);c<s&&ml(l,c,s)}}return o.length&&(o=o.filter(c=>c.type!=ae.CodeText),o.length&&(e.markers=o.concat(e.markers))),n.addNode(n.buffer.writeElements(l,-r).finish(ae.CodeBlock,s-r),r),!0},FencedCode(n,e){let t=t3(e);if(t<0)return!1;let i=n.lineStart+e.pos,r=e.next,s=t-e.pos,l=e.skipSpace(t),o=x$(e.text,e.text.length,l),c=[We(ae.CodeMark,i,i+s)];l<o&&c.push(We(ae.CodeInfo,n.lineStart+l,n.lineStart+o));for(let h=!0,d=!0,p=!1;n.nextLine()&&e.depth>=n.stack.length;h=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==r;)g++;if(g-e.pos>=s&&e.skipSpace(g)==e.text.length){for(let O of e.markers)c.push(O);d&&p&&ml(c,n.lineStart-1,n.lineStart),c.push(We(ae.CodeMark,n.lineStart+e.pos,n.lineStart+g)),n.nextLine();break}else{p=!0,h||(ml(c,n.lineStart-1,n.lineStart),d=!1);for(let v of e.markers)c.push(v);let O=n.lineStart+e.basePos,b=n.lineStart+e.text.length;O<b&&(ml(c,O,b),d=!1)}}return n.addNode(n.buffer.writeElements(c,-i).finish(ae.FencedCode,n.prevLineEnd()-i),i),!0},Blockquote(n,e){let t=n3(e);return t<0?!1:(n.startContext(ae.Blockquote,e.pos),n.addNode(ae.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(Xx(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(ae.HorizontalRule,t),!0},BulletList(n,e){let t=Ix(e,n,!1);if(t<0)return!1;n.block.type!=ae.BulletList&&n.startContext(ae.BulletList,e.basePos,e.next);let i=k$(e,e.pos+1);return n.startContext(ae.ListItem,e.basePos,i-e.baseIndent),n.addNode(ae.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},OrderedList(n,e){let t=Vx(e,n,!1);if(t<0)return!1;n.block.type!=ae.OrderedList&&n.startContext(ae.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let i=k$(e,e.pos+t);return n.startContext(ae.ListItem,e.basePos,i-e.baseIndent),n.addNode(ae.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},ATXHeading(n,e){let t=r3(e);if(t<0)return!1;let i=e.pos,r=n.lineStart+i,s=x$(e.text,e.text.length,i),l=s;for(;l>i&&e.text.charCodeAt(l-1)==e.next;)l--;(l==s||l==i||!Ui(e.text.charCodeAt(l-1)))&&(l=e.text.length);let o=n.buffer.write(ae.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(i+t+1,l),r+t+1),-r);l<e.text.length&&o.write(ae.HeaderMark,l-i,s-i);let c=o.finish(ae.ATXHeading1-1+t,e.text.length-i);return n.nextLine(),n.addNode(c,r),!0},HTMLBlock(n,e){let t=a3(e,n,!1);if(t<0)return!1;let i=n.lineStart+e.pos,r=IS[t][1],s=[],l=r!=XS;for(;!r.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){l=!1;break}for(let h of e.markers)s.push(h)}l&&n.nextLine();let o=r==l3?ae.CommentBlock:r==o3?ae.ProcessingInstructionBlock:ae.HTMLBlock,c=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-i).finish(o,c-i),i),!0},SetextHeading:void 0};class eJ{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,i){if(this.stage==-1)return!1;let r=i.content+`
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,i,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&kh(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,We(ae.LinkReference,this.start,this.start+i,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(y3(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(We(ae.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(g3(e,kh(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=kh(e,this.pos),i=0;if(t>this.pos){let r=O3(e,t,this.start);if(r){let s=Zb(e,r.to-this.start);s>0&&(this.nextStage(r),i=s)}}return i||(i=Zb(e,this.pos)),i>0&&i<e.length?i:-1}else return Zb(e,this.pos)}}}function Zb(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!Ui(t))return-1}return e}class tJ{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:s3(t),s=t.next;if(r<0)return!1;let l=We(ae.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,We(s==61?ae.SetextHeading1:ae.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),l])),!0}finish(){return!1}}const c3={LinkReference(n,e){return e.content.charCodeAt(0)==91?new eJ(e):null},SetextHeading(){return new tJ}},nJ=[(n,e)=>r3(e)>=0,(n,e)=>t3(e)>=0,(n,e)=>n3(e)>=0,(n,e)=>Ix(e,n,!0)>=0,(n,e)=>Vx(e,n,!0)>=0,(n,e)=>Xx(e,n,!0)>=0,(n,e)=>a3(e,n,!0)>=0],iJ={text:"",end:0};class rJ{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new JK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=dg.create(ae.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new oJ(i,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let i=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!r||e.markers[i].from<r.end);){let s=e.markers[i++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let i of this.parser.blockParsers)if(i){let r=i(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new KK(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let r=i(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,t))break e}for(let i of t.parsers)if(i.nextLine(this,e,t))return null;t.content+=`
`+e.scrub();for(let i of e.markers)t.marks.push(i)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=b3(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=iJ;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let i=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,l=this.lineChunkAt(s);t.end=s+l.length,t.text=t.text.slice(0,this.ranges[r-1].to-i)+l,i=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+ae[r.type]);let l=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>l&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),i;if(this.input.lineChunks)i=t==`
`?"":t;else{let r=t.indexOf(`
`);i=r<0?t:t.slice(0,r)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,i=0){this.block=dg.create(e,i,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,i=0){this.startContext(this.parser.getNodeType(e),t,i)}addNode(e,t,i){typeof e=="number"&&(e=new et(this.parser.nodeSet.types[e],Tc,Tc,(i??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(qS(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?u3(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let t=qS(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(ae.Paragraph,e.content.length),e.start)}elt(e,t,i,r){return typeof e=="string"?We(this.parser.getNodeType(e),t,i,r):new d3(e,t)}get buffer(){return new f3(this.parser.nodeSet)}}function u3(n,e,t,i,r){let s=n[e].to,l=[],o=[],c=t.from+i;function h(d,p){for(;p?d>=s:d>s;){let g=n[e+1].from-s;i+=g,d+=g,e++,s=n[e].to}}for(let d=t.firstChild;d;d=d.nextSibling){h(d.from+i,!0);let p=d.from+i,g,O=r.get(d.tree);O?g=O:d.to+i>s?(g=u3(n,e,d,i,r),h(d.to+i,!1)):g=d.toTree(),l.push(g),o.push(p-c)}return h(t.to+i,!1),new et(t.type,l,o,t.to+i-c,t.tree?t.tree.propValues:void 0)}class lO extends Sx{constructor(e,t,i,r,s,l,o,c,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=l,this.inlineParsers=o,this.inlineNames=c,this.wrappers=h,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,t,i){let r=new rJ(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}configure(e){let t=VS(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),o=this.blockNames.slice(),c=this.inlineParsers.slice(),h=this.inlineNames.slice(),d=this.endLeafBlock.slice(),p=this.wrappers;if(Zu(t.defineNodes)){r=Object.assign({},r);let g=i.types.slice(),O;for(let b of t.defineNodes){let{name:v,block:x,composite:k,style:C}=typeof b=="string"?{name:b}:b;if(g.some(E=>E.name==v))continue;k&&(r[g.length]=(E,D,$)=>k(D,$,E.value));let A=g.length,P=k?["Block","BlockContext"]:x?A>=ae.ATXHeading1&&A<=ae.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(en.define({id:A,name:v,props:P&&[[De.group,P]]})),C&&(O||(O={}),Array.isArray(C)||C instanceof gi?O[v]=C:Object.assign(O,C))}i=new bf(g),O&&(i=i.extend(Rc(O)))}if(Zu(t.props)&&(i=i.extend(...t.props)),Zu(t.remove))for(let g of t.remove){let O=this.blockNames.indexOf(g),b=this.inlineNames.indexOf(g);O>-1&&(s[O]=l[O]=void 0),b>-1&&(c[b]=void 0)}if(Zu(t.parseBlock))for(let g of t.parseBlock){let O=o.indexOf(g.name);if(O>-1)s[O]=g.parse,l[O]=g.leaf;else{let b=g.before?Ep(o,g.before):g.after?Ep(o,g.after)+1:o.length-1;s.splice(b,0,g.parse),l.splice(b,0,g.leaf),o.splice(b,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(Zu(t.parseInline))for(let g of t.parseInline){let O=h.indexOf(g.name);if(O>-1)c[O]=g.parse;else{let b=g.before?Ep(h,g.before):g.after?Ep(h,g.after)+1:h.length-1;c.splice(b,0,g.parse),h.splice(b,0,g.name)}}return t.wrap&&(p=p.concat(t.wrap)),new lO(i,s,l,o,d,r,c,h,p)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let i=new qx(this,e,t);e:for(let r=t;r<i.end;){let s=i.char(r);for(let l of this.inlineParsers)if(l){let o=l(i,s,r);if(o>=0){r=o;continue e}}r++}return i.resolveMarkers(0)}}function Zu(n){return n!=null&&n.length>0}function VS(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=VS(n[0]);if(n.length==1)return e;let t=VS(n.slice(1));if(!t||!e)return e||t;let i=(l,o)=>(l||Tc).concat(o||Tc),r=e.wrap,s=t.wrap;return{props:i(e.props,t.props),defineNodes:i(e.defineNodes,t.defineNodes),parseBlock:i(e.parseBlock,t.parseBlock),parseInline:i(e.parseInline,t.parseInline),remove:i(e.remove,t.remove),wrap:r?s?(l,o,c,h)=>r(s(l,o,c,h),o,c,h):r:s}}function Ep(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let h3=[en.none];for(let n=1,e;e=ae[n];n++)h3[n]=en.define({id:n,name:e,props:n>=ae.Escape?[]:[[De.group,n in e3?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Tc=[];class f3{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,r=0){return this.content.push(e,t,i,4+r*4),this}writeElements(e,t=0){for(let i of e)i.writeTo(this,t);return this}finish(e,t){return et.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let sf=class{constructor(e,t,i,r=Tc){this.type=e,this.from=t,this.to=i,this.children=r}writeTo(e,t){let i=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-i)}toTree(e){return new f3(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class d3{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Tc}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function We(n,e,t,i){return new sf(n,e,t,i)}const p3={resolve:"Emphasis",mark:"EmphasisMark"},m3={resolve:"Emphasis",mark:"EmphasisMark"},xo={},pg={};class mi{constructor(e,t,i,r){this.type=e,this.from=t,this.to=i,this.side=r}}const w$="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let lf=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{lf=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Xb={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let i=n.char(t+1);for(let r=0;r<w$.length;r++)if(w$.charCodeAt(r)==i)return n.append(We(ae.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let i=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return i?n.append(We(ae.Entity,t,t+1+i[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let i=t+1;for(;i<n.end&&n.char(i)==96;)i++;let r=i-t,s=0;for(;i<n.end;i++)if(n.char(i)==96){if(s++,s==r&&n.char(i+1)!=96)return n.append(We(ae.InlineCode,t,i+1,[We(ae.CodeMark,t,t+r),We(ae.CodeMark,i+1-r,i+1)]))}else s=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let i=n.slice(t+1,n.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return n.append(We(ae.Autolink,t,t+1+r[0].length,[We(ae.LinkMark,t,t+1),We(ae.URL,t+1,t+r[0].length),We(ae.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return n.append(We(ae.Comment,t,t+1+s[0].length));let l=/^\?[^]*?\?>/.exec(i);if(l)return n.append(We(ae.ProcessingInstruction,t,t+1+l[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return o?n.append(We(ae.HTMLTag,t,t+1+o[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let i=t+1;for(;n.char(i)==e;)i++;let r=n.slice(t-1,t),s=n.slice(i,i+1),l=lf.test(r),o=lf.test(s),c=/\s|^$/.test(r),h=/\s|^$/.test(s),d=!h&&(!o||c||l),p=!c&&(!l||h||o),g=d&&(e==42||!p||l),O=p&&(e==42||!d||o);return n.append(new mi(e==95?p3:m3,t,i,(g?1:0)|(O?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(We(ae.HardBreak,t,t+2));if(e==32){let i=t+1;for(;n.char(i)==32;)i++;if(n.char(i)==10&&i>=t+2)return n.append(We(ae.HardBreak,t,i+1))}return-1},Link(n,e,t){return e==91?n.append(new mi(xo,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new mi(pg,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let i=n.parts.length-1;i>=0;i--){let r=n.parts[i];if(r instanceof mi&&(r.type==xo||r.type==pg)){if(!r.side||n.skipSpace(r.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[i]=null,-1;let s=n.takeContent(i),l=n.parts[i]=sJ(n,s,r.type==xo?ae.Link:ae.Image,r.from,t+1);if(r.type==xo)for(let o=0;o<i;o++){let c=n.parts[o];c instanceof mi&&c.type==xo&&(c.side=0)}return l.to}}return-1}};function sJ(n,e,t,i,r){let{text:s}=n,l=n.char(r),o=r;if(e.unshift(We(ae.LinkMark,i,i+(t==ae.Image?2:1))),e.push(We(ae.LinkMark,r-1,r)),l==40){let c=n.skipSpace(r+1),h=g3(s,c-n.offset,n.offset),d;h&&(c=n.skipSpace(h.to),c!=h.to&&(d=O3(s,c-n.offset,n.offset),d&&(c=n.skipSpace(d.to)))),n.char(c)==41&&(e.push(We(ae.LinkMark,r,r+1)),o=c+1,h&&e.push(h),d&&e.push(d),e.push(We(ae.LinkMark,c,o)))}else if(l==91){let c=y3(s,r-n.offset,n.offset,!1);c&&(e.push(c),o=c.to)}return We(t,i,o,e)}function g3(n,e,t){if(n.charCodeAt(e)==60){for(let r=e+1;r<n.length;r++){let s=n.charCodeAt(r);if(s==62)return We(ae.URL,e+t,r+1+t);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let l=!1;s<n.length;s++){let o=n.charCodeAt(s);if(Ui(o))break;if(l)l=!1;else if(o==40)r++;else if(o==41){if(!r)break;r--}else o==92&&(l=!0)}return s>e?We(ae.URL,e+t,s+t):s==n.length?null:!1}}function O3(n,e,t){let i=n.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,l=!1;s<n.length;s++){let o=n.charCodeAt(s);if(l)l=!1;else{if(o==r)return We(ae.LinkTitle,e+t,s+1+t);o==92&&(l=!0)}}return null}function y3(n,e,t,i){for(let r=!1,s=e+1,l=Math.min(n.length,s+999);s<l;s++){let o=n.charCodeAt(s);if(r)r=!1;else{if(o==93)return i?!1:We(ae.LinkLabel,e+t,s+1+t);if(i&&!Ui(o)&&(i=!1),o==91)return!1;o==92&&(r=!0)}}return null}class qx{constructor(e,t,i){this.parser=e,this.text=t,this.offset=i,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,r,s){return this.append(new mi(e,t,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof mi&&(t.type==xo||t.type==pg))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i<this.parts.length;i++){let r=this.parts[i];if(!(r instanceof mi&&r.type.resolve&&r.side&2))continue;let s=r.type==p3||r.type==m3,l=r.to-r.from,o,c=i-1;for(;c>=e;c--){let v=this.parts[c];if(v instanceof mi&&v.side&1&&v.type==r.type&&!(s&&(r.side&1||v.side&2)&&(v.to-v.from+l)%3==0&&((v.to-v.from)%3||l%3))){o=v;break}}if(!o)continue;let h=r.type.resolve,d=[],p=o.from,g=r.to;if(s){let v=Math.min(2,o.to-o.from,l);p=o.to-v,g=r.from+v,h=v==1?"Emphasis":"StrongEmphasis"}o.type.mark&&d.push(this.elt(o.type.mark,p,o.to));for(let v=c+1;v<i;v++)this.parts[v]instanceof sf&&d.push(this.parts[v]),this.parts[v]=null;r.type.mark&&d.push(this.elt(r.type.mark,r.from,g));let O=this.elt(h,p,g,d);this.parts[c]=s&&o.from!=p?new mi(o.type,o.from,p,o.side):null,(this.parts[i]=s&&r.to!=g?new mi(r.type,g,r.to,r.side):null)?this.parts.splice(i,0,O):this.parts[i]=O}let t=[];for(let i=e;i<this.parts.length;i++){let r=this.parts[i];r instanceof sf&&t.push(r)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let i=this.parts[t];if(i instanceof mi&&i.type==e&&i.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof mi?t:null}skipSpace(e){return kh(this.text,e-this.offset)+this.offset}elt(e,t,i,r){return typeof e=="string"?We(this.parser.getNodeType(e),t,i,r):new d3(e,t)}}qx.linkStart=xo;qx.imageStart=pg;function qS(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),i=0;for(let r of e){for(;i<t.length&&t[i].to<r.to;)i++;if(i<t.length&&t[i].from<r.from){let s=t[i];s instanceof sf&&(t[i]=new sf(s.type,s.from,s.to,qS(s.children,[r])))}else t.splice(i++,0,r)}return t}const lJ=[ae.CodeBlock,ae.ListItem,ae.OrderedList,ae.BulletList];let oJ=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=t;if(!i.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(De.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,l=s,o=e.block.children.length,c=l,h=o;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let d=b3(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,d);else{let p=new et(e.parser.nodeSet.types[ae.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,t.tree),e.addNode(p,d)}if(t.type.is("Block")&&(lJ.indexOf(t.type.id)<0?(l=t.to-i,o=e.block.children.length):(l=c,o=h),c=t.to-i,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return l-s}};function b3(n,e){let t=n;for(let i=1;i<e.length;i++){let r=e[i-1].to,s=e[i].from;r<n&&(t-=s-r)}return t}const aJ=Rc({"Blockquote/...":M.quote,HorizontalRule:M.contentSeparator,"ATXHeading1/... SetextHeading1/...":M.heading1,"ATXHeading2/... SetextHeading2/...":M.heading2,"ATXHeading3/...":M.heading3,"ATXHeading4/...":M.heading4,"ATXHeading5/...":M.heading5,"ATXHeading6/...":M.heading6,"Comment CommentBlock":M.comment,Escape:M.escape,Entity:M.character,"Emphasis/...":M.emphasis,"StrongEmphasis/...":M.strong,"Link/... Image/...":M.link,"OrderedList/... BulletList/...":M.list,"BlockQuote/...":M.quote,"InlineCode CodeText":M.monospace,"URL Autolink":M.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":M.processingInstruction,"CodeInfo LinkLabel":M.labelName,LinkTitle:M.string,Paragraph:M.content}),cJ=new lO(new bf(h3).extend(aJ),Object.keys(Qp).map(n=>Qp[n]),Object.keys(Qp).map(n=>c3[n]),Object.keys(Qp),nJ,e3,Object.keys(Xb).map(n=>Xb[n]),Object.keys(Xb),[]);function uJ(n,e,t){let i=[];for(let r=n.firstChild,s=e;;r=r.nextSibling){let l=r?r.from:t;if(l>s&&i.push({from:s,to:l}),!r)break;s=r.to}return i}function hJ(n){let{codeParser:e,htmlParser:t}=n;return{wrap:Qz((r,s)=>{let l=r.type.id;if(e&&(l==ae.CodeBlock||l==ae.FencedCode)){let o="";if(l==ae.FencedCode){let h=r.node.getChild(ae.CodeInfo);h&&(o=s.read(h.from,h.to))}let c=e(o);if(c)return{parser:c,overlay:h=>h.type.id==ae.CodeText,bracketed:l==ae.FencedCode}}else if(t&&(l==ae.HTMLBlock||l==ae.HTMLTag||l==ae.CommentBlock))return{parser:t,overlay:uJ(r.node,r.from,r.to)};return null})}}const fJ={resolve:"Strikethrough",mark:"StrikethroughMark"},dJ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":M.strikethrough}},{name:"StrikethroughMark",style:M.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let i=n.slice(t-1,t),r=n.slice(t+2,t+3),s=/\s|^$/.test(i),l=/\s|^$/.test(r),o=lf.test(i),c=lf.test(r);return n.addDelimiter(fJ,t,t+2,!l&&(!c||s||o),!s&&(!o||l||c))},after:"Emphasis"}]};function wh(n,e,t=0,i,r=0){let s=0,l=!0,o=-1,c=-1,h=!1,d=()=>{i.push(n.elt("TableCell",r+o,r+c,n.parser.parseInline(e.slice(o,c),r+o)))};for(let p=t;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!h?((!l||o>-1)&&s++,l=!1,i&&(o>-1&&d(),i.push(n.elt("TableDelimiter",p+r,p+r+1))),o=c=-1):(h||g!=32&&g!=9)&&(o<0&&(o=p),c=p+1),h=!h&&g==92}return o>-1&&(s++,i&&d()),s}function T$(n,e){for(let t=e;t<n.length;t++){let i=n.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}const S3=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class C${constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&S3.test(r=t.text.slice(t.pos))){let s=[];wh(e,i.content,0,s,i.start)==wh(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];wh(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const pJ={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":M.heading}},"TableRow",{name:"TableCell",style:M.content},{name:"TableDelimiter",style:M.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return T$(e.content,0)?new C$:null},endLeaf(n,e,t){if(t.parsers.some(r=>r instanceof C$)||!T$(e.text,e.basePos))return!1;let i=n.peekLine();return S3.test(i)&&wh(n,e.text,e.basePos)==wh(n,i,e.basePos)},before:"SetextHeading"}]};class mJ{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const gJ={defineNodes:[{name:"Task",block:!0,style:M.list},{name:"TaskMarker",style:M.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new mJ:null},after:"SetextHeading"}]},A$=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,M$=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,OJ=/[\w-]+\.[\w-]+($|\/)/,Q$=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,E$=/\/[a-zA-Z\d@.]+/gy;function $$(n,e,t,i){let r=0;for(let s=e;s<t;s++)n[s]==i&&r++;return r}function yJ(n,e){M$.lastIndex=e;let t=M$.exec(n);if(!t||OJ.exec(t[0])[0].indexOf("_")>-1)return-1;let i=e+t[0].length;for(;;){let r=n[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&$$(n,e,i,")")>$$(n,e,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,i))))i=e+s.index;else break}return i}function R$(n,e){Q$.lastIndex=e;let t=Q$.exec(n);if(!t)return-1;let i=t[0][t[0].length-1];return i=="_"||i=="-"?-1:e+t[0].length-(i=="."?1:0)}const bJ={parseInline:[{name:"Autolink",parse(n,e,t){let i=t-n.offset;if(i&&/\w/.test(n.text[i-1]))return-1;A$.lastIndex=i;let r=A$.exec(n.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=yJ(n.text,i+r[0].length),s>-1&&n.hasOpenLink){let l=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(i,s));s=i+l[0].length}}else r[3]?s=R$(n.text,i):(s=R$(n.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(E$.lastIndex=s,r=E$.exec(n.text),r&&(s=r.index+r[0].length)));return s<0?-1:(n.addElement(n.elt("URL",t,s+n.offset)),s+n.offset)}}]},SJ=[pJ,gJ,dJ,bJ];function v3(n,e,t){return(i,r,s)=>{if(r!=n||i.char(s+1)==n)return-1;let l=[i.elt(t,s,s+1)];for(let o=s+1;o<i.end;o++){let c=i.char(o);if(c==n)return i.addElement(i.elt(e,s,o+1,l.concat(i.elt(t,o,o+1))));if(c==92&&l.push(i.elt("Escape",o,o+++2)),Ui(c))break}return-1}}const vJ={defineNodes:[{name:"Superscript",style:M.special(M.content)},{name:"SuperscriptMark",style:M.processingInstruction}],parseInline:[{name:"Superscript",parse:v3(94,"Superscript","SuperscriptMark")}]},xJ={defineNodes:[{name:"Subscript",style:M.special(M.content)},{name:"SubscriptMark",style:M.processingInstruction}],parseInline:[{name:"Subscript",parse:v3(126,"Subscript","SubscriptMark")}]},kJ={defineNodes:[{name:"Emoji",style:M.character}],parseInline:[{name:"Emoji",parse(n,e,t){let i;return e!=58||!(i=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+i[0].length))}}]};var P$={};class mg{constructor(e,t,i,r,s,l,o,c,h,d=0,p){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=c,this.curContext=h,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new mg(e,[],t,i,i,0,[],0,r?new D$(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=s.dynamicPrecedence(r);if(o&&(this.score+=o),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(r,this.reducePos);return}let c=this.stack.length-(i-1)*3-(e&262144?6:0),h=c?this.stack[c-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-h;d>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let O=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,O,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let O=this.stack[c-3];this.state=s.getGoto(O,r,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this.buffer.length;if(l>0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(t==i)return;if(this.buffer[l-2]>=t){this.buffer[l-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let o=!1;for(let c=l;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:l}=this.p;this.pos=r;let o=l.stateFlag(s,1);!o&&(r>i||t<=l.maxNode)&&(this.reducePos=r),this.pushState(s,o?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}else this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4)}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new mg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new wJ(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,l;s<t.length;s+=2)(l=t[s+1])!=this.state&&this.p.parser.hasAction(l,e)&&r.push(t[s],l);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let l=t[s+1];r.some((o,c)=>c&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r<t.length&&i.length<4;r+=2){let s=t[r+1];if(s==this.state)continue;let l=this.split();l.pushState(s,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(t[r],this.pos),l.reducePos=this.pos,l.score-=200,i.push(l)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let c=l&65535,h=this.stack.length-o*3;if(h>=0&&e.getGoto(this.stack[h],c,!1)>=0)return o<<19|65536|c}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new D$(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class D${constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class wJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class gg{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new gg(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new gg(this.stack,this.pos,this.index)}}function ih(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i<n.length;){let s=0;for(;;){let l=n.charCodeAt(i++),o=!1;if(l==126){s=65535;break}l>=92&&l--,l>=34&&l--;let c=l-32;if(c>=46&&(c-=46,o=!0),s+=c,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Up{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const N$=new Up;class TJ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=N$,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let l=this.ranges[--r];s-=i.from-l.to,i=l}for(;t<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let l=this.rangeIndex,o=this.range;for(;o.to<=i;)o=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=N$,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class oc{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;x3(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}oc.prototype.contextual=oc.prototype.fallback=oc.prototype.extend=!1;class Og{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?ih(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(x3(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Og.prototype.contextual=oc.prototype.fallback=oc.prototype.extend=!1;class ki{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function x3(n,e,t,i,r,s){let l=0,o=1<<i,{dialect:c}=t.p.parser;e:for(;(o&n[l])!=0;){let h=n[l+1];for(let O=l+3;O<h;O+=2)if((n[O+1]&o)>0){let b=n[O];if(c.allows(b)&&(e.token.value==-1||e.token.value==b||CJ(b,e.token.value,r,s))){e.acceptToken(b);break}}let d=e.next,p=0,g=n[l+2];if(e.next<0&&g>p&&n[h+g*3-3]==65535){l=n[h+g*3-1];continue e}for(;p<g;){let O=p+g>>1,b=h+O+(O<<1),v=n[b],x=n[b+1]||65536;if(d<v)g=O;else if(d>=x)p=O+1;else{l=n[b+2],e.advance();continue e}}break}}function z$(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function CJ(n,e,t,i){let r=z$(t,i,e);return r<0||z$(t,i,n)<r}const fi=typeof process<"u"&&P$&&/\bparse\b/.test(P$.LOG);let Ib=null;function L$(n,e,t){let i=n.cursor(nt.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class AJ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?L$(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?L$(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],l=this.start[t]+i.positions[r];if(l>e)return this.nextStart=l,null;if(s instanceof et){if(l==e){if(l<this.safeFrom)return null;let o=l+s.length;if(o<=this.safeTo){let c=s.prop(De.lookAhead);if(!c||o+c<this.fragment.to)return s}}this.index[t]++,l+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class MJ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Up)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,c=0;for(let h=0;h<s.length;h++){if((1<<h&l)==0)continue;let d=s[h],p=this.tokens[h];if(!(i&&!d.fallback)&&((d.contextual||p.start!=e.pos||p.mask!=l||p.context!=o)&&(this.updateCachedToken(p,d,e),p.mask=l,p.context=o),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!d.extend&&(i=p,t>g))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!i&&e.pos==this.stream.end&&(i=new Up,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Up,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l<s.specialized.length;l++)if(s.specialized[l]==e.value){let o=s.specializers[l](this.stream.read(e.start,e.end),i);if(o>=0&&i.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=i,r}addActions(e,t,i,r){let{state:s}=e,{parser:l}=e.p,{data:o}=l;for(let c=0;c<2;c++)for(let h=l.stateSlot(s,c?2:1);;h+=3){if(o[h]==65535)if(o[h+1]==1)h=vs(o,h+2);else{r==0&&o[h+1]==2&&(r=this.putAction(vs(o,h+2),t,i,r));break}o[h]==t&&(r=this.putAction(vs(o,h+1),t,i,r))}return r}}class QJ{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new TJ(t,r),this.tokens=new MJ(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[mg.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new AJ(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let o=e[l];for(;;){if(this.tokens.mainToken=null,o.pos>t)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let c=this.tokens.getMainToken(o);s.push(c.value,c.end)}}break}}if(!i.length){let l=r&&$J(r);if(l)return fi&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw fi&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return fi&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,c)=>c.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l<i.length-1;l++){let o=i[l];for(let c=l+1;c<i.length;c++){let h=i[c];if(o.sameState(h)||o.buffer.length>500&&h.buffer.length>500)if((o.score-h.score||o.buffer.length-h.buffer.length)>0)i.splice(c--,1);else{i.splice(l--,1);continue e}}}i.length>12&&(i.sort((l,o)=>o.score-l.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let l=1;l<i.length;l++)i[l].pos<this.minStackPos&&(this.minStackPos=i[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:s}=this,l=fi?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,d=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!h||(p.prop(De.contextHash)||0)==d))return e.useNode(p,g),fi&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof et)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof et&&p.positions[0]==0)p=O;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),fi&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let h=0;h<c.length;){let d=c[h++],p=c[h++],g=c[h++],O=h==c.length||!i,b=O?e:e.split(),v=this.tokens.mainToken;if(b.apply(d,p,v?v.start:b.pos,g),fi&&console.log(l+this.stackID(b)+` (via ${(d&65536)==0?"shift":`reduce of ${s.getName(d&65535)}`} for ${s.getName(p)} @ ${r}${b==e?"":", split"})`),O)return!0;b.pos>r?t.push(b):i.push(b)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return _$(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l<e.length;l++){let o=e[l],c=t[l<<1],h=t[(l<<1)+1],d=fi?this.stackID(o)+" -> ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),fi&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let p=o.split(),g=d;for(let O=0;O<10&&p.forceReduce()&&(fi&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,i));O++)fi&&(g=this.stackID(p)+" -> ");for(let O of o.recoverByInsert(c))fi&&console.log(d+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,i);this.stream.end>o.pos?(h==o.pos&&(h++,c=0),o.recoverByDelete(c,h),fi&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(c)})`),_$(o,i)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),et.build({buffer:gg.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Ib||(Ib=new WeakMap)).get(e);return t||Ib.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function _$(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class EJ{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const Vb=n=>n;class k3{constructor(e){this.start=e.start,this.shift=e.shift||Vb,this.reduce=e.reduce||Vb,this.reuse=e.reuse||Vb,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Cc extends Sx{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;o<e.repeatNodeCount;o++)t.push("");let i=Object.keys(e.topRules).map(o=>e.topRules[o][1]),r=[];for(let o=0;o<t.length;o++)r.push([]);function s(o,c,h){r[o].push([c,c.deserialize(String(h))])}if(e.nodeProps)for(let o of e.nodeProps){let c=o[0];typeof c=="string"&&(c=De[c]);for(let h=1;h<o.length;){let d=o[h++];if(d>=0)s(d,c,o[h++]);else{let p=o[h+-d];for(let g=-d;g>0;g--)s(o[h++],c,p);h++}}}this.nodeSet=new bf(t.map((o,c)=>en.define({name:c>=this.minRepeatTerm?void 0:o,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=wz;let l=ih(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(B$),this.states=ih(e.states,Uint32Array),this.data=ih(e.stateData),this.goto=ih(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new oc(l,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new QJ(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,c=r[s++];if(o&&i)return c;for(let h=s+(l>>1);s<h;s++)if(r[s]==e)return c;if(o)return-1}}hasAction(e,t){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),l;;s+=3){if((l=i[s])==65535)if(i[s+1]==1)l=i[s=vs(i,s+2)];else{if(i[s+1]==2)return vs(i,s+2);break}if(l==t||l==0)return vs(i,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vs(this.data,s+2);else break;r=t(vs(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=vs(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(Cc.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=B$(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!i[s])for(let l=this.dialects[t[s]],o;(o=this.data[l++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new EJ(e,i,r)}static deserialize(e){return new Cc(e)}}function vs(n,e){return n[e]|n[e+1]<<16}function $J(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function B$(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const RJ=55,PJ=1,DJ=56,NJ=2,zJ=57,LJ=3,j$=4,_J=5,Hx=6,w3=7,T3=8,C3=9,A3=10,BJ=11,jJ=12,ZJ=13,qb=58,XJ=14,IJ=15,Z$=59,M3=21,VJ=23,Q3=24,qJ=25,HS=27,E3=28,HJ=29,YJ=32,UJ=35,WJ=37,GJ=38,FJ=0,KJ=1,JJ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},eee={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},X$={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function tee(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let I$=null,V$=null,q$=0;function YS(n,e){let t=n.pos+e;if(q$==t&&V$==n)return I$;let i=n.peek(e),r="";for(;tee(i);)r+=String.fromCharCode(i),i=n.peek(++e);return V$=n,q$=t,I$=r?r.toLowerCase():i==nee||i==iee?void 0:null}const $3=60,yg=62,Yx=47,nee=63,iee=33,ree=45;function H$(n,e){this.name=n,this.parent=e}const see=[Hx,A3,w3,T3,C3],lee=new k3({start:null,shift(n,e,t,i){return see.indexOf(e)>-1?new H$(YS(i,1)||"",n):n},reduce(n,e){return e==M3&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Hx||r==WJ?new H$(YS(i,1)||"",n):n},strict:!1}),oee=new ki((n,e)=>{if(n.next!=$3){n.next<0&&e.context&&n.acceptToken(qb);return}n.advance();let t=n.next==Yx;t&&n.advance();let i=YS(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?IJ:XJ);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(BJ);if(r&&eee[r])return n.acceptToken(qb,-2);if(e.dialectEnabled(FJ))return n.acceptToken(jJ);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(ZJ)}else{if(i=="script")return n.acceptToken(w3);if(i=="style")return n.acceptToken(T3);if(i=="textarea")return n.acceptToken(C3);if(JJ.hasOwnProperty(i))return n.acceptToken(A3);r&&X$[r]&&X$[r][i]?n.acceptToken(qb,-1):n.acceptToken(Hx)}},{contextual:!0}),aee=new ki(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(Z$);break}if(n.next==ree)e++;else if(n.next==yg&&e>=2){t>=3&&n.acceptToken(Z$,-2);break}else e=0;n.advance()}});function cee(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const uee=new ki((n,e)=>{if(n.next==Yx&&n.peek(1)==yg){let t=e.dialectEnabled(KJ)||cee(e.context);n.acceptToken(t?_J:j$,2)}else n.next==yg&&n.acceptToken(j$,1)});function Ux(n,e,t){let i=2+n.length;return new ki(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==$3||s==1&&r.next==Yx||s>=2&&s<i&&r.next==n.charCodeAt(s-2))s++,l++;else if(s==i&&r.next==yg){o>l?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const hee=Ux("script",RJ,PJ),fee=Ux("style",DJ,NJ),dee=Ux("textarea",zJ,LJ),pee=Rc({"Text RawText IncompleteTag IncompleteCloseTag":M.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":M.angleBracket,TagName:M.tagName,"MismatchedCloseTag/TagName":[M.tagName,M.invalid],AttributeName:M.attributeName,"AttributeValue UnquotedAttributeValue":M.attributeValue,Is:M.definitionOperator,"EntityReference CharacterReference":M.character,Comment:M.blockComment,ProcessingInst:M.processingInstruction,DoctypeDecl:M.documentMeta}),mee=Cc.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O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WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:lee,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"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!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[hee,fee,dee,uee,oee,aee,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function R3(n,e){let t=Object.create(null);for(let i of n.getChildren(Q3)){let r=i.getChild(qJ),s=i.getChild(HS)||i.getChild(E3);r&&(t[e.read(r.from,r.to)]=s?s.type.id==HS?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function Y$(n,e){let t=n.getChild(VJ);return t?e.read(t.from,t.to):" "}function Hb(n,e,t){let i;for(let r of t)if(!r.attrs||r.attrs(i||(i=R3(n.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function P3(n=[],e=[]){let t=[],i=[],r=[],s=[];for(let o of n)(o.tag=="script"?t:o.tag=="style"?i:o.tag=="textarea"?r:s).push(o);let l=e.length?Object.create(null):null;for(let o of e)(l[o.name]||(l[o.name]=[])).push(o);return Qz((o,c)=>{let h=o.type.id;if(h==HJ)return Hb(o,c,t);if(h==YJ)return Hb(o,c,i);if(h==UJ)return Hb(o,c,r);if(h==M3&&s.length){let d=o.node,p=d.firstChild,g=p&&Y$(p,c),O;if(g){for(let b of s)if(b.tag==g&&(!b.attrs||b.attrs(O||(O=R3(p,c))))){let v=d.lastChild,x=v.type.id==GJ?v.from:d.to;if(x>p.to)return{parser:b.parser,overlay:[{from:p.to,to:x}]}}}}if(l&&h==Q3){let d=o.node,p;if(p=d.firstChild){let g=l[c.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=Y$(d.parent,c))continue;let b=d.lastChild;if(b.type.id==HS){let v=b.from+1,x=b.lastChild,k=b.to-(x&&x.isError?0:1);if(k>v)return{parser:O.parser,overlay:[{from:v,to:k}],bracketed:!0}}else if(b.type.id==E3)return{parser:O.parser,overlay:[{from:b.from,to:b.to}]}}}}return null})}const gee=135,U$=1,Oee=136,yee=137,D3=2,bee=138,See=3,vee=4,N3=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],xee=58,kee=40,z3=95,wee=91,Wp=45,Tee=46,Cee=35,Aee=37,Mee=38,Qee=92,Eee=10,$ee=42;function of(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function Wx(n){return n>=48&&n<=57}function W$(n){return Wx(n)||n>=97&&n<=102||n>=65&&n<=70}const L3=(n,e,t)=>(i,r)=>{for(let s=!1,l=0,o=0;;o++){let{next:c}=i;if(of(c)||c==Wp||c==z3||s&&Wx(c))!s&&(c!=Wp||o>0)&&(s=!0),l===o&&c==Wp&&l++,i.advance();else if(c==Qee&&i.peek(1)!=Eee){if(i.advance(),W$(i.next)){do i.advance();while(W$(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(l==2&&r.canShift(D3)?e:c==kee?t:n);break}}},Ree=new ki(L3(Oee,D3,yee),{contextual:!0}),Pee=new ki(L3(bee,See,vee),{contextual:!0}),Dee=new ki(n=>{if(N3.includes(n.peek(-1))){let{next:e}=n;(of(e)||e==z3||e==Cee||e==Tee||e==$ee||e==wee||e==xee&&of(n.peek(1))||e==Wp||e==Mee)&&n.acceptToken(gee)}}),Nee=new ki(n=>{if(!N3.includes(n.peek(-1))){let{next:e}=n;if(e==Aee&&(n.advance(),n.acceptToken(U$)),of(e)){do n.advance();while(of(n.next)||Wx(n.next));n.acceptToken(U$)}}}),zee=Rc({"AtKeyword import charset namespace keyframes media supports font-feature-values":M.definitionKeyword,"from to selector scope MatchFlag":M.keyword,NamespaceName:M.namespace,KeyframeName:M.labelName,KeyframeRangeName:M.operatorKeyword,TagName:M.tagName,ClassName:M.className,PseudoClassName:M.constant(M.className),IdName:M.labelName,"FeatureName PropertyName":M.propertyName,AttributeName:M.attributeName,NumberLiteral:M.number,KeywordQuery:M.keyword,UnaryQueryOp:M.operatorKeyword,"CallTag ValueName FontName":M.atom,VariableName:M.variableName,Callee:M.operatorKeyword,Unit:M.unit,"UniversalSelector NestingSelector":M.definitionOperator,"MatchOp CompareOp":M.compareOperator,"ChildOp SiblingOp, LogicOp":M.logicOperator,BinOp:M.arithmeticOperator,Important:M.modifier,Comment:M.blockComment,ColorLiteral:M.color,"ParenthesizedContent StringLiteral":M.string,":":M.punctuation,"PseudoOp #":M.derefOperator,"; , |":M.separator,"( )":M.paren,"[ ]":M.squareBracket,"{ }":M.brace}),Lee={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},_ee={__proto__:null,or:104,and:104,not:112,only:112,layer:186},Bee={__proto__:null,selector:118,layer:182},jee={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},Zee={__proto__:null,to:223},Xee=Cc.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQa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) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[zee],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%o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jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Dee,Nee,Ree,Pee,1,2,3,4,new Og("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:n=>Lee[n]||-1},{term:138,get:n=>_ee[n]||-1},{term:4,get:n=>Bee[n]||-1},{term:28,get:n=>jee[n]||-1},{term:136,get:n=>Zee[n]||-1}],tokenPrec:2256});let Yb=null;function Ub(){if(!Yb&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Yb=e.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return Yb||[]}const G$=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),F$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),Iee=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),Vee=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),Os=/^(\w[\w-]*|-\w[\w-]*|)$/,qee=/^-(-[\w-]*)?$/;function Hee(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const K$=new Mz,Yee=["Declaration"];function Uee(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function _3(n,e,t){if(e.to-e.from>4096){let i=K$.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(nt.IncludeAnonymous);if(l.firstChild())do for(let o of _3(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return K$.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(Yee)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const Wee=n=>e=>{let{state:t,pos:i}=e,r=Ot(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:Ub(),validFor:Os};if(r.name=="ValueName")return{from:r.from,options:F$,validFor:Os};if(r.name=="PseudoClassName")return{from:r.from,options:G$,validFor:Os};if(n(r)||(e.explicit||s)&&Hee(r,t.doc))return{from:n(r)||s?r.from:i,options:_3(t.doc,Uee(r),n),validFor:qee};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:Ub(),validFor:Os};return{from:r.from,options:Iee,validFor:Os}}if(r.name=="AtKeyword")return{from:r.from,options:Vee,validFor:Os};if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:G$,validFor:Os}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:F$,validFor:Os}:l.name=="Block"||l.name=="Styles"?{from:i,options:Ub(),validFor:Os}:null},Gee=Wee(n=>n.name=="VariableName"),bg=xc.define({name:"css",parser:Xee.configure({props:[Sf.add({Declaration:Hp()}),Dc.add({"Block KeyframeList":zz})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Fee(){return new Gh(bg,bg.data.of({autocomplete:Gee}))}const Kee=316,Jee=317,J$=1,ete=2,tte=3,nte=4,ite=318,rte=320,ste=321,lte=5,ote=6,ate=0,US=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],B3=125,cte=59,WS=47,ute=42,hte=43,fte=45,dte=60,pte=44,mte=63,gte=46,Ote=91,yte=new k3({start:!1,shift(n,e){return e==lte||e==ote||e==rte?n:e==ste},strict:!1}),bte=new ki((n,e)=>{let{next:t}=n;(t==B3||t==-1||e.context)&&n.acceptToken(ite)},{contextual:!0,fallback:!0}),Ste=new ki((n,e)=>{let{next:t}=n,i;US.indexOf(t)>-1||t==WS&&((i=n.peek(1))==WS||i==ute)||t!=B3&&t!=cte&&t!=-1&&!e.context&&n.acceptToken(Kee)},{contextual:!0}),vte=new ki((n,e)=>{n.next==Ote&&!e.context&&n.acceptToken(Jee)},{contextual:!0}),xte=new ki((n,e)=>{let{next:t}=n;if(t==hte||t==fte){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(J$);n.acceptToken(i?J$:ete)}}else t==mte&&n.peek(1)==gte&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(tte))},{contextual:!0});function Wb(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const kte=new ki((n,e)=>{if(n.next!=dte||!e.dialectEnabled(ate)||(n.advance(),n.next==WS))return;let t=0;for(;US.indexOf(n.next)>-1;)n.advance(),t++;if(Wb(n.next,!0)){for(n.advance(),t++;Wb(n.next,!1);)n.advance(),t++;for(;US.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==pte)return;for(let i=0;;i++){if(i==7){if(!Wb(n.next,!0))return;break}if(n.next!="extends".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(nte,-t)}),wte=Rc({"get set async static":M.modifier,"for while do if else switch try catch finally return throw break continue default case defer":M.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":M.operatorKeyword,"let var const using function class extends":M.definitionKeyword,"import export from":M.moduleKeyword,"with debugger new":M.keyword,TemplateString:M.special(M.string),super:M.atom,BooleanLiteral:M.bool,this:M.self,null:M.null,Star:M.modifier,VariableName:M.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":M.function(M.variableName),VariableDefinition:M.definition(M.variableName),Label:M.labelName,PropertyName:M.propertyName,PrivatePropertyName:M.special(M.propertyName),"CallExpression/MemberExpression/PropertyName":M.function(M.propertyName),"FunctionDeclaration/VariableDefinition":M.function(M.definition(M.variableName)),"ClassDeclaration/VariableDefinition":M.definition(M.className),"NewExpression/VariableName":M.className,PropertyDefinition:M.definition(M.propertyName),PrivatePropertyDefinition:M.definition(M.special(M.propertyName)),UpdateOp:M.updateOperator,"LineComment Hashbang":M.lineComment,BlockComment:M.blockComment,Number:M.number,String:M.string,Escape:M.escape,ArithOp:M.arithmeticOperator,LogicOp:M.logicOperator,BitOp:M.bitwiseOperator,CompareOp:M.compareOperator,RegExp:M.regexp,Equals:M.definitionOperator,Arrow:M.function(M.punctuation),": Spread":M.punctuation,"( )":M.paren,"[ ]":M.squareBracket,"{ }":M.brace,"InterpolationStart InterpolationEnd":M.special(M.brace),".":M.derefOperator,", ;":M.separator,"@":M.meta,TypeName:M.typeName,TypeDefinition:M.definition(M.typeName),"type enum interface implements namespace module declare":M.definitionKeyword,"abstract global Privacy readonly override":M.modifier,"is keyof unique infer asserts":M.operatorKeyword,JSXAttributeValue:M.attributeValue,JSXText:M.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":M.angleBracket,"JSXIdentifier JSXNameSpacedName":M.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":M.attributeName,"JSXBuiltin/JSXIdentifier":M.standard(M.tagName)}),Tte={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Cte={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Ate={__proto__:null,"<":193},Mte=Cc.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO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Q3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:yte,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[wte],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!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t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Ste,vte,xte,kte,2,3,4,5,6,7,8,9,10,11,12,13,14,bte,new Og("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Og("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>Tte[n]||-1},{term:343,get:n=>Cte[n]||-1},{term:95,get:n=>Ate[n]||-1}],tokenPrec:15201}),j3=[Un("function ${name}(${params}) {\n	${}\n}",{label:"function",detail:"definition",type:"keyword"}),Un("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}",{label:"for",detail:"loop",type:"keyword"}),Un("for (let ${name} of ${collection}) {\n	${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Un("do {\n	${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Un("while (${}) {\n	${}\n}",{label:"while",detail:"loop",type:"keyword"}),Un(`try {
	\${}
} catch (\${error}) {
	\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Un("if (${}) {\n	${}\n}",{label:"if",detail:"block",type:"keyword"}),Un(`if (\${}) {
	\${}
} else {
	\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Un(`class \${name} {
	constructor(\${params}) {
		\${}
	}
}`,{label:"class",detail:"definition",type:"keyword"}),Un('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Un('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Qte=j3.concat([Un("interface ${name} {\n	${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Un("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Un("enum ${name} {\n	${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),eR=new Mz,Z3=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Xu(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const Ete=["FunctionDeclaration"],$te={FunctionDeclaration:Xu("function"),ClassDeclaration:Xu("class"),ClassExpression:()=>!0,EnumDeclaration:Xu("constant"),TypeAliasDeclaration:Xu("type"),NamespaceDeclaration:Xu("namespace"),VariableDefinition(n,e){n.matchContext(Ete)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function X3(n,e){let t=eR.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let c=n.sliceString(l.from,l.to);i.push({label:c,type:o})}return e.cursor(nt.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=$te[l.name];if(o&&o(l,s)||Z3.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of X3(n,l.node))i.push(o);return!1}}),eR.set(e,i),i}const tR=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,I3=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Rte(n){let e=Ot(n.state).resolveInner(n.pos,-1);if(I3.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&tR.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Z3.has(r.name)&&(i=i.concat(X3(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:tR}}const jr=xc.define({name:"javascript",parser:Mte.configure({props:[Sf.add({IfStatement:Hp({except:/^\s*({|else\b)/}),TryStatement:Hp({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:i9,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:n9({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Hp({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Dc.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":zz,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),V3={test:n=>/^JSX/.test(n.name),facet:vx({commentTokens:{block:{open:"{/*",close:"*/}"}}})},q3=jr.configure({dialect:"ts"},"typescript"),H3=jr.configure({dialect:"jsx",props:[xx.add(n=>n.isTop?[V3]:void 0)]}),Y3=jr.configure({dialect:"jsx ts",props:[xx.add(n=>n.isTop?[V3]:void 0)]},"typescript");let U3=n=>({label:n,type:"keyword"});const W3="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(U3),Pte=W3.concat(["declare","implements","private","protected","public"].map(U3));function Dte(n={}){let e=n.jsx?n.typescript?Y3:H3:n.typescript?q3:jr,t=n.typescript?Qte.concat(Pte):j3.concat(W3);return new Gh(e,[jr.data.of({autocomplete:kF(I3,_L(t))}),jr.data.of({autocomplete:Rte}),n.jsx?Lte:[]])}function Nte(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function nR(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const zte=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Lte=de.inputHandler.of((n,e,t,i,r)=>{if((zte?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!jr.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(c=>{var h;let{head:d}=c,p=Ot(l).resolveInner(d-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(l.doc.sliceString(d-1,d)!=i||p.name=="JSXAttributeValue"&&p.to>d)){if(i==">"&&p.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(i=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,b=O.parent;if(b&&O.from==d-2&&((g=nR(l.doc,b.firstChild,d))||((h=b.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let v=`${g}>`;return{range:Y.cursor(d+v.length,-1),changes:{from:d,insert:v}}}}else if(i==">"){let O=Nte(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(l.doc.sliceString(d,d+2))&&(g=nR(l.doc,O,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Iu=["_blank","_self","_top","_parent"],Gb=["ascii","utf-8","utf-16","latin1","latin1"],Fb=["get","post","put","delete"],Kb=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],di=["true","false"],ve={},_te={a:{attrs:{href:null,ping:null,type:null,media:null,target:Iu,hreflang:null}},abbr:ve,address:ve,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:ve,aside:ve,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:ve,base:{attrs:{href:null,target:Iu}},bdi:ve,bdo:ve,blockquote:{attrs:{cite:null}},body:ve,br:ve,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Kb,formmethod:Fb,formnovalidate:["novalidate"],formtarget:Iu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:ve,center:ve,cite:ve,code:ve,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:ve,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:ve,div:ve,dl:ve,dt:ve,em:ve,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:ve,figure:ve,footer:ve,form:{attrs:{action:null,name:null,"accept-charset":Gb,autocomplete:["on","off"],enctype:Kb,method:Fb,novalidate:["novalidate"],target:Iu}},h1:ve,h2:ve,h3:ve,h4:ve,h5:ve,h6:ve,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:ve,hgroup:ve,hr:ve,html:{attrs:{manifest:null}},i:ve,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Kb,formmethod:Fb,formnovalidate:["novalidate"],formtarget:Iu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:ve,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:ve,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:ve,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Gb,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:ve,noscript:ve,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:ve,param:{attrs:{name:null,value:null}},pre:ve,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:ve,rt:ve,ruby:ve,samp:ve,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Gb}},section:ve,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:ve,source:{attrs:{src:null,type:null,media:null}},span:ve,strong:ve,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:ve,summary:ve,sup:ve,table:ve,tbody:ve,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:ve,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:ve,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:ve,time:{attrs:{datetime:null}},title:ve,tr:ve,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:ve,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:ve},G3={accesskey:null,class:null,contenteditable:di,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:di,autocorrect:di,autocapitalize:di,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":di,"aria-autocomplete":["inline","list","both","none"],"aria-busy":di,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":di,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":di,"aria-hidden":di,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":di,"aria-multiselectable":di,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":di,"aria-relevant":null,"aria-required":di,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},F3="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of F3)G3[n]=null;class af{constructor(e,t){this.tags={..._te,...e},this.globalAttrs={...G3,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}af.default=new af;function Ac(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function Mc(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function K3(n,e,t){let i=t.tags[Ac(n,Mc(e))];return(i==null?void 0:i.children)||t.allTags}function Gx(n,e){let t=[];for(let i=Mc(e);i&&!i.type.isTop;i=Mc(i.parent)){let r=Ac(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const J3=/^[:\-\.\w\u00b7-\uffff]*$/;function iR(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=Mc(t,t.name=="StartTag"||t.name=="TagName");return{from:i,to:r,options:K3(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(Gx(n.doc,t).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function rR(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:Gx(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:J3}}function Bte(n,e,t,i){let r=[],s=0;for(let l of K3(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of Gx(n.doc,t))r.push({label:"</"+l+">",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function jte(n,e,t,i,r){let s=Mc(t),l=s?e.tags[Ac(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],c=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:c.map(h=>({label:h,type:"property"})),validFor:J3}}function Zte(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(l){let h=n.sliceDoc(l.from,l.to),d=e.globalAttrs[h];if(!d){let p=Mc(t),g=p?e.tags[Ac(n.doc,p)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[h]}if(d){let p=n.sliceDoc(i,r).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(c=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=n.sliceDoc(r,r+1)==p[0]?"":p[0],p=p.slice(1),i++):c=/^[^\s<>='"]*$/;for(let b of d)o.push({label:b,apply:g+b+O,type:"constant"})}}return{from:i,to:r,options:o,validFor:c}}function e5(n,e){let{state:t,pos:i}=e,r=Ot(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=r=o,l=c.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?rR(t,r,r.from,i):iR(t,n,r,r.from,i):r.name=="StartTag"||r.name=="IncompleteTag"?iR(t,n,r,i,i):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?rR(t,r,i,i):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?jte(t,n,r,r.name=="AttributeName"?r.from:i,i):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?Zte(t,n,r,r.name=="Is"?i:r.from,i):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Bte(t,n,r,i):null}function Xte(n){return e5(af.default,n)}function Ite(n){let{extraTags:e,extraGlobalAttributes:t}=n,i=t||e?new af(e,t):af.default;return r=>e5(i,r)}const Vte=jr.parser.configure({top:"SingleExpression"}),t5=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:q3.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:H3.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:Y3.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:Vte},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:jr.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:bg.parser}],n5=[{name:"style",parser:bg.parser.configure({top:"Styles"})}].concat(F3.map(n=>({name:n,parser:jr.parser}))),i5=xc.define({name:"html",parser:mee.configure({props:[Sf.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let i=n.node;;){let r=i.lastChild;if(!r||r.name!="Element"||r.to!=i.to)break;e=i=r}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Dc.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),Wz.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Gp=i5.configure({wrap:P3(t5,n5)});function qte(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=P3((n.nestedLanguages||[]).concat(t5),(n.nestedAttributes||[]).concat(n5)));let i=t?i5.configure({wrap:t,dialect:e}):e?Gp.configure({dialect:e}):Gp;return new Gh(i,[Gp.data.of({autocomplete:Ite(n)}),n.autoCloseTags!==!1?Hte:[],Dte().support,Fee().support])}const sR=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Hte=de.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Gp.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(c=>{var h,d,p;let g=l.doc.sliceString(c.from-1,c.to)==i,{head:O}=c,b=Ot(l).resolveInner(O,-1),v;if(g&&i==">"&&b.name=="EndTag"){let x=b.parent;if(((d=(h=x.parent)===null||h===void 0?void 0:h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(v=Ac(l.doc,x.parent,O))&&!sR.has(v)){let k=O+(l.doc.sliceString(O,O+1)===">"?1:0),C=`</${v}>`;return{range:c,changes:{from:O,to:k,insert:C}}}}else if(g&&i=="/"&&b.name=="IncompleteCloseTag"){let x=b.parent;if(b.from==O-2&&((p=x.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(v=Ac(l.doc,x,O))&&!sR.has(v)){let k=O+(l.doc.sliceString(O,O+1)===">"?1:0),C=`${v}>`;return{range:Y.cursor(O+C.length,-1),changes:{from:O,to:k,insert:C}}}}return{range:c}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),r5=vx({commentTokens:{block:{open:"<!--",close:"-->"}}}),s5=new De,l5=cJ.configure({props:[Dc.add(n=>!n.is("Block")||n.is("Document")||GS(n)!=null||Yte(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),s5.add(GS),Sf.add({Document:()=>null}),Mo.add({Document:r5})]});function GS(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function Yte(n){return n.name=="OrderedList"||n.name=="BulletList"}function Ute(n,e){let t=n;for(;;){let i=t.nextSibling,r;if(!i||(r=GS(i.type))!=null&&r<=e)break;t=i}return t.to}const Wte=Nz.of((n,e,t)=>{for(let i=Ot(n).resolveInner(t,-1);i&&!(i.from<e);i=i.parent){let r=i.type.prop(s5);if(r==null)continue;let s=Ute(i,r);if(s>t)return{from:t,to:s}}return null});function Fx(n){return new Zi(r5,n,[],"markdown")}const Gte=Fx(l5),Fte=l5.configure([SJ,xJ,vJ,kJ,{props:[Dc.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Sg=Fx(Fte);function Kte(n,e){return t=>{if(t&&n){let i=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?i=n(t):i=tg.matchLanguageName(n,t,!0),i instanceof tg)return i.support?i.support.language.parser:Wh.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}class Jb{constructor(e,t,i,r,s,l,o){this.node=e,this.from=t,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=l,this.item=o}blank(e,t=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;i.length<e;)i+=" ";return i}else{for(let r=this.to-this.from-i.length-this.spaceAfter.length;r>0;r--)i+=" ";return i+(t?this.spaceAfter:"")}}marker(e,t){let i=this.node.name=="OrderedList"?String(+a5(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function o5(n,e){let t=[],i=[];for(let r=n;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],l,o=e.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(l=/^ *>( ?)/.exec(o.text.slice(c))))i.push(new Jb(s,c,c+l[0].length,"",l[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(l=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let h=l[3],d=l[0].length;h.length>=4&&(h=h.slice(0,h.length-4),d-=4),i.push(new Jb(s.parent,c,c+d,l[1],h,l[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(l=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let h=l[4],d=l[0].length;h.length>4&&(h=h.slice(0,h.length-4),d-=4);let p=l[2];l[3]&&(p+=l[3].replace(/[xX]/," ")),i.push(new Jb(s.parent,c,c+d,l[1],h,p,s))}}return i}function a5(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function e1(n,e,t,i=0){for(let r=-1,s=n;;){if(s.name=="ListItem"){let o=a5(s,e),c=+o[2];if(r>=0){if(c!=r+1)return;t.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(r+2+i)})}r=c}let l=s.nextSibling;if(!l)break;s=l}}function Kx(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(Pc)!="	")return n;let i=ar(n,4,t),r="";for(let s=i;s>0;)s>=4?(r+="	",s-=4):(r+=" ",s--);return r+n.slice(t)}const Jte=(n={})=>({state:e,dispatch:t})=>{let i=Ot(e),{doc:r}=e,s=null,l=e.changeByRange(o=>{if(!o.empty||!Sg.isActiveAt(e,o.from,-1)&&!Sg.isActiveAt(e,o.from,1))return s={range:o};let c=o.from,h=r.lineAt(c),d=o5(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-h.from;)d.pop();if(!d.length)return s={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-h.from)return s={range:o};let g=c>=p.to-p.spaceAfter.length&&!/\S/.test(h.text.slice(p.to));if(p.item&&g){let k=p.node.firstChild,C=p.node.getChild("ListItem","ListItem");if(k.to>=c||C&&C.to<c||h.from>0&&!/[^\s>]/.test(r.lineAt(h.from-1).text)||n.nonTightLists===!1){let A=d.length>1?d[d.length-2]:null,P,E="";A&&A.item?(P=h.from+A.from,E=A.marker(r,1)):P=h.from+(A?A.to:0);let D=[{from:P,to:c,insert:E}];return p.node.name=="OrderedList"&&e1(p.item,r,D,-2),A&&A.node.name=="OrderedList"&&e1(A.item,r,D),{range:Y.cursor(P+E.length),changes:D}}else{let A=oR(d,e,h);return{range:Y.cursor(c+A.length+1),changes:{from:h.from,insert:A+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&h.from){let k=r.lineAt(h.from-1),C=/>\s*$/.exec(k.text);if(C&&C.index==p.from){let A=e.changes([{from:k.from+C.index,to:k.to},{from:h.from+p.from,to:h.to}]);return{range:o.map(A),changes:A}}}let O=[];p.node.name=="OrderedList"&&e1(p.item,r,O);let b=p.item&&p.item.from<h.from,v="";if(!b||/^[\s\d.)\-+*>]*/.exec(h.text)[0].length>=p.to)for(let k=0,C=d.length-1;k<=C;k++)v+=k==C&&!b?d[k].marker(r,1):d[k].blank(k<C?ar(h.text,4,d[k+1].from)-v.length:null);let x=c;for(;x>h.from&&/\s/.test(h.text.charAt(x-h.from-1));)x--;return v=Kx(v,e),tne(p.node,e.doc)&&(v=oR(d,e,h)+e.lineBreak+v),O.push({from:x,to:c,insert:e.lineBreak+v}),{range:Y.cursor(x+v.length+1),changes:O}});return s?!1:(t(e.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)},ene=Jte();function lR(n){return n.name=="QuoteMark"||n.name=="ListMark"}function tne(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,i=n.getChild("ListItem","ListItem");if(!i)return!1;let r=e.lineAt(t.to),s=e.lineAt(i.from),l=/^[\s>]*$/.test(r.text);return r.number+(l?0:1)<s.number}function oR(n,e,t){let i="";for(let r=0,s=n.length-2;r<=s;r++)i+=n[r].blank(r<s?ar(t.text,4,n[r+1].from)-i.length:null,r<s);return Kx(i,e)}function nne(n,e){let t=n.resolveInner(e,-1),i=e;lR(t)&&(i=t.from,t=t.parent);for(let r;r=t.childBefore(i);)if(lR(r))i=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")t=r.lastChild,i=t.to;else break;return t}const ine=({state:n,dispatch:e})=>{let t=Ot(n),i=null,r=n.changeByRange(s=>{let l=s.from,{doc:o}=n;if(s.empty&&Sg.isActiveAt(n,s.from)){let c=o.lineAt(l),h=o5(nne(t,l),o);if(h.length){let d=h[h.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(l-c.from>p&&!/\S/.test(c.text.slice(p,l-c.from)))return{range:Y.cursor(c.from+p),changes:{from:c.from+p,to:l}};if(l-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let g=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let O=d.blank(ar(c.text,4,d.to)-ar(c.text,4,d.from));return g==c.from&&(O=Kx(O,n)),{range:Y.cursor(g+O.length),changes:{from:g,to:c.from+d.to,insert:O}}}if(g<l)return{range:Y.cursor(g),changes:{from:g,to:l}}}}}return i={range:s}});return i?!1:(e(n.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},rne=[{key:"Enter",run:ene},{key:"Backspace",run:ine}],c5=qte({matchClosingTags:!1});function sne(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:i=!0,base:{parser:r}=Gte,completeHTMLTags:s=!0,pasteURLAsLink:l=!0,htmlTagLanguage:o=c5}=n;if(!(r instanceof lO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=n.extensions?[n.extensions]:[],h=[o.support,Wte],d;l&&h.push(cne),t instanceof Gh?(h.push(t.support),d=t.language):t&&(d=t);let p=e||d?Kte(e,d):void 0;c.push(hJ({codeParser:p,htmlParser:o.language.parser})),i&&h.push(Bs.high($c.of(rne)));let g=Fx(r.configure(c));return s&&h.push(g.data.of({autocomplete:lne})),new Gh(g,h)}function lne(n){let{state:e,pos:t}=n,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!i)return null;let r=Ot(e).resolveInner(t,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:t-i[0].length,to:t,options:one(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let t1=null;function one(){if(t1)return t1;let n=Xte(new Rx(Ye.create({extensions:c5}),0,!0));return t1=n?n.options:[]}const ane=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,cne=de.domEventHandlers({paste:(n,e)=>{var t;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!Sg.isActiveAt(e.state,i.from,1)))return!1;let s=Ot(e.state),l=!1;return s.iterate({from:i.from,to:i.to,enter:o=>{(o.from>i.from||ane.test(o.name))&&(l=!0)},leave:o=>{o.to<i.to&&(l=!0)}}),l?!1:(e.dispatch({changes:[{from:i.from,insert:"["},{from:i.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function Jx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ko=Jx();function u5(n){Ko=n}var Th={exec:()=>null};function it(n,e=""){let t=typeof n=="string"?n:n.source;const i={replace:(r,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(zn.caret,"$1"),t=t.replace(r,l),i},getRegex:()=>new RegExp(t,e)};return i}var zn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},une=/^(?:[ \t]*(?:\n|$))+/,hne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fne=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dne=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ek=/(?:[*+-]|\d{1,9}[.)])/,h5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,f5=it(h5).replace(/bull/g,ek).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pne=it(h5).replace(/bull/g,ek).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),tk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mne=/^[^\n]+/,nk=/(?!\s*\])(?:\\.|[^\[\]\\])+/,gne=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",nk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),One=it(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ek).getRegex(),oO="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ik=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yne=it("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",ik).replace("tag",oO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d5=it(tk).replace("hr",Cf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oO).getRegex(),bne=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",d5).getRegex(),rk={blockquote:bne,code:hne,def:gne,fences:fne,heading:dne,hr:Cf,html:yne,lheading:f5,list:One,newline:une,paragraph:d5,table:Th,text:mne},aR=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oO).getRegex(),Sne={...rk,lheading:pne,table:aR,paragraph:it(tk).replace("hr",Cf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",aR).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oO).getRegex()},vne={...rk,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ik).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Th,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(tk).replace("hr",Cf).replace("heading",` *#{1,6} *[^
]`).replace("lheading",f5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xne=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kne=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,p5=/^( {2,}|\\)\n(?!\s*$)/,wne=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,aO=/[\p{P}\p{S}]/u,sk=/[\s\p{P}\p{S}]/u,m5=/[^\s\p{P}\p{S}]/u,Tne=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sk).getRegex(),g5=/(?!~)[\p{P}\p{S}]/u,Cne=/(?!~)[\s\p{P}\p{S}]/u,Ane=/(?:[^\s\p{P}\p{S}]|~)/u,Mne=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,O5=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qne=it(O5,"u").replace(/punct/g,aO).getRegex(),Ene=it(O5,"u").replace(/punct/g,g5).getRegex(),y5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$ne=it(y5,"gu").replace(/notPunctSpace/g,m5).replace(/punctSpace/g,sk).replace(/punct/g,aO).getRegex(),Rne=it(y5,"gu").replace(/notPunctSpace/g,Ane).replace(/punctSpace/g,Cne).replace(/punct/g,g5).getRegex(),Pne=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,m5).replace(/punctSpace/g,sk).replace(/punct/g,aO).getRegex(),Dne=it(/\\(punct)/,"gu").replace(/punct/g,aO).getRegex(),Nne=it(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),zne=it(ik).replace("(?:-->|$)","-->").getRegex(),Lne=it("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vg=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_ne=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vg).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),b5=it(/^!?\[(label)\]\[(ref)\]/).replace("label",vg).replace("ref",nk).getRegex(),S5=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",nk).getRegex(),Bne=it("reflink|nolink(?!\\()","g").replace("reflink",b5).replace("nolink",S5).getRegex(),lk={_backpedal:Th,anyPunctuation:Dne,autolink:Nne,blockSkip:Mne,br:p5,code:kne,del:Th,emStrongLDelim:Qne,emStrongRDelimAst:$ne,emStrongRDelimUnd:Pne,escape:xne,link:_ne,nolink:S5,punctuation:Tne,reflink:b5,reflinkSearch:Bne,tag:Lne,text:wne,url:Th},jne={...lk,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",vg).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vg).getRegex()},FS={...lk,emStrongRDelimAst:Rne,emStrongLDelim:Ene,url:it(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zne={...FS,br:it(p5).replace("{2,}","*").getRegex(),text:it(FS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$p={normal:rk,gfm:Sne,pedantic:vne},Vu={normal:lk,gfm:FS,breaks:Zne,pedantic:jne},Xne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cR=n=>Xne[n];function Cr(n,e){if(e){if(zn.escapeTest.test(n))return n.replace(zn.escapeReplace,cR)}else if(zn.escapeTestNoEncode.test(n))return n.replace(zn.escapeReplaceNoEncode,cR);return n}function uR(n){try{n=encodeURI(n).replace(zn.percentDecode,"%")}catch{return null}return n}function hR(n,e){var s;const t=n.replace(zn.findPipe,(l,o,c)=>{let h=!1,d=o;for(;--d>=0&&c[d]==="\\";)h=!h;return h?"|":" |"}),i=t.split(zn.splitPipe);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(zn.slashPipe,"|");return i}function qu(n,e,t){const i=n.length;if(i===0)return"";let r=0;for(;r<i&&n.charAt(i-r-1)===e;)r++;return n.slice(0,i-r)}function Ine(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function fR(n,e,t,i,r){const s=e.href,l=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;const c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:l,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,c}function Vne(n,e,t){const i=n.match(t.other.indentCodeCompensation);if(i===null)return e;const r=i[1];return e.split(`
`).map(s=>{const l=s.match(t.other.beginningSpace);if(l===null)return s;const[o]=l;return o.length>=r.length?s.slice(r.length):s}).join(`
`)}var xg=class{constructor(n){ft(this,"options");ft(this,"rules");ft(this,"lexer");this.options=n||Ko}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:qu(t,`
`)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],i=Vne(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const i=qu(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:qu(e[0],`
`)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=qu(e[0],`
`).split(`
`),i="",r="";const s=[];for(;t.length>0;){let l=!1;const o=[];let c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))o.push(t[c]),l=!0;else if(!l)o.push(t[c]);else break;t=t.slice(c);const h=o.join(`
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${h}`:h,r=r?`${r}
${d}`:d;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=p,t.length===0)break;const g=s.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const O=g,b=O.raw+`
`+t.join(`
`),v=this.blockquote(b);s[s.length-1]=v,i=i.substring(0,i.length-O.raw.length)+v.raw,r=r.substring(0,r.length-O.text.length)+v.text;break}else if((g==null?void 0:g.type)==="list"){const O=g,b=O.raw+`
`+t.join(`
`),v=this.list(b);s[s.length-1]=v,i=i.substring(0,i.length-g.raw.length)+v.raw,r=r.substring(0,r.length-O.raw.length)+v.raw,t=b.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const i=t.length>1,r={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");const s=this.rules.other.listItemRegex(t);let l=!1;for(;n;){let c=!1,h="",d="";if(!(e=s.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let p=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),g=n.split(`
`,1)[0],O=!p.trim(),b=0;if(this.options.pedantic?(b=2,d=p.trimStart()):O?b=e[1].length+1:(b=e[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,d=p.slice(b),b+=e[1].length),O&&this.rules.other.blankLine.test(g)&&(h+=g+`
`,n=n.substring(g.length+1),c=!0),!c){const k=this.rules.other.nextBulletRegex(b),C=this.rules.other.hrRegex(b),A=this.rules.other.fencesBeginRegex(b),P=this.rules.other.headingBeginRegex(b),E=this.rules.other.htmlBeginRegex(b);for(;n;){const D=n.split(`
`,1)[0];let $;if(g=D,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting,"  "),$=g):$=g.replace(this.rules.other.tabCharGlobal,"    "),A.test(g)||P.test(g)||E.test(g)||k.test(g)||C.test(g))break;if($.search(this.rules.other.nonSpaceChar)>=b||!g.trim())d+=`
`+$.slice(b);else{if(O||p.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||A.test(p)||P.test(p)||C.test(p))break;d+=`
`+g}!O&&!g.trim()&&(O=!0),h+=D+`
`,n=n.substring(D.length+1),p=$.slice(b)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0));let v=null,x;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(x=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:h,task:!!v,checked:x,loose:!1,text:d,tokens:[]}),r.raw+=h}const o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const h=r.items[c].tokens.filter(p=>p.type==="space"),d=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=d}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:r}}}table(n){var l;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=hR(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(l=e[3])!=null&&l.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(const o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<t.length;o++)s.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:s.align[o]});for(const o of r)s.rows.push(hR(o,s.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[h]})));return s}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const s=qu(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{const s=Ine(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),fR(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){const s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return fR(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const s=[...i[0]].length-1;let l,o,c=s,h=0;const d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+s);(i=d.exec(e))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(o=[...l].length,i[3]||i[4]){c+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){h+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+h);const p=[...i[0]][0].length,g=n.slice(0,s+i.index+p+o);if(Math.min(s,o)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const O=g.slice(2,-2);return{type:"strong",raw:g,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let i,r;if(e[2]==="@")i=e[0],r="mailto:"+i;else{let s;do s=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(s!==e[0]);i=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Ts=class KS{constructor(e){ft(this,"tokens");ft(this,"options");ft(this,"state");ft(this,"tokenizer");ft(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ko,this.options.tokenizer=this.options.tokenizer||new xg,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:zn,block:$p.normal,inline:Vu.normal};this.options.pedantic?(t.block=$p.pedantic,t.inline=Vu.pedantic):this.options.gfm&&(t.block=$p.gfm,this.options.breaks?t.inline=Vu.breaks:t.inline=Vu.gfm),this.tokenizer.rules=t}static get rules(){return{block:$p,inline:Vu}}static lex(e,t){return new KS(t).lex(e)}static lexInline(e,t){return new KS(t).inlineTokens(e)}lex(e){e=e.replace(zn.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){var r,s,l;for(this.options.pedantic&&(e=e.replace(zn.tabCharGlobal,"    ").replace(zn.spaceLine,""));e;){let o;if((s=(r=this.options.extensions)==null?void 0:r.block)!=null&&s.some(h=>(o=h.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const h=t.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
`+o.raw,h.text+=`
`+o.text,this.inlineQueue.at(-1).src=h.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
`+o.raw,h.text+=`
`+o.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let c=e;if((l=this.options.extensions)!=null&&l.startBlock){let h=1/0;const d=e.slice(1);let p;this.options.extensions.startBlock.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(c=e.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){const h=t.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=`
`+o.raw,h.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(o),i=c.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=`
`+o.raw,h.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(o);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var o,c,h;let i=e,r=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,l="";for(;e;){s||(l=""),s=!1;let d;if((c=(o=this.options.extensions)==null?void 0:o.inline)!=null&&c.some(g=>(d=g.call({lexer:this},e,t))?(e=e.substring(d.raw.length),t.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);const g=t.at(-1);d.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):t.push(d);continue}if(d=this.tokenizer.emStrong(e,i,l)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.del(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),t.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),t.push(d);continue}let p=e;if((h=this.options.extensions)!=null&&h.startInline){let g=1/0;const O=e.slice(1);let b;this.options.extensions.startInline.forEach(v=>{b=v.call({lexer:this},O),typeof b=="number"&&b>=0&&(g=Math.min(g,b))}),g<1/0&&g>=0&&(p=e.substring(0,g+1))}if(d=this.tokenizer.inlineText(p)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),s=!0;const g=t.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):t.push(d);continue}if(e){const g="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return t}},kg=class{constructor(n){ft(this,"options");ft(this,"parser");this.options=n||Ko}space(n){return""}code({text:n,lang:e,escaped:t}){var s;const i=(s=(e||"").match(zn.notSpaceStart))==null?void 0:s[0],r=n.replace(zn.endingNewline,"")+`
`;return i?'<pre><code class="language-'+Cr(i)+'">'+(t?r:Cr(r,!0))+`</code></pre>
`:"<pre><code>"+(t?r:Cr(r,!0))+`</code></pre>
`}blockquote({tokens:n}){return`<blockquote>
${this.parser.parse(n)}</blockquote>
`}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
`}hr(n){return`<hr>
`}list(n){const e=n.ordered,t=n.start;let i="";for(let l=0;l<n.items.length;l++){const o=n.items[l];i+=this.listitem(o)}const r=e?"ol":"ul",s=e&&t!==1?' start="'+t+'"':"";return"<"+r+s+`>
`+i+"</"+r+`>
`}listitem(n){var t;let e="";if(n.task){const i=this.checkbox({checked:!!n.checked});n.loose?((t=n.tokens[0])==null?void 0:t.type)==="paragraph"?(n.tokens[0].text=i+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=i+" "+Cr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):e+=i+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let i="";for(let r=0;r<n.rows.length;r++){const s=n.rows[r];t="";for(let l=0;l<s.length;l++)t+=this.tablecell(s[l]);i+=this.tablerow({text:t})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+i+`</table>
`}tablerow({text:n}){return`<tr>
${n}</tr>
`}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Cr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const i=this.parser.parseInline(t),r=uR(n);if(r===null)return i;n=r;let s='<a href="'+n+'"';return e&&(s+=' title="'+Cr(e)+'"'),s+=">"+i+"</a>",s}image({href:n,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));const r=uR(n);if(r===null)return Cr(t);n=r;let s=`<img src="${n}" alt="${t}"`;return e&&(s+=` title="${Cr(e)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Cr(n.text)}},ok=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Cs=class JS{constructor(e){ft(this,"options");ft(this,"renderer");ft(this,"textRenderer");this.options=e||Ko,this.options.renderer=this.options.renderer||new kg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ok}static parse(e,t){return new JS(t).parse(e)}static parseInline(e,t){return new JS(t).parseInline(e)}parse(e,t=!0){var r,s;let i="";for(let l=0;l<e.length;l++){const o=e[l];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){const h=o,d=this.options.extensions.renderers[h.type].call({parser:this},h);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type)){i+=d||"";continue}}const c=o;switch(c.type){case"space":{i+=this.renderer.space(c);continue}case"hr":{i+=this.renderer.hr(c);continue}case"heading":{i+=this.renderer.heading(c);continue}case"code":{i+=this.renderer.code(c);continue}case"table":{i+=this.renderer.table(c);continue}case"blockquote":{i+=this.renderer.blockquote(c);continue}case"list":{i+=this.renderer.list(c);continue}case"html":{i+=this.renderer.html(c);continue}case"paragraph":{i+=this.renderer.paragraph(c);continue}case"text":{let h=c,d=this.renderer.text(h);for(;l+1<e.length&&e[l+1].type==="text";)h=e[++l],d+=`
`+this.renderer.text(h);t?i+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):i+=d;continue}default:{const h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(e,t=this.renderer){var r,s;let i="";for(let l=0;l<e.length;l++){const o=e[l];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){const h=this.options.extensions.renderers[o.type].call({parser:this},o);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=h||"";continue}}const c=o;switch(c.type){case"escape":{i+=t.text(c);break}case"html":{i+=t.html(c);break}case"link":{i+=t.link(c);break}case"image":{i+=t.image(c);break}case"strong":{i+=t.strong(c);break}case"em":{i+=t.em(c);break}case"codespan":{i+=t.codespan(c);break}case"br":{i+=t.br(c);break}case"del":{i+=t.del(c);break}case"text":{i+=t.text(c);break}default:{const h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},l1,Fp=(l1=class{constructor(n){ft(this,"options");ft(this,"block");this.options=n||Ko}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Ts.lex:Ts.lexInline}provideParser(){return this.block?Cs.parse:Cs.parseInline}},ft(l1,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),l1),qne=class{constructor(...n){ft(this,"defaults",Jx());ft(this,"options",this.setOptions);ft(this,"parse",this.parseMarkdown(!0));ft(this,"parseInline",this.parseMarkdown(!1));ft(this,"Parser",Cs);ft(this,"Renderer",kg);ft(this,"TextRenderer",ok);ft(this,"Lexer",Ts);ft(this,"Tokenizer",xg);ft(this,"Hooks",Fp);this.use(...n)}walkTokens(n,e){var i,r;let t=[];for(const s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const l=s;for(const o of l.header)t=t.concat(this.walkTokens(o.tokens,e));for(const o of l.rows)for(const c of o)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{const l=s;t=t.concat(this.walkTokens(l.items,e));break}default:{const l=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[l.type]?this.defaults.extensions.childTokens[l.type].forEach(o=>{const c=l[o].flat(1/0);t=t.concat(this.walkTokens(c,e))}):l.tokens&&(t=t.concat(this.walkTokens(l.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let o=r.renderer.apply(this,l);return o===!1&&(o=s.apply(this,l)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),t.renderer){const r=this.defaults.renderer||new kg(this.defaults);for(const s in t.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const l=s,o=t.renderer[l],c=r[l];r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d||""}}i.renderer=r}if(t.tokenizer){const r=this.defaults.tokenizer||new xg(this.defaults);for(const s in t.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=s,o=t.tokenizer[l],c=r[l];r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d}}i.tokenizer=r}if(t.hooks){const r=this.defaults.hooks||new Fp;for(const s in t.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const l=s,o=t.hooks[l],c=r[l];Fp.passThroughHooks.has(s)?r[l]=h=>{if(this.defaults.async)return Promise.resolve(o.call(r,h)).then(p=>c.call(r,p));const d=o.call(r,h);return c.call(r,d)}:r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d}}i.hooks=r}if(t.walkTokens){const r=this.defaults.walkTokens,s=t.walkTokens;i.walkTokens=function(l){let o=[];return o.push(s.call(this,l)),r&&(o=o.concat(r.call(this,l))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Ts.lex(n,e??this.defaults)}parser(n,e){return Cs.parse(n,e??this.defaults)}parseMarkdown(n){return(t,i)=>{const r={...i},s={...this.defaults,...r},l=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=n);const o=s.hooks?s.hooks.provideLexer():n?Ts.lex:Ts.lexInline,c=s.hooks?s.hooks.provideParser():n?Cs.parse:Cs.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(h=>o(h,s)).then(h=>s.hooks?s.hooks.processAllTokens(h):h).then(h=>s.walkTokens?Promise.all(this.walkTokens(h,s.walkTokens)).then(()=>h):h).then(h=>c(h,s)).then(h=>s.hooks?s.hooks.postprocess(h):h).catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let h=o(t,s);s.hooks&&(h=s.hooks.processAllTokens(h)),s.walkTokens&&this.walkTokens(h,s.walkTokens);let d=c(h,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(h){return l(h)}}}onError(n,e){return t=>{if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An error occurred:</p><pre>"+Cr(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},Uo=new qne;function lt(n,e){return Uo.parse(n,e)}lt.options=lt.setOptions=function(n){return Uo.setOptions(n),lt.defaults=Uo.defaults,u5(lt.defaults),lt};lt.getDefaults=Jx;lt.defaults=Ko;lt.use=function(...n){return Uo.use(...n),lt.defaults=Uo.defaults,u5(lt.defaults),lt};lt.walkTokens=function(n,e){return Uo.walkTokens(n,e)};lt.parseInline=Uo.parseInline;lt.Parser=Cs;lt.parser=Cs.parse;lt.Renderer=kg;lt.TextRenderer=ok;lt.Lexer=Ts;lt.lexer=Ts.lex;lt.Tokenizer=xg;lt.Hooks=Fp;lt.parse=lt;lt.options;lt.setOptions;lt.use;lt.walkTokens;lt.parseInline;Cs.parse;Ts.lex;function Hne(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}function ev(n,e){return Array(e+1).join(n)}function v5(n){return n.replace(/^\n*/,"")}function x5(n){for(var e=n.length;e>0&&n[e-1]===`
`;)e--;return n.substring(0,e)}function k5(n){return x5(v5(n))}var Yne=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function ak(n){return ck(n,Yne)}var w5=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function T5(n){return ck(n,w5)}function Une(n){return A5(n,w5)}var C5=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Wne(n){return ck(n,C5)}function Gne(n){return A5(n,C5)}function ck(n,e){return e.indexOf(n.nodeName)>=0}function A5(n,e){return n.getElementsByTagName&&e.some(function(t){return n.getElementsByTagName(t).length})}var Fne=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function M5(n){return Fne.reduce(function(e,t){return e.replace(t[0],t[1])},n)}var Rn={};Rn.paragraph={filter:"p",replacement:function(n){return`

`+n+`

`}};Rn.lineBreak={filter:"br",replacement:function(n,e,t){return t.br+`
`}};Rn.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(n,e,t){var i=Number(e.nodeName.charAt(1));if(t.headingStyle==="setext"&&i<3){var r=ev(i===1?"=":"-",n.length);return`

`+n+`
`+r+`

`}else return`

`+ev("#",i)+" "+n+`

`}};Rn.blockquote={filter:"blockquote",replacement:function(n){return n=k5(n).replace(/^/gm,"> "),`

`+n+`

`}};Rn.list={filter:["ul","ol"],replacement:function(n,e){var t=e.parentNode;return t.nodeName==="LI"&&t.lastElementChild===e?`
`+n:`

`+n+`

`}};Rn.listItem={filter:"li",replacement:function(n,e,t){var i=t.bulletListMarker+"   ",r=e.parentNode;if(r.nodeName==="OL"){var s=r.getAttribute("start"),l=Array.prototype.indexOf.call(r.children,e);i=(s?Number(s)+l:l+1)+".  "}var o=/\n$/.test(n);return n=k5(n)+(o?`
`:""),n=n.replace(/\n/gm,`
`+" ".repeat(i.length)),i+n+(e.nextSibling?`
`:"")}};Rn.indentedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="indented"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){return`

    `+e.firstChild.textContent.replace(/\n/g,`
    `)+`

`}};Rn.fencedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="fenced"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){for(var i=e.firstChild.getAttribute("class")||"",r=(i.match(/language-(\S+)/)||[null,""])[1],s=e.firstChild.textContent,l=t.fence.charAt(0),o=3,c=new RegExp("^"+l+"{3,}","gm"),h;h=c.exec(s);)h[0].length>=o&&(o=h[0].length+1);var d=ev(l,o);return`

`+d+r+`
`+s.replace(/\n$/,"")+`
`+d+`

`}};Rn.horizontalRule={filter:"hr",replacement:function(n,e,t){return`

`+t.hr+`

`}};Rn.inlineLink={filter:function(n,e){return e.linkStyle==="inlined"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e){var t=uk(e.getAttribute("href")),i=hk(wg(e.getAttribute("title"))),r=i?' "'+i+'"':"";return"["+n+"]("+t+r+")"}};Rn.referenceLink={filter:function(n,e){return e.linkStyle==="referenced"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e,t){var i=uk(e.getAttribute("href")),r=wg(e.getAttribute("title"));r&&(r=' "'+hk(r)+'"');var s,l;switch(t.linkReferenceStyle){case"collapsed":s="["+n+"][]",l="["+n+"]: "+i+r;break;case"shortcut":s="["+n+"]",l="["+n+"]: "+i+r;break;default:var o=this.references.length+1;s="["+n+"]["+o+"]",l="["+o+"]: "+i+r}return this.references.push(l),s},references:[],append:function(n){var e="";return this.references.length&&(e=`

`+this.references.join(`
`)+`

`,this.references=[]),e}};Rn.emphasis={filter:["em","i"],replacement:function(n,e,t){return n.trim()?t.emDelimiter+n+t.emDelimiter:""}};Rn.strong={filter:["strong","b"],replacement:function(n,e,t){return n.trim()?t.strongDelimiter+n+t.strongDelimiter:""}};Rn.code={filter:function(n){var e=n.previousSibling||n.nextSibling,t=n.parentNode.nodeName==="PRE"&&!e;return n.nodeName==="CODE"&&!t},replacement:function(n){if(!n)return"";n=n.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(n)?" ":"",t="`",i=n.match(/`+/gm)||[];i.indexOf(t)!==-1;)t=t+"`";return t+e+n+e+t}};Rn.image={filter:"img",replacement:function(n,e){var t=M5(wg(e.getAttribute("alt"))),i=uk(e.getAttribute("src")||""),r=wg(e.getAttribute("title")),s=r?' "'+hk(r)+'"':"";return i?"!["+t+"]("+i+s+")":""}};function wg(n){return n?n.replace(/(\n+\s*)+/g,`
`):""}function uk(n){var e=n.replace(/([<>()])/g,"\\$1");return e.indexOf(" ")>=0?"<"+e+">":e}function hk(n){return n.replace(/"/g,'\\"')}function Q5(n){this.options=n,this._keep=[],this._remove=[],this.blankRule={replacement:n.blankReplacement},this.keepReplacement=n.keepReplacement,this.defaultRule={replacement:n.defaultReplacement},this.array=[];for(var e in n.rules)this.array.push(n.rules[e])}Q5.prototype={add:function(n,e){this.array.unshift(e)},keep:function(n){this._keep.unshift({filter:n,replacement:this.keepReplacement})},remove:function(n){this._remove.unshift({filter:n,replacement:function(){return""}})},forNode:function(n){if(n.isBlank)return this.blankRule;var e;return(e=n1(this.array,n,this.options))||(e=n1(this._keep,n,this.options))||(e=n1(this._remove,n,this.options))?e:this.defaultRule},forEach:function(n){for(var e=0;e<this.array.length;e++)n(this.array[e],e)}};function n1(n,e,t){for(var i=0;i<n.length;i++){var r=n[i];if(Kne(r,e,t))return r}}function Kne(n,e,t){var i=n.filter;if(typeof i=="string"){if(i===e.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(e.nodeName.toLowerCase())>-1)return!0}else if(typeof i=="function"){if(i.call(n,e,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Jne(n){var e=n.element,t=n.isBlock,i=n.isVoid,r=n.isPre||function(p){return p.nodeName==="PRE"};if(!(!e.firstChild||r(e))){for(var s=null,l=!1,o=null,c=dR(o,e,r);c!==e;){if(c.nodeType===3||c.nodeType===4){var h=c.data.replace(/[ \r\n\t]+/g," ");if((!s||/ $/.test(s.data))&&!l&&h[0]===" "&&(h=h.substr(1)),!h){c=i1(c);continue}c.data=h,s=c}else if(c.nodeType===1)t(c)||c.nodeName==="BR"?(s&&(s.data=s.data.replace(/ $/,"")),s=null,l=!1):i(c)||r(c)?(s=null,l=!0):s&&(l=!1);else{c=i1(c);continue}var d=dR(o,c,r);o=c,c=d}s&&(s.data=s.data.replace(/ $/,""),s.data||i1(s))}}function i1(n){var e=n.nextSibling||n.parentNode;return n.parentNode.removeChild(n),e}function dR(n,e,t){return n&&n.parentNode===e||t(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var fk=typeof window<"u"?window:{};function eie(){var n=fk.DOMParser,e=!1;try{new n().parseFromString("","text/html")&&(e=!0)}catch{}return e}function tie(){var n=function(){};return nie()?n.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:n.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},n}function nie(){var n=!1;try{document.implementation.createHTMLDocument("").open()}catch{fk.ActiveXObject&&(n=!0)}return n}var iie=eie()?fk.DOMParser:tie();function rie(n,e){var t;if(typeof n=="string"){var i=sie().parseFromString('<x-turndown id="turndown-root">'+n+"</x-turndown>","text/html");t=i.getElementById("turndown-root")}else t=n.cloneNode(!0);return Jne({element:t,isBlock:ak,isVoid:T5,isPre:e.preformattedCode?lie:null}),t}var r1;function sie(){return r1=r1||new iie,r1}function lie(n){return n.nodeName==="PRE"||n.nodeName==="CODE"}function oie(n,e){return n.isBlock=ak(n),n.isCode=n.nodeName==="CODE"||n.parentNode.isCode,n.isBlank=aie(n),n.flankingWhitespace=cie(n,e),n}function aie(n){return!T5(n)&&!Wne(n)&&/^\s*$/i.test(n.textContent)&&!Une(n)&&!Gne(n)}function cie(n,e){if(n.isBlock||e.preformattedCode&&n.isCode)return{leading:"",trailing:""};var t=uie(n.textContent);return t.leadingAscii&&pR("left",n,e)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&pR("right",n,e)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function uie(n){var e=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function pR(n,e,t){var i,r,s;return n==="left"?(i=e.previousSibling,r=/ $/):(i=e.nextSibling,r=/^ /),i&&(i.nodeType===3?s=r.test(i.nodeValue):t.preformattedCode&&i.nodeName==="CODE"?s=!1:i.nodeType===1&&!ak(i)&&(s=r.test(i.textContent))),s}var hie=Array.prototype.reduce;function Tg(n){if(!(this instanceof Tg))return new Tg(n);var e={rules:Rn,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:"  ",preformattedCode:!1,blankReplacement:function(t,i){return i.isBlock?`

`:""},keepReplacement:function(t,i){return i.isBlock?`

`+i.outerHTML+`

`:i.outerHTML},defaultReplacement:function(t,i){return i.isBlock?`

`+t+`

`:t}};this.options=Hne({},e,n),this.rules=new Q5(this.options)}Tg.prototype={turndown:function(n){if(!pie(n))throw new TypeError(n+" is not a string, or an element/document/fragment node.");if(n==="")return"";var e=E5.call(this,new rie(n,this.options));return fie.call(this,e)},use:function(n){if(Array.isArray(n))for(var e=0;e<n.length;e++)this.use(n[e]);else if(typeof n=="function")n(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(n,e){return this.rules.add(n,e),this},keep:function(n){return this.rules.keep(n),this},remove:function(n){return this.rules.remove(n),this},escape:function(n){return M5(n)}};function E5(n){var e=this;return hie.call(n.childNodes,function(t,i){i=new oie(i,e.options);var r="";return i.nodeType===3?r=i.isCode?i.nodeValue:e.escape(i.nodeValue):i.nodeType===1&&(r=die.call(e,i)),$5(t,r)},"")}function fie(n){var e=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(n=$5(n,t.append(e.options)))}),n.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function die(n){var e=this.rules.forNode(n),t=E5.call(this,n),i=n.flankingWhitespace;return(i.leading||i.trailing)&&(t=t.trim()),i.leading+e.replacement(t,n,this.options)+i.trailing}function $5(n,e){var t=x5(n),i=v5(e),r=Math.max(n.length-t.length,e.length-i.length),s=`

`.substring(0,r);return t+s+i}function pie(n){return n!=null&&(typeof n=="string"||n.nodeType&&(n.nodeType===1||n.nodeType===9||n.nodeType===11))}const mie="0.6.0",cf=new Tg({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced"});function gie(n){return String(n||"").replace(/\n+/g," ").replace(/\|/g,"\\|").trim()}cf.addRule("gfmStrike",{filter:["del","s","strike"],replacement(n){return`~~${n}~~`}});cf.addRule("gfmTaskItem",{filter(n){return n.nodeName==="LI"&&(n.getAttribute("data-type")==="taskItem"||n.hasAttribute("data-checked"))},replacement(n,e){return`- [${e.getAttribute("data-checked")==="true"?"x":" "}] ${n.replace(/\n+/g," ").trim()}
`}});cf.addRule("gfmTable",{filter:"table",replacement(n,e){const t=Array.from(e.querySelectorAll("tr"));if(!t.length)return"";const i=t.map(p=>Array.from(p.children).filter(g=>g.matches("th,td")).map(g=>gie(cf.turndown(g.innerHTML)))).filter(p=>p.length);if(!i.length)return"";const r=Math.max(...i.map(p=>p.length)),s=i.map(p=>Array.from({length:r},(g,O)=>p[O]||" ")),l=s[0],o=s.slice(1),c=`| ${l.join(" | ")} |`,h=`| ${Array.from({length:r},()=>"---").join(" | ")} |`,d=o.map(p=>`| ${p.join(" | ")} |`);return`

${[c,h,...d].join(`
`)}

`}});const Hu=5e4,Wn={nextId:1,pending:new Map,call(n,e={}){const t=this.nextId++,i={id:t,method:n,params:e};return new Promise((r,s)=>{var l;this.pending.set(t,{resolve:r,reject:s}),(l=window.chrome)!=null&&l.webview?window.chrome.webview.postMessage(i):s(new Error("Native bridge is not available."))})}};var gR;(gR=window.chrome)!=null&&gR.webview&&window.chrome.webview.addEventListener("message",n=>{const e=n.data,t=Wn.pending.get(e.id);t&&(Wn.pending.delete(e.id),e.ok?t.resolve(e.result):t.reject(new Error(e.error||"Native bridge failed.")))});function rh(n){return lt.parse(n||"",{gfm:!0,breaks:!1})}function mR(n){return cf.turndown(n||"")}function s1(n,e,t,i,r=i){const s=n.lastIndexOf(i,Math.max(0,e-1));if(s<0)return null;const l=n.indexOf(r,Math.max(t,s+i.length));return l<0||e<s+i.length||t>l||i==="*"&&(n[s-1]==="*"||n[s+1]==="*"||n[l-1]==="*"||n[l+1]==="*")||i==="`"&&n.slice(s+i.length,l).includes(`
`)?null:{open:s,close:l}}function Oie({markdown:n,formatLabel:e,pageAreaRef:t,onScroll:i}){const r=Ae.useDeferredValue(n),s=Ae.useMemo(()=>rh(r),[r]);return L.jsx("section",{className:"page-area",ref:t,onScroll:i,children:L.jsxs("article",{className:"page readonly-preview",children:[L.jsx("p",{className:"page-label",children:e==="NEW"?"New Markdown draft":`Converted from ${e}`}),L.jsx("div",{className:"rendered-markdown",dangerouslySetInnerHTML:{__html:s}})]})})}function wr({label:n,title:e,active:t,disabled:i,onClick:r,className:s=""}){return L.jsx("button",{type:"button",title:e||n,className:`${t?"active":""} ${s}`.trim(),disabled:i,onClick:r,children:n})}function yie(){const[n,e]=Ae.useState(`# regen-mde

Open a Markdown or Word file to begin.`),[t,i]=Ae.useState(""),[r,s]=Ae.useState(""),[l,o]=Ae.useState(""),[c,h]=Ae.useState(""),[d,p]=Ae.useState(""),[g,O]=Ae.useState("Ready"),[b,v]=Ae.useState("markdown"),[x,k]=Ae.useState(()=>{var re,Ne;const V=(re=window.localStorage)==null?void 0:re.getItem("build-corpus-editor-theme");return V==="dark"||V==="light"?V:(Ne=window.matchMedia)!=null&&Ne.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}),[C,A]=Ae.useState(!1),[P,E]=Ae.useState(!1),[D,$]=Ae.useState(!1),[H,W]=Ae.useState(()=>{var V;return((V=window.localStorage)==null?void 0:V.getItem("build-corpus-editor-left-panel"))==="collapsed"}),[te,ce]=Ae.useState(()=>{var V;return((V=window.localStorage)==null?void 0:V.getItem("build-corpus-editor-right-panel"))==="collapsed"}),ie=Ae.useRef(null),ue=Ae.useRef(null),se=Ae.useRef(!1),[fe,B]=Ae.useState(null),[G,he]=Ae.useState({start:0,end:0,ready:!1}),z=cq({extensions:[i6,ED.configure({openOnClick:!1,autolink:!0}),KU.configure({placeholder:"Start writing..."}),s6.configure({inline:!1,allowBase64:!0}),KD.configure({resizable:!0}),FD,GD,WD,XD,ZD.configure({nested:!0})],content:rh(n),immediatelyRender:!1,onUpdate({editor:V}){const re=mR(V.getHTML());e(re),A(!0)}}),J=Ae.useCallback(async V=>{O("Opening...");const re=await Wn.call("open",{path:V}),Ne=re.originalFormat||"",Me=Ne==="markdown";i(re.workingPath||Me&&re.sourcePath||""),s(re.workingPath||""),o(re.sourcePath||""),h(""),p(Ne),e(re.content||"");const ze=(re.content||"").length>Hu;E(ze),ze||z==null||z.commands.setContent(rh(re.content||"")),A(!1),v(ze?"raw":"markdown"),O(`Opened ${re.sourcePath}`)},[z]);Ae.useEffect(()=>{Wn.call("startup").then(V=>{V.initialPath&&J(V.initialPath)}).catch(V=>O(V.message))},[J]),Ae.useEffect(()=>{z&&!C&&n.length<=Hu&&z.commands.setContent(rh(n))},[z,n,C]),Ae.useEffect(()=>{var V;(V=window.localStorage)==null||V.setItem("build-corpus-editor-theme",x)},[x]),Ae.useEffect(()=>{var V;(V=window.localStorage)==null||V.setItem("build-corpus-editor-left-panel",H?"collapsed":"open")},[H]),Ae.useEffect(()=>{var V;(V=window.localStorage)==null||V.setItem("build-corpus-editor-right-panel",te?"collapsed":"open")},[te]);async function Q(){try{const V=await Wn.call("chooseOpen");V!=null&&V.path&&await J(V.path)}catch(V){O(V.message)}}async function j(){try{O("Saving...");const V=await Wn.call("save",{path:t,content:n});i(V.output),s(V.output),A(!1),O(`Saved Markdown ${V.output}`)}catch(V){O(V.message)}}async function F(V){try{O("Saving as...");const re=window.__REGEN_MDEDITOR_SMOKE_OUT,Ne=re?"saveAsDirect":"saveAs",Me={suggestedPath:t||l||r,format:V,content:n};if(re){const cn=V==="word"?".docx":".md";Me.targetPath=`${re}\\ui-save-as-${V}${cn}`}const ze=await Wn.call(Ne,Me);ze!=null&&ze.output&&(V==="markdown"?(i(ze.output),s(ze.output),A(!1),O(`Saved Markdown ${ze.output}`)):(h(ze.output),O(`Exported Word ${ze.output}`)))}catch(re){O(re.message)}}function le(){const V=(z==null?void 0:z.getAttributes("link").href)||"",re=window.prompt("URL",V);re!==null&&(re.trim()===""?z==null||z.chain().focus().unsetLink().run():z==null||z.chain().focus().extendMarkRange("link").setLink({href:re.trim()}).run())}async function ye(){try{const V=await Wn.call("chooseImage");V!=null&&V.src&&(z==null||z.chain().focus().setImage({src:V.src,alt:V.alt||""}).run())}catch(V){O(V.message)}}function Re(){const V=window.prompt("Image URL");V&&(z==null||z.chain().focus().setImage({src:V.trim()}).run())}async function je(){var V;try{const re=await Wn.call("chooseFolder");if(!(re!=null&&re.path))return;O("Converting folder...");const Ne=await Wn.call("convertBatch",{path:re.path,moveSources:D});O(`Converted ${((V=Ne.outputs)==null?void 0:V.length)||0} files from ${Ne.input}`)}catch(re){O(re.message)}}async function Gt(){var V;try{O("Inlining images...");const re=await Wn.call("inlineImages",{content:n,basePath:t||r||l});e(re.content||n),A(!0),E((re.content||n).length>Hu),v("raw"),O(`Inlined ${re.converted||0} images${(V=re.skipped)!=null&&V.length?`; skipped ${re.skipped.length}`:""}`)}catch(re){O(re.message)}}function bt(V){e(V),E(V.length>Hu),A(!0),z&&V.length<=Hu&&z.commands.setContent(rh(V))}function js(V,re){if(!V||!re)return;const Ne=Math.max(1,V.scrollHeight-V.clientHeight),Me=Math.max(0,re.scrollHeight-re.clientHeight),ze=V.scrollTop/Ne;re.scrollTop=ze*Me}const Ul=Ae.useCallback(V=>{var re;b!=="split"||se.current||(se.current=!0,js(V.currentTarget,(re=ie.current)==null?void 0:re.scrollDOM),window.requestAnimationFrame(()=>{se.current=!1}))},[b]);Ae.useEffect(()=>{if(!fe)return;function V(re){b!=="split"||se.current||(se.current=!0,js(re.currentTarget,ue.current),window.requestAnimationFrame(()=>{se.current=!1}))}return fe.addEventListener("scroll",V,{passive:!0}),()=>fe.removeEventListener("scroll",V)},[b,fe]);function Wi(V,re,Ne){bt(V),he({start:re,end:Ne,ready:!0}),window.requestAnimationFrame(()=>{const Me=ie.current;Me&&(Me.focus(),Me.dispatch({selection:{anchor:re,head:Ne}}))})}function Yr(){const V=ie.current;if(V){const re=V.state.selection.main;return G.ready&&re.from===0&&re.to===0&&(G.start!==0||G.end!==0)?G:{start:re.from,end:re.to,ready:!0}}return G.ready?G:{start:n.length,end:n.length}}function wi(V,re=V,Ne="text"){const{start:Me,end:ze}=Yr(),cn=n.slice(Me,ze);if(cn&&cn.startsWith(V)&&cn.endsWith(re)){const gr=cn.slice(V.length,cn.length-re.length),Fi=`${n.slice(0,Me)}${gr}${n.slice(ze)}`;Wi(Fi,Me,Me+gr.length);return}if(Me>=V.length&&n.slice(Me-V.length,Me)===V&&n.slice(ze,ze+re.length)===re){const gr=`${n.slice(0,Me-V.length)}${cn}${n.slice(ze+re.length)}`;Wi(gr,Me-V.length,ze-V.length);return}const Ft=s1(n,Me,ze,V,re);if(Ft){const gr=`${n.slice(0,Ft.open)}${n.slice(Ft.open+V.length,Ft.close)}${n.slice(Ft.close+re.length)}`,Fi=Me>Ft.open?V.length:0;Wi(gr,Math.max(Ft.open,Me-Fi),Math.max(Ft.open,ze-Fi));return}const Gi=cn||Ne,mr=`${n.slice(0,Me)}${V}${Gi}${re}${n.slice(ze)}`;Wi(mr,Me+V.length,Me+V.length+Gi.length)}function Zs(V,re=null){const{start:Ne,end:Me}=Yr(),ze=n.lastIndexOf(`
`,Math.max(0,Ne-1))+1,cn=n.indexOf(`
`,Ne),Ft=cn===-1?n.length:cn,Gi=n.slice(ze,Ft),mr=re?Gi.match(re):Gi.startsWith(V)?[V]:null;if(mr){const Fi=mr[0].length,Bc=`${n.slice(0,ze)}${Gi.slice(Fi)}${n.slice(Ft)}`;Wi(Bc,Math.max(ze,Ne-Fi),Math.max(ze,Me-Fi));return}const gr=`${n.slice(0,ze)}${V}${n.slice(ze)}`;Wi(gr,Ne+V.length,Me+V.length)}function Jo(V,re=V){const{start:Ne,end:Me}=Yr();return!!s1(n,Ne,Me,V,re)}function Af(V){const{start:re,end:Ne}=Yr();return V.find(Me=>s1(n,re,Ne,Me,Me))||""}function Mf(){const V=Af(["*","_"]);wi(V||"*",V||"*","italic")}function Xs(V){const{start:re}=Yr(),Ne=n.lastIndexOf(`
`,Math.max(0,re-1))+1,Me=n.indexOf(`
`,re),ze=Me===-1?n.length:Me;return V.test(n.slice(Ne,ze))}function ea(V,re=V.length){const{start:Ne,end:Me}=Yr(),ze=`${n.slice(0,Ne)}${V}${n.slice(Me)}`;Wi(ze,Ne+re,Ne+re)}Ae.useEffect(()=>{if(window.__REGEN_MDEDITOR_SMOKE_OUT)return window.__REGEN_MDEDITOR_SMOKE_API={appendMarkdown(V){const re=`${n}${V}`;return bt(re),re},setMarkdown(V){const re=String(V||"");return bt(re),re},setSelection(V,re=V){const Ne=ie.current;if(!Ne)throw new Error("Markdown editor view is not ready.");const Me=Math.max(0,Math.min(Number(V)||0,Ne.state.doc.length)),ze=Math.max(0,Math.min(Number(re)||Me,Ne.state.doc.length));return Ne.focus(),Ne.dispatch({selection:{anchor:Me,head:ze}}),he({start:Me,end:ze,ready:!0}),`${Me}:${ze}`},appendRichText(V){if(!z)throw new Error("Rich editor is not ready.");const re=String(V).split(/\n{2,}/).map(Ne=>Ne.trim()).filter(Boolean).map(Ne=>`<p>${Ne.replace(/[&<>"']/g,Me=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[Me])}</p>`).join("");return z.chain().focus().insertContent(re||"<p></p>").run(),mR(z.getHTML())},getMarkdown(){return n}},()=>{delete window.__REGEN_MDEDITOR_SMOKE_API}},[n,z]);const _t=!P,Qf=l||t||r||"No file open",Ur=d?d.toUpperCase():"NEW",kn=n.trim()?n.trim().split(/\s+/).length:0,Wl=(n.match(/\n\|/g)||[]).length>1?1:0,Is=(n.match(/!\[[^\]]*]\(/g)||[]).length,_c=(n.match(/https?:\/\//g)||[]).length,ta=Math.max(18,Math.min(94,92-Is*8-Wl*5)),cO=Ur==="MARKDOWN"?"MD":Ur==="NEW"?"NEW":Ur,Ef=l?`${Ur} source loaded`:"No source loaded",uO=t?"Markdown target selected":"Unsaved Markdown draft",hO=c?"Word export written":"Word export ready",Gl=x==="dark"?"light":"dark",At=!1,pr=Ae.useMemo(()=>[sne()],[]);return L.jsxs("main",{className:`app-shell${H?" left-collapsed":""}${te?" right-collapsed":""}`,"data-theme":x,children:[L.jsxs("aside",{className:"brand-rail","aria-label":"Primary tools",children:[L.jsx("div",{className:"mark",children:"BC"}),L.jsx("div",{className:"rail-item active",children:"Ed"}),L.jsx("div",{className:"rail-item",children:"Cv"}),L.jsx("div",{className:"rail-item",children:"Tb"}),L.jsx("div",{className:"rail-item",children:"Im"}),L.jsx("div",{className:"rail-item",children:"Qa"}),L.jsx("div",{}),L.jsx("div",{className:"rail-item",children:"?"})]}),L.jsxs("header",{className:"topbar",children:[L.jsxs("div",{className:"file-title",children:[L.jsx("strong",{children:"regen-mde"}),L.jsx("span",{title:Qf,children:Qf})]}),L.jsxs("div",{className:"actions",children:[L.jsx("button",{className:"ghost",onClick:Q,children:"Open"}),L.jsx("button",{onClick:j,disabled:!t,children:"Save MD"}),L.jsx("button",{onClick:()=>F("markdown"),children:"Save MD As..."}),L.jsx("button",{onClick:()=>F("word"),children:"Export Word..."}),L.jsx("button",{className:"ghost",onClick:Gt,disabled:!n,children:"Inline Images"}),L.jsx("button",{className:"ghost",onClick:je,children:"Convert Folder"}),L.jsx("button",{className:"ghost",onClick:()=>k(Gl),children:x==="dark"?"Light":"Dark"}),L.jsx("button",{className:"primary",onClick:()=>O(`Checked ${kn} words, ${Wl} tables, ${Is} images, ${_c} links`),children:"Run Check"})]})]}),L.jsxs("section",{className:`side-panel left-panel${H?" collapsed":""}`,children:[L.jsxs("div",{className:"panel-chrome",children:[L.jsx("button",{type:"button",className:"panel-toggle","aria-label":H?"Expand Document Flow panel":"Collapse Document Flow panel","aria-expanded":!H,onClick:()=>W(V=>!V),title:H?"Expand Document Flow":"Collapse Document Flow",children:L.jsx("span",{"aria-hidden":"true",children:"≡"})}),L.jsx("h2",{className:"panel-title",children:"Document Flow"})]}),L.jsxs("div",{className:"panel-body",children:[L.jsxs("div",{className:"source-card",children:[L.jsx("strong",{children:Ef}),L.jsx("p",{children:C?"The Markdown draft has unsaved changes.":"The Markdown draft is in sync with its save target."}),L.jsxs("label",{className:"batch-option",children:[L.jsx("input",{type:"checkbox",checked:D,onChange:V=>$(V.target.checked)})," Move processed files to sources"]})]}),L.jsxs("div",{className:"format-flow",children:[L.jsxs("div",{className:"flow-step",children:[L.jsx("div",{className:"badge",children:cO}),L.jsxs("div",{children:[L.jsx("b",{children:"Original"}),L.jsx("small",{children:l||"Choose a file to begin"})]}),L.jsx("small",{children:l?"loaded":"empty"})]}),L.jsxs("div",{className:"flow-step",children:[L.jsx("div",{className:"badge",children:"MD"}),L.jsxs("div",{children:[L.jsx("b",{children:"Working draft"}),L.jsx("small",{children:uO})]}),L.jsx("small",{children:C?"dirty":"saved"})]}),L.jsxs("div",{className:"flow-step",children:[L.jsx("div",{className:"badge",children:"DOCX"}),L.jsxs("div",{children:[L.jsx("b",{children:"Word export"}),L.jsx("small",{children:hO})]}),L.jsx("small",{children:c?"done":"ready"})]})]}),L.jsx("h2",{className:"panel-title",children:"Insert"}),L.jsxs("div",{className:"insert-grid",children:[L.jsxs("button",{className:"insert-tile",disabled:!_t,onClick:()=>z==null?void 0:z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:[L.jsx("b",{children:"Table"}),"Rows, columns, headers"]}),L.jsxs("button",{className:"insert-tile",disabled:!_t,onClick:ye,children:[L.jsx("b",{children:"Image"}),"File with alt text"]}),L.jsxs("button",{className:"insert-tile",disabled:!_t,onClick:()=>z==null?void 0:z.chain().focus().toggleBlockquote().run(),children:[L.jsx("b",{children:"Callout"}),"Note or quotation"]}),L.jsxs("button",{className:"insert-tile",disabled:!_t,onClick:()=>z==null?void 0:z.chain().focus().toggleTaskList().run(),children:[L.jsx("b",{children:"Task"}),"Checklist block"]})]})]})]}),L.jsxs("section",{className:`workspace ${b} ${P?"large":""}`,children:[L.jsxs("div",{className:"mode-strip",children:[L.jsxs("div",{className:"segmented","aria-label":"Editor mode",children:[L.jsx("button",{className:b==="markdown"?"active":"",onClick:()=>v("markdown"),children:"Markdown"}),L.jsx("button",{className:b==="raw"?"active":"",onClick:()=>v("raw"),children:"Raw"}),L.jsx("button",{className:b==="split"?"active":"",onClick:()=>v("split"),children:"Split Screen"})]}),L.jsxs("div",{className:"actions",children:[L.jsx("button",{className:"ghost",disabled:!_t,onClick:()=>z==null?void 0:z.chain().focus().undo().run(),children:"Undo"}),L.jsx("button",{className:"ghost",disabled:!_t,onClick:()=>z==null?void 0:z.chain().focus().redo().run(),children:"Redo"}),L.jsx("button",{className:"ghost",disabled:!_t,onClick:le,children:"Link"})]})]}),L.jsxs("div",{className:"canvas-wrap",children:[b!=="raw"&&_t&&z&&L.jsx("section",{className:"page-area",ref:ue,onScroll:Ul,children:L.jsxs("article",{className:"page rich",children:[L.jsx("p",{className:"page-label",children:Ur==="NEW"?"New Markdown draft":`Converted from ${Ur}`}),L.jsxs(OY,{editor:z,options:{placement:"top"},className:"bubble-menu",children:[L.jsx(wr,{label:"B",title:"Bold",active:z==null?void 0:z.isActive("bold"),onClick:()=>z==null?void 0:z.chain().focus().toggleBold().run()}),L.jsx(wr,{label:"I",title:"Italic",active:z==null?void 0:z.isActive("italic"),onClick:()=>z==null?void 0:z.chain().focus().toggleItalic().run()}),L.jsx(wr,{label:"S",title:"Strike",active:z==null?void 0:z.isActive("strike"),onClick:()=>z==null?void 0:z.chain().focus().toggleStrike().run()}),L.jsx(wr,{label:"Code",active:z==null?void 0:z.isActive("code"),onClick:()=>z==null?void 0:z.chain().focus().toggleCode().run()}),L.jsx(wr,{label:"Link",active:z==null?void 0:z.isActive("link"),onClick:le})]}),L.jsxs(yY,{editor:z,options:{placement:"right-start"},className:"floating-menu",children:[L.jsx(wr,{label:"H1",onClick:()=>z==null?void 0:z.chain().focus().toggleHeading({level:1}).run()}),L.jsx(wr,{label:"H2",onClick:()=>z==null?void 0:z.chain().focus().toggleHeading({level:2}).run()}),L.jsx(wr,{label:"List",onClick:()=>z==null?void 0:z.chain().focus().toggleBulletList().run()}),L.jsx(wr,{label:"Table",onClick:()=>z==null?void 0:z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}),L.jsx(wr,{label:"Image",onClick:ye})]}),L.jsx(PP,{editor:z})]})}),b!=="raw"&&!_t&&L.jsx(Oie,{markdown:n,formatLabel:Ur,pageAreaRef:ue,onScroll:Ul}),(b==="split"||b==="raw")&&L.jsxs("aside",{className:"markdown-pane editable-markdown",children:[L.jsxs("div",{className:"markdown-toolbar","aria-label":"Markdown formatting",onMouseDown:V=>V.preventDefault(),children:[L.jsx("button",{className:Xs(/^# /)?"active":"",disabled:At,onClick:()=>Zs("# ",/^#{1,6} /),children:"H1"}),L.jsx("button",{className:Xs(/^## /)?"active":"",disabled:At,onClick:()=>Zs("## ",/^#{1,6} /),children:"H2"}),L.jsx("button",{className:Jo("**")?"active":"",disabled:At,onClick:()=>wi("**","**","bold"),children:"B"}),L.jsx("button",{className:Af(["*","_"])?"active":"",disabled:At,onClick:Mf,children:"I"}),L.jsx("button",{className:Xs(/^- /)?"active":"",disabled:At,onClick:()=>Zs("- "),children:"List"}),L.jsx("button",{className:Xs(/^> /)?"active":"",disabled:At,onClick:()=>Zs("> "),children:"Quote"}),L.jsx("button",{className:Jo("`")?"active":"",disabled:At,onClick:()=>wi("`","`","code"),children:"Code"}),L.jsx("button",{disabled:At,onClick:()=>wi("[","](https://example.com)","link"),children:"Link"}),L.jsx("button",{disabled:At,onClick:()=>ea("![image](assets/image.png)",2),children:"Image"}),L.jsx("button",{disabled:At,onClick:()=>ea(`
| Column | Value |
| --- | --- |
| Item | Detail |
`,3),children:"Table"})]}),L.jsx(JL,{className:"source code-source",value:n,height:"100%",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,highlightSelectionMatches:!0},extensions:pr,theme:"light",onCreateEditor:V=>{ie.current=V;const re=V.state.selection.main;he({start:re.from,end:re.to,ready:!0}),B(V.scrollDOM)},onUpdate:V=>{if(!V.selectionSet)return;const re=V.state.selection.main;he({start:re.from,end:re.to,ready:!0})},onChange:V=>bt(V)})]})]})]}),L.jsxs("aside",{className:`side-panel right-panel${te?" collapsed":""}`,children:[L.jsxs("div",{className:"panel-chrome",children:[L.jsx("h2",{className:"panel-title",children:"Output Health"}),L.jsx("button",{type:"button",className:"panel-toggle","aria-label":te?"Expand Output Health panel":"Collapse Output Health panel","aria-expanded":!te,onClick:()=>ce(V=>!V),title:te?"Expand Output Health":"Collapse Output Health",children:L.jsx("span",{"aria-hidden":"true",children:"≡"})})]}),L.jsxs("div",{className:"panel-body",children:[L.jsxs("div",{className:"source-card",children:[L.jsx("strong",{children:"Round-trip confidence"}),L.jsx("p",{children:"Tables, images, links, and headings are tracked as conversion risks."}),L.jsx("div",{className:"meter","aria-label":"Round-trip confidence",children:L.jsx("span",{style:{width:`${ta}%`}})})]}),L.jsx("h2",{className:"panel-title",children:"Table Tools"}),L.jsxs("div",{className:"tool-group",children:[L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().addRowAfter().run(),children:"Row +"}),L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().addColumnAfter().run(),children:"Col +"}),L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteRow().run(),children:"Row -"}),L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteColumn().run(),children:"Col -"}),L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().toggleHeaderRow().run(),children:"Header"}),L.jsx("button",{disabled:!_t||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteTable().run(),children:"Delete"})]}),L.jsx("h2",{className:"panel-title",children:"Image Tools"}),L.jsxs("div",{className:"tool-group",children:[L.jsx("button",{disabled:!_t,onClick:ye,children:"File"}),L.jsx("button",{disabled:!_t,onClick:Re,children:"URL"})]}),L.jsxs("div",{className:"checklist",children:[L.jsxs("div",{className:"check",children:[L.jsx("span",{className:"dot"}),L.jsxs("div",{children:[L.jsx("b",{children:"Markdown target"}),L.jsx("br",{}),t||"Choose Save MD As..."]})]}),L.jsxs("div",{className:"check",children:[L.jsx("span",{className:"dot"}),L.jsxs("div",{children:[L.jsx("b",{children:"Word export"}),L.jsx("br",{}),c||"Ready to export with template hook."]})]}),L.jsxs("div",{className:"check",children:[L.jsx("span",{className:Is?"dot warn":"dot"}),L.jsxs("div",{children:[L.jsx("b",{children:"Images"}),L.jsx("br",{}),Is," detected. Asset folder policy still needs final pass."]})]}),L.jsxs("div",{className:"check",children:[L.jsx("span",{className:Wl?"dot warn":"dot"}),L.jsxs("div",{children:[L.jsx("b",{children:"Tables"}),L.jsx("br",{}),Wl," detected. Advanced cell controls are surfaced here."]})]})]})]})]}),L.jsxs("footer",{className:"statusbar",children:[L.jsxs("span",{children:[g,c?` - Last Word export: ${c}`:""]}),L.jsxs("span",{children:["Words ",kn," | Tables ",Wl," | Images ",Is," | Links ",_c]})]})]})}function bie({paneId:n,dropDir:e}){const t=Ae.useRef(null),[i,r]=Ae.useState("Ready — dictate, type, paste, or drop files."),[s,l]=Ae.useState("Voice idle"),[o,c]=Ae.useState(!1),[h,d]=Ae.useState(0),[p,g]=Ae.useState(!1),[O,b]=Ae.useState(!1),v=Ae.useRef(""),x=Ae.useRef([]),k=Ae.useRef(null),C=Ae.useRef(null),A=Ae.useRef(null),P=()=>{var J;return((J=t.current)==null?void 0:J.value)??""},E=J=>{t.current&&(t.current.value=J),v.current=J},D=Ae.useCallback(()=>{d(x.current.length)},[]);function $(J,Q,j){const F=t.current;if(!F)return;const le=F.value;F.value=le.slice(0,J)+j+le.slice(Q);const ye=J+j.length;F.selectionStart=ye,F.selectionEnd=ye,v.current=F.value}function H(J,Q="manual"){const j=t.current;if(!j)return;const F=j.selectionStart??j.value.length,le=j.selectionEnd??F;$(F,le,J),J.trim()&&(x.current.push({start:F,end:F+J.length,text:J,source:Q,at:Date.now()}),D()),j.focus()}function W(J,Q){let j=0;for(;j<J.length&&j<Q.length&&J[j]===Q[j];)j+=1;let F=J.length,le=Q.length;for(;F>j&&le>j&&J[F-1]===Q[le-1];)F-=1,le-=1;return{start:j,removed:J.slice(j,F),inserted:Q.slice(j,le)}}function te(){const J=k.current;J&&J.text.trim()&&(x.current.push({...J,end:J.start+J.text.length,at:Date.now()}),D()),k.current=null}function ce(){const J=P(),Q=W(v.current,J);Q.inserted&&(k.current?k.current.text+=Q.inserted:k.current={start:Q.start,text:Q.inserted,source:"type"},clearTimeout(C.current),C.current=setTimeout(te,1300)),v.current=J}function ie(){var F;te();const J=x.current.pop();if(D(),!J){r("No blocks to delete.");return}const j=P().lastIndexOf(J.text);j>=0&&($(j,j+J.text.length,""),r(`Deleted last block (${J.source}).`)),(F=t.current)==null||F.focus()}function ue(){var J;E(""),k.current=null,x.current=[],D(),r("Cleared."),(J=t.current)==null||J.focus()}async function se(J){var F,le;J.preventDefault(),b(!1);const Q=[...((F=J.dataTransfer)==null?void 0:F.files)||[]],j=(le=J.dataTransfer)==null?void 0:le.getData("text/plain");if(Q.length===0&&j){H(j,"drop");return}for(const ye of Q)try{r(`Saving ${ye.name}...`);const Re=await fe(ye),je=await Wn.call("saveDroppedFile",{fileName:ye.name||"drop.bin",mimeType:ye.type||"application/octet-stream",data:Re}),Gt=je.isImage?`
[Image saved locally]
${je.path}
`:`
[File saved locally]
${je.path}
`;H(Gt,je.isImage?"image-drop":"file-drop"),r(`Inserted local path for ${ye.name}.`)}catch(Re){r(`Drop failed: ${Re.message}`)}}function fe(J){return new Promise((Q,j)=>{const F=new FileReader;F.onload=()=>{const le=String(F.result||""),ye=le.indexOf(",");Q(ye>=0?le.slice(ye+1):le)},F.onerror=()=>j(F.error||new Error("Could not read file.")),F.readAsDataURL(J)})}function B(){const J=window.SpeechRecognition||window.webkitSpeechRecognition;if(!J)return l("Speech API unavailable — Windows dictation (Win+H) still works."),null;const Q=new J;return Q.continuous=!0,Q.interimResults=!1,Q.lang="en-US",Q.onstart=()=>{c(!0),l("Voice listening...")},Q.onend=()=>{c(!1),l("Voice idle"),te()},Q.onerror=j=>l(`Voice error: ${j.error}`),Q.onresult=j=>{for(let F=j.resultIndex;F<j.results.length;F+=1)if(j.results[F].isFinal){const le=j.results[F][0].transcript.trim();le&&(te(),H(`${le} `,"voice"),te())}},Q}Ae.useEffect(()=>{var J;return A.current=B(),(J=t.current)==null||J.focus(),()=>{var Q;try{(Q=A.current)==null||Q.stop()}catch{}clearTimeout(C.current)}},[]);function G(){const J=A.current;J&&(o?J.stop():J.start())}async function he(){te();const J=P();if(!J.trim()){r("Nothing to send.");return}g(!0),r("Sending to terminal...");try{const Q=await Wn.call("sendToPane",{content:J,paneId:n});r(`Pasted into pane ${Q.paneId}. Review in the terminal, then press Enter to submit.`),setTimeout(()=>window.close(),200)}catch(Q){r(`Send failed: ${Q.message}`),g(!1)}}function z(J){(J.ctrlKey||J.metaKey)&&J.key==="Enter"&&(J.preventDefault(),he())}return L.jsxs("main",{className:"compose-shell","data-theme":"dark",children:[L.jsxs("header",{className:"compose-topbar",children:[L.jsxs("div",{className:"compose-title",children:[L.jsx("strong",{children:"WezTerm Prompt Editor"}),L.jsxs("span",{children:[n?`Pane ${n}`:"No pane bound",e?` · drops → ${e}`:""]})]}),L.jsxs("div",{className:"compose-actions",children:[L.jsx("button",{type:"button",className:o?"active":"",onClick:G,children:o?"Stop Voice":"Start Voice"}),L.jsx("button",{type:"button",onClick:ie,children:"Delete Last Block"}),L.jsx("button",{type:"button",onClick:ue,children:"Clear"}),L.jsx("button",{type:"button",className:"primary",onClick:he,disabled:p,children:p?"Sending...":"Send to terminal"})]})]}),L.jsx("section",{className:`compose-editor-wrap${O?" dragging":""}`,onDragOver:J=>{J.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:se,children:L.jsx("textarea",{ref:t,className:"compose-editor",spellCheck:!0,autoFocus:!0,placeholder:"Dictate, type, paste, or drop files here. Images are saved to a temp folder and inserted as a local path. Ctrl+Enter sends.",onInput:ce,onKeyDown:z})}),L.jsxs("footer",{className:"compose-statusbar",children:[L.jsx("span",{children:i}),L.jsx("span",{children:s}),L.jsxs("span",{children:[h," block",h===1?"":"s"]}),L.jsxs("span",{children:["regen-mde v",mie]})]})]})}function Sie(){var i;const n=document.getElementById("root"),e=ej.createRoot(n),t=()=>e.render(L.jsx(yie,{}));if(!((i=window.chrome)!=null&&i.webview)){t();return}Wn.call("composeInfo").then(r=>{r!=null&&r.composeMode?e.render(L.jsx(bie,{paneId:r.paneId||"",dropDir:r.dropDir||""})):t()}).catch(()=>t())}Sie();
