@hanfang5057/co-space 0.0.0-stage → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/bin/cospace-local.js +2 -0
- package/dist/cli.js +379 -0
- package/dist/daemon.cjs +1464 -0
- package/dist/mcp.cjs +36826 -0
- package/dist/package.json +6 -0
- package/dist/web/app.css +1 -0
- package/dist/web/app.js +831 -0
- package/dist/web/index.html +1 -0
- package/package.json +45 -4
- package/skills/cospace-review/SKILL.md +15 -0
package/dist/web/app.js
ADDED
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
var V$=Object.create;var Sb=Object.defineProperty;var U$=Object.getOwnPropertyDescriptor;var q$=Object.getOwnPropertyNames;var j$=Object.getPrototypeOf,$$=Object.prototype.hasOwnProperty;var BR=e=>{throw TypeError(e)};var G$=(e,t,n)=>t in e?Sb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yo=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},aS=(e,t)=>{for(var n in t)Sb(e,n,{get:t[n],enumerable:!0})},W$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of q$(t))!$$.call(e,a)&&a!==n&&Sb(e,a,{get:()=>t[a],enumerable:!(r=U$(t,a))||r.enumerable});return e};var gr=(e,t,n)=>(n=e!=null?V$(j$(e)):{},W$(t||!e||!e.__esModule?Sb(n,"default",{value:e,enumerable:!0}):n,e));var Bn=(e,t,n)=>G$(e,typeof t!="symbol"?t+"":t,n),oS=(e,t,n)=>t.has(e)||BR("Cannot "+n);var L=(e,t,n)=>(oS(e,t,"read from private field"),n?n.call(e):t.get(e)),X=(e,t,n)=>t.has(e)?BR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),B=(e,t,n,r)=>(oS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),zR=(e,t,n)=>(oS(e,t,"access private method"),n);var ZR=yo(Xe=>{"use strict";var lS=Symbol.for("react.transitional.element"),K$=Symbol.for("react.portal"),X$=Symbol.for("react.fragment"),Y$=Symbol.for("react.strict_mode"),Z$=Symbol.for("react.profiler"),J$=Symbol.for("react.consumer"),Q$=Symbol.for("react.context"),eG=Symbol.for("react.forward_ref"),tG=Symbol.for("react.suspense"),nG=Symbol.for("react.memo"),qR=Symbol.for("react.lazy"),rG=Symbol.for("react.activity"),aG=Symbol.for("react.view_transition"),FR=Symbol.iterator;function oG(e){return e===null||typeof e!="object"?null:(e=FR&&e[FR]||e["@@iterator"],typeof e=="function"?e:null)}var jR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$R=Object.assign,GR={};function zf(e,t,n){this.props=e,this.context=t,this.refs=GR,this.updater=n||jR}zf.prototype.isReactComponent={};zf.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};zf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function WR(){}WR.prototype=zf.prototype;function uS(e,t,n){this.props=e,this.context=t,this.refs=GR,this.updater=n||jR}var cS=uS.prototype=new WR;cS.constructor=uS;$R(cS,zf.prototype);cS.isPureReactComponent=!0;var HR=Array.isArray;function sS(){}var Gt={H:null,A:null,T:null,S:null},KR=Object.prototype.hasOwnProperty;function fS(e,t,n){var r=n.ref;return{$$typeof:lS,type:e,key:t,ref:r!==void 0?r:null,props:n}}function iG(e,t){return fS(e.type,t,e.props)}function dS(e){return typeof e=="object"&&e!==null&&e.$$typeof===lS}function sG(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var VR=/\/+/g;function iS(e,t){return typeof e=="object"&&e!==null&&e.key!=null?sG(""+e.key):t.toString(36)}function lG(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(sS,sS):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Bf(e,t,n,r,a){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case lS:case K$:i=!0;break;case qR:return i=e._init,Bf(i(e._payload),t,n,r,a)}}if(i)return a=a(e),i=r===""?"."+iS(e,0):r,HR(a)?(n="",i!=null&&(n=i.replace(VR,"$&/")+"/"),Bf(a,t,n,"",function(u){return u})):a!=null&&(dS(a)&&(a=iG(a,n+(a.key==null||e&&e.key===a.key?"":(""+a.key).replace(VR,"$&/")+"/")+i)),t.push(a)),1;i=0;var s=r===""?".":r+":";if(HR(e))for(var l=0;l<e.length;l++)r=e[l],o=s+iS(r,l),i+=Bf(r,t,n,o,a);else if(l=oG(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,o=s+iS(r,l++),i+=Bf(r,t,n,o,a);else if(o==="object"){if(typeof e.then=="function")return Bf(lG(e),t,n,r,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Lb(e,t,n){if(e==null)return e;var r=[],a=0;return Bf(e,r,"","",function(o){return t.call(n,o,a++)}),r}function uG(e){if(e._status===-1){var t=e._result,n=t();n.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r,n.status===void 0&&(n.status="fulfilled",n.value=r))},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r,n.status===void 0&&(n.status="rejected",n.reason=r))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var UR=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function XR(e){var t=Gt.T,n={};n.types=t!==null?t.types:null,Gt.T=n;try{var r=e(),a=Gt.S;a!==null&&a(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(sS,UR)}catch(o){UR(o)}finally{t!==null&&n.types!==null&&(t.types=n.types),Gt.T=t}}function YR(e){var t=Gt.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else XR(YR.bind(null,e))}var cG={map:Lb,forEach:function(e,t,n){Lb(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Lb(e,function(){t++}),t},toArray:function(e){return Lb(e,function(t){return t})||[]},only:function(e){if(!dS(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Xe.Activity=rG;Xe.Children=cG;Xe.Component=zf;Xe.Fragment=X$;Xe.Profiler=Z$;Xe.PureComponent=uS;Xe.StrictMode=Y$;Xe.Suspense=tG;Xe.ViewTransition=aG;Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gt;Xe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Gt.H.useMemoCache(e)}};Xe.addTransitionType=YR;Xe.cache=function(e){return function(){return e.apply(null,arguments)}};Xe.cacheSignal=function(){return null};Xe.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=$R({},e.props),a=e.key;if(t!=null)for(o in t.key!==void 0&&(a=""+t.key),t)!KR.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var i=Array(o),s=0;s<o;s++)i[s]=arguments[s+2];r.children=i}return fS(e.type,a,r)};Xe.createContext=function(e){return e={$$typeof:Q$,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:J$,_context:e},e};Xe.createElement=function(e,t,n){var r,a={},o=null;if(t!=null)for(r in t.key!==void 0&&(o=""+t.key),t)KR.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(a[r]=t[r]);var i=arguments.length-2;if(i===1)a.children=n;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];a.children=s}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)a[r]===void 0&&(a[r]=i[r]);return fS(e,o,a)};Xe.createRef=function(){return{current:null}};Xe.forwardRef=function(e){return{$$typeof:eG,render:e}};Xe.isValidElement=dS;Xe.lazy=function(e){return{$$typeof:qR,_payload:{_status:-1,_result:e},_init:uG}};Xe.memo=function(e,t){return{$$typeof:nG,type:e,compare:t===void 0?null:t}};Xe.startTransition=XR;Xe.unstable_useCacheRefresh=function(){return Gt.H.useCacheRefresh()};Xe.use=function(e){return Gt.H.use(e)};Xe.useActionState=function(e,t,n){return Gt.H.useActionState(e,t,n)};Xe.useCallback=function(e,t){return Gt.H.useCallback(e,t)};Xe.useContext=function(e){return Gt.H.useContext(e)};Xe.useDebugValue=function(){};Xe.useDeferredValue=function(e,t){return Gt.H.useDeferredValue(e,t)};Xe.useEffect=function(e,t){return Gt.H.useEffect(e,t)};Xe.useEffectEvent=function(e){return Gt.H.useEffectEvent(e)};Xe.useId=function(){return Gt.H.useId()};Xe.useImperativeHandle=function(e,t,n){return Gt.H.useImperativeHandle(e,t,n)};Xe.useInsertionEffect=function(e,t){return Gt.H.useInsertionEffect(e,t)};Xe.useLayoutEffect=function(e,t){return Gt.H.useLayoutEffect(e,t)};Xe.useMemo=function(e,t){return Gt.H.useMemo(e,t)};Xe.useOptimistic=function(e,t){return Gt.H.useOptimistic(e,t)};Xe.useReducer=function(e,t,n){return Gt.H.useReducer(e,t,n)};Xe.useRef=function(e){return Gt.H.useRef(e)};Xe.useState=function(e){return Gt.H.useState(e)};Xe.useSyncExternalStore=function(e,t,n){return Gt.H.useSyncExternalStore(e,t,n)};Xe.useTransition=function(){return Gt.H.useTransition()};Xe.version="19.3.1"});var vo=yo((pge,JR)=>{"use strict";JR.exports=ZR()});var lM=yo(an=>{"use strict";function gS(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<Ib(a,t))e[r]=t,e[n]=a,n=r;else break e}}function ti(e){return e.length===0?null:e[0]}function Eb(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,o=a>>>1;r<o;){var i=2*(r+1)-1,s=e[i],l=i+1,u=e[l];if(0>Ib(s,n))l<a&&0>Ib(u,s)?(e[r]=u,e[l]=n,r=l):(e[r]=s,e[i]=n,r=i);else if(l<a&&0>Ib(u,n))e[r]=u,e[l]=n,r=l;else break e}}return t}function Ib(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}an.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(QR=performance,an.unstable_now=function(){return QR.now()}):(pS=Date,eM=pS.now(),an.unstable_now=function(){return pS.now()-eM});var QR,pS,eM,ts=[],il=[],fG=1,Wa=null,xr=3,xS=!1,hm=!1,mm=!1,bS=!1,rM=typeof setTimeout=="function"?setTimeout:null,aM=typeof clearTimeout=="function"?clearTimeout:null,tM=typeof setImmediate<"u"?setImmediate:null;function Ab(e){for(var t=ti(il);t!==null;){if(t.callback===null)Eb(il);else if(t.startTime<=e)Eb(il),t.sortIndex=t.expirationTime,gS(ts,t);else break;t=ti(il)}}function yS(e){if(mm=!1,Ab(e),!hm)if(ti(ts)!==null)hm=!0,Hf||(Hf=!0,Ff());else{var t=ti(il);t!==null&&vS(yS,t.startTime-e)}}var Hf=!1,gm=-1,oM=5,iM=-1;function sM(){return bS?!0:!(an.unstable_now()-iM<oM)}function hS(){if(bS=!1,Hf){var e=an.unstable_now();iM=e;var t=!0;try{e:{hm=!1,mm&&(mm=!1,aM(gm),gm=-1),xS=!0;var n=xr;try{t:{for(Ab(e),Wa=ti(ts);Wa!==null&&!(Wa.expirationTime>e&&sM());){var r=Wa.callback;if(typeof r=="function"){Wa.callback=null,xr=Wa.priorityLevel;var a=r(Wa.expirationTime<=e);if(e=an.unstable_now(),typeof a=="function"){Wa.callback=a,Ab(e),t=!0;break t}Wa===ti(ts)&&Eb(ts),Ab(e)}else Eb(ts);Wa=ti(ts)}if(Wa!==null)t=!0;else{var o=ti(il);o!==null&&vS(yS,o.startTime-e),t=!1}}break e}finally{Wa=null,xr=n,xS=!1}t=void 0}}finally{t?Ff():Hf=!1}}}var Ff;typeof tM=="function"?Ff=function(){tM(hS)}:typeof MessageChannel<"u"?(mS=new MessageChannel,nM=mS.port2,mS.port1.onmessage=hS,Ff=function(){nM.postMessage(null)}):Ff=function(){rM(hS,0)};var mS,nM;function vS(e,t){gm=rM(function(){e(an.unstable_now())},t)}an.unstable_IdlePriority=5;an.unstable_ImmediatePriority=1;an.unstable_LowPriority=4;an.unstable_NormalPriority=3;an.unstable_Profiling=null;an.unstable_UserBlockingPriority=2;an.unstable_cancelCallback=function(e){e.callback=null};an.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oM=0<e?Math.floor(1e3/e):5};an.unstable_getCurrentPriorityLevel=function(){return xr};an.unstable_next=function(e){switch(xr){case 1:case 2:case 3:var t=3;break;default:t=xr}var n=xr;xr=t;try{return e()}finally{xr=n}};an.unstable_requestPaint=function(){bS=!0};an.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=xr;xr=e;try{return t()}finally{xr=n}};an.unstable_scheduleCallback=function(e,t,n){var r=an.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return a=n+a,e={id:fG++,callback:t,priorityLevel:e,startTime:n,expirationTime:a,sortIndex:-1},n>r?(e.sortIndex=n,gS(il,e),ti(ts)===null&&e===ti(il)&&(mm?(aM(gm),gm=-1):mm=!0,vS(yS,n-r))):(e.sortIndex=a,gS(ts,e),hm||xS||(hm=!0,Hf||(Hf=!0,Ff()))),e};an.unstable_shouldYield=sM;an.unstable_wrapCallback=function(e){var t=xr;return function(){var n=xr;xr=t;try{return e.apply(this,arguments)}finally{xr=n}}}});var cM=yo((mge,uM)=>{"use strict";uM.exports=lM()});var pM=yo(br=>{"use strict";var dG=vo();function dM(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sl(){}var Rr={d:{f:sl,r:function(){throw Error(dM(522))},D:sl,C:sl,L:sl,m:sl,X:sl,S:sl,M:sl},p:0,findDOMNode:null},pG=Symbol.for("react.portal"),hG=Symbol.for("react.recoverable"),fM=Symbol.for("react.optimistic_key");function mG(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pG,key:r==null?null:r===fM?fM:""+r,children:e,containerInfo:t,implementation:n}}var xm=dG.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _b(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rr;br.browser=function(e){return{$$typeof:hG,_reason:e}};br.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(dM(299));return mG(e,t,null,n)};br.flushSync=function(e){var t=xm.T,n=Rr.p;try{if(xm.T=null,Rr.p=2,e)return e()}finally{xm.T=t,Rr.p=n,Rr.d.f()}};br.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Rr.d.C(e,t))};br.prefetchDNS=function(e){typeof e=="string"&&Rr.d.D(e)};br.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=_b(n,t.crossOrigin),a=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Rr.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n==="script"&&Rr.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};br.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=_b(t.as,t.crossOrigin);Rr.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Rr.d.M(e)};br.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=_b(n,t.crossOrigin);Rr.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};br.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=_b(t.as,t.crossOrigin);Rr.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Rr.d.m(e)};br.requestFormReset=function(e){Rr.d.r(e)};br.unstable_batchedUpdates=function(e,t){return e(t)};br.useFormState=function(e,t,n){return xm.H.useFormState(e,t,n)};br.useFormStatus=function(){return xm.H.useHostTransitionStatus()};br.version="19.3.1"});var gM=yo((xge,mM)=>{"use strict";function hM(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hM)}catch(e){console.error(e)}}hM(),mM.exports=pM()});var n4=yo(cv=>{"use strict";var Hn=cM(),tO=vo(),gG=gM();function ee(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function nO(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ag(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function rO(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function aO(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function xM(e){if(ag(e)!==e)throw Error(ee(188))}function xG(e){var t=e.alternate;if(!t){if(t=ag(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return xM(a),e;if(o===r)return xM(a),t;o=o.sibling}throw Error(ee(188))}if(n.return!==r.return)n=a,r=o;else{for(var i=!1,s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i){for(s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function oO(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=oO(e),t!==null)return t;e=e.sibling}return null}function ca(e,t,n,r,a,o){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,a,o)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&ca(e.child,t,n,r,a,o))return!0;e=e.sibling}return!1}function lc(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function bM(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function iO(e){var t=[null,null],n=lc(e);return n===null||sO(t,e,n.child,{foundSelf:!1}),t}function sO(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&sO(e,t,n.child,r))return!0;n=n.sibling}return!1}function Fn(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(ee(559))}}var Wf=null,JS=null;function bG(e,t,n){return e===n?!0:e===t?(Wf=e,!0):!1}function yG(e,t,n){return e===n?(JS=e,!1):e===t?(JS!==null&&(Wf=e),!0):!1}function yM(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function QS(e,t,n){for(var r=0,a=e;a;a=n(a))r++;a=0;for(var o=t;o;o=n(o))a++;for(;0<r-a;)e=n(e),r--;for(;0<a-r;)t=n(t),a--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var $t=Object.assign,vG=Symbol.for("react.element"),Tb=Symbol.for("react.transitional.element"),Sm=Symbol.for("react.portal"),Kf=Symbol.for("react.fragment"),lO=Symbol.for("react.strict_mode"),eL=Symbol.for("react.profiler"),uO=Symbol.for("react.consumer"),si=Symbol.for("react.context"),u2=Symbol.for("react.forward_ref"),tL=Symbol.for("react.suspense"),nL=Symbol.for("react.suspense_list"),c2=Symbol.for("react.memo"),fl=Symbol.for("react.lazy"),rL=Symbol.for("react.activity"),wG=Symbol.for("react.legacy_hidden"),kG=Symbol.for("react.memo_cache_sentinel"),aL=Symbol.for("react.view_transition"),CG=Symbol.for("react.recoverable"),vM=Symbol.iterator;function bm(e){return e===null||typeof e!="object"?null:(e=vM&&e[vM]||e["@@iterator"],typeof e=="function"?e:null)}var SG=Symbol.for("react.client.reference");function oL(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===SG?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kf:return"Fragment";case eL:return"Profiler";case lO:return"StrictMode";case tL:return"Suspense";case nL:return"SuspenseList";case rL:return"Activity";case aL:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case Sm:return"Portal";case si:return e.displayName||"Context";case uO:return(e._context.displayName||"Context")+".Consumer";case u2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case c2:return t=e.displayName||null,t!==null?t:oL(e.type)||"Memo";case fl:t=e._payload,e=e._init;try{return oL(e(t))}catch{}}return null}var Lm=Array.isArray,Ge=tO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Lt=gG.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Xu={pending:!1,data:null,method:null,action:null},iL=[],Xf=-1;function hi(e){return{current:e}}function rr(e){0>Xf||(e.current=iL[Xf],iL[Xf]=null,Xf--)}function Xt(e,t){Xf++,iL[Xf]=e.current,e.current=t}var fi=hi(null),Um=hi(null),vl=hi(null),gy=hi(null);function xy(e,t){switch(Xt(vl,t),Xt(Um,e),Xt(fi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?NN(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=NN(t),e=D3(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}rr(fi),Xt(fi,e)}function md(){rr(fi),rr(Um),rr(vl)}function sL(e){var t=e.memoizedState;t!==null&&(Ld._currentValue=t.memoizedState,Xt(gy,e)),t=fi.current;var n=D3(t,e.type);t!==n&&(Xt(Um,e),Xt(fi,n))}function by(e){Um.current===e&&(rr(fi),rr(Um)),gy.current===e&&(rr(gy),Ld._currentValue=Xu)}var wS,wM;function ul(e){if(wS===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wS=t&&t[1]||"",wM=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+wS+e+wM}var kS=!1;function CS(e,t){if(!e||kS)return"";kS=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}f=!1;try{var p=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),f=!0,new e}finally{f&&(p!==void 0?Object.defineProperty(e.prototype,"props",p):delete e.prototype.props)}}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),i=o[0],s=o[1];if(i&&s){var l=i.split(`
|
|
4
|
+
`),u=s.split(`
|
|
5
|
+
`);for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<u.length&&!u[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===u.length)for(r=l.length-1,a=u.length-1;1<=r&&0<=a&&l[r]!==u[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==u[a]){if(r!==1||a!==1)do if(r--,a--,0>a||l[r]!==u[a]){var c=`
|
|
6
|
+
`+l[r].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=r&&0<=a);break}}}finally{kS=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ul(n):""}function LG(e,t){switch(e.tag){case 26:case 27:case 5:return ul(e.type);case 16:return ul("Lazy");case 13:return e.child!==t&&t!==null?ul("Suspense Fallback"):ul("Suspense");case 19:return ul("SuspenseList");case 0:case 15:return CS(e.type,!1);case 11:return CS(e.type.render,!1);case 1:return CS(e.type,!0);case 31:return ul("Activity");case 30:return ul("ViewTransition");default:return""}}function kM(e){try{var t="",n=null;do t+=LG(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var lL=Object.prototype.hasOwnProperty,f2=Hn.unstable_scheduleCallback,SS=Hn.unstable_cancelCallback,IG=Hn.unstable_shouldYield,AG=Hn.unstable_requestPaint,Ta=Hn.unstable_now,EG=Hn.unstable_getCurrentPriorityLevel,cO=Hn.unstable_ImmediatePriority,fO=Hn.unstable_UserBlockingPriority,yy=Hn.unstable_NormalPriority,_G=Hn.unstable_LowPriority,dO=Hn.unstable_IdlePriority,TG=Hn.log,DG=Hn.unstable_setDisableYieldValue,og=null,Da=null;function hl(e){if(typeof TG=="function"&&DG(e),Da&&typeof Da.setStrictMode=="function")try{Da.setStrictMode(og,e)}catch{}}var Ra=Math.clz32?Math.clz32:NG,RG=Math.log,MG=Math.LN2;function NG(e){return e>>>=0,e===0?32:31-(RG(e)/MG|0)|0}var Db=256,Rb=262144,Mb=4194304;function ju(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $y(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?a=ju(r):(i&=s,i!==0?a=ju(i):n||(n=s&~e,n!==0&&(a=ju(n))))):(s=r&~o,s!==0?a=ju(s):i!==0?a=ju(i):n||(n=r&~e,n!==0&&(a=ju(n)))),a===0?0:t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:a}function ig(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pO(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ra(n),a=1<<r;t|=e[r],n&=~a}return t}function OG(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 hO(){var e=Mb;return Mb<<=1,(Mb&62914560)===0&&(Mb=4194304),e}function LS(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function sg(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function PG(e,t,n,r,a,o){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=i&~n;0<n;){var c=31-Ra(n),f=1<<c;s[c]=0,l[c]=-1;var d=u[c];if(d!==null)for(u[c]=null,c=0;c<d.length;c++){var p=d[c];p!==null&&(p.lane&=-536870913)}n&=~f}r!==0&&mO(e,r,0),o!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=o&~(i&~t))}function mO(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ra(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gO(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ra(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function xO(e,t){var n=t&-t;return n=(n&42)!==0?1:d2(n),(n&(e.suspendedLanes|t))!==0?0:n}function d2(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function p2(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function bO(){var e=Lt.p;return e!==0?e:(e=window.event,e===void 0?32:Q3(e.type))}function CM(e,t){var n=Lt.p;try{return Lt.p=e,t()}finally{Lt.p=n}}var ms=Math.random().toString(36).slice(2),tr="__reactFiber$"+ms,fa="__reactProps$"+ms,Ed="__reactContainer$"+ms,SM="__reactEvents$"+ms,BG="__reactListeners$"+ms,zG="__reactHandles$"+ms,LM="__reactResources$"+ms,lg="__reactMarker$"+ms,vy="__reactLoad$"+ms;function Gy(e){delete e[tr],delete e[fa],delete e[BG],delete e[zG]}function Wu(e){var t;if(t=e[tr])return t;for(var n=e.parentNode;n;){if(t=n[Ed]||n[tr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=UN(e);e!==null;){if(n=e[tr])return n;e=UN(e)}return t}e=n,n=e.parentNode}return null}function _d(e){if(e=e[tr]||e[Ed]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Im(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(ee(33))}function od(e){var t=e[LM];return t||(t=e[LM]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jn(e){e[lg]=!0}function yO(e){e[vy]=void 0}var vO=new Set,wO={};function uc(e,t){gd(e,t),gd(e+"Capture",t)}function gd(e,t){for(wO[e]=t,e=0;e<t.length;e++)vO.add(t[e])}var FG=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]*$"),IM={},AM={};function HG(e){return lL.call(AM,e)?!0:lL.call(IM,e)?!1:FG.test(e)?AM[e]=!0:(IM[e]=!0,!1)}var kt=!1;function EM(){var e=kt;return kt=!1,e}function Zb(e,t,n){if(HG(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function Nb(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function ns(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Ia(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function VG(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uL(e){if(!e._valueTracker){var t=kO(e)?"checked":"value";e._valueTracker=VG(e,t,""+e[t])}}function CO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}var UG=/[\n"\\]/g;function Ja(e){return e.replace(UG,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function cL(e,t,n,r,a,o,i,s){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ia(t)):e.value!==""+Ia(t)&&(e.value=""+Ia(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?i==="number"&&e.value==t?IS(e,Ia(e.value)):IS(e,Ia(t)):n!=null?IS(e,Ia(n)):r!=null&&e.removeAttribute("value"),a==null&&o!=null&&(e.defaultChecked=!!o),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+Ia(s):e.removeAttribute("name")}function SO(e,t,n,r,a,o,i,s){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){uL(e);return}n=n!=null?""+Ia(n):"",t=t!=null?""+Ia(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r=r??a,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),uL(e)}function IS(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function id(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ia(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function LO(e,t,n){if(t!=null&&(t=""+Ia(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ia(n):""}function IO(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(ee(92));if(Lm(r)){if(1<r.length)throw Error(ee(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Ia(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),uL(e)}function xd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qG=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 _M(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||qG.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function AO(e,t,n){if(t!=null&&typeof t!="object")throw Error(ee(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="",kt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(_M(e,a,r),kt=!0)}else for(var o in t)t.hasOwnProperty(o)&&_M(e,o,t[o])}function h2(e){if(e.indexOf("-")===-1)return!1;switch(e){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 jG=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"],["maskType","mask-type"],["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"]]),$G=/^[\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 Jb(e){return $G.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function li(){}var fL=null;function m2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yf=null,sd=null;function TM(e){var t=_d(e);if(t&&(e=t.stateNode)){var n=e[fa]||null;e:switch(e=t.stateNode,t.type){case"input":if(cL(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ja(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[fa]||null;if(!a)throw Error(ee(90));cL(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&CO(r)}break e;case"textarea":LO(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&id(e,!!n.multiple,t,!1)}}}var AS=!1;function EO(e,t,n){if(AS)return e(t,n);AS=!0;try{var r=e(t);return r}finally{if(AS=!1,(Yf!==null||sd!==null)&&(iv(),Yf&&(t=Yf,e=sd,sd=Yf=null,TM(t),e)))for(t=0;t<e.length;t++)TM(e[t])}}function qm(e,t){var n=e.stateNode;if(n===null)return null;var r=n[fa]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dL=!1;if(us)try{Vf={},Object.defineProperty(Vf,"passive",{get:function(){dL=!0}}),window.addEventListener("test",Vf,Vf),window.removeEventListener("test",Vf,Vf)}catch{dL=!1}var Vf,ml=null,g2=null,Qb=null;function _O(){if(Qb)return Qb;var e,t=g2,n=t.length,r,a="value"in ml?ml.value:ml.textContent,o=a.length;for(e=0;e<n&&t[e]===a[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===a[o-r];r++);return Qb=a.slice(e,1<r?1-r:void 0)}function ey(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ob(){return!0}function DM(){return!1}function Pr(e){function t(n,r,a,o,i){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ob:DM,this.isPropagationStopped=DM,this}return $t(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ob)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ob)},persist:function(){},isPersistent:Ob}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wy=Pr(Ol),ug=$t({},Ol,{view:0,detail:0}),GG=Pr(ug),ES,_S,ym,Ky=$t({},ug,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x2,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ym&&(ym&&e.type==="mousemove"?(ES=e.screenX-ym.screenX,_S=e.screenY-ym.screenY):_S=ES=0,ym=e),ES)},movementY:function(e){return"movementY"in e?e.movementY:_S}}),RM=Pr(Ky),WG=$t({},Ky,{dataTransfer:0}),KG=Pr(WG),XG=$t({},ug,{relatedTarget:0}),TS=Pr(XG),YG=$t({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),ZG=Pr(YG),JG=$t({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),QG=Pr(JG),eW=$t({},Ol,{data:0}),MM=Pr(eW),tW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nW={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"},rW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rW[e])?!!t[e]:!1}function x2(){return aW}var oW=$t({},ug,{key:function(e){if(e.key){var t=tW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ey(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x2,charCode:function(e){return e.type==="keypress"?ey(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ey(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),iW=Pr(oW),sW=$t({},Ky,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),NM=Pr(sW),lW=$t({},Ol,{submitter:0}),uW=Pr(lW),cW=$t({},ug,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x2}),fW=Pr(cW),dW=$t({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),pW=Pr(dW),hW=$t({},Ky,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mW=Pr(hW),gW=$t({},Ol,{newState:0,oldState:0,source:0}),xW=Pr(gW),bW=[9,13,27,32],b2=us&&"CompositionEvent"in window,_m=null;us&&"documentMode"in document&&(_m=document.documentMode);var yW=us&&"TextEvent"in window&&!_m,TO=us&&(!b2||_m&&8<_m&&11>=_m),OM=" ",PM=!1;function DO(e,t){switch(e){case"keyup":return bW.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function RO(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zf=!1;function vW(e,t){switch(e){case"compositionend":return RO(t);case"keypress":return t.which!==32?null:(PM=!0,OM);case"textInput":return e=t.data,e===OM&&PM?null:e;default:return null}}function wW(e,t){if(Zf)return e==="compositionend"||!b2&&DO(e,t)?(e=_O(),Qb=g2=ml=null,Zf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return TO&&t.locale!=="ko"?null:t.data;default:return null}}var kW={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 BM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kW[e.type]:t==="textarea"}function MO(e,t,n,r){Yf?sd?sd.push(r):sd=[r]:Yf=r,t=Uy(t,"onChange"),0<t.length&&(n=new Wy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Tm=null,jm=null;function CW(e){E3(e,0)}function Xy(e){var t=Im(e);if(CO(t))return e}function zM(e,t){if(e==="change")return t}var NO=!1;us&&(us?(Bb="oninput"in document,Bb||(DS=document.createElement("div"),DS.setAttribute("oninput","return;"),Bb=typeof DS.oninput=="function"),Pb=Bb):Pb=!1,NO=Pb&&(!document.documentMode||9<document.documentMode));var Pb,Bb,DS;function FM(){Tm&&(Tm.detachEvent("onpropertychange",OO),jm=Tm=null)}function OO(e){if(e.propertyName==="value"&&Xy(jm)){var t=[];MO(t,jm,e,m2(e)),EO(CW,t)}}function SW(e,t,n){e==="focusin"?(FM(),Tm=t,jm=n,Tm.attachEvent("onpropertychange",OO)):e==="focusout"&&FM()}function LW(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xy(jm)}function IW(e,t){if(e==="click")return Xy(t)}function AW(e,t){if(e==="input"||e==="change")return Xy(t)}function EW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Na=typeof Object.is=="function"?Object.is:EW;function $m(e,t){if(Na(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!lL.call(t,a)||!Na(e[a],t[a]))return!1}return!0}function pL(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function HM(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function VM(e,t){var n=HM(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=HM(n)}}function PO(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?PO(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function BO(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pL(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pL(e.document)}return t}function y2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _W=us&&"documentMode"in document&&11>=document.documentMode,Jf=null,hL=null,Dm=null,mL=!1;function UM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mL||Jf==null||Jf!==pL(r)||(r=Jf,"selectionStart"in r&&y2(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dm&&$m(Dm,r)||(Dm=r,r=Uy(hL,"onSelect"),0<r.length&&(t=new Wy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Jf)))}function Uu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qf={animationend:Uu("Animation","AnimationEnd"),animationiteration:Uu("Animation","AnimationIteration"),animationstart:Uu("Animation","AnimationStart"),transitionrun:Uu("Transition","TransitionRun"),transitionstart:Uu("Transition","TransitionStart"),transitioncancel:Uu("Transition","TransitionCancel"),transitionend:Uu("Transition","TransitionEnd")},RS={},zO={};us&&(zO=document.createElement("div").style,"AnimationEvent"in window||(delete Qf.animationend.animation,delete Qf.animationiteration.animation,delete Qf.animationstart.animation),"TransitionEvent"in window||delete Qf.transitionend.transition);function cc(e){if(RS[e])return RS[e];if(!Qf[e])return e;var t=Qf[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zO)return RS[e]=t[n];return e}var FO=cc("animationend"),HO=cc("animationiteration"),VO=cc("animationstart"),TW=cc("transitionrun"),DW=cc("transitionstart"),RW=cc("transitioncancel"),UO=cc("transitionend"),qO=new Map,gL="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");gL.push("scrollEnd");function Io(e,t){qO.set(e,t),uc(t,[e])}var MW=0;function cs(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Lo.identifierPrefix;var n=MW++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function qM(e){if(e==null||typeof e=="string")return e;var t=null,n=hd;if(n!==null)for(var r=0;r<n.length;r++){var a=e[n[r]];if(a!=null){if(a==="none")return"none";t=t==null?a:t+(" "+a)}}return t??e.default}function gs(e,t){return e=qM(e),t=qM(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var wy=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Xa=[],ed=0,v2=0;function Yy(){for(var e=ed,t=v2=ed=0;t<e;){var n=Xa[t];Xa[t++]=null;var r=Xa[t];Xa[t++]=null;var a=Xa[t];Xa[t++]=null;var o=Xa[t];if(Xa[t++]=null,r!==null&&a!==null){var i=r.pending;i===null?a.next=a:(a.next=i.next,i.next=a),r.pending=a}o!==0&&jO(n,a,o)}}function Zy(e,t,n,r){Xa[ed++]=e,Xa[ed++]=t,Xa[ed++]=n,Xa[ed++]=r,v2|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function w2(e,t,n,r){return Zy(e,t,n,r),ky(e)}function fc(e,t){return Zy(e,null,null,t),ky(e)}function jO(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var a=!1,o=e.return;o!==null;)o.childLanes|=n,r=o.alternate,r!==null&&(r.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(a=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,a&&t!==null&&(a=31-Ra(n),e=o.hiddenUpdates,r=e[a],r===null?e[a]=[t]:r.push(t),t.lane=n|536870912),o):null}function ky(e){if(50<Vm)throw Vm=0,cy=null,Error(ee(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var td={};function NW(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(e,t,n,r){return new NW(e,t,n,r)}function k2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ss(e,t){var n=e.alternate;return n===null?(n=la(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $O(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ty(e,t,n,r,a,o){var i=0;if(r=e,typeof r=="function")k2(r)&&(i=1);else if(typeof r=="string")i=iX(e,n,fi.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(r){case rL:return e=la(31,n,t,a),e.elementType=rL,e.lanes=o,e;case Kf:return Yu(n.children,a,o,t);case lO:i=8,a|=24;break;case eL:return e=la(12,n,t,a|2),e.elementType=eL,e.lanes=o,e;case tL:return e=la(13,n,t,a),e.elementType=tL,e.lanes=o,e;case nL:return e=la(19,n,t,a),e.elementType=nL,e.lanes=o,e;case wG:case aL:return e=a|32,e=la(30,n,t,e),e.elementType=aL,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case si:i=10;break e;case uO:i=9;break e;case u2:i=11;break e;case c2:i=14;break e;case fl:i=16,r=null;break e}i=29,n=Error(ee(130,e===null?"null":typeof e,"")),r=null}return t=la(i,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Yu(e,t,n,r){return e=la(7,e,r,t),e.lanes=n,e}function MS(e,t,n){return e=la(6,e,null,t),e.lanes=n,e}function GO(e){var t=la(18,null,null,0);return t.stateNode=e,t}function NS(e,t,n){return t=la(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jM=new WeakMap;function Qa(e,t){if(typeof e=="object"&&e!==null){var n=jM.get(e);return n!==void 0?n:(t={value:e,source:t,stack:kM(t)},jM.set(e,t),t)}return{value:e,source:t,stack:kM(t)}}var nd=[],rd=0,Cy=null,Gm=0,Ya=[],Za=0,Tl=null,ui=1,ci="";function as(e,t){nd[rd++]=Gm,nd[rd++]=Cy,Cy=e,Gm=t}function WO(e,t,n){Ya[Za++]=ui,Ya[Za++]=ci,Ya[Za++]=Tl,Tl=e;var r=ui;e=ci;var a=32-Ra(r)-1;r&=~(1<<a),n+=1;var o=32-Ra(t)+a;if(30<o){var i=a-a%5;o=(r&(1<<i)-1).toString(32),r>>=i,a-=i,ui=1<<32-Ra(t)+a|n<<a|r,ci=o+e}else ui=1<<o|n<<a|r,ci=e}function Jy(e){e.return!==null&&(as(e,1),WO(e,1,0))}function C2(e){for(;e===Cy;)Cy=nd[--rd],nd[rd]=null,Gm=nd[--rd],nd[rd]=null;for(;e===Tl;)Tl=Ya[--Za],Ya[Za]=null,ci=Ya[--Za],Ya[Za]=null,ui=Ya[--Za],Ya[Za]=null}function KO(e,t){Ya[Za++]=ui,Ya[Za++]=ci,Ya[Za++]=Tl,ui=t.id,ci=t.overflow,Tl=e}var $n=null,Kt=null,nt=!1,wl=null,eo=!1,xL=Error(ee(519));function Dl(e){var t=Error(ee(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wm(Qa(t,e)),xL}function $M(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tr]=e,t[fa]=r,n){case"dialog":ut("cancel",t),ut("close",t);break;case"iframe":case"object":case"embed":ut("load",t);break;case"video":case"audio":for(n=0;n<Zm.length;n++)ut(Zm[n],t);break;case"source":ut("error",t);break;case"img":case"image":case"link":ut("error",t),ut("load",t);break;case"details":ut("toggle",t);break;case"input":ut("invalid",t),SO(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ut("invalid",t);break;case"textarea":ut("invalid",t),IO(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||T3(t.textContent,n)?(r.popover!=null&&(ut("beforetoggle",t),ut("toggle",t)),r.onScroll!=null&&ut("scroll",t),r.onScrollEnd!=null&&ut("scrollend",t),r.onClick!=null&&(t.onclick=li),t=!0):t=!1,t||Dl(e,!0)}function Sy(e){for($n=e.return;$n;)switch($n.tag){case 5:case 31:case 13:eo=!1;return;case 27:case 3:eo=!0;return;default:$n=$n.return}}function Uf(e){if(e!==$n)return!1;if(!nt)return Sy(e),nt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||t2(e.type,e.memoizedProps)),n=!n),n&&Kt&&Dl(e),Sy(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));Kt=VN(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));Kt=VN(e)}else t===27?(t=Kt,Pl(e.type)?(e=o2,o2=null,Kt=e):Kt=t):Kt=$n?to(e.stateNode.nextSibling):null;return!0}function ec(){Kt=$n=null,nt=!1}function OS(){var e=wl;return e!==null&&(ia===null?ia=e:ia.push.apply(ia,e),wl=null),e}function Wm(e){wl===null?wl=[e]:wl.push(e)}var bL=hi(null),dc=null,is=null;function gl(e,t,n){Xt(bL,t._currentValue),t._currentValue=n}function ls(e){e._currentValue=bL.current,rr(bL)}function ny(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yL(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var i=a.child;o=o.firstContext;e:for(;o!==null;){var s=o;o=a;for(var l=0;l<t.length;l++)if(s.context===t[l]){o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ny(o.return,n,e),r||(i=null);break e}o=s.next}}else if(a.tag===18){if(i=a.return,i===null)throw Error(ee(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ny(i,n,e),i=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),ny(a.return,n,e),i=a.child,i=i!==null?i.sibling:null):i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===e){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}}function tc(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if((a.flags&524288)!==0)o=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var i=a.alternate;if(i===null)throw Error(ee(387));if(i=i.memoizedProps,i!==null){var s=a.type;Na(a.pendingProps.value,i.value)||(e!==null?e.push(s):e=[s])}}else if(a===gy.current){if(i=a.alternate,i===null)throw Error(ee(387));i.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ld):e=[Ld])}a=a.return}return e!==null&&yL(t,e,n,r),t.flags|=262144,e!==null}function Ly(e){for(e=e.firstContext;e!==null;){if(!Na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function nc(e){dc=e,is=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nr(e){return XO(dc,e)}function zb(e,t){return dc===null&&nc(e),XO(e,t)}function XO(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},is===null){if(e===null)throw Error(ee(308));is=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else is=is.next=t;return n}var OW=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},PW=Hn.unstable_scheduleCallback,BW=Hn.unstable_NormalPriority,Tn={$$typeof:si,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function S2(){return{controller:new OW,data:new Map,refCount:0}}function cg(e){e.refCount--,e.refCount===0&&PW(BW,function(){e.controller.abort()})}function GM(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Am=null;function zW(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Rm=null,vL=0,rc=0,ld=null;function FW(e,t){if(Rm===null){var n=Rm=[];vL=0,rc=J2(),ld={status:"pending",value:void 0,then:function(r){n.push(r)}}}return vL++,t.then(WM,WM),t}function WM(){if(--vL===0&&(Am=null,Rm!==null)){ld!==null&&(ld.status="fulfilled");var e=Rm;Rm=null,rc=0,ld=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function HW(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(r.status="rejected",r.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),r}var KM=Ge.S;Ge.S=function(e,t){if(p3=Ta(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&FW(e,t),Am!==null)for(var n=kd;n!==null;)GM(n,Am),n=n.next;if(n=e.types,n!==null){for(var r=kd;r!==null;)GM(r,n),r=r.next;if(rc!==0){r=Am,r===null&&(r=Am=[]);for(var a=0;a<n.length;a++){var o=n[a];r.indexOf(o)===-1&&r.push(o)}}}KM!==null&&KM(e,t)};var Zu=hi(null);function L2(){var e=Zu.current;return e!==null?e:jt.pooledCache}function ry(e,t){t===null?Xt(Zu,Zu.current):Xt(Zu,t.pool)}function YO(){var e=L2();return e===null?null:{parent:Tn._currentValue,pool:e}}var Td=Error(ee(460)),I2=Error(ee(474)),Qy=Error(ee(542)),Iy={then:function(){}};function XM(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ZO(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(li,li),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ZM(e),e===void 0&&!("reason"in t)?Error(ee(600)):e;default:if(typeof t.status=="string")t.then(li,li);else{if(e=jt,e!==null&&100<e.shellSuspendCounter)throw Error(ee(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=r}},function(r){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ZM(e),e}throw Ju=t,Td}}function $u(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ju=n,Td):n}}var Ju=null;function YM(){if(Ju===null)throw Error(ee(459));var e=Ju;return Ju=null,e}function ZM(e){if(e===Td||e===Qy)throw Error(ee(483))}var ud=null,Km=0;function Fb(e){var t=Km;return Km+=1,ud===null&&(ud=[]),ZO(ud,e,t)}function ll(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hb(e,t){throw t.$$typeof===vG?Error(ee(525)):(e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function JO(e){function t(m,y){if(e){var b=m.deletions;b===null?(m.deletions=[y],m.flags|=16):b.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function r(m){for(var y=new Map;m!==null;)m.key===null?y.set(m.index,m):y.set(m.key,m),m=m.sibling;return y}function a(m,y){return m=ss(m,y),m.index=0,m.sibling=null,m}function o(m,y,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<y?(m.flags|=2,y):b):(m.flags|=134217730,y)):(m.flags|=1048576,y)}function i(m){return e&&m.alternate===null&&(m.flags|=134217730),m}function s(m,y,b,v){return y===null||y.tag!==6?(y=MS(b,m.mode,v),y.return=m,y):(y=a(y,b),y.return=m,y)}function l(m,y,b,v){var w=b.type;return w===Kf?(m=c(m,y,b.props.children,v,b.key),ll(m,b),m):y!==null&&(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===fl&&$u(w)===y.type)?(y=a(y,b.props),ll(y,b),y.return=m,y):(y=ty(b.type,b.key,b.props,null,m.mode,v),ll(y,b),y.return=m,y)}function u(m,y,b,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=NS(b,m.mode,v),y.return=m,y):(y=a(y,b.children||[]),y.return=m,y)}function c(m,y,b,v,w){return y===null||y.tag!==7?(y=Yu(b,m.mode,v,w),y.return=m,y):(y=a(y,b),y.return=m,y)}function f(m,y,b){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=MS(""+y,m.mode,b),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Tb:return b=ty(y.type,y.key,y.props,null,m.mode,b),ll(b,y),b.return=m,b;case Sm:return y=NS(y,m.mode,b),y.return=m,y;case fl:return y=$u(y),f(m,y,b)}if(Lm(y)||bm(y))return y=Yu(y,m.mode,b,null),y.return=m,y;if(typeof y.then=="function")return f(m,Fb(y),b);if(y.$$typeof===si)return f(m,zb(m,y),b);Hb(m,y)}return null}function d(m,y,b,v){var w=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return w!==null?null:s(m,y,""+b,v);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Tb:return b.key===w?l(m,y,b,v):null;case Sm:return b.key===w?u(m,y,b,v):null;case fl:return b=$u(b),d(m,y,b,v)}if(Lm(b)||bm(b))return w!==null?null:c(m,y,b,v,null);if(typeof b.then=="function")return d(m,y,Fb(b),v);if(b.$$typeof===si)return d(m,y,zb(m,b),v);Hb(m,b)}return null}function p(m,y,b,v,w){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return m=m.get(b)||null,s(y,m,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tb:return m=m.get(v.key===null?b:v.key)||null,l(y,m,v,w);case Sm:return m=m.get(v.key===null?b:v.key)||null,u(y,m,v,w);case fl:return v=$u(v),p(m,y,b,v,w)}if(Lm(v)||bm(v))return m=m.get(b)||null,c(y,m,v,w,null);if(typeof v.then=="function")return p(m,y,b,Fb(v),w);if(v.$$typeof===si)return p(m,y,b,zb(y,v),w);Hb(y,v)}return null}function h(m,y,b,v){for(var w=null,k=null,_=y,E=y=0,M=null;_!==null&&E<b.length;E++){_.index>E?(M=_,_=null):M=_.sibling;var S=d(m,_,b[E],v);if(S===null){_===null&&(_=M);break}e&&_&&S.alternate===null&&t(m,_),y=o(S,y,E),k===null?w=S:k.sibling=S,k=S,_=M}if(E===b.length)return n(m,_),nt&&as(m,E),w;if(_===null){for(;E<b.length;E++)_=f(m,b[E],v),_!==null&&(y=o(_,y,E),k===null?w=_:k.sibling=_,k=_);return nt&&as(m,E),w}for(_=r(_);E<b.length;E++)M=p(_,m,E,b[E],v),M!==null&&(e&&(S=M.alternate,S!==null&&_.delete(S.key===null?E:S.key)),y=o(M,y,E),k===null?w=M:k.sibling=M,k=M);return e&&_.forEach(function(U){return t(m,U)}),nt&&as(m,E),w}function g(m,y,b,v){if(b==null)throw Error(ee(151));for(var w=null,k=null,_=y,E=y=0,M=null,S=b.next();_!==null&&!S.done;E++,S=b.next()){_.index>E?(M=_,_=null):M=_.sibling;var U=d(m,_,S.value,v);if(U===null){_===null&&(_=M);break}e&&_&&U.alternate===null&&t(m,_),y=o(U,y,E),k===null?w=U:k.sibling=U,k=U,_=M}if(S.done)return n(m,_),nt&&as(m,E),w;if(_===null){for(;!S.done;E++,S=b.next())S=f(m,S.value,v),S!==null&&(y=o(S,y,E),k===null?w=S:k.sibling=S,k=S);return nt&&as(m,E),w}for(_=r(_);!S.done;E++,S=b.next())S=p(_,m,E,S.value,v),S!==null&&(e&&(M=S.alternate,M!==null&&_.delete(M.key===null?E:M.key)),y=o(S,y,E),k===null?w=S:k.sibling=S,k=S);return e&&_.forEach(function(N){return t(m,N)}),nt&&as(m,E),w}function x(m,y,b,v){if(typeof b=="object"&&b!==null&&b.type===Kf&&b.key===null&&b.props.ref===void 0&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Tb:e:{for(var w=b.key;y!==null;){if(y.key===w){if(w=b.type,w===Kf){if(y.tag===7){n(m,y.sibling),v=a(y,b.props.children),ll(v,b),v.return=m,m=v;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===fl&&$u(w)===y.type){n(m,y.sibling),v=a(y,b.props),ll(v,b),v.return=m,m=v;break e}n(m,y);break}else t(m,y);y=y.sibling}b.type===Kf?(v=Yu(b.props.children,m.mode,v,b.key),ll(v,b),v.return=m,m=v):(v=ty(b.type,b.key,b.props,null,m.mode,v),ll(v,b),v.return=m,m=v)}return i(m);case Sm:e:{for(w=b.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(m,y.sibling),v=a(y,b.children||[]),v.return=m,m=v;break e}else{n(m,y);break}else t(m,y);y=y.sibling}v=NS(b,m.mode,v),v.return=m,m=v}return i(m);case fl:return b=$u(b),x(m,y,b,v)}if(Lm(b))return h(m,y,b,v);if(bm(b)){if(w=bm(b),typeof w!="function")throw Error(ee(150));return b=w.call(b),g(m,y,b,v)}if(typeof b.then=="function")return x(m,y,Fb(b),v);if(b.$$typeof===si)return x(m,y,zb(m,b),v);Hb(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,y!==null&&y.tag===6?(n(m,y.sibling),v=a(y,b),v.return=m,m=v):(n(m,y),v=MS(b,m.mode,v),v.return=m,m=v),i(m)):n(m,y)}return function(m,y,b,v){try{Km=0;var w=x(m,y,b,v);return ud=null,w}catch(_){if(_===Td||_===Qy)throw _;var k=la(29,_,null,m.mode);return k.lanes=v,k.return=m,k}}}var ac=JO(!0),QO=JO(!1),dl=!1;function A2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wL(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function kl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(St&2)!==0){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=ky(e),jO(e,null,n),t}return Zy(e,r,t,n),ky(e)}function Mm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gO(e,n)}}function PS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?a=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?a=o=t:o=o.next=t}else a=o=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var kL=!1;function Nm(){if(kL){var e=ld;if(e!==null)throw e}}function Om(e,t,n,r){kL=!1;var a=e.updateQueue;dl=!1;var o=a.firstBaseUpdate,i=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,u=l.next;l.next=null,i===null?o=u:i.next=u,i=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==i&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=a.baseState;i=0,c=u=l=null,s=o;do{var d=s.lane&-536870913,p=d!==s.lane;if(p?(ft&d)===d:(r&d)===d){d!==0&&d===rc&&(kL=!0),c!==null&&(c=c.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var h=e,g=s;d=t;var x=n;switch(g.tag){case 1:if(h=g.payload,typeof h=="function"){f=h.call(x,f,d);break e}f=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,d=typeof h=="function"?h.call(x,f,d):h,d==null)break e;f=$t({},f,d);break e;case 2:dl=!0}}d=s.callback,d!==null&&(e.flags|=64,p&&(e.flags|=8192),p=a.callbacks,p===null?a.callbacks=[d]:p.push(d))}else p={lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=f):c=c.next=p,i|=d;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);c===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,o===null&&(a.shared.lanes=0),Nl|=i,e.lanes=i,e.memoizedState=f}}function e5(e,t){if(typeof e!="function")throw Error(ee(191,e));e.call(t)}function t5(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)e5(n[e],t)}var Rl=hi(null),Ay=hi(0);function JM(e,t){e=hs,Xt(Ay,e),Xt(Rl,t),hs=e|t.baseLanes}function CL(){Xt(Ay,hs),Xt(Rl,Rl.current)}function E2(){hs=Ay.current,rr(Rl),rr(Ay)}var ir=hi(null),yr=null;function Sl(e){var t=e.alternate;Xt(ar,ar.current&1),Xt(ir,e),yr===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(yr=e)}function SL(e){Xt(ar,ar.current),Xt(ir,e),yr===null&&(yr=e)}function n5(e){e.tag===22?(Xt(ar,ar.current),Xt(ir,e),yr===null&&(yr=e)):Ll()}function Ll(){Xt(ar,ar.current),Xt(ir,ir.current)}function Aa(e){rr(ir),yr===e&&(yr=null),rr(ar)}var ar=hi(0);function Xm(e,t){Xt(ir,ir.current),Xt(ar,t)}function _2(e){rr(ar),rr(ir),yr===e&&(yr=null)}function Ey(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||a2(n)||nI(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fs=0,Qe=null,Ft=null,_n=null,_y=!1,cd=!1,oc=!1,Ty=0,Ym=0,fd=null,VW=0;function mn(){throw Error(ee(321))}function T2(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Na(e[n],t[n]))return!1;return!0}function D2(e,t,n,r,a,o){return fs=o,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ge.H=e===null||e.memoizedState===null?M5:N5,oc=!1,o=n(r,a),oc=!1,cd&&(o=a5(t,n,r,a)),r5(e),o}function r5(e){Ge.H=Dy;var t=Ft!==null&&Ft.next!==null;if(fs=0,_n=Ft=Qe=null,_y=!1,Ym=0,fd=null,t)throw Error(ee(300));e===null||Dn||(e=e.dependencies,e!==null&&Ly(e)&&(Dn=!0))}function a5(e,t,n,r){Qe=e;var a=0;do{if(cd&&(fd=null),Ym=0,cd=!1,25<=a)throw Error(ee(301));if(a+=1,_n=Ft=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}Ge.H=XW,o=t(n,r)}while(cd);return o}function UW(){var e=Ge.H,t=e.useState()[0];return t=typeof t.then=="function"?fg(t):t,e=e.useState()[0],(Ft!==null?Ft.memoizedState:null)!==e&&(Qe.flags|=1024),t}function R2(){var e=Ty!==0;return Ty=0,e}function M2(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function N2(e){if(_y){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_y=!1}fs=0,_n=Ft=Qe=null,cd=!1,Ym=Ty=0,fd=null}function Or(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?Qe.memoizedState=_n=e:_n=_n.next=e,_n}function wn(){if(Ft===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=_n===null?Qe.memoizedState:_n.next;if(t!==null)_n=t,Ft=e;else{if(e===null)throw Qe.alternate===null?Error(ee(467)):Error(ee(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},_n===null?Qe.memoizedState=_n=e:_n=_n.next=e}return _n}function ev(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fg(e){var t=Ym;return Ym+=1,fd===null&&(fd=[]),e=ZO(fd,e,t),t=Qe,(_n===null?t.memoizedState:_n.next)===null&&(t=t.alternate,Ge.H=t===null||t.memoizedState===null?M5:N5),e}function tv(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fg(e);if(e.$$typeof===CG)return;if(e.$$typeof===si)return nr(e)}throw Error(ee(438,String(e)))}function O2(e){var t=null,n=Qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Qe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ev(),Qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=kG;return t.index++,n}function ds(e,t){return typeof t=="function"?t(e):t}function ay(e){var t=wn();return P2(t,Ft,e)}function P2(e,t,n){var r=e.queue;if(r===null)throw Error(ee(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var i=a.next;a.next=o.next,o.next=i}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var s=i=null,l=null,u=t,c=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(ft&f)===f:(fs&f)===f){var d=u.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===rc&&(c=!0);else if((fs&d)===d){u=u.next,d===rc&&(c=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=f,i=o):l=l.next=f,Qe.lanes|=d,Nl|=d;f=u.action,oc&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else d={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(s=l=d,i=o):l=l.next=d,Qe.lanes|=f,Nl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?i=o:l.next=s,!Na(o,e.memoizedState)&&(Dn=!0,c&&(n=ld,n!==null)))throw n;e.memoizedState=o,e.baseState=i,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function BS(e){var t=wn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var i=a=a.next;do o=e(o,i.action),i=i.next;while(i!==a);Na(o,t.memoizedState)||(Dn=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function o5(e,t,n){var r=Qe,a=wn(),o=nt;if(o){if(n===void 0)throw Error(ee(407));n=n()}else n=t();var i=!Na((Ft||a).memoizedState,n);if(i&&(a.memoizedState=n,Dn=!0),a=a.queue,B2(l5.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||i||_n!==null&&(_n.memoizedState.tag&1)!==0,bd(e?9:8,{destroy:void 0},s5.bind(null,r,a,n,t),null),e){if(r.flags|=2048,jt===null)throw Error(ee(349));o||(fs&127)!==0||i5(r,t,n)}return n}function i5(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t=ev(),Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function s5(e,t,n,r){t.value=n,t.getSnapshot=r,u5(t)&&c5(e)}function l5(e,t,n){return n(function(){u5(t)&&c5(e)})}function u5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Na(e,n)}catch{return!0}}function c5(e){var t=fc(e,2);t!==null&&ua(t,e,2)}function LL(e){var t=Or();if(typeof e=="function"){var n=e;if(e=n(),oc){hl(!0);try{n()}finally{hl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function f5(e,t,n,r){return e.baseState=n,P2(e,Ft,typeof r=="function"?r:ds)}function qW(e,t,n,r,a){if(rv(e))throw Error(ee(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){o.listeners.push(i)}};Ge.T!==null?n(!0):o.isTransition=!1,r(o),n=t.pending,n===null?(o.next=t.pending=o,d5(t,o)):(o.next=n.next,t.pending=n.next=o)}}function d5(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var o=Ge.T,i={};i.types=o!==null?o.types:null,Ge.T=i;try{var s=n(a,r),l=Ge.S;l!==null&&l(i,s),QM(e,t,s)}catch(u){IL(e,t,u)}finally{o!==null&&i.types!==null&&(o.types=i.types),Ge.T=o}}else try{o=n(a,r),QM(e,t,o)}catch(u){IL(e,t,u)}}function QM(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){eN(e,t,r)},function(r){return IL(e,t,r)}):eN(e,t,n)}function eN(e,t,n){t.status="fulfilled",t.value=n,p5(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,d5(e,n)))}function IL(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,p5(t),t=t.next;while(t!==r)}e.action=null}function p5(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function h5(e,t){return t}function tN(e,t){if(nt){var n=jt.formState;if(n!==null){e:{var r=Qe;if(nt){if(Kt){t:{for(var a=Kt,o=eo;a.nodeType!==8;){if(!o){a=null;break t}if(a=to(a.nextSibling),a===null){a=null;break t}}o=a.data,a=o==="F!"||o==="F"?a:null}if(a){Kt=to(a.nextSibling),r=a.data==="F!";break e}}Dl(r)}r=!1}r&&(t=n[0])}}return n=Or(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h5,lastRenderedState:t},n.queue=r,n=T5.bind(null,Qe,r),r.dispatch=n,r=LL(!1),o=V2.bind(null,Qe,!1,r.queue),r=Or(),a={state:t,dispatch:null,action:e,pending:null},r.queue=a,n=qW.bind(null,Qe,a,o,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function nN(e){var t=wn();return m5(t,Ft,e)}function m5(e,t,n){if(t=P2(e,t,h5)[0],e=ay(ds)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=fg(t)}catch(i){throw i===Td?Qy:i}else r=t;t=wn();var a=t.queue,o=a.dispatch;return n!==t.memoizedState&&(Qe.flags|=2048,bd(9,{destroy:void 0},jW.bind(null,a,n),null)),[r,o,e]}function jW(e,t){e.action=t}function rN(e){var t=wn(),n=Ft;if(n!==null)return m5(t,n,e);wn(),t=t.memoizedState,n=wn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function bd(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=ev(),Qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function g5(){return wn().memoizedState}function oy(e,t,n,r){var a=Or();Qe.flags|=e,a.memoizedState=bd(1|t,{destroy:void 0},n,r===void 0?null:r)}function nv(e,t,n,r){var a=wn();r=r===void 0?null:r;var o=a.memoizedState.inst;Ft!==null&&r!==null&&T2(r,Ft.memoizedState.deps)?a.memoizedState=bd(t,o,n,r):(Qe.flags|=e,a.memoizedState=bd(1|t,o,n,r))}function aN(e,t){oy(8390656,8,e,t)}function B2(e,t){nv(2048,8,e,t)}function $W(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=ev(),Qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function x5(e){var t=wn().memoizedState;return $W({ref:t,nextImpl:e}),function(){if((St&2)!==0)throw Error(ee(440));return t.impl.apply(void 0,arguments)}}function b5(e,t){return nv(4,2,e,t)}function y5(e,t){return nv(4,4,e,t)}function v5(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function w5(e,t,n){n=n!=null?n.concat([e]):null,nv(4,4,v5.bind(null,t,e),n)}function z2(){}function k5(e,t){var n=wn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&T2(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function C5(e,t){var n=wn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&T2(t,r[1]))return r[0];if(r=e(),oc){hl(!0);try{e()}finally{hl(!1)}}return n.memoizedState=[r,t],r}function F2(e,t,n){return n===void 0||(fs&1073741824)!==0&&(ft&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=m3(),Qe.lanes|=e,Nl|=e,n)}function S5(e,t,n,r){return Na(n,t)?n:Rl.current!==null?(e=F2(e,n,r),Na(e,t)||(Dn=!0),e):(fs&106)===0||(fs&1073741824)!==0&&(ft&261930)===0?(Dn=!0,e.memoizedState=n):(e=m3(),Qe.lanes|=e,Nl|=e,t)}function L5(e,t,n,r,a){var o=Lt.p;Lt.p=o!==0&&8>o?o:8;var i=Ge.T,s={};s.types=i!==null?i.types:null,Ge.T=s,V2(e,!1,t,n);try{var l=a(),u=Ge.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=HW(l,r);Pm(e,t,c,Ma(e))}else Pm(e,t,r,Ma(e))}catch(f){Pm(e,t,{then:function(){},status:"rejected",reason:f},Ma())}finally{Lt.p=o,i!==null&&s.types!==null&&(i.types=s.types),Ge.T=i}}function GW(){}function AL(e,t,n,r){if(e.tag!==5)throw Error(ee(476));var a=I5(e).queue;L5(e,a,t,Xu,n===null?GW:function(){return A5(e),n(r)})}function I5(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xu,baseState:Xu,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:Xu},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function A5(e){var t=I5(e);t.next===null&&(t=e.alternate.memoizedState),Pm(e,t.next.queue,{},Ma())}function H2(){return nr(Ld)}function E5(){return wn().memoizedState}function _5(){return wn().memoizedState}function WW(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ma();e=kl(n);var r=Cl(t,e,n);r!==null&&(ua(r,t,n),Mm(r,t,n)),t={cache:S2()},e.payload=t;return}t=t.return}}function KW(e,t,n){var r=Ma();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},rv(e)?D5(t,n):(n=w2(e,t,n,r),n!==null&&(ua(n,e,r),R5(n,t,r)))}function T5(e,t,n){var r=Ma();Pm(e,t,n,r)}function Pm(e,t,n,r){var a={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(rv(e))D5(t,a);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,s=o(i,n);if(a.hasEagerState=!0,a.eagerState=s,Na(s,i))return Zy(e,t,a,0),jt===null&&Yy(),!1}catch{}if(n=w2(e,t,a,r),n!==null)return ua(n,e,r),R5(n,t,r),!0}return!1}function V2(e,t,n,r){if(r={lane:2,revertLane:J2(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},rv(e)){if(t)throw Error(ee(479))}else t=w2(e,n,r,2),t!==null&&ua(t,e,2)}function rv(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function D5(e,t){cd=_y=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function R5(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gO(e,n)}}var Dy={readContext:nr,use:tv,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useLayoutEffect:mn,useInsertionEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useSyncExternalStore:mn,useId:mn,useHostTransitionStatus:mn,useFormState:mn,useActionState:mn,useOptimistic:mn,useMemoCache:mn,useCacheRefresh:mn,useEffectEvent:mn},M5={readContext:nr,use:tv,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:nr,useEffect:aN,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,oy(4194308,4,v5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oy(4194308,4,e,t)},useInsertionEffect:function(e,t){oy(4,2,e,t)},useMemo:function(e,t){var n=Or();t=t===void 0?null:t;var r=e();if(oc){hl(!0);try{e()}finally{hl(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Or();if(n!==void 0){var a=n(t);if(oc){hl(!0);try{n(t)}finally{hl(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=KW.bind(null,Qe,e),[r.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:function(e){e=LL(e);var t=e.queue,n=T5.bind(null,Qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:z2,useDeferredValue:function(e,t){var n=Or();return F2(n,e,t)},useTransition:function(){var e=LL(!1);return e=L5.bind(null,Qe,e.queue,!0,!1),Or().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Qe,a=Or();if(nt){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),jt===null)throw Error(ee(349));(ft&127)!==0||i5(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,aN(l5.bind(null,r,o,e),[e]),r.flags|=2048,bd(9,{destroy:void 0},s5.bind(null,r,o,n,t),null),n},useId:function(){var e=Or(),t=jt.identifierPrefix;if(nt){var n=ci,r=ui;n=(r&~(1<<32-Ra(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ty++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=VW++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:H2,useFormState:tN,useActionState:tN,useOptimistic:function(e){var t=Or();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=V2.bind(null,Qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:O2,useCacheRefresh:function(){return Or().memoizedState=WW.bind(null,Qe)},useEffectEvent:function(e){var t=Or(),n={impl:e};return t.memoizedState=n,function(){if((St&2)!==0)throw Error(ee(440));return n.impl.apply(void 0,arguments)}}},N5={readContext:nr,use:tv,useCallback:k5,useContext:nr,useEffect:B2,useImperativeHandle:w5,useInsertionEffect:b5,useLayoutEffect:y5,useMemo:C5,useReducer:ay,useRef:g5,useState:function(){return ay(ds)},useDebugValue:z2,useDeferredValue:function(e,t){var n=wn();return S5(n,Ft.memoizedState,e,t)},useTransition:function(){var e=ay(ds)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:fg(e),t]},useSyncExternalStore:o5,useId:E5,useHostTransitionStatus:H2,useFormState:nN,useActionState:nN,useOptimistic:function(e,t){var n=wn();return f5(n,Ft,e,t)},useMemoCache:O2,useCacheRefresh:_5,useEffectEvent:x5},XW={readContext:nr,use:tv,useCallback:k5,useContext:nr,useEffect:B2,useImperativeHandle:w5,useInsertionEffect:b5,useLayoutEffect:y5,useMemo:C5,useReducer:BS,useRef:g5,useState:function(){return BS(ds)},useDebugValue:z2,useDeferredValue:function(e,t){var n=wn();return Ft===null?F2(n,e,t):S5(n,Ft.memoizedState,e,t)},useTransition:function(){var e=BS(ds)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:fg(e),t]},useSyncExternalStore:o5,useId:E5,useHostTransitionStatus:H2,useFormState:rN,useActionState:rN,useOptimistic:function(e,t){var n=wn();return Ft!==null?f5(n,Ft,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:O2,useCacheRefresh:_5,useEffectEvent:x5};function zS(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:$t({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var EL={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ma(),a=kl(r);a.payload=t,n!=null&&(a.callback=n),t=Cl(e,a,r),t!==null&&(ua(t,e,r),Mm(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ma(),a=kl(r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Cl(e,a,r),t!==null&&(ua(t,e,r),Mm(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ma(),r=kl(n);r.tag=2,t!=null&&(r.callback=t),t=Cl(e,r,n),t!==null&&(ua(t,e,n),Mm(t,e,n))}};function oN(e,t,n,r,a,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!$m(n,r)||!$m(a,o):!0}function iN(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&EL.enqueueReplaceState(t,t.state,null)}function ic(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=$t({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function O5(e){wy(e)}function P5(e){console.error(e)}function B5(e){wy(e)}function Ry(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function sN(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function _L(e,t,n){return n=kl(n),n.tag=3,n.payload={element:null},n.callback=function(){Ry(e,t)},n}function z5(e){return e=kl(e),e.tag=3,e}function F5(e,t,n,r){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var o=r.value;e.payload=function(){return a(o)},e.callback=function(){sN(t,n,r)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){sN(t,n,r),typeof a!="function"&&(Il===null?Il=new Set([this]):Il.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function YW(e,t,n,r,a){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&tc(t,n,a,!0),n=ir.current,n!==null){switch(n.tag){case 31:case 13:case 19:return yr===null?Hy():n.alternate===null&&gn===0&&(gn=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Iy?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),$S(e,r,a)),!1;case 22:return n.flags|=65536,r===Iy?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),$S(e,r,a)),!1}throw Error(ee(435,n.tag))}return $S(e,r,a),Hy(),!1}if(nt)return t=ir.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==xL&&(e=Error(ee(422),{cause:r}),Wm(Qa(e,n)))):(r!==xL&&(t=Error(ee(423),{cause:r}),Wm(Qa(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Qa(r,n),a=_L(e.stateNode,r,a),PS(e,a),gn!==4&&(gn=2)),!1;var o=Error(ee(520),{cause:r});if(o=Qa(o,n),Hm===null?Hm=[o]:Hm.push(o),gn!==4&&(gn=2),t===null)return!0;r=Qa(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=_L(n.stateNode,r,e),PS(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Il===null||!Il.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=z5(a),F5(a,e,n,r),PS(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var U2=Error(ee(461)),Dn=!1;function zn(e,t,n,r){t.child=e===null?QO(t,null,n,r):ac(t,e.child,n,r)}function lN(e,t,n,r,a){n=n.render;var o=t.ref;if("ref"in r){var i={};for(var s in r)s!=="ref"&&(i[s]=r[s])}else i=r;return nc(t),r=D2(e,t,n,i,o,a),s=R2(),e!==null&&!Dn?(M2(e,t,a),ps(e,t,a)):(nt&&s&&Jy(t),t.flags|=1,zn(e,t,r,a),t.child)}function uN(e,t,n,r,a){if(e===null){var o=n.type;return typeof o=="function"&&!k2(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,H5(e,t,o,r,a)):(e=ty(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!j2(e,a)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:$m,n(i,r)&&e.ref===t.ref)return ps(e,t,a)}return t.flags|=1,e=ss(o,r),e.ref=t.ref,e.return=t,t.child=e}function H5(e,t,n,r,a){if(e!==null){var o=e.memoizedProps;if($m(o,r)&&e.ref===t.ref)if(Dn=!1,t.pendingProps=r=o,j2(e,a))(e.flags&131072)!==0&&(Dn=!0);else return t.lanes=e.lanes,ps(e,t,a)}return TL(e,t,n,r,a)}function V5(e,t,n,r){var a=r.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(r=t.child=e.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;r=a&~o}else r=0,t.child=null;return cN(e,t,o,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ry(t,o!==null?o.cachePool:null),o!==null?JM(t,o):CL(),n5(t);else return r=t.lanes=536870912,cN(e,t,o!==null?o.baseLanes|n:n,n,r)}else o!==null?(ry(t,o.cachePool),JM(t,o),Ll(),t.memoizedState=null):(e!==null&&ry(t,null),CL(),Ll());return zn(e,t,a,n),t.child}function Bm(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cN(e,t,n,r,a){var o=L2();return o=o===null?null:{parent:Tn._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&ry(t,null),CL(),n5(t),e!==null&&tc(e,t,r,!0),t.childLanes=a,null}function iy(e,t){return t=av({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fN(e,t,n){return ac(t,e.child,null,n),e=iy(t,t.pendingProps),e.flags|=2,Aa(t),t.memoizedState=null,e}function ZW(e,t,n){var r=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(r.mode==="hidden")return e=iy(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bm(null,e);if(SL(t),(e=Kt)?(e=V3(e,eo),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tl!==null?{id:ui,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},n=GO(e),n.return=t,t.child=n,$n=t,Kt=null)):e=null,e===null)throw Dl(t);return t.lanes=536870912,null}return iy(t,r)}var o=e.memoizedState;if(o!==null){var i=o.dehydrated;if(SL(t),a)if(t.flags&256)t.flags&=-257,t=fN(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(ee(558));else if(Dn||tc(e,t,n,!1),a=(n&e.childLanes)!==0,Dn||a){if(Rl.current===null){if(r=jt,r!==null&&(i=xO(r,n),i!==0&&i!==o.retryLane))throw o.retryLane=i,fc(e,i),ua(r,e,i),U2;Hy()}t=fN(e,t,n)}else e=o.treeContext,Kt=to(i.nextSibling),$n=t,nt=!0,wl=null,eo=!1,e!==null&&KO(t,e),t=iy(t,r),t.flags|=134221824;return t}return e=ss(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function jf(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(ee(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function TL(e,t,n,r,a){return nc(t),n=D2(e,t,n,r,void 0,a),r=R2(),e!==null&&!Dn?(M2(e,t,a),ps(e,t,a)):(nt&&r&&Jy(t),t.flags|=1,zn(e,t,n,a),t.child)}function dN(e,t,n,r,a,o){return nc(t),t.updateQueue=null,n=a5(t,r,n,a),r5(e),r=R2(),e!==null&&!Dn?(M2(e,t,o),ps(e,t,o)):(nt&&r&&Jy(t),t.flags|=1,zn(e,t,n,o),t.child)}function pN(e,t,n,r,a){if(nc(t),t.stateNode===null){var o=td,i=n.contextType;typeof i=="object"&&i!==null&&(o=nr(i)),o=new n(r,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=EL,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=r,o.state=t.memoizedState,o.refs={},A2(t),i=n.contextType,o.context=typeof i=="object"&&i!==null?nr(i):td,o.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(zS(t,n,i,r),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(i=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),i!==o.state&&EL.enqueueReplaceState(o,o.state,null),Om(t,r,o,a),Nm(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){o=t.stateNode;var s=t.memoizedProps,l=ic(n,s);o.props=l;var u=o.context,c=n.contextType;i=td,typeof c=="object"&&c!==null&&(i=nr(c));var f=n.getDerivedStateFromProps;c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s||u!==i)&&iN(t,o,r,i),dl=!1;var d=t.memoizedState;o.state=d,Om(t,r,o,a),Nm(),u=t.memoizedState,s||d!==u||dl?(typeof f=="function"&&(zS(t,n,f,r),u=t.memoizedState),(l=dl||oN(t,n,l,r,d,u,i))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=i,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,wL(e,t),i=t.memoizedProps,c=ic(n,i),o.props=c,f=t.pendingProps,d=o.context,u=n.contextType,l=td,typeof u=="object"&&u!==null&&(l=nr(u)),s=n.getDerivedStateFromProps,(u=typeof s=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==f||d!==l)&&iN(t,o,r,l),dl=!1,d=t.memoizedState,o.state=d,Om(t,r,o,a),Nm();var p=t.memoizedState;i!==f||d!==p||dl||e!==null&&e.dependencies!==null&&Ly(e.dependencies)?(typeof s=="function"&&(zS(t,n,s,r),p=t.memoizedState),(c=dl||oN(t,n,c,r,d,p,l)||e!==null&&e.dependencies!==null&&Ly(e.dependencies))?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,jf(e,t),r=(t.flags&128)!==0,o||r?(o=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&r?(t.child=ac(t,e.child,null,a),t.child=ac(t,null,n,a)):zn(e,t,n,a),t.memoizedState=o.state,e=t.child):e=ps(e,t,a),e}function hN(e,t,n,r){return ec(),t.flags|=256,zn(e,t,n,r),t.child}var DL={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function RL(e){return{baseLanes:e,cachePool:YO()}}function ML(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=_a),e}function U5(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(ar.current&2)!==0),i&&(a=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(a?Sl(t):Ll(),(e=Kt)?(e=V3(e,eo),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Tl!==null?{id:ui,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},n=GO(e),n.return=t,t.child=n,$n=t,Kt=null)):e=null,e===null)throw Dl(t);return nI(e)?t.lanes=32:t.lanes=536870912,null}return o=r.children,r=r.fallback,a?(Ll(),a=t.mode,o=av({mode:"hidden",children:o},a),r=Yu(r,a,n,null),o.return=t,r.return=t,o.sibling=r,t.child=o,r=t.child,r.memoizedState=RL(n),r.childLanes=ML(e,i,n),t.memoizedState=DL,Bm(null,r)):(Sl(t),q2(t,o))}var s=e.memoizedState;if(s!==null){var l=s.dehydrated;if(l!==null)return JW(e,t,o,i,r,l,s,n)}return a?(Ll(),a=r.fallback,o=t.mode,s=e.child,l=s.sibling,r=ss(s,{mode:"hidden",children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,l!==null?a=ss(l,a):(a=Yu(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,Bm(null,r),r=t.child,a=e.child.memoizedState,a===null?a=RL(n):(o=a.cachePool,o!==null?(s=Tn._currentValue,o=o.parent!==s?{parent:s,pool:s}:o):o=YO(),a={baseLanes:a.baseLanes|n,cachePool:o}),r.memoizedState=a,r.childLanes=ML(e,i,n),t.memoizedState=DL,Bm(e.child,r)):(Sl(t),n=e.child,e=n.sibling,n=ss(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function q2(e,t){return t=av({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function av(e,t){return e=la(22,e,null,t),e.lanes=0,e}function Vb(e,t,n){return ac(t,e.child,null,n),e=q2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function JW(e,t,n,r,a,o,i,s){if(n)return t.flags&256?(Sl(t),t.flags&=-257,Vb(e,t,s)):t.memoizedState!==null?(Ll(),t.child=e.child,t.flags|=128,null):(Ll(),o=a.fallback,i=t.mode,a=av({mode:"visible",children:a.children},i),o=Yu(o,i,s,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ac(t,e.child,null,s),a=t.child,a.memoizedState=RL(s),a.childLanes=ML(e,r,s),t.memoizedState=DL,Bm(null,a));if(Sl(t),nI(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==""&&(a=Error(ee(419)),a.stack="",a.digest=r,Wm({value:a,source:null,stack:null})),Vb(e,t,s)}if(Dn||tc(e,t,s,!1),r=(s&e.childLanes)!==0,Dn||r){if(Rl.current!==null)return Vb(e,t,s);if(r=jt,r!==null&&(a=xO(r,s),a!==0&&a!==i.retryLane))throw i.retryLane=a,fc(e,a),ua(r,e,a),U2;return a2(o)||Hy(),Vb(e,t,s)}return a2(o)?(t.flags|=192,t.child=e.child,null):(e=i.treeContext,Kt=to(o.nextSibling),$n=t,nt=!0,wl=null,eo=!1,e!==null&&KO(t,e),t=q2(t,a.children),t.flags|=134221824,t)}function mN(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ny(e.return,t,n)}function gN(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ey(n)===null&&(t=e),e=e.sibling}return t}function Ub(e,t,n,r,a,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a,treeForkCount:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a,i.treeForkCount=o)}function FS(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function NL(e,t,n){var r=t.pendingProps,a=r.revealOrder,o=r.tail;r=r.children;var i=ar.current;if(t.flags&128)return Xm(t,i),null;var s=(i&2)!==0;if(s?(i=i&1|2,t.flags|=128):i&=1,Xm(t,i),a==="backwards"&&e!==null?(FS(e),zn(e,t,r,n),FS(e)):zn(e,t,r,n),r=nt?Gm:0,!s&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mN(e,n,t);else if(e.tag===19)mN(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"backwards":n=gN(t.child),n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null,FS(t)),Ub(t,!0,a,null,o,r);break;case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ey(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Ub(t,!0,n,null,o,r);break;case"together":Ub(t,!1,null,null,void 0,r);break;case"independent":t.memoizedState=null;break;default:n=gN(t.child),n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Ub(t,!1,a,n,o,r)}return t.child}function xN(e,t,n){var r=t.pendingProps;return gl(t,t.type,r.value),zn(e,t,r.children,n),t.child}function ps(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(tc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=ss(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ss(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function j2(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ly(e)))}function QW(e,t,n){switch(t.tag){case 3:xy(t,t.stateNode.containerInfo),gl(t,Tn,e.memoizedState.cache),ec();break;case 27:case 5:sL(t);break;case 4:xy(t,t.stateNode.containerInfo);break;case 10:gl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,SL(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Sl(t),t.flags|=128,null;r=tc(e,t,n,!1);var a=t.child.childLanes;return r||(n&a)!==0?U5(e,t,n):(Sl(t),e=ps(e,t,n),e!==null?e.sibling:null)}Sl(t);break;case 19:if(t.flags&128)return NL(e,t,n);if(a=(e.flags&128)!==0,r=(n&t.childLanes)!==0,r||(tc(e,t,n,!1),r=(n&t.childLanes)!==0),a){if(r)return NL(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Xm(t,ar.current),r)break;return null;case 22:return t.lanes=0,V5(e,t,n,t.pendingProps);case 24:gl(t,Tn,e.memoizedState.cache)}return ps(e,t,n)}function q5(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dn=!0;else{if(!j2(e,n)&&(t.flags&128)===0)return Dn=!1,QW(e,t,n);Dn=(e.flags&131072)!==0}else Dn=!1,nt&&(t.flags&1048576)!==0&&WO(t,Gm,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=$u(t.elementType),t.type=e,typeof e=="function")k2(e)?(r=ic(e,r),t.tag=1,t=pN(null,t,e,r,n)):(t.tag=0,t=TL(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===u2){t.tag=11,t=lN(null,t,e,r,n);break e}else if(a===c2){t.tag=14,t=uN(null,t,e,r,n);break e}else if(a===si){t.tag=10,t.type=e,t=xN(null,t,n);break e}}throw t=oL(e)||e,Error(ee(306,t,""))}}return t;case 0:return TL(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=ic(r,t.pendingProps),pN(e,t,r,a,n);case 3:e:{if(xy(t,t.stateNode.containerInfo),e===null)throw Error(ee(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,wL(e,t),Om(t,r,null,n);var i=t.memoizedState;if(r=i.cache,gl(t,Tn,r),r!==o.cache&&yL(t,[Tn],n,!0),Nm(),r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=hN(e,t,r,n);break e}else if(r!==a){a=Qa(Error(ee(424)),t),Wm(a),t=hN(e,t,r,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Kt=to(e.firstChild),$n=t,nt=!0,wl=null,eo=!0,n=QO(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling;else{if(ec(),r===a){t=ps(e,t,n);break e}zn(e,t,r,n)}t=t.child}return t;case 26:return jf(e,t),e===null?(n=jN(t.type,null,t.pendingProps,null))?t.memoizedState=n:nt||(t.stateNode=R3(t.type,t.pendingProps,vl.current,t)):t.memoizedState=jN(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return sL(t),e===null&&nt&&(r=t.stateNode=U3(t.type,t.pendingProps,vl.current),$n=t,eo=!0,a=Kt,Pl(t.type)?(o2=a,Kt=to(r.firstChild)):Kt=a),zn(e,t,t.pendingProps.children,n),jf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((a=r=Kt)&&(r=$K(r,t.type,t.pendingProps,eo),r!==null?(t.stateNode=r,$n=t,Kt=to(r.firstChild),eo=!1,a=!0):a=!1),a||Dl(t)),sL(t),a=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,r=o.children,t2(a,o)?r=null:i!==null&&t2(a,i)&&(t.flags|=32),t.memoizedState!==null&&(a=D2(e,t,UW,null,null,n),Ld._currentValue=a),jf(e,t),zn(e,t,r,n),t.child;case 6:return e===null&&nt&&((e=n=Kt)&&(n=GK(n,t.pendingProps,eo),n!==null?(t.stateNode=n,$n=t,Kt=null,e=!0):e=!1),e||Dl(t)),null;case 13:return U5(e,t,n);case 4:return xy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ac(t,null,r,n):zn(e,t,r,n),t.child;case 11:return lN(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,jf(e,t),zn(e,t,r,n),t.child;case 8:return zn(e,t,t.pendingProps.children,n),t.child;case 12:return zn(e,t,t.pendingProps.children,n),t.child;case 10:return xN(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,nc(t),a=nr(a),r=r(a),t.flags|=1,zn(e,t,r,n),t.child;case 14:return uN(e,t,t.type,t.pendingProps,n);case 15:return H5(e,t,t.type,t.pendingProps,n);case 19:return NL(e,t,n);case 31:return ZW(e,t,n);case 22:return V5(e,t,n,t.pendingProps);case 24:return nc(t),r=nr(Tn),e===null?(a=L2(),a===null&&(a=jt,o=S2(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},A2(t),gl(t,Tn,a)):((e.lanes&n)!==0&&(wL(e,t),Om(t,null,null,n),Nm()),a=e.memoizedState,o=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),gl(t,Tn,r)):(r=o.cache,gl(t,Tn,r),r!==a.cache&&yL(t,[Tn],n,!0))),zn(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!=="auto"?t.flags|=e===null?18882560:18874368:nt&&Jy(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:jf(e,t),zn(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(ee(156,t.tag))}function rs(e){e.flags|=4}function HS(e,t,n,r,a){var o;if((o=(e.mode&32)!==0)&&(o=n===null?WN(t,r):WN(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(b3())e.flags|=8192;else throw Ju=Iy,I2}else e.flags&=-16777217}function bN(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!G3(t))if(b3())e.flags|=8192;else throw Ju=Iy,I2}function qb(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hO():536870912,e.lanes|=t,yd|=t)}function vm(e,t){if(!nt)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&1206910976,r|=a.flags&1206910976,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function eK(e,t,n){var r=t.pendingProps;switch(C2(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return Wt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ls(Tn),md(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Uf(t)?rs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,OS())),Wt(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(rs(t),o!==null?(Wt(t),bN(t,o)):(Wt(t),HS(t,a,null,r,n))):o?o!==e.memoizedState?(rs(t),Wt(t),bN(t,o)):(Wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&rs(t),Wt(t),HS(t,a,e,r,n)),null;case 27:if(by(t),n=vl.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&rs(t);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return Wt(t),t.subtreeFlags&=-33554433,null}e=fi.current,Uf(t)?$M(t,e):(e=U3(a,r,n),t.stateNode=e,rs(t))}return Wt(t),t.subtreeFlags&=-33554433,null;case 5:if(by(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&rs(t);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return Wt(t),t.subtreeFlags&=-33554433,null}if(o=fi.current,Uf(t))$M(t,o);else{var i=Qm(vl.current);switch(o){case 1:o=i.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:o=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":o=i.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":o=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":o=i.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?i.createElement("select",{is:r.is}):i.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?i.createElement(a,{is:r.is}):i.createElement(a)}}o[tr]=t,o[fa]=r;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)o.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=o;e:switch(or(o,a,r),a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&rs(t)}}return Wt(t),t.subtreeFlags&=-33554433,HS(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&rs(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(e=vl.current,Uf(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$n,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tr]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||T3(e.nodeValue,n)),e||Dl(t,!0)}else e=Qm(e).createTextNode(r),e[tr]=t,t.stateNode=e}return Wt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Uf(t),n!==null){if(e===null){if(!r)throw Error(ee(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(557));e[tr]=t}else ec(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Wt(t),e=!1}else n=OS(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Aa(t),t):(Aa(t),null);if((t.flags&128)!==0)throw Error(ee(558))}return Wt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Uf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ee(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ee(317));a[tr]=t}else ec(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Wt(t),a=!1}else a=OS(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Aa(t),t):(Aa(t),null)}return Aa(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),qb(t,t.updateQueue),Wt(t),null);case 4:return md(),e===null&&Q2(t.stateNode.containerInfo),t.flags|=67108864,Wt(t),null;case 10:return ls(t.type),Wt(t),null;case 19:if(_2(t),r=t.memoizedState,r===null)return Wt(t),null;if(a=(t.flags&128)!==0,o=r.rendering,o===null)if(a)vm(r,!1);else{if(gn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Ey(e),o!==null){for(t.flags|=128,vm(r,!1),e=o.updateQueue,t.updateQueue=e,qb(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$O(n,e),n=n.sibling;return Xm(t,ar.current&1|2),nt&&as(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ta()>zy&&(t.flags|=128,a=!0,vm(r,!1),t.lanes=4194304)}else{if(!a)if(e=Ey(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,qb(t,e),vm(r,!0),r.tail===null&&r.tailMode!=="collapsed"&&r.tailMode!=="visible"&&!o.alternate&&!nt)return Wt(t),null}else 2*Ta()-r.renderingStartTime>zy&&n!==536870912&&(t.flags|=128,a=!0,vm(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}if(r.tail!==null){e=r.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ta(),e.sibling=null,o=ar.current,o=a?o&1|2:o&1,r.tailMode==="visible"||r.tailMode==="collapsed"||!n||nt?Xm(t,o):(n=o,Xt(ir,t),Xt(ar,n),yr===null&&(yr=t)),nt&&as(t,r.treeForkCount),e}return Wt(t),null;case 22:case 23:return Aa(t),E2(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),n=t.updateQueue,n!==null&&qb(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&rr(Zu),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ls(Tn),Wt(t),null;case 25:return null;case 30:return t.flags|=33554432,Wt(t),null}throw Error(ee(156,t.tag))}function tK(e,t){switch(C2(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(Tn),md(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return by(t),null;case 31:if(t.memoizedState!==null){if(Aa(t),t.alternate===null)throw Error(ee(340));ec()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));ec()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _2(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return md(),null;case 10:return ls(t.type),null;case 22:case 23:return Aa(t),E2(),e!==null&&rr(Zu),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ls(Tn),null;case 25:return null;default:return null}}function j5(e,t){switch(C2(t),t.tag){case 3:ls(Tn),md();break;case 26:case 27:case 5:by(t);break;case 4:md();break;case 31:t.memoizedState!==null&&Aa(t);break;case 13:Aa(t);break;case 19:_2(t);break;case 10:ls(t.type);break;case 22:case 23:Aa(t),E2(),e!==null&&rr(Zu);break;case 24:ls(Tn)}}function dg(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var o=n.create,i=n.inst;r=o(),i.destroy=r}n=n.next}while(n!==a)}}catch(s){Nt(t,t.return,s)}}function Ml(e,t,n){try{var r=t.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var o=a.next;r=o;do{if((r.tag&e)===e){var i=r.inst,s=i.destroy;if(s!==void 0){i.destroy=void 0,a=t;var l=n,u=s;try{u()}catch(c){Nt(a,l,c)}}}r=r.next}while(r!==o)}}catch(c){Nt(t,t.return,c)}}function $5(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{t5(t,n)}catch(r){Nt(e,e.return,r)}}}function G5(e,t,n){n.props=ic(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Nt(e,t,r)}}function oi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var a=e.stateNode,o=cs(e.memoizedProps,a);(a.ref===null||a.ref.name!==o)&&(a.ref=P3(o)),r=a.ref;break;case 7:if(e.stateNode===null){var i=new Oa(e);ca(e.child,!1,qK,i,void 0,void 0),e.stateNode=i}r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(s){Nt(e,t,s)}}function er(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(a){Nt(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){Nt(e,t,a)}else n.current=null}function My(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)H3(e.stateNode,t[n])}function yN(e){for(var t=e.return;t!==null&&(G2(t)&&H3(e.stateNode,t.stateNode),!$2(t));)t=t.return}function zm(e){for(var t=e.return;t!==null&&(G2(t)&&jK(e.stateNode,t.stateNode),!$2(t));)t=t.return}function $2(e){return e.tag===5||e.tag===3||e.tag===27}function G2(e){return e&&e.tag===7&&e.stateNode!==null}function OL(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){Nt(e,e.return,a)}}function VS(e,t,n){try{var r=e.stateNode;LK(r,e.type,n,t),r[fa]=t}catch(a){Nt(e,e.return,a)}}function W5(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pl(e.type)||e.tag===4}function US(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||W5(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Pl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function PL(e,t,n,r){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(a,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(a),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=li)),My(e,r),kt=!0;else if(a!==4&&(a===27&&(My(e,r),r=null,Pl(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(PL(e,t,n,r),e=e.sibling;e!==null;)PL(e,t,n,r),e=e.sibling}function Ny(e,t,n,r){var a=e.tag;if(a===5||a===6)a=e.stateNode,t?n.insertBefore(a,t):n.appendChild(a),My(e,r),kt=!0;else if(a!==4&&(a===27&&(My(e,r),r=null,Pl(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ny(e,t,n,r),e=e.sibling;e!==null;)Ny(e,t,n,r),e=e.sibling}function K5(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);or(t,r,n),t[tr]=e,t[fa]=n}catch(o){Nt(e,e.return,o)}}var Oy=!1,Ea=null;function vN(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Oy=!0)}var ii=null;function wN(){var e=ii;return ii=null,e}var sa=0;function Dd(e,t,n,r,a){return sa=0,X5(e.child,t,n,r,a)}function X5(e,t,n,r,a){for(var o=!1;e!==null;){if(e.tag===5){var i=e.stateNode;if(r!==null){var s=n2(i);r.push(s),s.view&&(o=!0)}else o||n2(i).view&&(o=!0);Oy=!0,M3(i,sa===0?t:t+"_"+sa,n),sa++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&a||X5(e.child,t,n,r,a)&&(o=!0));e=e.sibling}return o}function pi(e,t){for(;e!==null;)e.tag===5?N3(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||pi(e.child,t)),e=e.sibling}function sy(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(sy(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(ee(544));var n=t.name;t=gs(t.default,t.share),t!=="none"&&(Dd(e,n,t,null,!1)||pi(e.child,!1))}e=e.sibling}}function BL(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,a=cs(r,n),o=gs(r.default,n.paired?r.share:r.enter);o!=="none"?Dd(e,a,o,null,!1)?(sy(e),n.paired||t||vd(e,r.onEnter)):pi(e.child,!1):sy(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)BL(e,t),e=e.sibling;else sy(e)}function zL(e){if(Ea!==null&&Ea.size!==0){var t=Ea;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,r=n.name;if(r!=null&&r!=="auto"){var a=t.get(r);if(a!==void 0){var o=gs(n.default,n.share);if(o!=="none"&&(Dd(e,r,o,null,!1)?(o=e.stateNode,a.paired=o,o.paired=a,vd(e,n.onShare)):pi(e.child,!1)),t.delete(r),t.size===0)break}}}zL(e)}e=e.sibling}}}function FL(e){if(e.tag===30){var t=e.memoizedProps,n=cs(t,e.stateNode),r=Ea!==null?Ea.get(n):void 0,a=gs(t.default,r!==void 0?t.share:t.exit);a!=="none"&&(Dd(e,n,a,null,!1)?r!==void 0?(a=e.stateNode,r.paired=a,a.paired=r,Ea.delete(n),vd(e,t.onShare)):vd(e,t.onExit):pi(e.child,!1)),Ea!==null&&zL(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)FL(e),e=e.sibling;else Ea!==null&&zL(e)}function Y5(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=cs(t,e.stateNode);t=gs(t.default,t.update),e.flags&=-5,t!=="none"&&Dd(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Y5(e);e=e.sibling}}function HL(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,pi(e.child,!1))}HL(e)}e=e.sibling}}function ly(e){if(e.tag===30)e.stateNode.paired=null,pi(e.child,!1),HL(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ly(e),e=e.sibling;else HL(e)}function Z5(e){for(e=e.child;e!==null;)e.tag===30?pi(e.child,!1):(e.subtreeFlags&33554432)!==0&&Z5(e),e=e.sibling}function W2(e,t,n,r,a,o,i){for(var s=!1;t!==null;){if(t.tag===5){var l=t.stateNode;if(o!==null&&sa<o.length){var u=o[sa],c=n2(l);(u.view||c.view)&&(s=!0);var f;if(f=(e.flags&4)===0)if(c.clip)f=!0;else{f=u.rect;var d=c.rect;f=f.y!==d.y||f.x!==d.x||f.height!==d.height||f.width!==d.width}f&&(e.flags|=4),c.abs?c=!u.abs:(u=u.rect,c=c.rect,c=u.height!==c.height||u.width!==c.width),c&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&M3(l,sa===0?n:n+"_"+sa,a),s&&(e.flags&4)!==0||(ii===null&&(ii=[]),ii.push(l,sa===0?r:r+"_"+sa,t.memoizedProps)),sa++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&i?e.flags|=t.flags&32:W2(e,t.child,n,r,a,o,i)&&(s=!0));t=t.sibling}return s}function J5(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,a=cs(n,r),o=gs(n.default,n.update);if(t){r=r.clones;var i=r===null?null:r.map(DK)}else i=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;sa=0,a=W2(r,s,a,a,o,i,!1),(e.flags&4)!==0&&a&&(t||vd(e,n.onUpdate))}else(e.subtreeFlags&33554432)!==0&&J5(e,t);e=e.sibling}}var Un=!1,_t=!1,ni=!1,qS=!1,kN=typeof WeakSet=="function"?WeakSet:Set,qn=null,ri=!1,Em=!1,Py=!1,VL=!1;function nK(e,t,n){if(e=e.containerInfo,QL=Id,e=BO(e),y2(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var o=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,l=-1,u=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var h;d!==r||o!==0&&d.nodeType!==3||(l=s+o),d!==i||a!==0&&d.nodeType!==3||(u=s+a),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===r&&++c===o&&(l=s),p===i&&++f===a&&(u=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(e2={focusedElem:e,selectionRange:r},Id=!1,n=(n&335544064)===n,qn=t,t=n?9270:1024;qn!==null;){if(e=qn,n&&(r=e.deletions,r!==null))for(o=0;o<r.length;o++)n&&FL(r[o]);if(e.alternate===null&&(e.flags&2)!==0)n&&vN(e),jb(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&FL(r),jb(n);continue}else if(r!==null&&r.memoizedState!==null){n&&vN(e),jb(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,qn=r):(n&&Y5(e),jb(n))}}Ea=null}function jb(e){for(;qn!==null;){var t=qn,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((a&1024)!==0&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var i=ic(t.type,a);n=o.getSnapshotBeforeUpdate(i,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(s){Nt(t,t.return,s)}}break;case 3:if((a&1024)!==0){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)r2(r);else if(n===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":r2(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=cs(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=gs(a.default,a.update),a!=="none"&&Dd(r,n,a,r.memoizedState=[],!0));break;default:if((a&1024)!==0)throw Error(ee(163))}if(r=t.sibling,r!==null){r.return=t.return,qn=r;break}qn=t.return}}function Q5(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ai(e,n),r&4&&dg(5,n);break;case 1:if(ai(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Nt(n,n.return,i)}else{var a=ic(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Nt(n,n.return,i)}}r&64&&$5(n),r&512&&oi(n,n.return);break;case 3:if(ai(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{t5(e,t)}catch(i){Nt(n,n.return,i)}}break;case 27:t===null&&r&4&&K5(n);case 26:case 5:ai(e,n),t===null&&r&4&&OL(n),r&512&&oi(n,n.return);break;case 12:ai(e,n);break;case 31:ai(e,n),r&4&&r3(e,n);break;case 13:ai(e,n),r&4&&a3(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hK.bind(null,n),WK(e,n))));break;case 22:if(r=n.memoizedState!==null||Un,!r){var o=t!==null&&t.memoizedState!==null||_t;t=Un,a=_t,Un=r,(_t=o)&&!a?(r=2,(n.subtreeFlags&8772)!==0&&(r|=1),ko(e,n,r)):ai(e,n),Un=t,_t=a}break;case 30:ai(e,n),r&512&&oi(n,n.return);break;case 7:r&512&&oi(n,n.return);default:ai(e,n)}}function UL(e,t){for(e=e.child;e!==null;)e3(e,t),e=e.sibling}function e3(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none"}else{var a=e.stateNode,o=e.memoizedProps.style,i=o!=null&&o.hasOwnProperty("display")?o.display:null;a.style.display=i==null||typeof i=="boolean"?"":(""+i).trim()}}catch(l){Nt(e,e.return,l)}qL(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,kt=!0}catch(l){Nt(e,e.return,l)}break;case 18:try{var s=e.stateNode;t?zN(s,!0):zN(e.stateNode,!1)}catch(l){Nt(e,e.return,l)}break;case 22:case 23:e.memoizedState===null&&UL(e,t);break;default:UL(e,t)}}function qL(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,r=t;switch(n.tag){case 4:e3(n,r);break e;case 22:n.memoizedState===null&&qL(n,r);break e;default:qL(n,r)}}e=e.sibling}}function t3(e){var t=e.alternate;t!==null&&(e.alternate=null,t3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gy(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var on=null,oa=!1;function wo(e,t,n){for(n=n.child;n!==null;)n3(e,t,n),n=n.sibling}function n3(e,t,n){if(Da&&typeof Da.onCommitFiberUnmount=="function")try{Da.onCommitFiberUnmount(og,n)}catch{}switch(n.tag){case 26:_t||er(n,t),wo(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!_t&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_t||er(n,t),zm(n);var r=on,a=oa;Pl(n.type)&&(on=n.stateNode,oa=!1),wo(e,t,n),q3(n.stateNode,n.type,n.memoizedProps),on=r,oa=a;break;case 5:_t||er(n,t),zm(n);case 6:if(n.tag===6&&zm(n),r=on,a=oa,on=null,wo(e,t,n),on=r,oa=a,on!==null)if(oa)try{(on.nodeType===9?on.body:on.nodeName==="HTML"?on.ownerDocument.body:on).removeChild(n.stateNode),kt=!0}catch(o){Nt(n,t,o)}else try{on.removeChild(n.stateNode),kt=!0}catch(o){Nt(n,t,o)}break;case 18:on!==null&&(oa?(e=on,BN(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ad(e)):BN(on,n.stateNode));break;case 4:r=on,a=oa,on=n.stateNode.containerInfo,oa=!0,wo(e,t,n),on=r,oa=a;break;case 0:case 11:case 14:case 15:Ml(2,n,t),_t||Ml(4,n,t),wo(e,t,n);break;case 1:_t||(er(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&G5(n,t,r)),wo(e,t,n);break;case 21:wo(e,t,n);break;case 22:_t=(r=_t)||n.memoizedState!==null,wo(e,t,n),_t=r;break;case 30:er(n,t),wo(e,t,n);break;case 7:_t||er(n,t),wo(e,t,n);break;default:wo(e,t,n)}}function r3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ad(e)}catch(n){Nt(t,t.return,n)}}}function a3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ad(e)}catch(n){Nt(t,t.return,n)}}function rK(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kN),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kN),t;default:throw Error(ee(435,e.tag))}}function $b(e,t){var n=rK(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var a=mK.bind(null,e,r);r.then(a,a)}})}function Mr(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 27:if(Pl(l.type)){on=l.stateNode,oa=!1;break e}break;case 5:on=l.stateNode,oa=!1;break e;case 3:case 4:on=l.stateNode.containerInfo,oa=!0;break e}l=l.return}if(on===null)throw Error(ee(160));n3(i,s,o),on=null,oa=!1,i=o.alternate,i!==null&&(i.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)o3(t,e,n),t=t.sibling}var Co=null;function o3(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r!==null?r.events:null,r!==null))for(var o=0;o<r.length;o++){var i=r[o];i.ref.impl=i.nextImpl}Mr(t,e,n),Nr(e),a&4&&(Ml(3,e,e.return),dg(3,e),Ml(5,e,e.return));break;case 1:Mr(t,e,n),Nr(e),a&512&&(_t||r===null||er(r,r.return)),a&64&&Un&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Co,Mr(t,e,n),Nr(e),a&512&&(_t||r===null||er(r,r.return)),a&4)if(a=r!==null?r.memoizedState:null,n=e.memoizedState,r===null)if(n===null)if(e.stateNode===null)if(Un)e.stateNode=R3(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;t:switch(t){case"title":r=a.getElementsByTagName("title")[0],(!r||r[lg]||r[tr]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector("head > title"))),or(r,t,n),r[tr]=e,jn(r),t=r;break e;case"link":if(o=GN("link","href",a).get(t+(n.href||""))){for(i=0;i<o.length;i++)if(r=o[i],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(i,1);break t}}r=a.createElement(t),or(r,t,n),a.head.appendChild(r);break;case"meta":if(o=GN("meta","content",a).get(t+(n.content||""))){for(i=0;i<o.length;i++)if(r=o[i],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(i,1);break t}}r=a.createElement(t),or(r,t,n),a.head.appendChild(r);break;default:throw Error(ee(468,t))}r[tr]=e,jn(r),t=r}e.stateNode=t}else Un||i2(o,e.type,e.stateNode);else e.stateNode=$N(o,n,e.memoizedProps);else a!==n?(a===null?(t=r.stateNode,t===null||_t||t.parentNode.removeChild(t)):a.count--,n===null?Un||i2(o,e.type,e.stateNode):$N(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&VS(e,e.memoizedProps,r.memoizedProps);break;case 27:Mr(t,e,n),Nr(e),a&512&&(_t||r===null||er(r,r.return)),r!==null&&a&4&&VS(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ni,ni=!1,Mr(t,e,n),ni=o,Nr(e),a&512&&(_t||r===null||er(r,r.return)),e.flags&32){t=e.stateNode;try{xd(t,""),kt=!0}catch(c){Nt(e,e.return,c)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,VS(e,t,r!==null?r.memoizedProps:t)),a&1024&&(qS=!0);break;case 6:if(Mr(t,e,n),Nr(e),a&4){if(e.stateNode===null)throw Error(ee(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,kt=!0}catch(c){Nt(e,e.return,c)}}break;case 3:if(kt=!1,dy=null,o=Co,Co=eg(t.containerInfo),Mr(t,e,n),Co=o,Nr(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Ad(t.containerInfo)}catch(c){Nt(e,e.return,c)}qS&&(qS=!1,i3(e)),kt=!1;break;case 4:a=ni,ni=Un,r=EM(),o=Co,Co=eg(e.stateNode.containerInfo),Mr(t,e,n),Nr(e),Co=o,kt&&Em&&(Py=!0),kt=r,ni=a;break;case 12:Mr(t,e,n),Nr(e);break;case 31:Mr(t,e,n),Nr(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,$b(e,t)));break;case 13:Mr(t,e,n),Nr(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(ov=Ta()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,$b(e,t)));break;case 22:o=e.memoizedState!==null,i=r!==null&&r.memoizedState!==null;var s=Un,l=_t,u=ni;Un=s||o,ni=u||o,_t=l||i,Mr(t,e,n),_t=l,ni=u,Un=s,Nr(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||i||Un||_t||(t=i||_t,n=Un,r=_t,Un=o||Un,_t=t,cl(e,2),Un=n,_t=r),!o&&ni||UL(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,$b(e,n))));break;case 19:Mr(t,e,n),Nr(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,$b(e,t)));break;case 30:a&512&&(_t||r===null||er(r,r.return)),a=EM(),o=Em,i=(n&335544064)===n,s=e.memoizedProps,Em=i&&gs(s.default,s.update)!=="none",Mr(t,e,n),Nr(e),i&&r!==null&&kt&&(e.flags|=4),Em=o,kt=a;break;case 21:break;case 7:a&512&&(_t||r===null||er(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mr(t,e,n),Nr(e)}}function Nr(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(W5(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(G2(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if($2(a))break;a=a.return}var i=r;if(n==null)throw Error(ee(160));switch(n.tag){case 27:var s=n.stateNode,l=US(e);Ny(e,l,s,i);break;case 5:var u=n.stateNode;n.flags&32&&(xd(u,""),n.flags&=-33);var c=US(e);Ny(e,c,u,i);break;case 3:case 4:var f=n.stateNode.containerInfo,d=US(e);PL(e,d,f,i);break;default:throw Error(ee(161))}}catch(p){Nt(e,e.return,p)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function i3(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;i3(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Id=!0,t.reset(),Id=!1),e=e.sibling}}function qf(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)s3(t,e),t=t.sibling;else J5(t,!1)}function s3(e,t){var n=e.alternate;if(n===null)BL(e,!1);else switch(e.tag){case 3:if(VL=ri=!1,wN(),qf(t,e),!ri&&!Py){if(e=ii,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var a=e[r+1];N3(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+a+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),VL=!0}ii=null;break;case 5:qf(t,e);break;case 4:r=ri,ri=!1,qf(t,e),ri&&(Py=!0),ri=r;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?BL(e,!1):qf(t,e));break;case 30:r=ri,a=wN(),ri=!1,qf(t,e),ri&&(e.flags|=4);var o=e.memoizedProps,i=e.stateNode;t=cs(o,i),i=cs(n.memoizedProps,i);var s=gs(o.default,o.update);s==="none"?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,sa=0,t=W2(e,n,t,i,s,o,!0),sa!==(o===null?0:o.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(vd(e,e.memoizedProps.onUpdate),ii=a):a!==null&&(a.push.apply(a,ii),ii=a),ri=(e.flags&32)!==0?!0:r;break;default:qf(t,e)}}function ai(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Q5(e,t.alternate,t),t=t.sibling}function cl(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ml(4,n,n.return),cl(n,r);break;case 1:er(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&G5(n,n.return,a),cl(n,r);break;case 27:(r&2)!==0&&q3(n.stateNode,n.type,n.memoizedProps);case 5:er(n,n.return),n.tag!==5&&n.tag!==27||zm(n),cl(n,r);break;case 6:zm(n);break;case 26:er(n,n.return),a=n.stateNode,n.memoizedState!==null||a===null||_t||a.parentNode.removeChild(a),cl(n,r);break;case 22:n.memoizedState===null&&cl(n,r);break;case 30:er(n,n.return),cl(n,r);break;case 7:er(n,n.return);default:cl(n,r)}e=e.sibling}}function ko(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var r=t.alternate,a=e,o=t,i=o.flags,s=(n&1)!==0;switch(o.tag){case 0:case 11:case 15:ko(a,o,n),dg(4,o);break;case 1:if(ko(a,o,n),r=o,a=r.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(c){Nt(r,r.return,c)}if(r=o,a=r.updateQueue,a!==null){var l=r.stateNode;try{var u=a.shared.hiddenCallbacks;if(u!==null)for(a.shared.hiddenCallbacks=null,a=0;a<u.length;a++)e5(u[a],l)}catch(c){Nt(r,r.return,c)}}s&&i&64&&$5(o),oi(o,o.return);break;case 27:(n&2)!==0&&K5(o);case 5:o.tag!==5&&o.tag!==27||yN(o),ko(a,o,n),s&&r===null&&i&4&&OL(o),oi(o,o.return);break;case 6:yN(o);break;case 26:l=o.stateNode,o.memoizedState!==null||l===null||Un||i2(eg(l.ownerDocument),o.type,l),ko(a,o,n),s&&r===null&&i&4&&OL(o),oi(o,o.return);break;case 12:ko(a,o,n);break;case 31:ko(a,o,n),s&&i&4&&r3(a,o);break;case 13:ko(a,o,n),s&&i&4&&a3(a,o);break;case 22:o.memoizedState===null&&ko(a,o,n),oi(o,o.return);break;case 30:ko(a,o,n),oi(o,o.return);break;case 7:oi(o,o.return);default:ko(a,o,n)}t=t.sibling}}function K2(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&cg(n))}function X2(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&cg(e))}function Ka(e,t,n,r){var a=(n&335544064)===n;if(t.subtreeFlags&(a?10262:10256))for(t=t.child;t!==null;)l3(e,t,n,r),t=t.sibling;else a&&Z5(t)}function l3(e,t,n,r){var a=(n&335544064)===n;a&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ly(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:Ka(e,t,n,r),o&2048&&dg(9,t);break;case 1:Ka(e,t,n,r);break;case 3:Ka(e,t,n,r),a&&VL&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),o&2048&&(o=null,t.alternate!==null&&(o=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==o&&(t.refCount++,o!=null&&cg(o)));break;case 12:if(o&2048){Ka(e,t,n,r),o=t.stateNode;try{var i=t.memoizedProps,s=i.id,l=i.onPostCommit;typeof l=="function"&&l(s,t.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(u){Nt(t,t.return,u)}}else Ka(e,t,n,r);break;case 31:Ka(e,t,n,r);break;case 13:Ka(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?(a&&s!==null&&s.memoizedState===null&&ly(s),i._visibility&2?Ka(e,t,n,r):Fm(e,t)):(a&&s!==null&&s.memoizedState!==null&&ly(t),i._visibility&2?Ka(e,t,n,r):(i._visibility|=2,$f(e,t,n,r,(t.subtreeFlags&10256)!==0||!1))),o&2048&&K2(s,t);break;case 24:Ka(e,t,n,r),o&2048&&X2(t.alternate,t);break;case 30:a&&(o=t.alternate,o!==null&&(pi(o.child,!0),pi(t.child,!0))),Ka(e,t,n,r);break;default:Ka(e,t,n,r)}}function $f(e,t,n,r,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,i=t,s=n,l=r,u=i.flags;switch(i.tag){case 0:case 11:case 15:$f(o,i,s,l,a),dg(8,i);break;case 23:break;case 22:var c=i.stateNode;i.memoizedState!==null?c._visibility&2?$f(o,i,s,l,a):Fm(o,i):(c._visibility|=2,$f(o,i,s,l,a)),a&&u&2048&&K2(i.alternate,i);break;case 24:$f(o,i,s,l,a),a&&u&2048&&X2(i.alternate,i);break;default:$f(o,i,s,l,a)}t=t.sibling}}function Fm(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:Fm(n,r),a&2048&&K2(r.alternate,r);break;case 24:Fm(n,r),a&2048&&X2(r.alternate,r);break;default:Fm(n,r)}t=t.sibling}}var Gu=8192;function qu(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)u3(e,t,n),e=e.sibling}function u3(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Gu&&(e.memoizedState!==null?sX(n,Co,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&KN(n,e)));break;case 5:qu(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&KN(n,e));break;case 3:case 4:var r=Co;Co=eg(e.stateNode.containerInfo),qu(e,t,n),Co=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,qu(e,t,n),Gu=r):qu(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!=="auto")){var a=e.stateNode;a.paired=null,Ea===null&&(Ea=new Map),Ea.set(r,a)}qu(e,t,n);break;default:qu(e,t,n)}}function c3(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function wm(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];qn=r,d3(r,e)}c3(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)f3(e),e=e.sibling}function f3(e){switch(e.tag){case 0:case 11:case 15:wm(e),e.flags&2048&&Ml(9,e,e.return);break;case 3:wm(e);break;case 12:wm(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,uy(e)):wm(e);break;default:wm(e)}}function uy(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];qn=r,d3(r,e)}c3(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ml(8,t,t.return),uy(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,uy(t));break;default:uy(t)}e=e.sibling}}function d3(e,t){for(;qn!==null;){var n=qn;switch(n.tag){case 0:case 11:case 15:Ml(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:cg(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,qn=r;else e:for(n=e;qn!==null;){r=qn;var a=r.sibling,o=r.return;if(t3(r),r===n){qn=null;break e}if(a!==null){a.return=o,qn=a;break e}qn=o}}}var aK={getCacheForType:function(e){var t=nr(Tn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return nr(Tn).controller.signal}},oK=typeof WeakMap=="function"?WeakMap:Map,St=0,jt=null,ct=null,ft=0,Rt=0,La=null,xl=!1,Rd=!1,Y2=!1,hs=0,gn=0,Nl=0,Qu=0,By=0,_a=0,yd=0,Hm=null,ia=null,jL=!1,ov=0,p3=0,zy=1/0,Fy=null,Il=null,dn=0,Lo=null,sc=null,di=0,$L=0,GL=null,h3=null,dd=null,pd=null,hd=null,Vm=0,cy=null;function Ma(){return(St&2)!==0&&ft!==0?ft&-ft:Ge.T!==null?J2():bO()}function m3(){if(_a===0)if((ft&536870912)===0||nt){var e=Rb;Rb<<=1,(Rb&3932160)===0&&(Rb=262144),_a=e}else _a=536870912;return e=ir.current,e!==null&&(e.flags|=32),_a}function vd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=P3(cs(e.memoizedProps,n))),pd===null&&(pd=[]),pd.push(t.bind(null,r))}}function ua(e,t,n){(e===jt&&(Rt===2||Rt===9)||e.cancelPendingCommit!==null)&&(wd(e,0),bl(e,ft,_a,!1)),sg(e,n),((St&2)===0||e!==jt)&&(e===jt&&((St&2)===0&&(Qu|=n),gn===4&&bl(e,ft,_a,!1)),mi(e))}function g3(e,t,n){if((St&6)!==0)throw Error(ee(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ig(e,t),a=r?lK(e,t):jS(e,t,!0),o=r;do{if(a===0){Rd&&!r&&bl(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!iK(n)){a=jS(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var s=e;a=Hm;var l=s.current.memoizedState.isDehydrated;if(l&&(wd(s,i).flags|=256),i=jS(s,i,!1),i!==2&&i!==6){if(Y2&&!l){s.errorRecoveryDisabledLanes|=o,Qu|=o,a=4;break e}o=ia,ia=a,o!==null&&(ia===null?ia=o:ia.push.apply(ia,o))}a=i}if(o=!1,a!==2)continue}}if(a===1){wd(e,0),bl(e,t,0,!0);break}e:{switch(r=e,o=a,o){case 0:case 1:throw Error(ee(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:bl(r,t,_a,!xl);break e;case 2:ia=null;break;case 3:case 5:break;default:throw Error(ee(329))}if((t&62914560)===t&&(a=ov+300-Ta(),10<a)){if(bl(r,t,_a,!xl),$y(r,0,!0)!==0)break e;di=t,r.timeoutHandle=eI(CN.bind(null,r,n,ia,Fy,jL,t,_a,Qu,yd,xl,o,"Throttled",-0,0),a);break e}CN(r,n,ia,Fy,jL,t,_a,Qu,yd,xl,o,null,-0,0)}}break}while(!0);mi(e)}function CN(e,t,n,r,a,o,i,s,l,u,c,f,d,p){e.timeoutHandle=-1;var h=t.subtreeFlags,g=(o&335544064)===o;if(f=null,(g||h&8192||(h&16785408)===16785408)&&(f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:li},Ea=null,u3(t,o,f),g&&(h=f,g=e.containerInfo,g=(g.nodeType===9?g:g.ownerDocument).__reactViewTransition,g!=null&&(h.count++,h.waitingForViewTransition=!0,h=tg.bind(h),g.finished.then(h,h))),h=(o&62914560)===o?ov-Ta():(o&4194048)===o?p3-Ta():0,h=lX(f,h),h!==null)){di=o,e.cancelPendingCommit=h(LN.bind(null,e,t,o,n,r,a,i,s,l,u,c,f,null,d,p)),bl(e,o,i,!u);return}LN(e,t,o,n,r,a,i,s,l,u,c,f)}function iK(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var a=n[r],o=a.getSnapshot;a=a.value;try{if(!Na(o(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bl(e,t,n,r){t=pO(e,t),t&=~By,t&=~Qu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var o=31-Ra(a),i=1<<o;r[o]=-1,a&=~i}n!==0&&mO(e,n,t)}function iv(){return(St&6)===0?(pg(0,!1),!1):!0}function Z2(){if(ct!==null){if(Rt===0)var e=ct.return;else e=ct,is=dc=null,N2(e),ud=null,Km=0,e=ct;for(;e!==null;)j5(e.alternate,e),e=e.return;ct=null}}function wd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,EK(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),di=0,Z2(),jt=e,ct=n=ss(e.current,null),ft=t,Rt=0,La=null,xl=!1,Rd=ig(e,t),Y2=!1,yd=_a=By=Qu=Nl=gn=0,ia=Hm=null,jL=!1,hs=pO(e,t),Yy(),n}function x3(e,t){Qe=null,Ge.H=Dy,t===Td||t===Qy?(t=YM(),Rt=3):t===I2?(t=YM(),Rt=4):Rt=t===U2?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,La=t,ct===null&&(gn=1,Ry(e,Qa(t,e.current)))}function b3(){var e=ir.current;return e===null?!0:(ft&4194048)===ft?yr===null:(ft&62914560)===ft||(ft&536870912)!==0?e===yr:!1}function y3(){var e=Ge.H;return Ge.H=Dy,e===null?Dy:e}function v3(){var e=Ge.A;return Ge.A=aK,e}function Hy(){gn=4,xl||(ft&4194048)!==ft&&ir.current!==null||(Rd=!0),(Nl&134217727)===0&&(Qu&134217727)===0||jt===null||bl(jt,ft,_a,!1)}function jS(e,t,n){var r=St;St|=2;var a=y3(),o=v3();(jt!==e||ft!==t)&&(Fy=null,wd(e,t)),t=!1;var i=gn;e:do try{if(Rt!==0&&ct!==null){var s=ct,l=La;switch(Rt){case 8:Z2(),i=6;break e;case 3:case 2:case 9:case 6:ir.current===null&&(t=!0);var u=Rt;if(Rt=0,La=null,ad(e,s,l,u),n&&Rd){i=0;break e}break;default:u=Rt,Rt=0,La=null,ad(e,s,l,u)}}sK(),i=gn;break}catch(c){x3(e,c)}while(!0);return t&&e.shellSuspendCounter++,is=dc=null,St=r,Ge.H=a,Ge.A=o,ct===null&&(jt=null,ft=0,Yy()),i}function sK(){for(;ct!==null;)w3(ct)}function lK(e,t){var n=St;St|=2;var r=y3(),a=v3();jt!==e||ft!==t?(Fy=null,zy=Ta()+500,wd(e,t)):Rd=ig(e,t);e:do try{if(Rt!==0&&ct!==null){t=ct;var o=La;t:switch(Rt){case 1:Rt=0,La=null,ad(e,t,o,1);break;case 2:case 9:if(XM(o)){Rt=0,La=null,SN(t);break}t=function(){Rt!==2&&Rt!==9||jt!==e||(Rt=7),mi(e)},o.then(t,t);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:XM(o)?(Rt=0,La=null,SN(t)):(Rt=0,La=null,ad(e,t,o,7));break;case 5:var i=null;switch(ct.tag){case 26:i=ct.memoizedState;case 5:case 27:var s=ct;if(i?G3(i):s.stateNode.complete){Rt=0,La=null;var l=s.sibling;if(l!==null)ct=l;else{var u=s.return;u!==null?(ct=u,sv(u)):ct=null}break t}}Rt=0,La=null,ad(e,t,o,5);break;case 6:Rt=0,La=null,ad(e,t,o,6);break;case 8:Z2(),gn=6;break e;default:throw Error(ee(462))}}uK();break}catch(c){x3(e,c)}while(!0);return is=dc=null,Ge.H=r,Ge.A=a,St=n,ct!==null?0:(jt=null,ft=0,Yy(),gn)}function uK(){for(;ct!==null&&!IG();)w3(ct)}function w3(e){var t=q5(e.alternate,e,hs);e.memoizedProps=e.pendingProps,t===null?sv(e):ct=t}function SN(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dN(n,t,t.pendingProps,t.type,void 0,ft);break;case 11:t=dN(n,t,t.pendingProps,t.type.render,t.ref,ft);break;case 5:N2(t);var r=t;r===$n&&(nt?(Sy(r),r.tag===5&&r.stateNode!=null&&(Kt=r.stateNode)):(Sy(r),nt=!0));default:j5(n,t),t=ct=$O(t,hs),t=q5(n,t,hs)}e.memoizedProps=e.pendingProps,t===null?sv(e):ct=t}function ad(e,t,n,r){is=dc=null,N2(t),ud=null,Km=0;var a=t.return;try{if(YW(e,a,t,n,ft)){gn=1,Ry(e,Qa(n,e.current)),ct=null;return}}catch(o){if(a!==null)throw ct=a,o;gn=1,Ry(e,Qa(n,e.current)),ct=null;return}t.flags&32768?(nt||r===1?e=!0:Rd||(ft&536870912)!==0?e=!1:(xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ir.current,r!==null&&r.tag===13&&(r.flags|=16384))),k3(t,e)):sv(t)}function sv(e){var t=e;do{if((t.flags&32768)!==0){k3(t,xl);return}e=t.return;var n=eK(t.alternate,t,hs);if(n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);gn===0&&(gn=5)}function k3(e,t){do{var n=tK(e.alternate,e);if(n!==null){n.flags&=32767,ct=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ct=e;return}ct=e=n}while(e!==null);gn=6,ct=null}function LN(e,t,n,r,a,o,i,s,l,u,c,f){e.cancelPendingCommit=null;do lv();while(dn!==0);if((St&6)!==0)throw Error(ee(327));if(t!==null){if(t===e.current)throw Error(ee(177));e===jt&&(ct=jt=null,ft=0),sc=t,Lo=e,di=n,GL=a,h3=r,cK(e,t,n,i,s,l,f)}}function cK(e,t,n,r,a,o,i){var s=t.lanes|t.childLanes;if($L=s,s|=v2,PG(e,n,s,r,a,o),pd=null,(n&335544064)===n?(hd=zW(e),r=10262):(hd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,gK(yy,function(){return YL(),null})):(e.callbackNode=null,e.callbackPriority=0),Oy=!1,r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=Ge.T,Ge.T=null,a=Lt.p,Lt.p=2,o=St,St|=4;try{nK(e,t,n)}finally{St=o,Lt.p=a,Ge.T=r}}dn=1,Oy?dd=NK(i,e.containerInfo,hd,WL,KL,dK,XL,YL,fK,null,null):(WL(),KL(),XL())}function fK(e){if(dn!==0){var t=Lo.onRecoverableError;t(e,{componentStack:null})}}function dK(){dn===3&&(dn=0,s3(sc,Lo),dn=4)}function WL(){if(dn===1){dn=0;var e=Lo,t=sc,n=di,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=Ge.T,Ge.T=null;var a=Lt.p;Lt.p=2;var o=St;St|=4;try{Em=Py=!1,o3(t,e,n),n=e2;var i=BO(e.containerInfo),s=n.focusedElem,l=n.selectionRange;if(i!==s&&s&&s.ownerDocument&&PO(s.ownerDocument.documentElement,s)){if(l!==null&&y2(s)){var u=l.start,c=l.end;if(c===void 0&&(c=u),"selectionStart"in s)s.selectionStart=u,s.selectionEnd=Math.min(c,s.value.length);else{var f=s.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var p=d.getSelection(),h=s.textContent.length,g=Math.min(l.start,h),x=l.end===void 0?g:Math.min(l.end,h);!p.extend&&g>x&&(i=x,x=g,g=i);var m=VM(s,g),y=VM(s,x);if(m&&y&&(p.rangeCount!==1||p.anchorNode!==m.node||p.anchorOffset!==m.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=f.createRange();b.setStart(m.node,m.offset),p.removeAllRanges(),g>x?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(f=[],p=s;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<f.length;s++){var v=f[s];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Id=!!QL,e2=QL=null}finally{St=o,Lt.p=a,Ge.T=r}}e.current=t,dn=2}}function KL(){if(dn===2){dn=0;var e=Lo,t=sc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=Ge.T,Ge.T=null;var r=Lt.p;Lt.p=2;var a=St;St|=4;try{Q5(e,t.alternate,t)}finally{St=a,Lt.p=r,Ge.T=n}}dn=3}}function XL(){if(dn===4||dn===3){dn=0;var e=dd;dd=null,AG();var t=Lo,n=sc,r=di,a=h3,o=(r&335544064)===r?10262:10256;if((n.subtreeFlags&o)!==0||(n.flags&o)!==0?dn=5:(dn=0,sc=Lo=null,C3(t,t.pendingLanes)),o=t.pendingLanes,o===0&&(Il=null),p2(r),n=n.stateNode,Da&&typeof Da.onCommitFiberRoot=="function")try{Da.onCommitFiberRoot(og,n,void 0,(n.current.flags&128)===128)}catch{}if(a!==null){n=Ge.T,o=Lt.p,Lt.p=2,Ge.T=null;try{for(var i=t.onRecoverableError,s=0;s<a.length;s++){var l=a[s];i(l.value,{componentStack:l.stack})}}finally{Ge.T=n,Lt.p=o}}if(a=pd,i=hd,hd=null,a!==null&&(pd=null,i===null&&(i=[]),e!==null))for(l=0;l<a.length;l++)n=(0,a[l])(i),n!==void 0&&e.finished.finally(n);(di&3)!==0&&lv(),mi(t),o=t.pendingLanes,(r&261930)!==0&&(o&42)!==0?t===cy?Vm++:(Vm=0,cy=t):(Vm=0,cy=null),pg(0,!1)}}function C3(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,cg(t)))}function lv(){return dd!==null&&(dd.skipTransition(),dd=null),WL(),KL(),XL(),YL()}function YL(){if(dn!==5)return!1;var e=Lo,t=$L;$L=0;var n=p2(di),r=Ge.T,a=Lt.p;try{Lt.p=32>n?32:n,Ge.T=null,n=GL,GL=null;var o=Lo,i=di;if(dn=0,sc=Lo=null,di=0,(St&6)!==0)throw Error(ee(331));var s=St;if(St|=4,f3(o.current),l3(o,o.current,i,n),St=s,pg(0,!1),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(og,o)}catch{}return!0}finally{Lt.p=a,Ge.T=r,C3(e,t)}}function IN(e,t,n){t=Qa(n,t),t=_L(e.stateNode,t,2),e=Cl(e,t,2),e!==null&&(sg(e,2),mi(e))}function Nt(e,t,n){if(e.tag===3)IN(e,e,n);else for(;t!==null;){if(t.tag===3){IN(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Il===null||!Il.has(r))){e=Qa(n,e),n=z5(2),r=Cl(t,n,2),r!==null&&(F5(n,r,t,e),sg(r,2),mi(r));break}}t=t.return}}function $S(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oK;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(Y2=!0,a.add(n),e=pK.bind(null,e,t,n),t.then(e,e))}function pK(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,jt===e&&(ft&n)===n&&((gn===4||gn===3&&(ft&62914560)===ft&&300>Ta()-ov)&&(St&2)===0?wd(e,0):By|=n,yd===ft&&(yd=0)),mi(e)}function S3(e,t){t===0&&(t=hO()),e=fc(e,t),e!==null&&(sg(e,t),mi(e))}function hK(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),S3(e,n)}function mK(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(ee(314))}r!==null&&r.delete(t),S3(e,n)}function gK(e,t){return f2(e,t)}var kd=null,Gf=null,ZL=!1,Vy=!1,GS=!1,yl=0;function mi(e){e!==Gf&&e.next===null&&(Gf===null?kd=Gf=e:Gf=Gf.next=e),Vy=!0,ZL||(ZL=!0,bK())}function pg(e,t){if(!GS&&Vy){GS=!0;do for(var n=!1,r=kd;r!==null;){if(!t)if(e!==0){var a=r.pendingLanes;if(a===0)var o=0;else{var i=r.suspendedLanes,s=r.pingedLanes;o=(1<<31-Ra(42|e)+1)-1,o&=a&~(i&~s),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,AN(r,o))}else o=ft,o=$y(r,r===jt?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||ig(r,o)||(n=!0,AN(r,o));r=r.next}while(n);GS=!1}}function xK(){L3()}function L3(){Vy=ZL=!1;var e=0;yl!==0&&AK()&&(e=yl);for(var t=Ta(),n=null,r=kd;r!==null;){var a=r.next,o=I3(r,t);o===0?(r.next=null,n===null?kd=a:n.next=a,a===null&&(Gf=n)):(n=r,(e!==0||(o&3)!==0)&&(Vy=!0)),r=a}dn!==0&&dn!==5||pg(e,!1),yl!==0&&(yl=0)}function I3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var i=31-Ra(o),s=1<<i,l=a[i];l===-1?((s&n)===0||(s&r)!==0)&&(a[i]=OG(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}if(t=jt,n=ft,n=$y(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rt===2||Rt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&SS(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ig(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&SS(r),p2(n)){case 2:case 8:n=fO;break;case 32:n=yy;break;case 268435456:n=dO;break;default:n=yy}return r=A3.bind(null,e),n=f2(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&SS(r),e.callbackPriority=2,e.callbackNode=null,2}function A3(e,t){if(dn!==0&&dn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lv()&&e.callbackNode!==n)return null;var r=ft;return r=$y(e,e===jt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(g3(e,r,t),I3(e,Ta()),e.callbackNode!=null&&e.callbackNode===n?A3.bind(null,e):null)}function AN(e,t){if(lv())return null;g3(e,t,!0)}function bK(){_K(function(){(St&6)!==0?f2(cO,xK):L3()})}function J2(){if(yl===0){var e=rc;e===0&&(e=Db,Db<<=1,(Db&261888)===0&&(Db=256)),yl=e}return yl}function EN(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Jb(e)}function yK(e,t,n,r,a){if(t==="submit"&&n&&n.stateNode===a){var o=EN((a[fa]||null).action),i=r.submitter;i&&(t=(t=i[fa]||null)?EN(t.formAction):i.getAttribute("formAction"),t!==null&&(o=t,i=null));var s=new Wy("action","action",null,r,a);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(yl!==0){var l=new FormData(a,i);AL(n,{pending:!0,data:l,method:a.method,action:o},null,l)}}else typeof o=="function"&&(s.preventDefault(),l=new FormData(a,i),AL(n,{pending:!0,data:l,method:a.method,action:o},o,l))},currentTarget:a}]})}}for(Gb=0;Gb<gL.length;Gb++)Wb=gL[Gb],_N=Wb.toLowerCase(),TN=Wb[0].toUpperCase()+Wb.slice(1),Io(_N,"on"+TN);var Wb,_N,TN,Gb;Io(FO,"onAnimationEnd");Io(HO,"onAnimationIteration");Io(VO,"onAnimationStart");Io("dblclick","onDoubleClick");Io("focusin","onFocus");Io("focusout","onBlur");Io(TW,"onTransitionRun");Io(DW,"onTransitionStart");Io(RW,"onTransitionCancel");Io(UO,"onTransitionEnd");gd("onMouseEnter",["mouseout","mouseover"]);gd("onMouseLeave",["mouseout","mouseover"]);gd("onPointerEnter",["pointerout","pointerover"]);gd("onPointerLeave",["pointerout","pointerover"]);uc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));uc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));uc("onBeforeInput",["compositionend","keypress","textInput","paste"]);uc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));uc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));uc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zm="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(" "),vK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zm));function E3(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var s=r[i],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&a.isPropagationStopped())break e;o=s,a.currentTarget=u;try{o(a)}catch(c){wy(c)}a.currentTarget=null,o=l}else for(i=0;i<r.length;i++){if(s=r[i],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&a.isPropagationStopped())break e;o=s,a.currentTarget=u;try{o(a)}catch(c){wy(c)}a.currentTarget=null,o=l}}}}function ut(e,t){var n=t[SM];n===void 0&&(n=t[SM]=new Set);var r=e+"__bubble";n.has(r)||(_3(t,e,2,!1),n.add(r))}function WS(e,t,n){var r=0;t&&(r|=4),_3(n,e,r,t)}var Kb="_reactListening"+Math.random().toString(36).slice(2);function Q2(e){if(!e[Kb]){e[Kb]=!0,vO.forEach(function(n){n!=="selectionchange"&&(vK.has(n)||WS(n,!1,e),WS(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kb]||(t[Kb]=!0,WS("selectionchange",!1,t))}}function _3(e,t,n,r){switch(Q3(t)){case 2:var a=dX;break;case 8:a=pX;break;default:a=iI}n=a.bind(null,t,n,e),a=void 0,!dL||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function KS(e,t,n,r,a){var o=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var s=r.stateNode.containerInfo;if(s===a)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&i.stateNode.containerInfo===a)return;i=i.return}for(;s!==null;){if(i=Wu(s),i===null)return;if(l=i.tag,l===5||l===6||l===26||l===27){r=o=i;continue e}s=s.parentNode}}r=r.return}EO(function(){var u=o,c=m2(n),f=[];e:{var d=qO.get(e);if(d!==void 0){var p=Wy,h=e;switch(e){case"keypress":if(ey(n)===0)break e;case"keydown":case"keyup":p=iW;break;case"focusin":h="focus",p=TS;break;case"focusout":h="blur",p=TS;break;case"beforeblur":case"afterblur":p=TS;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=RM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=KG;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=fW;break;case FO:case HO:case VO:p=ZG;break;case UO:p=pW;break;case"scroll":case"scrollend":p=GG;break;case"wheel":p=mW;break;case"copy":case"cut":case"paste":p=QG;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=NM;break;case"submit":p=uW;break;case"toggle":case"beforetoggle":p=xW}var g=(t&4)!==0,x=!g&&(e==="scroll"||e==="scrollend"),m=g?d!==null?d+"Capture":null:d;g=[];for(var y=u,b;y!==null;){var v=y;if(b=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||b===null||m===null||(v=qm(y,m),v!=null&&g.push(Jm(y,v,b))),x)break;y=y.return}0<g.length&&(d=new p(d,h,null,n,c),f.push({event:d,listeners:g}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",p&&n!==fL&&(h=n.relatedTarget||n.fromElement)&&(Wu(h)||h[Ed]))break e;(d||p)&&(h=c.window===c?c:(p=c.ownerDocument)?p.defaultView||p.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=u,p=p?Wu(p):null,p!==null&&(x=ag(p),g=p.tag,p!==x||g!==5&&g!==27&&g!==6)&&(p=null)):(d=null,p=u),d!==p&&(g=RM,v="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=NM,v="onPointerLeave",m="onPointerEnter",y="pointer"),x=d==null?h:Im(d),b=p==null?h:Im(p),h=new g(v,y+"leave",d,n,c),h.target=x,h.relatedTarget=b,v=null,Wu(c)===u&&(g=new g(m,y+"enter",p,n,c),g.target=b,g.relatedTarget=x,v=g),x=v,g=d&&p?QS(d,p,wK):null,d!==null&&DN(f,h,d,g,!1),p!==null&&x!==null&&DN(f,x,p,g,!0)))}e:{if(d=u?Im(u):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var w=zM;else if(BM(d))if(NO)w=AW;else{w=LW;var k=SW}else p=d.nodeName,!p||p.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?u&&h2(u.elementType)&&(w=zM):w=IW;if(w&&(w=w(e,u))){MO(f,w,n,c);break e}k&&k(e,d,u)}switch(k=u?Im(u):window,e){case"focusin":(BM(k)||k.contentEditable==="true")&&(Jf=k,hL=u,Dm=null);break;case"focusout":Dm=hL=Jf=null;break;case"mousedown":mL=!0;break;case"contextmenu":case"mouseup":case"dragend":mL=!1,UM(f,n,c);break;case"selectionchange":if(_W)break;case"keydown":case"keyup":UM(f,n,c)}var _;if(b2)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Zf?DO(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(TO&&n.locale!=="ko"&&(Zf||E!=="onCompositionStart"?E==="onCompositionEnd"&&Zf&&(_=_O()):(ml=c,g2="value"in ml?ml.value:ml.textContent,Zf=!0)),k=Uy(u,E),0<k.length&&(E=new MM(E,e,null,n,c),f.push({event:E,listeners:k}),_?E.data=_:(_=RO(n),_!==null&&(E.data=_)))),(_=yW?vW(e,n):wW(e,n))&&(E=Uy(u,"onBeforeInput"),0<E.length&&(k=new MM("onBeforeInput","beforeinput",null,n,c),f.push({event:k,listeners:E}),k.data=_)),yK(f,e,u,n,c)}E3(f,t)})}function Jm(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Uy(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,o=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||o===null||(a=qm(e,n),a!=null&&r.unshift(Jm(e,a,o)),a=qm(e,t),a!=null&&r.push(Jm(e,a,o))),e.tag===3)return r;e=e.return}return[]}function wK(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function DN(e,t,n,r,a){for(var o=t._reactName,i=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||u===null||(l=u,a?(u=qm(n,o),u!=null&&i.unshift(Jm(n,u,l))):a||(u=qm(n,o),u!=null&&i.push(Jm(n,u,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var kK=/\r\n?/g,CK=/\u0000|\uFFFD/g;function RN(e){return(typeof e=="string"?e:""+e).replace(kK,`
|
|
9
|
+
`).replace(CK,"")}function T3(e,t){return t=RN(t),RN(e)===t}function Mt(e,t,n,r,a,o){switch(n){case"children":if(typeof r=="string")t==="body"||t==="textarea"&&r===""||xd(e,r);else if(typeof r=="number"||typeof r=="bigint")t!=="body"&&xd(e,""+r);else return;break;case"className":Nb(e,"class",r);break;case"tabIndex":Nb(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Nb(e,n,r);break;case"style":AO(e,r,o);return;case"data":if(t!=="object"){Nb(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Jb(r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&Mt(e,t,"name",a.name,a,null),Mt(e,t,"formEncType",a.formEncType,a,null),Mt(e,t,"formMethod",a.formMethod,a,null),Mt(e,t,"formTarget",a.formTarget,a,null)):(Mt(e,t,"encType",a.encType,a,null),Mt(e,t,"method",a.method,a,null),Mt(e,t,"target",a.target,a,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Jb(r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=li);return;case"onScroll":r!=null&&ut("scroll",e);return;case"onScrollEnd":r!=null&&ut("scrollend",e);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(ee(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(ee(60));o?.__html!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Jb(r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ut("beforetoggle",e),ut("toggle",e),Zb(e,"popover",r);break;case"xlinkActuate":ns(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ns(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ns(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ns(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ns(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ns(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ns(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ns(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ns(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Zb(e,"is",r);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=jG.get(n)||n,Zb(e,n,r);else return}kt=!0}function JL(e,t,n,r,a,o){switch(n){case"style":AO(e,r,o);return;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(ee(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(ee(60));o?.__html!==n&&(e.innerHTML=n)}}break;case"children":if(typeof r=="string")xd(e,r);else if(typeof r=="number"||typeof r=="bigint")xd(e,""+r);else return;break;case"onScroll":r!=null&&ut("scroll",e);return;case"onScrollEnd":r!=null&&ut("scrollend",e);return;case"onClick":r!=null&&(e.onclick=li);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!wO.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),o=n.slice(2,a?n.length-7:void 0),t=e[fa]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(o,t,a),typeof r=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break e}kt=!0,n in e?e[n]=r:r===!0?e.setAttribute(n,""):Zb(e,n,r)}return}kt=!0}function or(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",e),ut("load",e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var i=n[o];if(i!=null)switch(o){case"src":r=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(ee(137,t));default:Mt(e,t,o,i,n,null)}}a&&Mt(e,t,"srcSet",n.srcSet,n,null),r&&Mt(e,t,"src",n.src,n,null);return;case"input":ut("invalid",e);var s=o=i=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var c=n[r];if(c!=null)switch(r){case"name":a=c;break;case"type":i=c;break;case"checked":l=c;break;case"defaultChecked":u=c;break;case"value":o=c;break;case"defaultValue":s=c;break;case"children":case"dangerouslySetInnerHTML":if(c!=null)throw Error(ee(137,t));break;default:Mt(e,t,r,c,n,null)}}SO(e,o,s,l,u,i,a,!1);return;case"select":ut("invalid",e),r=i=o=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":o=s;break;case"defaultValue":i=s;break;case"multiple":r=s;default:Mt(e,t,a,s,n,null)}t=o,n=i,e.multiple=!!r,t!=null?id(e,!!r,t,!1):n!=null&&id(e,!!r,n,!0);return;case"textarea":ut("invalid",e),o=a=r=null;for(i in n)if(n.hasOwnProperty(i)&&(s=n[i],s!=null))switch(i){case"value":r=s;break;case"defaultValue":a=s;break;case"children":o=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(ee(91));break;default:Mt(e,t,i,s,n,null)}IO(e,r,a,o);return;case"option":for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null)&&(l==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Mt(e,t,l,r,n,null));return;case"dialog":ut("beforetoggle",e),ut("toggle",e),ut("cancel",e),ut("close",e);break;case"iframe":case"object":ut("load",e);break;case"video":case"audio":for(r=0;r<Zm.length;r++)ut(Zm[r],e);break;case"image":ut("error",e),ut("load",e);break;case"details":ut("toggle",e);break;case"embed":case"source":case"link":ut("error",e),ut("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(ee(137,t));default:Mt(e,t,u,r,n,null)}return;default:if(h2(t)){for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!==void 0&&JL(e,t,c,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&Mt(e,t,s,r,n,null))}var SK={};function LK(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,o=null,i=null,s=null,l=null,u=null,c=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(p)||Mt(e,t,p,null,r,f)}}for(var d in r){var p=r[d];if(f=n[d],r.hasOwnProperty(d)&&(p!=null||f!=null))switch(d){case"type":p!==f&&(kt=!0),o=p;break;case"name":p!==f&&(kt=!0),a=p;break;case"checked":p!==f&&(kt=!0),u=p;break;case"defaultChecked":p!==f&&(kt=!0),c=p;break;case"value":p!==f&&(kt=!0),i=p;break;case"defaultValue":p!==f&&(kt=!0),s=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(ee(137,t));break;default:p!==f&&Mt(e,t,d,p,r,f)}}cL(e,i,s,l,u,c,o,a);return;case"select":p=i=s=d=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":p=l;default:r.hasOwnProperty(o)||Mt(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case"value":o!==l&&(kt=!0),d=o;break;case"defaultValue":o!==l&&(kt=!0),s=o;break;case"multiple":o!==l&&(kt=!0),i=o;default:o!==l&&Mt(e,t,a,o,r,l)}t=s,n=i,r=p,d!=null?id(e,!!n,d,!1):!!r!=!!n&&(t!=null?id(e,!!n,t,!0):id(e,!!n,n?[]:"",!1));return;case"textarea":p=d=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:Mt(e,t,s,null,r,a)}for(i in r)if(a=r[i],o=n[i],r.hasOwnProperty(i)&&(a!=null||o!=null))switch(i){case"value":a!==o&&(kt=!0),d=a;break;case"defaultValue":a!==o&&(kt=!0),p=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(ee(91));break;default:a!==o&&Mt(e,t,i,a,r,o)}LO(e,d,p);return;case"option":for(var h in n)d=n[h],n.hasOwnProperty(h)&&d!=null&&!r.hasOwnProperty(h)&&(h==="selected"?e.selected=!1:Mt(e,t,h,null,r,d));for(l in r)d=r[l],p=n[l],r.hasOwnProperty(l)&&d!==p&&(d!=null||p!=null)&&(l==="selected"?(d!==p&&(kt=!0),e.selected=d&&typeof d!="function"&&typeof d!="symbol"):Mt(e,t,l,d,r,p));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 g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g)&&Mt(e,t,g,null,r,d);for(u in r)if(d=r[u],p=n[u],r.hasOwnProperty(u)&&d!==p&&(d!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(ee(137,t));break;default:Mt(e,t,u,d,r,p)}return;default:if(h2(t)){for(var x in n)d=n[x],n.hasOwnProperty(x)&&d!==void 0&&!r.hasOwnProperty(x)&&JL(e,t,x,void 0,r,d);for(c in r)d=r[c],p=n[c],!r.hasOwnProperty(c)||d===p||d===void 0&&p===void 0||JL(e,t,c,d,r,p);return}}for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&Mt(e,t,m,null,r,d);for(f in r)d=r[f],p=n[f],!r.hasOwnProperty(f)||d===p||d==null&&p==null||Mt(e,t,f,d,r,p)}function MN(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function IK(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var a=n[r],o=a.transferSize,i=a.initiatorType,s=a.duration;if(o&&s&&MN(i)){for(i=0,s=a.responseEnd,r+=1;r<n.length;r++){var l=n[r],u=l.startTime;if(u>s)break;var c=l.transferSize,f=l.initiatorType;c&&MN(f)&&(l=l.responseEnd,i+=c*(l<s?1:(s-u)/(l-u)))}if(--r,t+=8*(o+i)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var QL=null,e2=null;function Qm(e){return e.nodeType===9?e:e.ownerDocument}function NN(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function D3(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function R3(e,t,n,r){return n=Qm(n).createElement(e),n[tr]=r,n[fa]=t,or(n,e,t),jn(n),n}function t2(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var XS=null;function AK(){var e=window.event;return e&&e.type==="popstate"?e===XS?!1:(XS=e,!0):(XS=null,!1)}var eI=typeof setTimeout=="function"?setTimeout:void 0,EK=typeof clearTimeout=="function"?clearTimeout:void 0,ON=typeof Promise=="function"?Promise:void 0,PN=typeof requestAnimationFrame=="function"?requestAnimationFrame:eI,_K=typeof queueMicrotask=="function"?queueMicrotask:typeof ON<"u"?function(e){return ON.resolve(null).then(e).catch(TK)}:eI;function TK(e){setTimeout(function(){throw e})}function Pl(e){return e==="head"}function BN(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(a),Ad(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")ZS(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ZS(n);for(var o=n.firstChild;o;){var i=o.nextSibling,s=o.nodeName;o[lg]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=i}}else n==="body"&&ZS(e.ownerDocument.body);n=a}while(n);Ad(t)}function zN(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function M3(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var r=1;else for(var a=r=0;a<t.length;a++){var o=t[a];0<o.width&&0<o.height&&r++}r===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function N3(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function O3(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function n2(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return O3(t,n,e)}function DK(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return O3(t,n,e)}function RK(e){return e.documentElement.clientHeight}function MK(e){this.addEventListener("load",e),this.addEventListener("error",e)}function NK(e,t,n,r,a,o,i,s,l){var u=t.nodeType===9?t:t.ownerDocument;try{var c=u.startViewTransition({update:function(){var d=u.defaultView,p=d.navigation&&d.navigation.transition,h=u.fonts.status;r();var g=[];if(h==="loaded"&&(RK(u),u.fonts.status==="loading"&&g.push(u.fonts.ready)),h=g.length,e!==null)for(var x=e.suspenseyImages,m=0,y=0;y<x.length;y++){var b=x[y];if(!b.complete){var v=b.getBoundingClientRect();if(0<v.bottom&&0<v.right&&v.top<d.innerHeight&&v.left<d.innerWidth){if(m+=W3(b),m>py){g.length=h;break}b=new Promise(MK.bind(b)),g.push(b)}}}if(0<g.length)return d=Promise.race([Promise.all(g),new Promise(function(w){return setTimeout(w,500)})]).then(a,a),(p?Promise.allSettled([p.finished,d]):d).then(o,o);if(a(),p)return p.finished.then(o,o);o()},types:n});u.__reactViewTransition=c;var f=[];return c.ready.then(function(){for(var d=u.documentElement.getAnimations({subtree:!0}),p=0;p<d.length;p++){var h=d[p],g=h.effect,x=g.pseudoElement;if(x!=null&&x.startsWith("::view-transition")){f.push(h),h=g.getKeyframes();for(var m=x=void 0,y=!0,b=0;b<h.length;b++){var v=h[b],w=v.width;if(x===void 0)x=w;else if(x!==w){y=!1;break}if(w=v.height,m===void 0)m=w;else if(m!==w){y=!1;break}delete v.width,delete v.height,v.transform==="none"&&delete v.transform}y&&x!==void 0&&m!==void 0&&(g.setKeyframes(h),y=getComputedStyle(g.target,g.pseudoElement),y.width!==x||y.height!==m)&&(y=h[0],y.width=x,y.height=m,y=h[h.length-1],y.width=x,y.height=m,g.setKeyframes(h))}}i()},function(d){u.__reactViewTransition===c&&(u.__reactViewTransition=null);try{typeof d=="object"&&d!==null&&d.name==="InvalidStateError"&&(d.message==="View transition was skipped because document visibility state is hidden."||d.message==="Skipping view transition because document visibility state has become hidden."||d.message==="Skipping view transition because viewport size changed."||d.message==="Transition was aborted because of invalid state")&&(d=null),d!==null&&l(d)}finally{r(),a(),i()}}),c.finished.finally(function(){for(var d=0;d<f.length;d++)f[d].cancel();u.__reactViewTransition===c&&(u.__reactViewTransition=null),s()}),c}catch{return r(),a(),i(),null}}function Ku(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Ku.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:$t({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};Ku.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],a=0;a<n.length;a++){var o=n[a].effect;o!==null&&o.target===e&&o.pseudoElement===t&&r.push(n[a])}return r};Ku.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function P3(e){return{name:e,group:new Ku("group",e),imagePair:new Ku("image-pair",e),old:new Ku("old",e),new:new Ku("new",e)}}function Oa(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Oa.prototype.addEventListener=function(e,t,n){var r=null,a=null;if(!(n!=null&&typeof n!="boolean"&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var o=this._eventListeners;if(B3(o,e,t,n)===-1){var i=this,s=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(s=function(l){i.removeEventListener(e,t,n),typeof t=="function"?t.call(this,l):t.handleEvent(l)}),r!==null&&(a=i.removeEventListener.bind(i,e,t,n),r.addEventListener("abort",a,{once:!0}),a=r.removeEventListener.bind(r,"abort",a)),r=Cd(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:a}),ca(this._fragmentFiber.child,!1,OK,e,s,r)}this._eventListeners=o}};function OK(e,t,n,r){return Fn(e).addEventListener(t,n,r),!1}Oa.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=B3(r,e,t,n),t!==-1)){var a=r[t];n=a.attachedListener;var o=a.cleanup;a=Cd(a.optionsOrUseCapture),ca(this._fragmentFiber.child,!1,PK,e,n,a),r.splice(t,1),o!==null&&o()}};function PK(e,t,n,r){return Fn(e).removeEventListener(t,n,r),!1}function Cd(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function FN(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function B3(e,t,n,r){if(e.length===0)return-1;r=FN(r);for(var a=0;a<e.length;a++){var o=e[a];if(o.type===t&&o.listener===n&&FN(o.optionsOrUseCapture)===r)return a}return-1}Oa.prototype.dispatchEvent=function(e){var t=lc(this._fragmentFiber);if(t===null)return!0;t=Fn(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var a=0;a<n.length;a++){var o=n[a];r.addEventListener(o.type,o.attachedListener,Cd(o.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(a=0;a<n.length;a++)o=n[a],r.removeEventListener(o.type,o.attachedListener,Cd(o.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)};Oa.prototype.focus=function(e){ca(this._fragmentFiber.child,!0,z3,e,void 0,void 0)};function z3(e,t){return e.tag===6?!1:(e=Fn(e),KK(e,t))}Oa.prototype.focusLast=function(e){var t=[];ca(this._fragmentFiber.child,!0,tI,t,void 0,void 0);for(var n=t.length-1;0<=n&&!z3(t[n],e);n--);};function tI(e,t){return t.push(e),!1}Oa.prototype.blur=function(){var e=lc(this._fragmentFiber);e!==null&&(e=Fn(e),e=Qm(e).activeElement,e!==null&&ca(this._fragmentFiber.child,!1,BK,e,void 0,void 0))};function BK(e,t){return e.tag===6?!1:(e=Fn(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Oa.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),ca(this._fragmentFiber.child,!1,zK,e,void 0,void 0)};function zK(e,t){return e.tag===6||(e=Fn(e),t.observe(e)),!1}Oa.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),ca(this._fragmentFiber.child,!1,FK,e,void 0,void 0);for(var n=t=0;n<So.length;n++){var r=So[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):So[t++]=r}So.length=t}};function FK(e,t){return e.tag===6||(e=Fn(e),t.unobserve(e)),!1}var So=[],YS=!1;function HK(e,t,n){So.push({fragmentInstance:e,observer:t,instance:n}),YS||(YS=!0,XK(function(){YS=!1;var r=So;So=[];for(var a=0;a<r.length;a++){var o=r[a];o.observer.unobserve(o.instance)}}))}Oa.prototype.getClientRects=function(){var e=[];return ca(this._fragmentFiber.child,!1,VK,e,void 0,void 0),e};function VK(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=Fn(e),t.push.apply(t,e.getClientRects());return!1}Oa.prototype.getRootNode=function(e){var t=lc(this._fragmentFiber);return t===null?this:Fn(t).getRootNode(e)};Oa.prototype.compareDocumentPosition=function(e){var t=lc(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];ca(this._fragmentFiber.child,!1,tI,n,void 0,void 0);var r=Fn(t);if(n.length===0){if(n=r,bM(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var a=r=n.compareDocumentPosition(e);return n===e?a=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=iO(t)[1],n===null?a=Node.DOCUMENT_POSITION_PRECEDING:(e=Fn(n).compareDocumentPosition(e),a=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),a|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Fn(n[0]),a=Fn(n[n.length-1]);var o=bM(this._fragmentFiber)?t.parentElement:r;if(o==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY;var i=t.compareDocumentPosition(e),s=a.compareDocumentPosition(e),l=i&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&o&&i&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||o&&a===e||l||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!o&&a===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:i,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||UK(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function UK(e,t,n,r,a){var o=Wu(a);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;o!==null;){if(o.tag===7&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(o===null)return o=a.ownerDocument,a===o||a===o.documentElement||a===o.body;e:{for(o=t,t=lc(t);o!==null;){if(!(o.tag!==5&&o.tag!==3&&o.tag!==27||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(t=QS(n,o,yM),t===null?t=!1:(ca(t,!0,bG,o,n),o=Wf,Wf=null,t=o!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!o)&&!(t=o===r)&&(t=QS(r,o,yM),t===null?t=!1:(ca(t,!0,yG,o,r),o=Wf,JS=Wf=null,t=o!==null)),t):!1}function HN(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Oa.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(ee(566));var t=[];ca(this._fragmentFiber.child,!1,tI,t,void 0,void 0);var n=e!==!1;if(t.length===0){var r=iO(this._fragmentFiber);if(r=n?r[1]||r[0]||lc(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=Fn(r),HN(e,n);return}if(r=Fn(r),r.nodeType!==9){if(r.nodeType===11){n="host"in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=Fn(a),HN(a,n)):Fn(a).scrollIntoView(e),r+=n?-1:1}};function qK(e,t){return e=Fn(e),F3(e,t),!1}function F3(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function H3(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];e.addEventListener(a.type,a.attachedListener,Cd(a.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){for(var i=0,s=0;s<So.length;s++){var l=So[s];(l.fragmentInstance!==t||l.observer!==o||l.instance!==e)&&(So[i++]=l)}So.length=i,o.observe(e)}),F3(e,t))}function jK(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];e.removeEventListener(a.type,a.attachedListener,Cd(a.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(o){typeof o.rootMargin=="string"?HK(t,o,e):o.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function r2(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":r2(n),Gy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function $K(e,t,n,r){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[lg])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=to(e.nextSibling),e===null)break}return null}function GK(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=to(e.nextSibling),e===null))return null;return e}function V3(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=to(e.nextSibling),e===null))return null;return e}function a2(e){return e.data==="$?"||e.data==="$~"}function nI(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function WK(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function to(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var o2=null;function VN(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return to(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function UN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function KK(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return r}function XK(e){PN(function(){PN(function(t){return e(t)})})}function U3(e,t,n){switch(t=Qm(n),e){case"html":if(e=t.documentElement,!e)throw Error(ee(452));return e;case"head":if(e=t.head,!e)throw Error(ee(453));return e;case"body":if(e=t.body,!e)throw Error(ee(454));return e;default:throw Error(ee(451))}}function q3(e,t,n){for(var r in n){var a=n[r];n.hasOwnProperty(r)&&a!=null&&Mt(e,t,r,null,SK,a)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===li&&(e.onclick=null),Gy(e)}function ZS(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Gy(e)}var no=new Map,qN=new Set;function eg(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xs=Lt.d;Lt.d={f:YK,r:ZK,D:JK,C:QK,L:eX,m:tX,X:rX,S:nX,M:aX};function YK(){var e=xs.f(),t=iv();return e||t}function ZK(e){var t=_d(e);t!==null&&t.tag===5&&t.type==="form"?A5(t):xs.r(e)}var Md=typeof document>"u"?null:document;function j3(e,t,n){var r=Md;if(r&&typeof t=="string"&&t){var a=Ja(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),qN.has(a)||(qN.add(a),e={rel:e,crossOrigin:n,href:t},r.querySelector(a)===null&&(t=r.createElement("link"),or(t,"link",e),jn(t),r.head.appendChild(t)))}}function JK(e){xs.D(e),j3("dns-prefetch",e,null)}function QK(e,t){xs.C(e,t),j3("preconnect",e,t)}function eX(e,t,n){xs.L(e,t,n);var r=Md;if(r&&e&&t){var a='link[rel="preload"][as="'+Ja(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Ja(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Ja(n.imageSizes)+'"]')):a+='[href="'+Ja(e)+'"]';var o=a;switch(t){case"style":o=Sd(e);break;case"script":o=Nd(e)}if(!(no.has(o)||(e=$t({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),no.set(o,e),r.querySelector(a)!==null||t==="style"&&r.querySelector(hg(o))||t==="script"&&r.querySelector(mg(o))))){var i=r.createElement("link");or(i,"link",e),t==="style"&&(i[vy]=!0,i.onload=i.onerror=function(){yO(i)}),jn(i),r.head.appendChild(i)}}}function tX(e,t){xs.m(e,t);var n=Md;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Ja(r)+'"][href="'+Ja(e)+'"]',o=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Nd(e)}if(!no.has(o)&&(e=$t({rel:"modulepreload",href:e},t),no.set(o,e),n.querySelector(a)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(mg(o)))return}r=n.createElement("link"),or(r,"link",e),jn(r),n.head.appendChild(r)}}}function nX(e,t,n){xs.S(e,t,n);var r=Md;if(r&&e){var a=od(r).hoistableStyles,o=Sd(e);t=t||"default";var i=a.get(o);if(!i){var s={loading:0,preload:null};if(i=r.querySelector(hg(o)))s.loading=5;else{e=$t({rel:"stylesheet",href:e,"data-precedence":t},n),(n=no.get(o))&&rI(e,n);var l=i=r.createElement("link");jn(l),or(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,fy(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:s},a.set(o,i)}}}function rX(e,t){xs.X(e,t);var n=Md;if(n&&e){var r=od(n).hoistableScripts,a=Nd(e),o=r.get(a);o||(o=n.querySelector(mg(a)),o||(e=$t({src:e,async:!0},t),(t=no.get(a))&&aI(e,t),o=n.createElement("script"),jn(o),or(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(a,o))}}function aX(e,t){xs.M(e,t);var n=Md;if(n&&e){var r=od(n).hoistableScripts,a=Nd(e),o=r.get(a);o||(o=n.querySelector(mg(a)),o||(e=$t({src:e,async:!0,type:"module"},t),(t=no.get(a))&&aI(e,t),o=n.createElement("script"),jn(o),or(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(a,o))}}function jN(e,t,n,r){var a=(a=vl.current)?eg(a):null;if(!a)throw Error(ee(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Sd(n.href),t=od(a).hoistableStyles,r=t.get(n),r||(r={type:"style",instance:null,count:0,state:null},t.set(n,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Sd(n.href);var o=od(a).hoistableStyles,i=o.get(e);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,i),(o=a.querySelector(hg(e)))?o._p||(i.instance=o,i.state.loading=5):(o=no.get(e),o||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},no.set(e,o)),oX(a,e,o,i.state))),t&&r===null)throw Error(ee(528,""));return i}if(t&&r!==null)throw Error(ee(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=Nd(n),t=od(a).hoistableScripts,r=t.get(n),r||(r={type:"script",instance:null,count:0,state:null},t.set(n,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(ee(444,e))}}function Sd(e){return'href="'+Ja(e)+'"'}function hg(e){return'link[rel="stylesheet"]['+e+"]"}function $3(e){return $t({},e,{"data-precedence":e.precedence,precedence:null})}function oX(e,t,n,r){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[vy]!==!0){r.loading=1;return}}else t=e.createElement("link"),t[vy]=!0,t.onload=t.onerror=yO.bind(null,t),or(t,"link",n),jn(t),e.head.appendChild(t);r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2})}function Nd(e){return'[src="'+Ja(e)+'"]'}function mg(e){return"script[async]"+e}function $N(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Ja(n.href)+'"]');if(r)return t.instance=r,jn(r),r;var a=$t({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),jn(r),or(r,"style",a),fy(r,n.precedence,e),t.instance=r;case"stylesheet":a=Sd(n.href);var o=e.querySelector(hg(a));if(o)return t.state.loading|=4,t.instance=o,jn(o),o;r=$3(n),(a=no.get(a))&&rI(r,a),o=(e.ownerDocument||e).createElement("link"),jn(o);var i=o;return i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),or(o,"link",r),t.state.loading|=4,fy(o,n.precedence,e),t.instance=o;case"script":return o=Nd(n.src),(a=e.querySelector(mg(o)))?(t.instance=a,jn(a),a):(r=n,(a=no.get(o))&&(r=$t({},n),aI(r,a)),e=e.ownerDocument||e,a=e.createElement("script"),jn(a),or(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(ee(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,fy(r,n.precedence,e));return t.instance}function fy(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,o=a,i=0;i<r.length;i++){var s=r[i];if(s.dataset.precedence===t)o=s;else if(o!==a)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rI(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function aI(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var dy=null;function GN(e,t,n){if(dy===null){var r=new Map,a=dy=new Map;a.set(n,r)}else a=dy,r=a.get(n),r||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var o=n[a];if(!(o[lg]||o[tr]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var i=o.getAttribute(t)||"";i=e+i;var s=r.get(i);s?s.push(o):r.set(i,[o])}}return r}function i2(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function iX(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function WN(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function G3(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function W3(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function KN(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=W3(t),e.suspenseyImages.push(t)),e=uX.bind(e),t.decode().then(e,e))}function sX(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Sd(r.href),o=t.querySelector(hg(a));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=tg.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,jn(o);return}o=t.ownerDocument||t,r=$3(r),(a=no.get(a))&&rI(r,a),o=o.createElement("link"),jn(o);var i=o;i._p=new Promise(function(s,l){i.onload=s,i.onerror=l}),or(o,"link",r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=tg.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var py=0;function lX(e,t){return e.stylesheets&&e.count===0&&hy(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hy(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&py===0&&(py=62500*IK());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hy(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>py?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(a)}}:null}function K3(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hy(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function tg(){this.count--,K3(this)}function uX(){this.imgCount--,K3(this)}var qy=null;function hy(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qy=new Map,t.forEach(cX,e),qy=null,tg.call(e))}function cX(e,t){if(!(t.state.loading&4)){var n=qy.get(e);if(n)var r=n.get(null);else{n=new Map,qy.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<a.length;o++){var i=a[o];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}a=t.instance,i=a.getAttribute("data-precedence"),o=n.get(i)||r,o===r&&n.set(null,a),n.set(i,a),this.count++,r=tg.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),o?o.parentNode.insertBefore(a,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ld={$$typeof:si,Provider:null,Consumer:null,_currentValue:Xu,_currentValue2:Xu,_threadCount:0};function fX(e,t,n,r,a,o,i,s,l){this.tag=1,this.containerInfo=e,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=LS(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=LS(0),this.hiddenUpdates=LS(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=o,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function X3(e,t,n,r,a,o,i,s,l,u,c,f){return e=new fX(e,t,n,i,l,u,c,f,s),t=1,o===!0&&(t|=24),o=la(3,null,null,t),e.current=o,o.stateNode=e,t=S2(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},A2(o),e}function Y3(e){return e?(e=td,e):td}function Z3(e,t,n,r,a,o){a=Y3(a),r.context===null?r.context=a:r.pendingContext=a,r=kl(t),r.payload={element:n},o=o===void 0?null:o,o!==null&&(r.callback=o),n=Cl(e,r,t),n!==null&&(ua(n,e,t),Mm(n,e,t))}function XN(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function oI(e,t){XN(e,t),(e=e.alternate)&&XN(e,t)}function J3(e){if(e.tag===13||e.tag===31){var t=fc(e,67108864);t!==null&&ua(t,e,67108864),oI(e,67108864)}}function YN(e){if(e.tag===13||e.tag===31){var t=Ma();t=d2(t);var n=fc(e,t);n!==null&&ua(n,e,t),oI(e,t)}}var Id=!0;function dX(e,t,n,r){var a=Ge.T;Ge.T=null;var o=Lt.p;try{Lt.p=2,iI(e,t,n,r)}finally{Lt.p=o,Ge.T=a}}function pX(e,t,n,r){var a=Ge.T;Ge.T=null;var o=Lt.p;try{Lt.p=8,iI(e,t,n,r)}finally{Lt.p=o,Ge.T=a}}function iI(e,t,n,r){if(Id){var a=s2(r);if(a===null)KS(e,t,r,jy,n),ZN(e,r);else if(mX(a,e,t,n,r))r.stopPropagation();else if(ZN(e,r),t&4&&-1<hX.indexOf(e)){for(;a!==null;){var o=_d(a);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var i=ju(o.pendingLanes);if(i!==0){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;i;){var l=1<<31-Ra(i);s.entanglements[1]|=l,i&=~l}mi(o),(St&6)===0&&(zy=Ta()+500,pg(0,!1))}}break;case 31:case 13:s=fc(o,2),s!==null&&ua(s,o,2),iv(),oI(o,2)}if(o=s2(r),o===null&&KS(e,t,r,jy,n),o===a)break;a=o}a!==null&&r.stopPropagation()}else KS(e,t,r,null,n)}}function s2(e){return e=m2(e),sI(e)}var jy=null;function sI(e){if(jy=null,e=Wu(e),e!==null){var t=ag(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=rO(t),e!==null)return e;e=null}else if(n===31){if(e=aO(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jy=e,null}function Q3(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(EG()){case cO:return 2;case fO:return 8;case yy:case _G:return 32;case dO:return 268435456;default:return 32}default:return 32}}var l2=!1,Al=null,El=null,_l=null,ng=new Map,rg=new Map,pl=[],hX="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 ZN(e,t){switch(e){case"focusin":case"focusout":Al=null;break;case"dragenter":case"dragleave":El=null;break;case"mouseover":case"mouseout":_l=null;break;case"pointerover":case"pointerout":ng.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rg.delete(t.pointerId)}}function km(e,t,n,r,a,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[a]},t!==null&&(t=_d(t),t!==null&&J3(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function mX(e,t,n,r,a){switch(t){case"focusin":return Al=km(Al,e,t,n,r,a),!0;case"dragenter":return El=km(El,e,t,n,r,a),!0;case"mouseover":return _l=km(_l,e,t,n,r,a),!0;case"pointerover":var o=a.pointerId;return ng.set(o,km(ng.get(o)||null,e,t,n,r,a)),!0;case"gotpointercapture":return o=a.pointerId,rg.set(o,km(rg.get(o)||null,e,t,n,r,a)),!0}return!1}function e4(e){var t=Wu(e.target);if(t!==null){var n=ag(t);if(n!==null){if(t=n.tag,t===13){if(t=rO(n),t!==null){e.blockedOn=t,CM(e.priority,function(){YN(n)});return}}else if(t===31){if(t=aO(n),t!==null){e.blockedOn=t,CM(e.priority,function(){YN(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function my(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=s2(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fL=r,n.target.dispatchEvent(r),fL=null}else return t=_d(n),t!==null&&J3(t),e.blockedOn=n,!1;t.shift()}return!0}function JN(e,t,n){my(e)&&n.delete(t)}function gX(){l2=!1,Al!==null&&my(Al)&&(Al=null),El!==null&&my(El)&&(El=null),_l!==null&&my(_l)&&(_l=null),ng.forEach(JN),rg.forEach(JN)}function Xb(e,t){e.blockedOn===t&&(e.blockedOn=null,l2||(l2=!0,Hn.unstable_scheduleCallback(Hn.unstable_NormalPriority,gX)))}var Yb=null;function QN(e){Yb!==e&&(Yb=e,Hn.unstable_scheduleCallback(Hn.unstable_NormalPriority,function(){Yb===e&&(Yb=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if(typeof r!="function"){if(sI(r||n)===null)continue;break}var o=_d(n);o!==null&&(e.splice(t,3),t-=3,AL(o,{pending:!0,data:a,method:n.method,action:r},r,a))}}))}function Ad(e){function t(l){return Xb(l,e)}Al!==null&&Xb(Al,e),El!==null&&Xb(El,e),_l!==null&&Xb(_l,e),ng.forEach(t),rg.forEach(t);for(var n=0;n<pl.length;n++){var r=pl[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<pl.length&&(n=pl[0],n.blockedOn===null);)e4(n),n.blockedOn===null&&pl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var a=n[r],o=n[r+1],i=a[fa]||null;if(typeof o=="function")i||QN(n);else if(i){var s=null;if(o&&o.hasAttribute("formAction")){if(a=o,i=o[fa]||null)s=i.formAction;else if(sI(a)!==null)continue}else s=i.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),QN(n)}}}function t4(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(i){return a=i})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function lI(e){this._internalRoot=e}uv.prototype.render=lI.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));var n=t.current,r=Ma();Z3(n,r,e,t,null,null)};uv.prototype.unmount=lI.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Z3(e.current,2,null,e,null,null),iv(),t[Ed]=null}};function uv(e){this._internalRoot=e}uv.prototype.unstable_scheduleHydration=function(e){if(e){var t=bO();e={blockedOn:null,target:e,priority:t};for(var n=0;n<pl.length&&t!==0&&t<pl[n].priority;n++);pl.splice(n,0,e),n===0&&e4(e)}};var eO=tO.version;if(eO!=="19.3.1")throw Error(ee(527,eO,"19.3.1"));Lt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=xG(t),e=e!==null?oO(e):null,e=e===null?null:e.stateNode,e};var xX={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Cm=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Cm.isDisabled&&Cm.supportsFiber))try{og=Cm.inject(xX),Da=Cm}catch{}var Cm;cv.createRoot=function(e,t){if(!nO(e))throw Error(ee(299));var n=!1,r="",a=O5,o=P5,i=B5;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=X3(e,1,!1,null,null,n,r,null,a,o,i,t4),e[Ed]=t.current,Q2(e),new lI(t)};cv.hydrateRoot=function(e,t,n){if(!nO(e))throw Error(ee(299));var r=!1,a="",o=O5,i=P5,s=B5,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=X3(e,1,!0,t,n??null,r,a,l,o,i,s,t4),t.context=Y3(null),n=t.current,r=Ma(),r=d2(r),a=kl(r),a.callback=null,Cl(n,a,r),n=r,t.current.lanes=n,sg(t,n),mi(t),e[Ed]=t.current,Q2(e),new uv(t)};cv.version="19.3.1"});var o4=yo((yge,a4)=>{"use strict";function r4(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r4)}catch(e){console.error(e)}}r4(),a4.exports=n4()});var O6=yo((pke,N6)=>{"use strict";var jv=Object.prototype.hasOwnProperty,M6=Object.prototype.toString,A6=Object.defineProperty,E6=Object.getOwnPropertyDescriptor,_6=function(t){return typeof Array.isArray=="function"?Array.isArray(t):M6.call(t)==="[object Array]"},T6=function(t){if(!t||M6.call(t)!=="[object Object]")return!1;var n=jv.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&jv.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var a;for(a in t);return typeof a>"u"||jv.call(t,a)},D6=function(t,n){A6&&n.name==="__proto__"?A6(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},R6=function(t,n){if(n==="__proto__")if(jv.call(t,n)){if(E6)return E6(t,n).value}else return;return t[n]};N6.exports=function e(){var t,n,r,a,o,i,s=arguments[0],l=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=R6(s,n),a=R6(t,n),s!==a&&(c&&a&&(T6(a)||(o=_6(a)))?(o?(o=!1,i=r&&_6(r)?r:[]):i=r&&T6(r)?r:{},D6(s,{name:n,newValue:e(c,i,a)})):typeof a<"u"&&D6(s,{name:n,newValue:a}));return s}});var Qj=yo(KC=>{"use strict";var Ime=Symbol.for("react.transitional.element"),Ame=Symbol.for("react.fragment");function Jj(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:Ime,type:e,key:r,ref:t!==void 0?t:null,props:n}}KC.Fragment=Ame;KC.jsx=Jj;KC.jsxs=Jj});var Nf=yo((LRe,e$)=>{"use strict";e$.exports=Qj()});var LMe=gr(vo(),1),I$=gr(o4(),1);var ae=gr(vo(),1);var Od=Math.min,bs=Math.max,xg=Math.round,bg=Math.floor,gi=e=>({x:e,y:e}),bX={left:"right",right:"left",bottom:"top",top:"bottom"};function l4(e,t,n){return bs(e,Od(t,n))}function yg(e,t){return typeof e=="function"?e(t):e}function pc(e){return e.split("-")[0]}function vg(e){return e.split("-")[1]}function uI(e){return e==="x"?"y":"x"}function cI(e){return e==="y"?"height":"width"}function ys(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function fI(e){return uI(ys(e))}function u4(e,t,n){n===void 0&&(n=!1);let r=vg(e),a=fI(e),o=cI(a),i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=gg(i)),[i,gg(i)]}function c4(e){let t=gg(e);return[fv(e),t,fv(t)]}function fv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var i4=["left","right"],s4=["right","left"],yX=["top","bottom"],vX=["bottom","top"];function wX(e,t,n){switch(e){case"top":case"bottom":return n?t?s4:i4:t?i4:s4;case"left":case"right":return t?yX:vX;default:return[]}}function f4(e,t,n,r){let a=vg(e),o=wX(pc(e),n==="start",r);return a&&(o=o.map(i=>i+"-"+a),t&&(o=o.concat(o.map(fv)))),o}function gg(e){let t=pc(e);return bX[t]+e.slice(t.length)}function kX(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function d4(e){return typeof e!="number"?kX(e):{top:e,right:e,bottom:e,left:e}}function hc(e){let{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function p4(e,t,n){let{reference:r,floating:a}=e,o=ys(t),i=fI(t),s=cI(i),l=pc(t),u=o==="y",c=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,d=r[s]/2-a[s]/2,p;switch(l){case"top":p={x:c,y:r.y-a.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-a.width,y:f};break;default:p={x:r.x,y:r.y}}let h=vg(t);return h&&(p[i]+=d*(h==="end"?1:-1)*(n&&u?-1:1)),p}async function h4(e,t){var n;t===void 0&&(t={});let{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=yg(t,e),h=d4(p),x=s[d?f==="floating"?"reference":"floating":f],m=hc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),y=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,b=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),v=await(o.isElement==null?void 0:o.isElement(b))&&await(o.getScale==null?void 0:o.getScale(b))||{x:1,y:1},w=hc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(m.top-w.top+h.top)/v.y,bottom:(w.bottom-m.bottom+h.bottom)/v.y,left:(m.left-w.left+h.left)/v.x,right:(w.right-m.right+h.right)/v.x}}var CX=50,m4=async(e,t,n)=>{let{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:h4},l=await(i.isRTL==null?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:c,y:f}=p4(u,r,l),d=r,p=0,h={};for(let g=0;g<o.length;g++){let x=o[g];if(!x)continue;let{name:m,fn:y}=x,{x:b,y:v,data:w,reset:k}=await y({x:c,y:f,initialPlacement:r,placement:d,strategy:a,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=b??c,f=v??f,h[m]={...h[m],...w},k&&p<CX&&(p++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(u=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:c,y:f}=p4(u,d,l)),g=-1)}return{x:c,y:f,placement:d,strategy:a,middlewareData:h}};var g4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;let{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...x}=yg(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let m=pc(a),y=ys(s),b=pc(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),w=d||(b||!g?[gg(s)]:c4(s)),k=h!=="none";!d&&k&&w.push(...f4(s,g,h,v));let _=[s,...w],E=await l.detectOverflow(t,x),M=[],S=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&M.push(E[m]),f){let ie=u4(a,i,v);M.push(E[ie[0]],E[ie[1]])}if(S=[...S,{placement:a,overflows:M}],!M.every(ie=>ie<=0)){var U,N;let ie=(((U=o.flip)==null?void 0:U.index)||0)+1,fe=_[ie];if(fe&&(!(f==="alignment"?y!==ys(fe):!1)||S.every(Ce=>ys(Ce.placement)===y?Ce.overflows[0]>0:!0)))return{data:{index:ie,overflows:S},reset:{placement:fe}};let he=(N=S.filter(xe=>xe.overflows[0]<=0).sort((xe,Ce)=>xe.overflows[1]-Ce.overflows[1])[0])==null?void 0:N.placement;if(!he)switch(p){case"bestFit":{var q;let xe=(q=S.filter(Ce=>{if(k){let Fe=ys(Ce.placement);return Fe===y||Fe==="y"}return!0}).map(Ce=>[Ce.placement,Ce.overflows.filter(Fe=>Fe>0).reduce((Fe,D)=>Fe+D,0)]).sort((Ce,Fe)=>Ce[1]-Fe[1])[0])==null?void 0:q[0];xe&&(he=xe);break}case"initialPlacement":he=s;break}if(a!==he)return{reset:{placement:he}}}return{}}}};var SX=new Set(["left","top"]);async function LX(e,t){let{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=pc(n),s=vg(n),l=ys(n)==="y",u=SX.has(i)?-1:1,c=o&&l?-1:1,f=yg(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*c,y:d*u}:{x:d*u,y:p*c}}var x4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:a,y:o,placement:i,middlewareData:s}=t,l=await LX(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}},b4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:a,platform:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...u}=yg(e,t),c={x:n,y:r},f=await o.detectOverflow(t,u),d=ys(a),p=uI(d),h=c[p],g=c[d],x=(y,b)=>l4(b+f[y==="y"?"top":"left"],b,b-f[y==="y"?"bottom":"right"]);i&&(h=x(p,h)),s&&(g=x(d,g));let m=l.fn({...t,[p]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:s}}}}}};function dv(){return typeof window<"u"}function gc(e){return v4(e)?(e.nodeName||"").toLowerCase():"#document"}function Br(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xi(e){var t;return(t=(v4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function v4(e){return dv()?e instanceof Node||e instanceof Br(e).Node:!1}function Ao(e){return dv()?e instanceof Element||e instanceof Br(e).Element:!1}function vs(e){return dv()?e instanceof HTMLElement||e instanceof Br(e).HTMLElement:!1}function y4(e){return!dv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Br(e).ShadowRoot}function wg(e){let{overflow:t,overflowX:n,overflowY:r,display:a}=Eo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function w4(e){return/^(table|td|th)$/.test(gc(e))}function kg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var IX=/transform|translate|scale|rotate|perspective|filter/,AX=/paint|layout|strict|content/,mc=e=>!!e&&e!=="none",dI;function pv(e){let t=Ao(e)?Eo(e):e;return mc(t.transform)||mc(t.translate)||mc(t.scale)||mc(t.rotate)||mc(t.perspective)||!hv()&&(mc(t.backdropFilter)||mc(t.filter))||IX.test(t.willChange||"")||AX.test(t.contain||"")}function k4(e){let t=Bl(e);for(;vs(t)&&!Bd(t);){if(pv(t))return t;if(kg(t))return null;t=Bl(t)}return null}function hv(){return dI==null&&(dI=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dI}function Bd(e){return/^(html|body|#document)$/.test(gc(e))}function Eo(e){return Br(e).getComputedStyle(e)}function Cg(e){return Ao(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bl(e){if(gc(e)==="html")return e;let t=e.assignedSlot||e.parentNode||y4(e)&&e.host||xi(e);return y4(t)?t.host:t}function C4(e){let t=Bl(e);return Bd(t)?(e.ownerDocument||e).body:vs(t)&&wg(t)?t:C4(t)}function Pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=C4(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),i=Br(a);if(o){let s=mv(i);return t.concat(i,i.visualViewport||[],wg(a)?a:[],s&&n?Pd(s):[])}else return t.concat(a,Pd(a,[],n))}function mv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I4(e){let t=Eo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,a=vs(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=xg(n)!==o||xg(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function hI(e){return Ao(e)?e:e.contextElement}function zd(e){let t=hI(e);if(!vs(t))return gi(1);let n=t.getBoundingClientRect(),{width:r,height:a,$:o}=I4(t),i=(o?xg(n.width):n.width)/r,s=(o?xg(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var EX=gi(0);function A4(e){let t=Br(e);return!hv()||!t.visualViewport?EX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _X(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Br(e)}function xc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=hI(e),i=gi(1);t&&(r?Ao(r)&&(i=zd(r)):i=zd(e));let s=_X(o,n,r)?A4(o):gi(0),l=(a.left+s.x)/i.x,u=(a.top+s.y)/i.y,c=a.width/i.x,f=a.height/i.y;if(o&&r){let d=Br(o),p=Ao(r)?Br(r):r,h=d,g=mv(h);for(;g&&p!==h;){let x=zd(g),m=g.getBoundingClientRect(),y=Eo(g),b=m.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,v=m.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=b,u+=v,h=Br(g),g=mv(h)}}return hc({width:c,height:f,x:l,y:u})}function gv(e,t){let n=Cg(e).scrollLeft;return t?t.left+n:xc(xi(e)).left+n}function E4(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gv(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function TX(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=a==="fixed",i=xi(r),s=t?kg(t.floating):!1;if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},u=gi(1),c=gi(0),f=vs(r);if((f||!o)&&((gc(r)!=="body"||wg(i))&&(l=Cg(r)),f)){let p=xc(r);u=zd(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let d=i&&!f&&!o?E4(i,l):gi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function DX(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function RX(e){let t=Cg(e),n=e.ownerDocument.body,r=bs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=bs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),o=-t.scrollLeft+gv(e),i=-t.scrollTop;return Eo(n).direction==="rtl"&&(o+=bs(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:o,y:i}}var MX=25;function NX(e,t,n){n===void 0&&(n="viewport");let r=n==="layoutViewport",a=Br(e),o=xi(e),i=a.visualViewport,s=o.clientWidth,l=o.clientHeight,u=0,c=0;if(i){let d=!hv()||t==="fixed";r?d||(u=-i.offsetLeft,c=-i.offsetTop):(s=i.width,l=i.height,d&&(u=i.offsetLeft,c=i.offsetTop))}if(gv(o)<=0){let d=o.ownerDocument,p=d.body,h=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(o.clientWidth-p.clientWidth-g),m=getComputedStyle(o).scrollbarGutter==="stable both-edges"?x/2:x;m<=MX&&(s-=m)}return{width:s,height:l,x:u,y:c}}function OX(e,t){let n=xc(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=zd(e),i=e.clientWidth*o.x,s=e.clientHeight*o.y,l=a*o.x,u=r*o.y;return{width:i,height:s,x:l,y:u}}function S4(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=NX(e,n,t);else if(t==="document")r=RX(xi(e));else if(Ao(t))r=OX(t,n);else{let a=A4(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return hc(r)}function PX(e,t){let n=t.get(e);if(n)return n;let r=Pd(e,[],!1).filter(s=>Ao(s)&&gc(s)!=="body"),a=null,o=Eo(e).position==="fixed",i=o?Bl(e):e;for(;Ao(i)&&!Bd(i);){let s=Eo(i),l=pv(i),u=a?a.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?r=r.filter(f=>f!==i):a=s,i=Bl(i)}return t.set(e,r),r}function BX(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,i=[...n==="clippingAncestors"?kg(t)?[]:PX(t,this._c):[].concat(n),r],s=S4(t,i[0],a),l=s.top,u=s.right,c=s.bottom,f=s.left;for(let d=1;d<i.length;d++){let p=S4(t,i[d],a);l=bs(p.top,l),u=Od(p.right,u),c=Od(p.bottom,c),f=bs(p.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function zX(e){let{width:t,height:n}=I4(e);return{width:t,height:n}}function FX(e,t,n){let r=vs(t),a=xi(t),o=n==="fixed",i=xc(e,!0,o,t),s={scrollLeft:0,scrollTop:0},l=gi(0);if((r||!o)&&((gc(t)!=="body"||wg(a))&&(s=Cg(t)),r)){let d=xc(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!r&&a&&(l.x=gv(a));let u=a&&!r&&!o?E4(a,s):gi(0),c=i.left+s.scrollLeft-l.x-u.x,f=i.top+s.scrollTop-l.y-u.y;return{x:c,y:f,width:i.width,height:i.height}}function pI(e){return Eo(e).position==="static"}function L4(e,t){if(!vs(e)||Eo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xi(e)===n&&(n=n.ownerDocument.body),n}function _4(e,t){let n=Br(e);if(kg(e))return n;if(!vs(e)){let a=Bl(e);for(;a&&!Bd(a);){if(Ao(a)&&!pI(a))return a;a=Bl(a)}return n}let r=L4(e,t);for(;r&&w4(r)&&pI(r);)r=L4(r,t);return r&&Bd(r)&&pI(r)&&!pv(r)?n:r||k4(e)||n}var HX=async function(e){let t=this.getOffsetParent||_4,n=this.getDimensions,r=await n(e.floating);return{reference:FX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VX(e){return Eo(e).direction==="rtl"}var UX={convertOffsetParentRelativeRectToViewportRelativeRect:TX,getDocumentElement:xi,getClippingRect:BX,getOffsetParent:_4,getElementRects:HX,getClientRects:DX,getDimensions:zX,getScale:zd,isElement:Ao,isRTL:VX};function T4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qX(e,t,n){let r=null,a,o=xi(e);function i(){var c;clearTimeout(a),(c=r)==null||c.disconnect(),r=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),i();let d=e.getBoundingClientRect(),{left:p,top:h,width:g,height:x}=d;if(c||t(),!g||!x)return;let m=bg(h),y=bg(o.clientWidth-(p+g)),b=bg(o.clientHeight-(h+x)),v=bg(p),k={rootMargin:-m+"px "+-y+"px "+-b+"px "+-v+"px",threshold:bs(0,Od(1,f))||1},_=!0;function E(M){let S=M[0].intersectionRatio;if(!T4(d,e.getBoundingClientRect()))return s();if(S!==f){if(!_)return s();S?s(!1,S):a=setTimeout(()=>{s(!1,1e-7)},1e3)}_=!1}try{r=new IntersectionObserver(E,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,k)}r.observe(e)}let l=Br(e),u=()=>s(n);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),i()}}function Sg(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=hI(e),c=a||o?[...u?Pd(u):[],...t?Pd(t):[]]:[];c.forEach(m=>{a&&m.addEventListener("scroll",n),o&&m.addEventListener("resize",n)});let f=u&&s?qX(u,n,o):null,d=-1,p=null;i&&(p=new ResizeObserver(m=>{let[y]=m;y&&y.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let h,g=l?xc(e):null;l&&x();function x(){let m=xc(e);g&&!T4(g,m)&&n(),g=m,h=requestAnimationFrame(x)}return n(),()=>{var m;c.forEach(y=>{a&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f?.(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var Pa=x4;var xv=b4,zl=g4;var zr=(e,t,n)=>{let r=new Map,a=n??{},o={...UX,...a.platform,_c:r};return m4(e,t,{...a,platform:o})};var bv=gr(vo(),1);var D4=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();function R4(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:D4(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var M4=e=>{let t="",n=!1;for(let r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};var N4=e=>{let t=M4(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ig=gr(vo(),1);var Lg=(...e)=>{let t=new Set;for(let n of e)if(typeof n=="string")for(let r of n.split(/\s+/))r&&t.add(r);return[...t].join(" ")};var bc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function mI(e){return e!=null}function O4(e,t={}){let n=t.attributeNames??{},r=d=>n[d]??d,a=e.size??e.width??bc.width,o=e.size??e.height??bc.height,i=e.aliases?.filter(d=>typeof d=="string"&&d.trim()!=="").map(d=>`lucide-${d}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...i],l=t.className?.split(" ").filter(Boolean)??[],u=t.includeDefaultClasses===!1?Lg(...l):Lg("lucide",...s,...l),c=t.strokeWidth??bc["stroke-width"];if(t.absoluteStrokeWidth){let d=Number(c)*Number(e.size??e.width??bc.width)/Number(t.size??t.width??bc.width);Number.isFinite(d)&&(c=d)}return["svg",{...Object.entries(bc).reduce((d,[p,h])=>(d[r(p)]=h,d),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&mI(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&mI(t.width)&&{[r("width")]:t.width},..."height"in t&&mI(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:c,...u&&{[r("class")]:u},[r("viewBox")]:`0 0 ${a} ${o}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(d=>{let[p,h,g]=d,x=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...h}:h;return g?[p,x,g]:[p,x]})]}function P4(e,t={}){return O4(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var B4=e=>{if(e==null||typeof e!="object")return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith("aria-")||t==="role"||t==="title")&&e[t]!=null)return!0;return!1};var Fd=gr(vo(),1);var jX=(0,Fd.createContext)({});var z4=()=>(0,Fd.useContext)(jX);var F4=(0,Ig.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:i,className:s="",children:l,iconNode:u=[],icon:c={node:u,aliases:[],size:24},...f},d)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:x=!1,color:m="currentColor",className:y=""}=z4()??{},b=!!l||B4(f),[v,w,k=[]]=P4(c,{color:e??m,width:n??t??p,height:r??t??p,strokeWidth:a??h,absoluteStrokeWidth:o??g,nonScalingStroke:i??x,className:Lg(y,s),hasA11yProp:b,attributes:f});return(0,Ig.createElement)(v,{ref:d,...w},[...k.map(([_,E])=>(0,Ig.createElement)(_,E)),...Array.isArray(l)?l:[l]])});function vr(e,t=[],n=[]){let r=typeof e=="string"?R4(e,t,n):e,a=(0,bv.forwardRef)(({className:o,...i},s)=>(0,bv.createElement)(F4,{ref:s,icon:r,className:o,...i}));return r.name&&(a.displayName=N4(r.name)),a}var H4={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};H4.node;var Ag=vr(H4);var V4={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};V4.node;var Eg=vr(V4);var U4={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};U4.node;var Fl=vr(U4);var q4={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};q4.node;var Hd=vr(q4);var j4={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};j4.node;var Vd=vr(j4);var $4={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};$4.node;var _g=vr($4);var G4={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};G4.node;var ws=vr(G4);var W4={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};W4.node;var Ud=vr(W4);var K4={name:{zh:"\u667A\u8054\u6587\u6863\u7A7A\u95F4",en:"CoSpace"},description:{zh:"\u8DDF\u4F60\u7684 Agent \u4E00\u8D77\u5199\u6587\u6863\uFF1A\u5B83\u63D0\u4FEE\u6539\u5EFA\u8BAE\uFF0C\u4F60\u9010\u6761\u51B3\u5B9A\u3002",en:"Write documents with your agent: it proposes edits, and you decide each one."},icon:"assets/cospace-icon.svg"};var X4='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" role="img" aria-labelledby="title">%0A <title id="title">CoSpace</title>%0A <rect width="128" height="128" fill="%232448c5"/>%0A <g transform="translate(3 0)">%0A <path d="M64 43a29 29 0 1 0 0 42" fill="none" stroke="%23fff" stroke-width="12" stroke-linecap="round"/>%0A <circle cx="82" cy="64" r="23" fill="none" stroke="%238fe8df" stroke-width="12"/>%0A </g>%0A</svg>%0A';var kn=K4,Y4=X4;var Z4={"dialog.close":"\u5173\u95ED\u5F39\u7A97","collab.open":"\u98CE\u683C\u504F\u597D","collab.globalOpen":"\u5168\u5C40\u98CE\u683C\u504F\u597D","collab.title":"\u98CE\u683C\u504F\u597D","collab.globalTitle":"\u5168\u5C40\u98CE\u683C\u504F\u597D","collab.documentTitle":"\u672C\u6587\u6863\u98CE\u683C\u504F\u597D","collab.close":"\u5173\u95ED\u98CE\u683C\u504F\u597D","collab.placeholder":"\u4F8B\u5982\uFF1A\u9762\u5411\u8C01\u5199\u4F5C\u3001\u8BED\u6C14\u3001\u672F\u8BED\u3001\u683C\u5F0F\u548C\u8868\u8FBE\u4E60\u60EF","collab.save":"\u4FDD\u5B58","collab.saving":"\u6B63\u5728\u4FDD\u5B58\u2026","collab.saved":"\u5DF2\u4FDD\u5B58","collab.saveError":"\u4FDD\u5B58\u5931\u8D25","collab.loading":"\u6B63\u5728\u8BFB\u53D6\u98CE\u683C\u504F\u597D\u2026","collab.backendOutdated":"\u534F\u4F5C\u670D\u52A1\u5C1A\u672A\u52A0\u8F7D\u3002\u8BF7\u5728\u5BBF\u4E3B\u5E94\u7528\u4E2D\u91CD\u65B0\u52A0\u8F7D CoSpace \u63D2\u4EF6\u540E\u91CD\u8BD5\u3002","brand.name":kn.name.zh,"brand.nameEnglish":kn.name.en,"header.eyebrow":`${kn.name.en.toUpperCase()} / \u6587\u6863\u5BA1\u9605`,"header.untitled":"\u4E2A\u4EBA\u6587\u6863","header.pending":"{count} \u6761\u5F85\u5904\u7406","header.pick":"\u9009\u62E9\u6587\u6863\u5F00\u59CB\u5BA1\u9605","edit.modeLabel":"\u6587\u6863\u6A21\u5F0F","edit.reviewMode":"\u5BA1\u9605","edit.editMode":"\u7F16\u8F91","edit.autoSaveHint":"\u5207\u56DE\u5BA1\u9605\u6A21\u5F0F\u65F6\u4F1A\u5148\u81EA\u52A8\u4FDD\u5B58","edit.unavailable":"\u6587\u6863\u5DF2\u6709\u8BC4\u8BBA\u6216\u5EFA\u8BAE\uFF0C\u65E0\u6CD5\u76F4\u63A5\u7F16\u8F91\u3002","edit.saveErrorTitle":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u7F16\u8F91\u5185\u5BB9\u4ECD\u4FDD\u7559","edit.saveErrorKeepEditing":"\u5F53\u524D\u5185\u5BB9\u4ECD\u5728\u7F16\u8F91\u5668\u4E2D\u3002\u5173\u95ED\u6B64\u63D0\u793A\u540E\u53EF\u4EE5\u7EE7\u7EED\u7F16\u8F91\uFF1B\u5207\u56DE\u5BA1\u9605\u6A21\u5F0F\u524D\u9700\u8981\u6210\u529F\u4FDD\u5B58\u3002","edit.keepEditing":"\u7EE7\u7EED\u7F16\u8F91","edit.versionConflict":"\u6587\u6863\u5728\u7F16\u8F91\u671F\u95F4\u5DF2\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u590D\u5236\u672A\u4FDD\u5B58\u5185\u5BB9\u540E\u91CD\u65B0\u8F7D\u5165\u3002","edit.unavailableReason":"\u4EC5\u6CA1\u6709\u8BC4\u8BBA\u548C\u5EFA\u8BAE\u7684\u6587\u6863\u53EF\u4EE5\u76F4\u63A5\u7F16\u8F91","edit.saving":"\u6B63\u5728\u4FDD\u5B58\u2026","edit.toolbar":"\u6587\u672C\u683C\u5F0F","edit.contentLabel":"\u53EF\u89C1\u5373\u6240\u5F97\u6587\u6863\u7F16\u8F91\u5668","edit.bold":"\u7C97\u4F53","edit.italic":"\u659C\u4F53","edit.heading1":"\u4E00\u7EA7\u6807\u9898","edit.heading2":"\u4E8C\u7EA7\u6807\u9898","edit.strike":"\u5220\u9664\u7EBF","edit.bullets":"\u9879\u76EE\u7B26\u53F7\u5217\u8868","edit.numbered":"\u7F16\u53F7\u5217\u8868","edit.quote":"\u5F15\u7528","edit.link":"\u94FE\u63A5","edit.code":"\u884C\u5185\u4EE3\u7801","edit.placeholder":"\u5F00\u59CB\u7F16\u5199\u6587\u6863\u2026","home.eyebrow":`${kn.name.en.toUpperCase()} \xB7 \u4E2A\u4EBA\u5DE5\u4F5C\u53F0`,"home.title":"\u4F60\u7684\u6587\u6863\uFF0C\u4E00\u76EE\u4E86\u7136\u3002","home.description":"\u96C6\u4E2D\u67E5\u770B\u6587\u6863\u4E0E\u5F85\u5904\u7406\u5EFA\u8BAE\uFF0C\u6253\u5F00\u4EFB\u610F\u6587\u6863\u5373\u53EF\u7EE7\u7EED\u5BA1\u9605\u3002","home.documentCount":"{count} \u7BC7\u6587\u6863","home.pendingCount":"{count} \u6761\u5F85\u5904\u7406\u5EFA\u8BAE","home.openDocument":"\u6253\u5F00\u6587\u6863\uFF1A{title}","home.emptyTitle":"\u4ECE\u4E00\u4EFD\u65B0\u6587\u6863\u5F00\u59CB","home.emptyDescription":"\u521B\u5EFA\u6587\u6863\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u96C6\u4E2D\u9605\u8BFB\u5185\u5BB9\u3001\u5904\u7406\u4FEE\u6539\u5EFA\u8BAE\u548C\u6DFB\u52A0\u8BC4\u8BBA\u3002","home.back":"\u8FD4\u56DE\u6587\u6863\u9996\u9875","home.updated":"\u66F4\u65B0\u4E8E {time}","home.created":"\u521B\u5EFA\u4E8E {time}","home.timeUnknown":"\u65F6\u95F4\u672A\u77E5","home.noPending":"\u6682\u65E0\u5F85\u5904\u7406\u5EFA\u8BAE","home.search":"\u641C\u7D22\u6587\u6863","home.filter":"\u7B5B\u9009\u6587\u6863","home.filterAll":"\u5168\u90E8\u6587\u6863","home.filterPending":"\u6709\u5F85\u5904\u7406\u5EFA\u8BAE","home.sort":"\u6392\u5E8F\u65B9\u5F0F","home.sortRecent":"\u6700\u8FD1\u66F4\u65B0","home.sortTitle":"\u6309\u6807\u9898\u6392\u5E8F","home.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u6587\u6863\uFF0C\u8BF7\u8C03\u6574\u641C\u7D22\u6216\u7B5B\u9009\u6761\u4EF6\u3002","nav.aria":"\u4E2A\u4EBA\u6587\u6863","nav.documents":"\u6587\u6863","nav.newDocument":"\u65B0\u5EFA\u6587\u6863","nav.empty":"\u6682\u65E0\u6587\u6863","nav.deleteDocument":"\u5220\u9664\u6587\u6863","nav.deleteDocumentLabel":"\u5220\u9664\u201C{title}\u201D","document.deleteTitle":"\u5220\u9664\u6587\u6863\uFF1F","document.deleteDescription":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{title}\u201D\u53CA\u5176\u5EFA\u8BAE\u548C\u8BC4\u8BBA\u3002\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002","document.deleteConfirm":"\u5220\u9664\u6587\u6863","document.deleteCancel":"\u4FDD\u7559\u6587\u6863","document.untitled":"\u672A\u547D\u540D\u6587\u6863","empty.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u6863\u2026","empty.pick":"\u9009\u62E9\u5DE6\u4FA7\u6587\u6863\uFF0C\u6216\u70B9\u51FB\u300C\u65B0\u5EFA\u6587\u6863\u300D\u5F00\u59CB\u5BA1\u9605\u3002","review.aria":"\u4FEE\u6539\u5EFA\u8BAE","annotations.title":"\u6279\u6CE8","annotations.counts":"\u5EFA\u8BAE {suggestions} \xB7 \u8BC4\u8BBA {comments}","annotations.suggestions":"\u5EFA\u8BAE {count}","annotations.comments":"\u8BC4\u8BBA {count}","annotations.emptyTitle":"\u8FD8\u6CA1\u6709\u6279\u6CE8","annotations.emptyHint":"\u9009\u4E2D\u6B63\u6587\u6587\u5B57\u5373\u53EF\u6DFB\u52A0\u8BC4\u8BBA\uFF1BAgent \u7684\u5EFA\u8BAE\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002","zoom.label":"\u7EB8\u5F20\u7F29\u653E","zoom.out":"\u7F29\u5C0F\u7EB8\u5F20","zoom.in":"\u653E\u5927\u7EB8\u5F20","toolbar.more":"\u66F4\u591A\u5DE5\u5177","toolbar.aria":"\u6587\u6863\u64CD\u4F5C","suggestion.badge":"\u4FEE\u6539\u5EFA\u8BAE","review.suggestions":"\u4FEE\u6539\u5EFA\u8BAE","review.comments":"\u8BC4\u8BBA","review.noSuggestions":"\u6CA1\u6709\u5F85\u5904\u7406\u5EFA\u8BAE\u3002","review.noComments":"\u6682\u65E0\u8BC4\u8BBA\u3002","review.commentCount":"{count} \u6761","review.toggleShow":"\u4FEE\u6539\u5EFA\u8BAE \u5C55\u5F00","review.toggleHide":"\u4FEE\u6539\u5EFA\u8BAE \u6536\u8D77","review.refresh":"\u5237\u65B0\u6587\u6863","export.button":"\u5BFC\u51FA","build.versionTitle":"\u672C\u5730\u6784\u5EFA\u7248\u672C\uFF1B\u53D1\u5E03\u7248\u672C\u4E0D\u53D8","export.busy":"\u51C6\u5907\u4E2D\u2026","export.note":"\u4EC5\u5BFC\u51FA\u5DF2\u63A5\u53D7\u6B63\u6587\uFF0C\u4E0D\u542B\u5F85\u5904\u7406\u5EFA\u8BAE\u548C\u8BC4\u8BBA\u3002","export.failed":"\u5BFC\u51FA\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002","paper.aria":"\u6587\u6863\u6B63\u6587","comment.bubble":"\u8BC4\u8BBA","comment.author":"\u7528\u6237","comment.accountUser":"\u5DF2\u767B\u5F55\u7528\u6237","comment.addTitle":"\u6DFB\u52A0\u8BC4\u8BBA","comment.selected":"\u5DF2\u9009\uFF1A{quote}","comment.hint":"\u5728\u6B63\u6587\u4E2D\u9009\u62E9\u6587\u5B57\u540E\u6DFB\u52A0\u8BC4\u8BBA\u3002","comment.label":"\u8BC4\u8BBA\u5185\u5BB9","comment.save":"\u4FDD\u5B58\u8BC4\u8BBA","comment.cancel":"\u53D6\u6D88","comment.delete":"\u5220\u9664","comment.deleteConfirm":"\u5220\u9664\u8FD9\u6761\u8BC4\u8BBA\uFF1F","comment.pick":"\u9009\u5165\u53D1\u9001","comment.locate":"\u5B9A\u4F4D\u6B63\u6587","comment.anchorLabel":"\u8BC4\u8BBA\u951A\u70B9\uFF08{count} \u6761\uFF09","comment.staleGroup":"\u4F4D\u7F6E\u5DF2\u5931\u6548","comment.staleHint":"\u5F15\u7528\u6587\u5B57\u5728\u5F53\u524D\u6B63\u6587\u4E2D\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\uFF0C\u672A\u7ED8\u5236\u951A\u70B9\u3002","comment.required":"\u8BF7\u9009\u62E9\u6B63\u6587\u5E76\u586B\u5199\u8BC4\u8BBA\u3002","comment.stale":" \xB7 \u5F15\u7528\u4F4D\u7F6E\u5DF2\u5931\u6548","comment.staleStatus":"\u4F4D\u7F6E\u5DF2\u5931\u6548","suggestion.locate":"\u5B9A\u4F4D\u5EFA\u8BAE {id}","suggestion.locateCard":"\u5EFA\u8BAE {n}","suggestion.kind.delete":"\u5220\u9664\u5EFA\u8BAE","suggestion.kind.insert":"\u65B0\u589E\u5EFA\u8BAE","suggestion.kind.replace":"\u4FEE\u6539\u5EFA\u8BAE","suggestion.kind.unknown":"\u5185\u5BB9\u53D8\u66F4","suggestion.conflicted":"\u5EFA\u8BAE\u5DF2\u51B2\u7A81\uFF0C\u8BF7\u91CD\u65B0\u63D0\u4EA4","suggestion.defaultAuthor":"Agent","suggestion.unknownTime":"\u65F6\u95F4\u672A\u77E5","suggestion.deletedOriginal":"\u5220\u9664\u7684\u539F\u6587","suggestion.insertedContent":"\u65B0\u589E\u5185\u5BB9","suggestion.deletedLabel":"\u5DF2\u5220\u9664","suggestion.insertedLabel":"\u5DF2\u63D2\u5165","suggestion.original":"\u88AB\u4FEE\u6539\u7684\u539F\u6587","suggestion.replacement":"\u5EFA\u8BAE\u6539\u4E3A","suggestion.unavailable":"\u6B64\u5EFA\u8BAE\u7684\u4F4D\u7F6E\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5237\u65B0\u6587\u6863\u3002","suggestion.pendingStatus":"\u5F85\u5BA1","suggestion.acceptedStatus":"\u5DF2\u63A5\u53D7","suggestion.rejectedStatus":"\u5DF2\u62D2\u7EDD","suggestion.conflictedStatus":"\u51B2\u7A81","comment.relatedSuggestions":"\u5173\u8054\u5EFA\u8BAE\uFF1A{states}","action.accept":"\u63A5\u53D7","action.reject":"\u62D2\u7EDD","diff.before":"\u539F\u6587","diff.none":"\uFF08\u65E0\uFF09","status.pending":"\u5F85\u5904\u7406","status.sending":"\u6B63\u5728\u53D1\u9001\u5904\u7406\u8BF7\u6C42","status.sent":"\u5DF2\u53D1\u9001\uFF0C\u7B49\u5F85 Agent \u56DE\u62A5","status.failed":"\u53D1\u9001\u5931\u8D25","status.unknown":"\u53D1\u9001\u7ED3\u679C\u672A\u77E5","status.processed":"\u5EFA\u8BAE\u5DF2\u751F\u6210","send.action":"\u6309\u8BC4\u8BBA\u63D0\u51FA\u5EFA\u8BAE","send.selected":"\u5904\u7406\u6240\u9009\u8BC4\u8BBA\uFF08{count}\uFF09","send.all":"\u8BA9 Agent \u5904\u7406\u8BC4\u8BBA\uFF08{count}\uFF09","send.hint":"\u4ECE\u5BF9\u8BDD\u4E2D\u6253\u5F00\u6587\u6863\u540E\u53EF\u53D1\u8D77\u8BC4\u8BBA\u5904\u7406\u3002","send.chooseTitle":"\u9009\u62E9\u8BC4\u8BBA\u5904\u7406\u65B9\u5F0F","send.chooseDescription":"\u8BF7\u9009\u62E9\u5982\u4F55\u5904\u7406\u8FD9 {count} \u6761\u5F85\u5904\u7406\u8BC4\u8BBA\u3002","send.destination":"\u5904\u7406\u65B9\u5F0F","send.currentOption":"\u53D1\u9001\u5230\u5F53\u524D\u5BF9\u8BDD","send.currentUnavailable":"\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684\u5BF9\u8BDD","send.sessionId":"\u5BF9\u8BDD\uFF1A{id}","send.newOption":"\u65B0\u5EFA\u5BF9\u8BDD","send.newOptionHint":"\u5728\u5F53\u524D\u6216\u6700\u8FD1\u4F7F\u7528\u7684\u5DE5\u4F5C\u533A\u65B0\u5EFA\u5BF9\u8BDD\u5E76\u53D1\u9001\u8BF7\u6C42","send.newUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u4E0D\u652F\u6301\u65B0\u5EFA\u5BF9\u8BDD","send.copyOption":"\u590D\u5236\u63D0\u793A\u8BCD","send.copyOptionHint":"\u590D\u5236\u540E\u53EF\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\uFF0C\u9700\u624B\u52A8\u53D1\u9001","send.confirmTitle":"\u8BA9 Agent \u5904\u7406\u8BC4\u8BBA\uFF1F","send.confirmDescription":"\u5C06\u5411\u5F53\u524D\u5BF9\u8BDD\u53D1\u9001\u5904\u7406\u8BF7\u6C42\uFF0C\u8BF7 Agent \u5904\u7406\u8FD9 {count} \u6761\u5F85\u5904\u7406\u8BC4\u8BBA\u3002","send.confirm":"\u53D1\u9001\u5904\u7406\u8BF7\u6C42","send.copyConfirmTitle":"\u590D\u5236\u8BC4\u8BBA\u5904\u7406\u63D0\u793A\u8BCD\uFF1F","send.copyConfirmDescription":"\u5C06\u590D\u5236\u5904\u7406\u63D0\u793A\u8BCD\uFF0C\u6D89\u53CA\u8FD9\u4EFD\u6587\u6863\u7684 {count} \u6761\u5F85\u5904\u7406\u8BC4\u8BBA\u3002\u590D\u5236\u540E\u8BF7\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u53D1\u9001\u3002","send.copyConfirm":"\u590D\u5236\u63D0\u793A\u8BCD","send.newSessionTitle":"\u65B0\u5EFA\u5BF9\u8BDD\u5E76\u5904\u7406\u8BC4\u8BBA\uFF1F","send.newSessionDescription":"\u5F53\u524D\u6CA1\u6709\u6253\u5F00\u7684\u5BF9\u8BDD\u3002\u7EE7\u7EED\u540E\u4F1A\u590D\u7528\u6700\u8FD1\u7684\u5DE5\u4F5C\u533A\uFF1B\u6CA1\u6709\u5DE5\u4F5C\u533A\u65F6\u4F1A\u521B\u5EFA\u9ED8\u8BA4\u5DE5\u4F5C\u533A\uFF0C\u7136\u540E\u65B0\u5EFA\u5BF9\u8BDD\u5E76\u8BF7\u6C42 Agent \u5904\u7406\u8FD9 {count} \u6761\u8BC4\u8BBA\u3002","send.newSessionConfirm":"\u65B0\u5EFA\u5E76\u5904\u7406","send.newSessionHint":"\u5F53\u524D\u6CA1\u6709\u6253\u5F00\u7684\u5BF9\u8BDD\uFF1B\u7EE7\u7EED\u540E\u4F1A\u65B0\u5EFA\u4E00\u4E2A\u5BF9\u8BDD\u3002","send.createUnavailable":"\u65E0\u6CD5\u521B\u5EFA\u5DE5\u4F5C\u533A\u6216\u5BF9\u8BDD\uFF0C\u8BF7\u5148\u6253\u5F00\u6216\u65B0\u5EFA\u4E00\u4E2A\u5DE5\u4F5C\u533A\u3002","send.noSession":"\u5F53\u524D\u6CA1\u6709\u53EF\u53D1\u9001\u7684\u5BF9\u8BDD\uFF0C\u8BF7\u4ECE\u5BF9\u8BDD\u4E2D\u6253\u5F00\u6587\u6863\u3002","send.none":"\u5F53\u524D\u6CA1\u6709\u5F85\u5904\u7406\u8BC4\u8BBA\u3002","send.copyHint":"\u590D\u5236\u7B80\u77ED\u63D0\u793A\u8BCD\uFF0C\u7136\u540E\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u53D1\u9001\u3002","send.copied":"\u5904\u7406\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u53D1\u9001\u3002","send.clipboardUnavailable":"\u65E0\u6CD5\u8BBF\u95EE\u526A\u8D34\u677F\uFF0C\u8BF7\u68C0\u67E5\u6D4F\u89C8\u5668\u6743\u9650\u3002","send.processingPrompt":"\u6309\u8BC4\u8BBA\u63D0\u51FA\u4FEE\u6539\u5EFA\u8BAE\u3002","error.generic":"{message}","error.genericAction":"\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002","error.requestFailed":"\u8BF7\u6C42\u5931\u8D25","error.limitExceeded":"\u8BF7\u6C42\u5185\u5BB9\u8FC7\u5927\u3002","error.methodNotFound":"\u8BE5\u64CD\u4F5C\u4E0D\u53D7\u652F\u6301\u3002","error.sessionUnavailable":"\u5F53\u524D\u5BF9\u8BDD\u53D1\u9001\u80FD\u529B\u4E0D\u53EF\u7528\u3002","picker.title":`\u9009\u62E9 ${kn.name.en} \u6587\u6863`,"picker.description":"\u9009\u62E9\u4E00\u4E2A\u6216\u591A\u4E2A\u6587\u6863\uFF0C\u6DFB\u52A0\u5230\u5F53\u524D\u5BF9\u8BDD\u3002","picker.documents":"\u6587\u6863","picker.empty":"\u8FD8\u6CA1\u6709\u6587\u6863\u3002","picker.add":"\u6DFB\u52A0\u5230\u5BF9\u8BDD","picker.cancel":"\u53D6\u6D88","picker.choose":"\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u6587\u6863\u3002","picker.closed":"\u5BF9\u8BDD\u5DF2\u5173\u95ED\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002","picker.failed":"\u65E0\u6CD5\u6DFB\u52A0\u5230\u5F53\u524D\u5BF9\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002","picker.openFailed":`\u65E0\u6CD5\u6253\u5F00 ${kn.name.en} \u6587\u6863`,"command.label":`${kn.name.en} \u6587\u6863`,"command.description":"\u9009\u62E9\u4E00\u4E2A\u6216\u591A\u4E2A\u6587\u6863","reference.card":`${kn.name.en} \u6587\u6863`,"sidebar.title":`${kn.name.en} \u6587\u6863`},zxe={"dialog.close":"Close dialog","collab.open":"Style preferences","collab.globalOpen":"Global style preferences","collab.title":"Style preferences","collab.globalTitle":"Global style preferences","collab.documentTitle":"Document style preferences","collab.close":"Close style preferences","collab.placeholder":"For example: audience, tone, terminology, formatting, and expression preferences","collab.save":"Save","collab.saving":"Saving\u2026","collab.saved":"Saved","collab.saveError":"Could not save","collab.loading":"Loading style preferences\u2026","collab.backendOutdated":"The collaboration service is not loaded. Reload the CoSpace plugin in the host app and try again.","brand.name":kn.name.zh,"brand.nameEnglish":kn.name.en,"header.eyebrow":`${kn.name.en.toUpperCase()} / Document review`,"header.untitled":"Personal documents","header.pending":"{count} pending","header.pick":"Select a document to start reviewing","edit.modeLabel":"Document mode","edit.reviewMode":"Review","edit.editMode":"Edit","edit.autoSaveHint":"Changes are saved before switching back to review mode","edit.unavailable":"This document has comments or suggestions and cannot be edited directly.","edit.saveErrorTitle":"Could not save; your edits are still here","edit.saveErrorKeepEditing":"Your changes remain in the editor. Close this message to continue editing; saving must succeed before returning to review mode.","edit.keepEditing":"Continue editing","edit.versionConflict":"The document changed while you were editing. Copy your unsaved text, then reload the document.","edit.unavailableReason":"Direct editing is only available when the document has no comments or suggestions","edit.saving":"Saving\u2026","edit.toolbar":"Text formatting","edit.contentLabel":"What you see is what you get document editor","edit.bold":"Bold","edit.italic":"Italic","edit.heading1":"Heading 1","edit.heading2":"Heading 2","edit.strike":"Strikethrough","edit.bullets":"Bulleted list","edit.numbered":"Numbered list","edit.quote":"Block quote","edit.link":"Link","edit.code":"Inline code","edit.placeholder":"Start writing\u2026","home.eyebrow":`${kn.name.en.toUpperCase()} \xB7 PERSONAL WORKSPACE`,"home.title":"Your documents, at a glance.","home.description":"Browse your documents and pending suggestions. Open any document to continue reviewing.","home.documentCount":"{count} documents","home.pendingCount":"{count} pending suggestions","home.openDocument":"Open document: {title}","home.emptyTitle":"Start with a new document","home.emptyDescription":"Create a document to read, review suggested changes, and add comments here.","home.back":"Back to documents","home.updated":"Updated {time}","home.created":"Created {time}","home.timeUnknown":"Time unknown","home.noPending":"No pending suggestions","home.search":"Search documents","home.filter":"Filter documents","home.filterAll":"All documents","home.filterPending":"Pending suggestions","home.sort":"Sort documents","home.sortRecent":"Recently updated","home.sortTitle":"Sort by title","home.noResults":"No documents match. Try another search or filter.","nav.aria":"Personal documents","nav.documents":"Documents","nav.newDocument":"New document","nav.empty":"No documents yet","nav.deleteDocument":"Delete document","nav.deleteDocumentLabel":"Delete \u201C{title}\u201D","document.deleteTitle":"Delete document?","document.deleteDescription":"\u201C{title}\u201D and its suggestions and comments will be permanently deleted. This cannot be undone.","document.deleteConfirm":"Delete document","document.deleteCancel":"Keep document","document.untitled":"Untitled document","empty.loading":"Loading document\u2026","empty.pick":"Select a document on the left, or choose New document to start.","review.aria":"Suggested changes","annotations.title":"Annotations","annotations.counts":"Suggestions {suggestions} \xB7 Comments {comments}","annotations.suggestions":"Suggestions {count}","annotations.comments":"Comments {count}","annotations.emptyTitle":"No annotations yet","annotations.emptyHint":"Select text to add a comment. Agent suggestions appear here.","zoom.label":"Page zoom","zoom.out":"Zoom out","zoom.in":"Zoom in","toolbar.more":"More tools","toolbar.aria":"Document actions","suggestion.badge":"Suggested change","review.suggestions":"Suggested changes","review.comments":"Comments","review.noSuggestions":"No pending suggestions.","review.noComments":"No comments yet.","review.commentCount":"{count}","review.toggleShow":"Suggested changes \u2014 expand","review.toggleHide":"Suggested changes \u2014 collapse","review.refresh":"Refresh document","export.button":"Export","build.versionTitle":"Local build version; the release version is unchanged","export.busy":"Preparing\u2026","export.note":"Exports accepted content only; pending suggestions and comments are excluded.","export.failed":"Export failed. Please try again.","paper.aria":"Document body","comment.bubble":"Comment","comment.author":"You","comment.accountUser":"Signed-in user","comment.addTitle":"Add a comment","comment.selected":"Selected: {quote}","comment.hint":"Select text in the document to add a comment.","comment.label":"Comment","comment.save":"Save comment","comment.cancel":"Cancel","comment.delete":"Delete","comment.deleteConfirm":"Delete this comment?","comment.pick":"Select to send","comment.locate":"Locate in document","comment.anchorLabel":"Comment anchor ({count})","comment.staleGroup":"Position unavailable","comment.staleHint":"The quoted text can no longer be located uniquely, so no anchor is drawn.","comment.required":"Select text in the document and write a comment.","comment.stale":" \xB7 Quote position is stale","comment.staleStatus":"Position unavailable","suggestion.locate":"Locate suggestion {id}","suggestion.locateCard":"Suggestion {n}","suggestion.kind.delete":"Deletion","suggestion.kind.insert":"Insertion","suggestion.kind.replace":"Replacement","suggestion.kind.unknown":"Change","suggestion.conflicted":"Conflicted; submit again","suggestion.defaultAuthor":"Agent","suggestion.unknownTime":"Time unknown","suggestion.deletedOriginal":"Deleted text","suggestion.insertedContent":"Inserted content","suggestion.deletedLabel":"Deleted","suggestion.insertedLabel":"Inserted","suggestion.original":"Original text","suggestion.replacement":"Suggested text","suggestion.unavailable":"This suggestion can no longer be located. Refresh the document.","suggestion.pendingStatus":"Pending review","suggestion.acceptedStatus":"Accepted","suggestion.rejectedStatus":"Rejected","suggestion.conflictedStatus":"Conflicted","comment.relatedSuggestions":"Related suggestions: {states}","action.accept":"Accept","action.reject":"Reject","diff.before":"Current","diff.none":"(none)","status.pending":"Pending","status.sending":"Sending processing request","status.sent":"Sent, awaiting Agent result","status.failed":"Send failed","status.unknown":"Send result unknown","status.processed":"Suggestions created","send.action":"Propose from comments","send.selected":"Process selected comments ({count})","send.all":"Ask the agent to process comments ({count})","send.hint":"Open the document from a conversation to request comment processing.","send.chooseTitle":"Choose how to process comments","send.chooseDescription":"Choose how to process these {count} pending comments.","send.destination":"Processing method","send.currentOption":"Send to current conversation","send.currentUnavailable":"No current conversation is available","send.sessionId":"Conversation: {id}","send.newOption":"New conversation","send.newOptionHint":"Create a conversation in the current or most recently used workspace and send the request","send.newUnavailable":"This host cannot create a conversation","send.copyOption":"Copy prompt","send.copyOptionHint":"Paste it into a conversation and send it yourself","send.confirmTitle":"Ask the agent to process comments?","send.confirmDescription":"A request will be sent to the current conversation to process these {count} pending comments.","send.confirm":"Send request","send.copyConfirmTitle":"Copy the comment processing prompt?","send.copyConfirmDescription":"Copy a prompt for the {count} pending comments in this document. Then paste and send it in a conversation.","send.copyConfirm":"Copy prompt","send.newSessionTitle":"Start a conversation to process comments?","send.newSessionDescription":"No conversation is open. Continuing reuses the most recent workspace, creates the default workspace when none exists, then starts a conversation and asks the agent to process these {count} comments.","send.newSessionConfirm":"Start and process","send.newSessionHint":"No conversation is open; continuing will start one.","send.createUnavailable":"Could not create a workspace or conversation. Open or create a workspace first.","send.noSession":"There is no conversation to send to. Open the document from a conversation.","send.none":"There are no comments to process.","send.copyHint":"Copy the short prompt, then paste and send it in a conversation.","send.copied":"Processing prompt copied. Paste and send it in a conversation.","send.clipboardUnavailable":"Clipboard access is unavailable. Check browser permissions.","send.processingPrompt":"Propose revisions based on comments.","error.generic":"{message}","error.genericAction":"The operation failed. Try again.","error.requestFailed":"Request failed","error.limitExceeded":"The request is too large.","error.methodNotFound":"This operation is not supported.","error.sessionUnavailable":"Sending to the conversation is unavailable.","picker.title":`Choose ${kn.name.en} documents`,"picker.description":"Choose one or more documents to add to the current conversation.","picker.documents":"Documents","picker.empty":"No documents yet.","picker.add":"Add to conversation","picker.cancel":"Cancel","picker.choose":"Choose at least one document.","picker.closed":"The conversation closed. Choose the documents again.","picker.failed":"Could not add the documents to this conversation. Try again.","picker.openFailed":`Could not open ${kn.name.en}`,"command.label":`${kn.name.en} documents`,"command.description":"Choose one or more documents","reference.card":`${kn.name.en} document`,"sidebar.title":`${kn.name.en} document`},WX={REQUEST_FAILED:"error.requestFailed",LIMIT_EXCEEDED:"error.limitExceeded",METHOD_NOT_FOUND:"error.methodNotFound",SESSION_UNAVAILABLE:"error.sessionUnavailable",SEND_TARGET_UNAVAILABLE:"send.createUnavailable",EDIT_REQUIRES_UNANNOTATED_DOCUMENT:"edit.unavailable",VERSION_CONFLICT:"edit.versionConflict"},KX=/\{([A-Za-z0-9_]+)\}/g;function J4(e,t,n){let r=e[t]??t;return n===void 0?r:r.replace(KX,(a,o)=>Object.prototype.hasOwnProperty.call(n,o)?String(n[o]):a)}function ks(e,t){let n=e?.code,r=typeof n=="string"?WX[n]:void 0;return r!==void 0?t(r):t("error.generic",{message:e?.message||t("error.genericAction")})}var ib=gr(vo(),1);var Fr=(function(e){return e.docTypeError="docTypeError",e.contextNotFound="contextNotFound",e.timerNotFound="timerNotFound",e.ctxCallOutOfScope="ctxCallOutOfScope",e.createNodeInParserFail="createNodeInParserFail",e.stackOverFlow="stackOverFlow",e.parserMatchError="parserMatchError",e.serializerMatchError="serializerMatchError",e.getAtomFromSchemaFail="getAtomFromSchemaFail",e.expectDomTypeError="expectDomTypeError",e.callCommandBeforeEditorView="callCommandBeforeEditorView",e.missingRootElement="missingRootElement",e.missingNodeInSchema="missingNodeInSchema",e.missingMarkInSchema="missingMarkInSchema",e.ctxNotBind="ctxNotBind",e.missingYjsDoc="missingYjsDoc",e.aiProviderError="aiProviderError",e.aiBuildContextError="aiBuildContextError",e})({}),Hr=class extends Error{constructor(e,t,n){super(t,n),this.name="MilkdownError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},XX=(e,t)=>typeof t=="function"?"[Function]":t,Tg=e=>JSON.stringify(e,XX);function Q4(e){return new Hr(Fr.docTypeError,`Doc type error, unsupported type: ${Tg(e)}`)}function eP(e){return new Hr(Fr.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function tP(e){return new Hr(Fr.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function qd(){return new Hr(Fr.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function nP(e,t,n){let r=`Cannot create node for ${"name"in e?e.name:e}`,a=i=>{if(i==null)return"null";if(Array.isArray(i))return`[${i.map(a).join(", ")}]`;if(typeof i=="object")return"toJSON"in i&&typeof i.toJSON=="function"?JSON.stringify(i.toJSON()):"spec"in i?JSON.stringify(i.spec):JSON.stringify(i);if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")return JSON.stringify(i);if(typeof i=="function")return`[Function: ${i.name||"anonymous"}]`;try{return String(i)}catch{return"[Unserializable]"}},o=[["[Description]",r],["[Attributes]",t],["[Content]",(n??[]).map(i=>i?typeof i=="object"&&"type"in i?`${i}`:a(i):"null")]].reduce((i,[s,l])=>{let u=`${s}: ${a(l)}.`;return i.concat(u)},[]);return new Hr(Fr.createNodeInParserFail,o.join(`
|
|
10
|
+
`))}function gI(){return new Hr(Fr.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function rP(e){return new Hr(Fr.parserMatchError,`Cannot match target parser for node: ${Tg(e)}.`)}function aP(e){return new Hr(Fr.serializerMatchError,`Cannot match target serializer for node: ${Tg(e)}.`)}function oP(e,t){return new Hr(Fr.getAtomFromSchemaFail,`Cannot get ${e}: ${t} from schema.`)}function Vr(e){return new Hr(Fr.expectDomTypeError,`Expect to be a dom, but get: ${Tg(e)}.`)}function yv(){return new Hr(Fr.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function vv(e){return new Hr(Fr.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function iP(e){return new Hr(Fr.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}function sP(e){try{return Tg(e)}catch{return"[Unserializable]"}}function lP(e){let t=e instanceof Error?e.message:sP(e);return new Hr(Fr.aiProviderError,`AI provider error: ${t}`,{cause:e})}function uP(e){let t=e instanceof Error?e.message:sP(e);return new Hr(Fr.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:e})}var xI=class{constructor(){this.sliceMap=new Map,this.get=e=>{let t=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);if(!t){let n=typeof e=="string"?e:e.name;throw eP(n)}return t},this.remove=e=>{let t=typeof e=="string"?[...this.sliceMap.values()].find(n=>n.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e=="string"?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},_o,Cs,jd,cP,YX=(cP=class{constructor(e,t,n){X(this,_o);X(this,Cs);X(this,jd);B(this,_o,[]),B(this,jd,()=>{L(this,_o).forEach(r=>r(L(this,Cs)))}),this.set=r=>{B(this,Cs,r),L(this,jd).call(this)},this.get=()=>L(this,Cs),this.update=r=>{B(this,Cs,r(L(this,Cs))),L(this,jd).call(this)},this.type=n,B(this,Cs,t),e.set(n.id,this)}on(e){return L(this,_o).push(e),()=>{B(this,_o,L(this,_o).filter(t=>t!==e))}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){B(this,_o,L(this,_o).filter(t=>t!==e))}offAll(){B(this,_o,[])}},_o=new WeakMap,Cs=new WeakMap,jd=new WeakMap,cP),ZX=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw qd()}}create(e,t=this._defaultValue){return new YX(e,t,this)}},Ie=(e,t)=>new ZX(e,t),Dg,Rg,Mg,yc,$d,Hl,Gd,Wd,Kd,fP,JX=(fP=class{constructor(e,t,n){X(this,Dg);X(this,Rg);X(this,Mg);X(this,yc);X(this,$d);X(this,Hl);X(this,Gd);X(this,Wd);X(this,Kd);B(this,yc,new Set),B(this,$d,new Set),B(this,Hl,new Map),B(this,Gd,new Map),this.read=()=>({metadata:L(this,Dg),injectedSlices:[...L(this,yc)].map(r=>({name:typeof r=="string"?r:r.name,value:L(this,Wd).call(this,r)})),consumedSlices:[...L(this,$d)].map(r=>({name:typeof r=="string"?r:r.name,value:L(this,Wd).call(this,r)})),recordedTimers:[...L(this,Hl)].map(([r,{duration:a}])=>({name:r.name,duration:a,status:L(this,Kd).call(this,r)})),waitTimers:[...L(this,Gd)].map(([r,{duration:a}])=>({name:r.name,duration:a,status:L(this,Kd).call(this,r)}))}),this.onRecord=r=>{L(this,Hl).set(r,{start:Date.now(),duration:0})},this.onClear=r=>{L(this,Hl).delete(r)},this.onDone=r=>{let a=L(this,Hl).get(r);a&&(a.duration=Date.now()-a.start)},this.onWait=(r,a)=>{let o=Date.now();a.finally(()=>{L(this,Gd).set(r,{duration:Date.now()-o})}).catch(console.error)},this.onInject=r=>{L(this,yc).add(r)},this.onRemove=r=>{L(this,yc).delete(r)},this.onUse=r=>{L(this,$d).add(r)},B(this,Wd,r=>L(this,Rg).get(r).get()),B(this,Kd,r=>L(this,Mg).get(r).status),B(this,Rg,e),B(this,Mg,t),B(this,Dg,n)}},Dg=new WeakMap,Rg=new WeakMap,Mg=new WeakMap,yc=new WeakMap,$d=new WeakMap,Hl=new WeakMap,Gd=new WeakMap,Wd=new WeakMap,Kd=new WeakMap,fP),Ss,Ls,Ng,ro,Xd,pP=(Xd=class{constructor(t,n,r){X(this,Ss);X(this,Ls);X(this,Ng);X(this,ro);this.produce=a=>a&&Object.keys(a).length?new Xd(L(this,Ss),L(this,Ls),{...a}):this,this.inject=(a,o)=>{let i=a.create(L(this,Ss).sliceMap);return o!=null&&i.set(o),L(this,ro)?.onInject(a),this},this.remove=a=>(L(this,Ss).remove(a),L(this,ro)?.onRemove(a),this),this.record=a=>(a.create(L(this,Ls).store),L(this,ro)?.onRecord(a),this),this.clearTimer=a=>(L(this,Ls).remove(a),L(this,ro)?.onClear(a),this),this.isInjected=a=>L(this,Ss).has(a),this.isRecorded=a=>L(this,Ls).has(a),this.use=a=>(L(this,ro)?.onUse(a),L(this,Ss).get(a)),this.get=a=>this.use(a).get(),this.set=(a,o)=>this.use(a).set(o),this.update=(a,o)=>this.use(a).update(o),this.timer=a=>L(this,Ls).get(a),this.done=a=>{this.timer(a).done(),L(this,ro)?.onDone(a)},this.wait=a=>{let o=this.timer(a).start();return L(this,ro)?.onWait(a,o),o},this.waitTimers=async a=>{await Promise.all(this.get(a).map(o=>this.wait(o)))},B(this,Ss,t),B(this,Ls,n),B(this,Ng,r),r&&B(this,ro,new JX(t,n,r))}get meta(){return L(this,Ng)}get inspector(){return L(this,ro)}},Ss=new WeakMap,Ls=new WeakMap,Ng=new WeakMap,ro=new WeakMap,Xd),hP=class{constructor(){this.store=new Map,this.get=e=>{let t=this.store.get(e.id);if(!t)throw tP(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},Yd,Vl,Zd,Is,As,Jd,Og,dP,QX=(dP=class{constructor(e,t){X(this,Yd);X(this,Vl);X(this,Zd);X(this,Is);X(this,As);X(this,Jd);X(this,Og);B(this,Yd,null),B(this,Vl,null),B(this,Is,"pending"),B(this,As,null),this.start=()=>(L(this,Yd)??B(this,Yd,new Promise((n,r)=>{B(this,Vl,a=>{a instanceof CustomEvent&&a.detail.id===L(this,Zd)&&(B(this,Is,"resolved"),L(this,Jd).call(this),a.stopImmediatePropagation(),n())}),L(this,Og).call(this,()=>{L(this,Is)==="pending"&&B(this,Is,"rejected"),L(this,Jd).call(this),r(new Error(`Timing ${this.type.name} timeout.`))}),B(this,Is,"pending"),addEventListener(this.type.name,L(this,Vl))})),L(this,Yd)),this.done=()=>{let n=new CustomEvent(this.type.name,{detail:{id:L(this,Zd)}});dispatchEvent(n)},B(this,Jd,()=>{L(this,As)!==null&&(clearTimeout(L(this,As)),B(this,As,null)),L(this,Vl)&&removeEventListener(this.type.name,L(this,Vl))}),B(this,Og,n=>{B(this,As,setTimeout(()=>{B(this,As,null),n()},this.type.timeout))}),B(this,Zd,Symbol(t.name)),this.type=t,e.set(t.id,this)}get status(){return L(this,Is)}},Yd=new WeakMap,Vl=new WeakMap,Zd=new WeakMap,Is=new WeakMap,As=new WeakMap,Jd=new WeakMap,Og=new WeakMap,dP),eY=class{constructor(e,t=3e3){this.create=n=>new QX(n,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},ao=(e,t=3e3)=>new eY(e,t);var tY={};function Es(e,t){let n=t||tY,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return gP(e,r,a)}function gP(e,t,n){if(nY(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mP(e.children,t,n)}return Array.isArray(e)?mP(e,t,n):""}function mP(e,t,n){let r=[],a=-1;for(;++a<e.length;)r[a]=gP(e[a],t,n);return r.join("")}function nY(e){return!!(e&&typeof e=="object")}var xP=document.createElement("i");function Qd(e){let t="&"+e+";";xP.innerHTML=t;let n=xP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gn(e,t,n,r){let a=e.length,o=0,i;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);o<r.length;)i=r.slice(o,o+1e4),i.unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function Ur(e,t){return e.length>0?(Gn(e,e.length,0,t),e):t}var bP={}.hasOwnProperty;function wv(e){let t={},n=-1;for(;++n<e.length;)rY(t,e[n]);return t}function rY(e,t){let n;for(n in t){let a=(bP.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],i;if(o)for(i in o){bP.call(a,i)||(a[i]=[]);let s=o[i];aY(a[i],Array.isArray(s)?s:s?[s]:[])}}}function aY(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gn(e,0,0,r)}function kv(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function wr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xn=ql(/[A-Za-z]/),Cn=ql(/[\dA-Za-z]/),yP=ql(/[#-'*+\--9=?A-Z^-~]/);function vc(e){return e!==null&&(e<32||e===127)}var Pg=ql(/\d/),vP=ql(/[\dA-Fa-f]/),Cv=ql(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}var Ul=ql(/\p{P}|\p{S}/u),bi=ql(/\s/);function ql(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ve(e,t,n,r){let a=r?r-1:1/0,o=0;return i;function i(l){return Pe(l)?(e.enter(n),s(l)):t(l)}function s(l){return Pe(l)&&o++<a?(e.consume(l),s):(e.exit(n),t(l))}}function bI(e,t,n,r,a,o){let i=0;return s;function s(c){return o>0&&Pe(c)?(e.enter(r),l(c)):u(c)}function l(c){return Pe(c)&&i<o?(e.consume(c),i++,l):(e.exit(r),u(c))}function u(c){return i>=a?t(c):n(c)}}var wP={tokenize:oY};function oY(e){let t=e.attempt(this.parser.constructs.contentInitial,r,a),n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ve(e,t,"linePrefix")}function a(s){return e.enter("paragraph"),o(s)}function o(s){let l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return we(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),i)}}var _s=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){kP(this,t,n,r,!1)}addBefore(t,n,r){kP(this,t,n,r,!0)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(let o of a)t.push(o);a=r.pop()}this.map.length=0,this.index.clear()}};function kP(e,t,n,r,a){if(n===0&&r.length===0)return;let o=e.index.get(t);if(o){o[1]+=n,a?(r.push(...o[2]),o[2]=r):o[2].push(...r);return}let i=[t,n,r];e.map.push(i),e.index.set(t,i)}var SP={tokenize:iY},CP={tokenize:sY};function iY(e){let t=this,n=[],r=0,a,o,i;return s;function s(b){if(r<n.length){let v=n[r];return t.containerState=v[1],e.attempt(v[0].continuation,l,u)(b)}return u(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&y();let v=t.events.length,w=v,k;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){k=t.events[w][1].end;break}m(r);let _=v;for(;_<t.events.length;)t.events[_][1].end={...k},_++;let E=new _s;return E.add(w+1,0,t.events.slice(v)),E.add(v,_-v,[]),E.consume(t.events),u(b)}return s(b)}function u(b){if(r===n.length){if(!a)return d(b);if(a.currentConstruct&&a.currentConstruct.concrete)return h(b);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(CP,c,f)(b)}function c(b){return a&&y(),m(r),d(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,i=t.now().offset,h(b)}function d(b){return t.containerState={},e.attempt(CP,p,h)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),d(b)}function h(b){if(b===null){a&&y(),m(0),e.consume(b);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),g(b)}function g(b){if(b===null){x(e.exit("chunkFlow"),!0),m(0),e.consume(b);return}return we(b)?(e.consume(b),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(b),g)}function x(b,v){let w=t.sliceStream(b);if(v&&w.push(null),b.previous=o,o&&(o.next=b),o=b,a.defineSkip(b.start),a.write(w),t.parser.lazy[b.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<i&&(!a.events[k][1].end||a.events[k][1].end.offset>i))return;let _=t.events.length,E=_,M,S;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(M){S=t.events[E][1].end;break}M=!0}for(m(r),k=_;k<t.events.length;)t.events[k][1].end={...S},k++;let U=new _s;U.add(E+1,0,t.events.slice(_)),U.add(_,k-_,[]),U.consume(t.events)}}function m(b){let v=n.length;for(;v-- >b;){let w=n[v];t.containerState=w[1],w[0].exit.call(t,e)}n.length=b}function y(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function sY(e,t,n){return Ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qr(e){if(e===null||ot(e)||bi(e))return 1;if(Ul(e))return 2}function jl(e,t,n){let r=[],a=-1;for(;++a<e.length;){let o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Bg={name:"attention",resolveAll:lY,tokenize:uY};function lY(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let a=n;for(;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let o=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,i={...e[a][1].end},s={...e[n][1].start};LP(i,-o),LP(s,o);let l={type:o>1?"strongSequence":"emphasisSequence",start:i,end:{...e[a][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:s},c={type:o>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},f={type:o>1?"strong":"emphasis",start:{...l.start},end:{...u.end}};e[a][1].end={...l.start},e[n][1].start={...u.end},r=[],e[a][1].end.offset-e[a][1].start.offset&&(r=Ur(r,[["enter",e[a][1],t],["exit",e[a][1],t]])),r=Ur(r,[["enter",f,t],["enter",l,t],["exit",l,t],["enter",c,t]]),r=Ur(r,jl(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),r=Ur(r,[["exit",c,t],["enter",u,t],["exit",u,t],["exit",f,t]]);let d=0;e[n][1].end.offset-e[n][1].start.offset&&(d=2,r=Ur(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),Gn(e,a-1,n-a+3,r),n=a+r.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uY(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=qr(r),o;return i;function i(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;let u=e.exit("attentionSequence"),c=qr(l),f=!c||c===2&&a||n.includes(l)&&l!==42&&l!==95,d=!a||a===2&&c||n.includes(r)&&r!==42&&r!==95;return u._open=!!(o===42?f:f&&(a||!d)),u._close=!!(o===42?d:d&&(c||!f)),t(l)}}function LP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var yI={name:"autolink",tokenize:cY};function cY(e,t,n){let r=0;return a;function a(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return xn(p)?(e.consume(p),i):p===64?n(p):u(p)}function i(p){return p===43||p===45||p===46||Cn(p)?(r=1,s(p)):u(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Cn(p))&&r++<32?(e.consume(p),s):(r=0,u(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||vc(p)?n(p):(e.consume(p),l)}function u(p){return p===64?(e.consume(p),c):yP(p)?(e.consume(p),u):n(p)}function c(p){return Cn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):d(p)}function d(p){if((p===45||Cn(p))&&r++<63){let h=p===45?d:f;return e.consume(p),h}return n(p)}}var yi={partial:!0,tokenize:fY};function fY(e,t,n){return r;function r(o){return Pe(o)?Ve(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||we(o)?t(o):n(o)}}var Sv={continuation:{tokenize:pY},exit:hY,name:"blockQuote",tokenize:dY};function dY(e,t,n){let r=this;return a;function a(i){if(i===62){let s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return n(i)}function o(i){return Pe(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function pY(e,t,n){let r=this;return a;function a(i){return Pe(i)?Ve(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(Sv,t,n)(i)}}function hY(e){e.exit("blockQuote")}var Lv={name:"characterEscape",tokenize:mY};function mY(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return Cv(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var Iv={name:"characterReference",tokenize:gY};function gY(e,t,n){let r=this,a=0,o,i;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,i=Cn,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=vP,c):(e.enter("characterReferenceValue"),o=7,i=Pg,c(f))}function c(f){if(f===59&&a){let d=e.exit("characterReferenceValue");return i===Cn&&!Qd(r.sliceSerialize(d))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&a++<o?(e.consume(f),c):n(f)}}var zg={partial:!0,tokenize:xY};function xY(e,t,n){let r=this;return a;function a(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}var Av={concrete:!0,name:"codeFenced",tokenize:bY};function bY(e,t,n){let r=this,a={partial:!0,tokenize:w},o=0,i=0,s;return l;function l(k){return u(k)}function u(k){let _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,s=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===s?(i++,e.consume(k),c):i<3?n(k):(e.exit("codeFencedFenceSequence"),Pe(k)?Ve(e,f,"whitespace")(k):f(k))}function f(k){return k===null||we(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(zg,g,v)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||we(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Pe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ve(e,p,"whitespace")(k)):k===96&&k===s?n(k):(e.consume(k),d)}function p(k){return k===null||we(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||we(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===s?n(k):(e.consume(k),h)}function g(k){return e.attempt(a,v,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),m}function m(k){return o>0&&Pe(k)?Ve(e,y,"linePrefix",o+1)(k):y(k)}function y(k){return k===null||we(k)?e.check(zg,g,v)(k):(e.enter("codeFlowValue"),b(k))}function b(k){return k===null||we(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),b)}function v(k){return e.exit("codeFenced"),t(k)}function w(k,_,E){let M=0;return S;function S(fe){return k.enter("lineEnding"),k.consume(fe),k.exit("lineEnding"),U}function U(fe){return k.enter("codeFencedFence"),Pe(fe)?Ve(k,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(fe):N(fe)}function N(fe){return fe===s?(k.enter("codeFencedFenceSequence"),q(fe)):E(fe)}function q(fe){return fe===s?(M++,k.consume(fe),q):M>=i?(k.exit("codeFencedFenceSequence"),Pe(fe)?Ve(k,ie,"whitespace")(fe):ie(fe)):E(fe)}function ie(fe){return fe===null||we(fe)?(k.exit("codeFencedFence"),_(fe)):E(fe)}}}var Fg={name:"codeIndented",tokenize:vY},yY={partial:!0,tokenize:wY};function vY(e,t,n){return r;function r(s){return e.enter("codeIndented"),bI(e,a,n,"linePrefix",4,4)(s)}function a(s){return s===null?i(s):we(s)?e.attempt(yY,a,i)(s):(e.enter("codeFlowValue"),o(s))}function o(s){return s===null||we(s)?(e.exit("codeFlowValue"),a(s)):(e.consume(s),o)}function i(s){return e.exit("codeIndented"),t(s)}}function wY(e,t,n){let r=this;return a;function a(i){return r.parser.lazy[r.now().line]?n(i):we(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):bI(e,t,o,"linePrefix",4,4)(i)}function o(i){return we(i)?a(i):n(i)}}var vI={name:"codeText",previous:CY,resolve:kY,tokenize:SY};function kY(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function CY(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SY(e,t,n){let r=this,a=0,o,i;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),a++,l):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(i=e.enter("codeTextSequence"),o=0,f(d)):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||we(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function f(d){return d===96?(e.consume(d),o++,f):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}var Ev=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let a=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Hg(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Hg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Hg(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Hg(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Hg(this.left,n.reverse())}}};function Hg(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _v(e){let t={},n=-1,r,a,o,i,s,l,u,c=new Ev(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,LY(c,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(i=c.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(a&&(c.get(a)[1].type="lineEndingBlank"),i[1].type="lineEnding",a=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;a&&(r[1].end={...c.get(a)[1].start},s=c.slice(a,n),s.unshift(r),c.splice(a,n-a+1,s))}}return Gn(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function LY(e,t){let n=e.get(t)[1],r=e.get(t)[2],a=t-1,o=[],i=n._tokenizer;i||(i=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let s=i.events,l=[],u={},c,f,d=-1,p=n,h=0,g=0,x=[g];for(;p;){for(;e.get(++a)[1]!==p;);o.push(a),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(g=d+1,x.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),d=x.length;d--;){let m=s.slice(x[d],x[d+1]),y=o.pop();l.push([y,y+m.length-1]),e.splice(y,2,m)}for(l.reverse(),d=-1;++d<l.length;)u[h+l[d][0]]=h+l[d][1],h+=l[d][1]-l[d][0]-1;return u}var wI={resolve:AY,tokenize:EY},IY={partial:!0,tokenize:_Y};function AY(e){return _v(e),e}function EY(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(s)}function a(s){return s===null?o(s):we(s)?e.check(IY,i,o)(s):(e.consume(s),a)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function _Y(e,t,n){let r=this;return a;function a(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ve(e,o,"linePrefix")}function o(i){if(i===null||we(i))return n(i);let s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Tv(e,t,n,r,a,o,i,s,l){let u=l||Number.POSITIVE_INFINITY,c=0;return f;function f(m){return m===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(m),e.exit(o),d):m===null||m===32||m===41||vc(m)?n(m):(e.enter(r),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(m))}function d(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(s),d(m)):m===null||m===60||we(m)?n(m):(e.consume(m),m===92?h:p)}function h(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function g(m){return!c&&(m===null||m===41||ot(m))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(r),t(m)):c<u&&m===40?(e.consume(m),c++,g):m===41?(e.consume(m),c--,g):m===null||m===32||m===40||vc(m)?n(m):(e.consume(m),m===92?x:g)}function x(m){return m===40||m===41||m===92?(e.consume(m),g):g(m)}}function Dv(e,t,n,r,a,o){let i=this,s=0,l;return u;function u(p){return e.enter(r),e.enter(a),e.consume(p),e.exit(a),e.enter(o),c}function c(p){return s>999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(p):p===93?(e.exit(o),e.enter(a),e.consume(p),e.exit(a),e.exit(r),t):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||we(p)||s++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!Pe(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}}function Rv(e,t,n,r,a,o){let i;return s;function s(d){return d===34||d===39||d===40?(e.enter(r),e.enter(a),e.consume(d),e.exit(a),i=d===40?41:d,l):n(d)}function l(d){return d===i?(e.enter(a),e.consume(d),e.exit(a),e.exit(r),t):(e.enter(o),u(d))}function u(d){return d===i?(e.exit(o),l(i)):d===null?n(d):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ve(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===i||d===null||we(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?f:c)}function f(d){return d===i||d===92?(e.consume(d),c):c(d)}}function wc(e,t){let n;return r;function r(a){return we(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Pe(a)?Ve(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}var kI={name:"definition",tokenize:DY},TY={partial:!0,tokenize:RY};function DY(e,t,n){let r=this,a;return o;function o(p){return e.enter("definition"),i(p)}function i(p){return Dv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return a=wr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return ot(p)?wc(e,u)(p):u(p)}function u(p){return Tv(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(TY,f,f)(p)}function f(p){return Pe(p)?Ve(e,d,"whitespace")(p):d(p)}function d(p){return p===null||we(p)?(e.exit("definition"),r.parser.defined.push(a),t(p)):n(p)}}function RY(e,t,n){return r;function r(s){return ot(s)?wc(e,a)(s):n(s)}function a(s){return Rv(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Pe(s)?Ve(e,i,"whitespace")(s):i(s)}function i(s){return s===null||we(s)?t(s):n(s)}}var CI={name:"hardBreakEscape",tokenize:MY};function MY(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return we(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var SI={name:"headingAtx",resolve:NY,tokenize:OY};function NY(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){let a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};Gn(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])}return e}function OY(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),i(c)}function i(c){return c===35&&r++<6?(e.consume(c),i):c===null||ot(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||we(c)?(e.exit("atxHeading"),t(c)):Pe(c)?Ve(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||ot(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}var Mv=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Vg=["pre","script","style","textarea"];var LI={concrete:!0,name:"htmlFlow",resolveTo:BY,tokenize:zY},PY={partial:!0,tokenize:FY};function BY(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zY(e,t,n){let r=this,a,o,i,s,l;return u;function u(T){return c(T)}function c(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),f}function f(T){return T===33?(e.consume(T),d):T===47?(e.consume(T),o=!0,g):T===63?(e.consume(T),a=3,r.interrupt?t:D):xn(T)?(e.consume(T),i=String.fromCharCode(T),x):n(T)}function d(T){return T===45?(e.consume(T),a=2,p):T===91?(e.consume(T),a=5,s=0,h):xn(T)?(e.consume(T),a=4,r.interrupt?t:D):n(T)}function p(T){return T===45?(e.consume(T),r.interrupt?t:D):n(T)}function h(T){let at="CDATA[";return T===at.charCodeAt(s++)?(e.consume(T),s===at.length?r.interrupt?t:N:h):n(T)}function g(T){return xn(T)?(e.consume(T),i=String.fromCharCode(T),x):n(T)}function x(T){if(T===null||T===47||T===62||ot(T)){let at=T===47,yt=i.toLowerCase();return!at&&!o&&Vg.includes(yt)?(a=1,r.interrupt?t(T):N(T)):Mv.includes(i.toLowerCase())?(a=6,at?(e.consume(T),m):r.interrupt?t(T):N(T)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):o?y(T):b(T))}return T===45||Cn(T)?(e.consume(T),i+=String.fromCharCode(T),x):n(T)}function m(T){return T===62?(e.consume(T),r.interrupt?t:N):n(T)}function y(T){return Pe(T)?(e.consume(T),y):S(T)}function b(T){return T===47?(e.consume(T),S):T===58||T===95||xn(T)?(e.consume(T),v):Pe(T)?(e.consume(T),b):S(T)}function v(T){return T===45||T===46||T===58||T===95||Cn(T)?(e.consume(T),v):w(T)}function w(T){return T===61?(e.consume(T),k):Pe(T)?(e.consume(T),w):b(T)}function k(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,_):Pe(T)?(e.consume(T),k):E(T)}function _(T){return T===l?(e.consume(T),l=null,M):T===null||we(T)?n(T):(e.consume(T),_)}function E(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||ot(T)?w(T):(e.consume(T),E)}function M(T){return T===47||T===62||Pe(T)?b(T):n(T)}function S(T){return T===62?(e.consume(T),U):n(T)}function U(T){return T===null||we(T)?N(T):Pe(T)?(e.consume(T),U):n(T)}function N(T){return T===45&&a===2?(e.consume(T),he):T===60&&a===1?(e.consume(T),xe):T===62&&a===4?(e.consume(T),st):T===63&&a===3?(e.consume(T),D):T===93&&a===5?(e.consume(T),Fe):we(T)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(PY,Ke,q)(T)):T===null||we(T)?(e.exit("htmlFlowData"),q(T)):(e.consume(T),N)}function q(T){return e.check(zg,ie,Ke)(T)}function ie(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),fe}function fe(T){return T===null||we(T)?q(T):(e.enter("htmlFlowData"),N(T))}function he(T){return T===45?(e.consume(T),D):N(T)}function xe(T){return T===47?(e.consume(T),i="",Ce):N(T)}function Ce(T){if(T===62){let at=i.toLowerCase();return Vg.includes(at)?(e.consume(T),st):N(T)}return xn(T)&&i.length<8?(e.consume(T),i+=String.fromCharCode(T),Ce):N(T)}function Fe(T){return T===93?(e.consume(T),D):N(T)}function D(T){return T===62?(e.consume(T),st):T===45&&a===2?(e.consume(T),D):N(T)}function st(T){return T===null||we(T)?(e.exit("htmlFlowData"),Ke(T)):(e.consume(T),st)}function Ke(T){return e.exit("htmlFlow"),t(T)}}function FY(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(yi,t,n)}}var II={name:"htmlText",tokenize:HY};function HY(e,t,n){let r=this,a,o,i;return s;function s(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),u):D===47?(e.consume(D),w):D===63?(e.consume(D),b):xn(D)?(e.consume(D),E):n(D)}function u(D){return D===45?(e.consume(D),c):D===91?(e.consume(D),o=0,h):xn(D)?(e.consume(D),y):n(D)}function c(D){return D===45?(e.consume(D),p):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),d):we(D)?(i=f,xe(D)):(e.consume(D),f)}function d(D){return D===45?(e.consume(D),p):f(D)}function p(D){return D===62?he(D):D===45?d(D):f(D)}function h(D){let st="CDATA[";return D===st.charCodeAt(o++)?(e.consume(D),o===st.length?g:h):n(D)}function g(D){return D===null?n(D):D===93?(e.consume(D),x):we(D)?(i=g,xe(D)):(e.consume(D),g)}function x(D){return D===93?(e.consume(D),m):g(D)}function m(D){return D===62?he(D):D===93?(e.consume(D),m):g(D)}function y(D){return D===null||D===62?he(D):we(D)?(i=y,xe(D)):(e.consume(D),y)}function b(D){return D===null?n(D):D===63?(e.consume(D),v):we(D)?(i=b,xe(D)):(e.consume(D),b)}function v(D){return D===62?he(D):b(D)}function w(D){return xn(D)?(e.consume(D),k):n(D)}function k(D){return D===45||Cn(D)?(e.consume(D),k):_(D)}function _(D){return we(D)?(i=_,xe(D)):Pe(D)?(e.consume(D),_):he(D)}function E(D){return D===45||Cn(D)?(e.consume(D),E):D===47||D===62||ot(D)?M(D):n(D)}function M(D){return D===47?(e.consume(D),he):D===58||D===95||xn(D)?(e.consume(D),S):we(D)?(i=M,xe(D)):Pe(D)?(e.consume(D),M):he(D)}function S(D){return D===45||D===46||D===58||D===95||Cn(D)?(e.consume(D),S):U(D)}function U(D){return D===61?(e.consume(D),N):we(D)?(i=U,xe(D)):Pe(D)?(e.consume(D),U):M(D)}function N(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,q):we(D)?(i=N,xe(D)):Pe(D)?(e.consume(D),N):(e.consume(D),ie)}function q(D){return D===a?(e.consume(D),a=void 0,fe):D===null?n(D):we(D)?(i=q,xe(D)):(e.consume(D),q)}function ie(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||ot(D)?M(D):(e.consume(D),ie)}function fe(D){return D===47||D===62||ot(D)?M(D):n(D)}function he(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function xe(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Ce}function Ce(D){return Pe(D)?Ve(e,Fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):Fe(D)}function Fe(D){return e.enter("htmlTextData"),i(D)}}var kc={name:"labelEnd",resolveAll:jY,resolveTo:$Y,tokenize:GY},VY={tokenize:WY},UY={tokenize:KY},qY={tokenize:XY};function jY(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Gn(e,0,e.length,n),e}function $Y(e,t){let n=e.length,r=0,a,o,i;for(;n--;){let c=e[n][1];if(a){if(c.type==="link"||c.type==="labelLink"&&c._inactive)break;e[n][0]==="enter"&&c.type==="labelLink"&&(c._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(c.type==="labelImage"||c.type==="labelLink")&&!c._balanced&&(a=n,c.type!=="labelLink")){r=2;break}}else c.type==="labelEnd"&&(o=n)}let s={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",s,t],["enter",l,t]],i=Ur(i,e.slice(a+1,a+r+3)),i=Ur(i,[["enter",u,t]]),i=Ur(i,jl(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),i=Ur(i,[["exit",u,t],e[o-2],e[o-1],["exit",l,t]]),i=Ur(i,e.slice(o+1)),i=Ur(i,[["exit",s,t]]),Gn(e,a,e.length,i),e}function GY(e,t,n){let r=this,a=r._labelStarts,o,i;if(a){for(;a.length>0&&a[a.length-1]._balanced;)a.pop();o=a[a.length-1]}return s;function s(d){return o?o._inactive?f(d):(i=r.parser.defined.includes(wr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),l):n(d)}function l(d){return d===40?e.attempt(VY,c,i?c:f)(d):d===91?e.attempt(UY,c,i?u:f)(d):i?c(d):f(d)}function u(d){return e.attempt(qY,c,f)(d)}function c(d){return a.pop(),t(d)}function f(d){return o._balanced=!0,n(d)}}function WY(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),a}function a(f){return ot(f)?wc(e,o)(f):o(f)}function o(f){return f===41?c(f):Tv(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return ot(f)?wc(e,l)(f):c(f)}function s(f){return n(f)}function l(f){return f===34||f===39||f===40?Rv(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return ot(f)?wc(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function KY(e,t,n){let r=this;return a;function a(s){return Dv.call(r,e,o,i,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(wr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function i(s){return n(s)}}function XY(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var AI={name:"labelStartImage",resolveAll:kc.resolveAll,tokenize:YY};function YY(e,t,n){let r=this,a;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),a=e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(a),t(l))}}var EI={name:"labelStartLink",resolveAll:kc.resolveAll,tokenize:ZY};function ZY(e,t,n){let r=this,a;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),a=e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(a),t(s))}}var Ug={name:"lineEnding",tokenize:JY};function JY(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ve(e,t,"linePrefix")}}var Cc={name:"thematicBreak",tokenize:QY};function QY(e,t,n){let r=0,a;return o;function o(u){return e.enter("thematicBreak"),i(u)}function i(u){return a=u,s(u)}function s(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||we(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Pe(u)?Ve(e,s,"whitespace")(u):s(u))}}var kr={continuation:{tokenize:rZ},exit:oZ,name:"list",tokenize:nZ},eZ={partial:!0,tokenize:iZ},tZ={partial:!0,tokenize:aZ};function nZ(e,t,n){let r=this,a=r.events[r.events.length-1],o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,i=0;return s;function s(p){let h=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Pg(p)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Cc,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Pg(p)&&++i<10?(e.consume(p),l):(!r.interrupt||i<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yi,r.interrupt?n:c,e.attempt(eZ,d,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,d(p)}function f(p){return Pe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):n(p)}function d(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function rZ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(yi,a,o);function a(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Pe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tZ,t,i)(s))}function i(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ve(e,e.attempt(kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function aZ(e,t,n){let r=this;return Ve(e,a,"listItemIndent",r.containerState.size+1);function a(o){let i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(o):n(o)}}function oZ(e){e.exit(this.containerState.type)}function iZ(e,t,n){let r=this;return Ve(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){let i=r.events[r.events.length-1];return!Pe(o)&&i&&i[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var Nv={name:"setextUnderline",resolveTo:sZ,tokenize:lZ};function sZ(e,t){let n=new _s,r=e.length,a,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!i&&e[r][1].type==="definition"&&(i=r);let s={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(n.add(o,0,[["enter",s,t]]),n.add(i+1,0,[["exit",e[a][1],t]]),e[a][1].end={...e[i][1].end}):e[a][1]=s,n.add(e.length,0,[["exit",s,t]]),n.consume(e),e}function lZ(e,t,n){let r=this,a;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),a=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===a?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),Pe(u)?Ve(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||we(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var IP={tokenize:uZ};function uZ(e){let t=this,n=e.attempt(yi,r,e.attempt(this.parser.constructs.flowInitial,a,Ve(e,e.attempt(this.parser.constructs.flow,a,e.attempt(wI,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var AP={resolveAll:DP()},EP=TP("string"),_P=TP("text");function TP(e){return{resolveAll:DP(e==="text"?cZ:void 0),tokenize:t};function t(n){let r=this,a=this.parser.constructs[e],o=n.attempt(a,i,s);return i;function i(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;let f=a[c],d=-1;if(f)for(;++d<f.length;){let p=f[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function DP(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function cZ(e,t){let n=new _s,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let a=e[r-1][1],o=t.sliceStream(a),i=o.length,s=-1,l=0,u;for(;i--;){let c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)u=!0,l++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){let c={type:r===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:a.start._bufferIndex+s,_index:a.start._index+i,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...c.start},a.start.offset===a.end.offset?Object.assign(a,c):n.add(r,0,[["enter",c,t],["exit",c,t]])}r++}return n.consume(e),e}var _I={};aS(_I,{attentionMarkers:()=>bZ,contentInitial:()=>dZ,disable:()=>yZ,document:()=>fZ,flow:()=>hZ,flowInitial:()=>pZ,insideSpan:()=>xZ,string:()=>mZ,text:()=>gZ});var fZ={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:Sv},dZ={91:kI},pZ={[-2]:Fg,[-1]:Fg,32:Fg},hZ={35:SI,42:Cc,45:[Nv,Cc],60:LI,61:Nv,95:Cc,96:Av,126:Av},mZ={38:Iv,92:Lv},gZ={[-5]:Ug,[-4]:Ug,[-3]:Ug,33:AI,38:Iv,42:Bg,60:[yI,II],91:EI,92:[CI,Lv],93:kc,95:Bg,96:vI},xZ={null:[Bg,AP]},bZ={null:[42,95]},yZ={null:[]};function RP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},a={},o=[],i=[],s=[],l=!0,u={attempt:M(_),check:M(E),consume:v,enter:w,exit:k,interrupt:M(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:h,sliceStream:g,write:p},f=t.tokenize.call(c,u),d;return t.resolveAll&&o.push(t),c;function p(q){return i=Ur(i,q),y(),i[i.length-1]!==null?[]:(S(t,0),c.events=jl(o,c.events,c),c.events)}function h(q,ie){return wZ(g(q),ie)}function g(q){return vZ(i,q)}function x(){let{_bufferIndex:q,_index:ie,line:fe,column:he,offset:xe}=r;return{_bufferIndex:q,_index:ie,line:fe,column:he,offset:xe}}function m(q){a[q.line]=q.column,N()}function y(){for(;r._index<i.length;){let q=i[r._index];if(typeof q=="string"){let ie=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===ie&&r._bufferIndex<q.length;)b(q.charCodeAt(r._bufferIndex))}else b(q)}}function b(q){l=void 0,d=q,f=f(q)}function v(q){we(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,N()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=q,l=!0}function w(q,ie){let fe=ie||{};return fe.type=q,fe.start=x(),c.events.push(["enter",fe,c]),s.push(fe),fe}function k(q){let ie=s.pop();return ie.end=x(),c.events.push(["exit",ie,c]),ie}function _(q,ie){S(q,ie.from)}function E(q,ie){ie.restore()}function M(q,ie){return fe;function fe(he,xe,Ce){let Fe,D,st,Ke;return Array.isArray(he)?at(he):"tokenize"in he?at([he]):T(he);function T(mt){return be;function be(Tt){let Dt=Tt!==null&&mt[Tt],vt=Tt!==null&&mt.null,I=[...Array.isArray(Dt)?Dt:Dt?[Dt]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return at(I)(Tt)}}function at(mt){return Fe=mt,D=0,mt.length===0?Ce:yt(mt[D])}function yt(mt){return be;function be(Tt){return Ke=U(),st=mt,mt.partial||(c.currentConstruct=mt),mt.name&&c.parser.constructs.disable.null.includes(mt.name)?ln(Tt):mt.tokenize.call(ie?Object.assign(Object.create(c),ie):c,u,Ut,ln)(Tt)}}function Ut(mt){return l=!0,q(st,Ke),xe}function ln(mt){return l=!0,Ke.restore(),++D<Fe.length?yt(Fe[D]):Ce}}}function S(q,ie){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Gn(c.events,ie,c.events.length-ie,q.resolve(c.events.slice(ie),c)),q.resolveTo&&(c.events=q.resolveTo(c.events,c))}function U(){let q=x(),ie=c.previous,fe=c.currentConstruct,he=c.events.length,xe=Array.from(s);return{from:he,restore:Ce};function Ce(){r=q,c.previous=ie,c.currentConstruct=fe,c.events.length=he,s=xe,N()}}function N(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function vZ(e,t){let n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex,i;if(n===a)i=[e[n].slice(r,o)];else{if(i=e.slice(n,a),r>-1){let s=i[0];typeof s=="string"?i[0]=s.slice(r):i.shift()}o>0&&i.push(e[a].slice(0,o))}return i}function wZ(e,t){let n=-1,r=[],a;for(;++n<e.length;){let o=e[n],i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
11
|
+
`;break}case-3:{i=`\r
|
|
12
|
+
`;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&a)continue;i=" ";break}default:i=String.fromCharCode(o)}a=o===-2,r.push(i)}return r.join("")}function TI(e){let r={constructs:wv([_I,...(e||{}).extensions||[]]),content:a(wP),defined:[],document:a(SP),flow:a(IP),lazy:{},string:a(EP),text:a(_P)};return r;function a(o){return i;function i(s){return RP(r,o,s)}}}function DI(e){for(;!_v(e););return e}var MP=/[\0\t\n\r]/g;function RI(){let e=1,t="",n=!0,r;return a;function a(o,i,s){o=t+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o));let l=[],u=0;for(t="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){MP.lastIndex=u;let c=MP.exec(o),f=c&&c.index!==void 0?c.index:o.length,d=o.charCodeAt(f);if(!c){t=o.slice(u);break}if(d===10&&u===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<f&&(l.push(o.slice(u,f)),e+=f-u),d){case 0:{l.push(65533),e++;break}case 9:{let p=Math.ceil(e/4)*4;for(l.push(-2);e++<p;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=f+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}var kZ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ov(e){return e.replace(kZ,CZ)}function CZ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let a=n.charCodeAt(1),o=a===120||a===88;return kv(n.slice(o?2:1),o?16:10)}return Qd(n)||e}function $l(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?NP(e.position):"start"in e||"end"in e?NP(e):"line"in e||"column"in e?MI(e):""}function MI(e){return OP(e&&e.line)+":"+OP(e&&e.column)}function NP(e){return MI(e&&e.start)+"-"+MI(e&&e.end)}function OP(e){return e&&typeof e=="number"?e:1}var BP={}.hasOwnProperty;function NI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),SZ(n)(DI(TI(n).document().write(RI()(e,t,!0))))}function SZ(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(se),autolinkProtocol:S,autolinkEmail:S,atxHeading:i(ne),blockQuote:i(Dt),characterEscape:S,characterReference:S,codeFenced:i(vt),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(vt,s),codeText:i(I,s),codeTextData:S,data:S,codeFlowValue:S,definition:i(R),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(z),hardBreakEscape:i(j),hardBreakTrailing:i(j),htmlFlow:i(W,s),htmlFlowData:S,htmlText:i(W,s),htmlTextData:S,image:i(Y),label:s,link:i(se),listItem:i(Z),listItemValue:p,listOrdered:i(K,d),listUnordered:i(K),paragraph:i($),reference:at,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(ne),strong:i(te),thematicBreak:i(me)},exit:{atxHeading:u(),atxHeadingSequence:k,autolink:u(),autolinkEmail:Tt,autolinkProtocol:be,blockQuote:u(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:Ut,characterReferenceMarkerNumeric:Ut,characterReferenceValue:ln,characterReference:mt,codeFenced:u(m),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:U,codeIndented:u(y),codeText:u(he),codeTextData:U,data:U,definition:u(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(q),hardBreakTrailing:u(q),htmlFlow:u(ie),htmlFlowData:U,htmlText:u(fe),htmlTextData:U,image:u(Ce),label:D,labelText:Fe,lineEnding:N,link:u(xe),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:yt,resourceDestinationString:st,resourceTitleString:Ke,resource:T,setextHeading:u(M),setextHeadingLineSequence:E,setextHeadingText:_,strong:u(),thematicBreak:u()}};zP(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(P){let G={type:"root",children:[],position:void 0},de={stack:[G],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:f,data:n},ve=[],oe=[],ce=-1;for(;++ce<P.length;)if(oe.push(P[ce]),P[ce][1].type==="listOrdered"||P[ce][1].type==="listUnordered")if(P[ce][0]==="enter")ve.push(oe.length-1);else{let Ee=ve.pop();o(oe,Ee)}for(P=oe,ce=-1;++ce<P.length;){let Ee=t[P[ce][0]];P[ce][0]==="enter"&&t.beforeEnter.length>0&&a(t.beforeEnter,{...de,sliceSerialize:P[ce][2].sliceSerialize},P[ce][1]),BP.call(Ee,P[ce][1].type)&&Ee[P[ce][1].type].call({...de,sliceSerialize:P[ce][2].sliceSerialize},P[ce][1]),P[ce][0]==="exit"&&t.afterExit.length>0&&a(t.afterExit,{...de,sliceSerialize:P[ce][2].sliceSerialize},P[ce][1])}if(de.tokenStack.length>0){let Ee=de.tokenStack[de.tokenStack.length-1];(Ee[1]||PP).call(de,void 0,Ee[0])}for(G.position={start:Gl(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Gl(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},ce=-1;++ce<t.transforms.length;)G=t.transforms[ce](G)||G;return G}function a(P,G,de){let ve=-1;for(;++ve<P.length;)P[ve].call(G,de)}function o(P,G){let de=P.length-1,ve=G-1,oe=-1,ce=!1,Ee,tt,un,Et,Qt=[];for(;++ve<=de;){let Oe=P[ve];switch(Oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Oe[0]==="enter"?oe++:oe--,Et=void 0;break}case"lineEndingBlank":{Oe[0]==="enter"&&(Ee&&!Et&&!oe&&!un&&(un=ve),Et=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Et=void 0}if(!oe&&Oe[0]==="enter"&&Oe[1].type==="listItemPrefix"||oe===-1&&Oe[0]==="exit"&&(Oe[1].type==="listUnordered"||Oe[1].type==="listOrdered")){if(Ee){let et=ve;for(tt=void 0;et--;){let lt=P[et];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;tt&&(P[tt][1].type="lineEndingBlank",ce=!0),lt[1].type="lineEnding",tt=et}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}un&&(!tt||un<tt)&&(Ee._spread=!0),Ee.end=Object.assign({},tt?P[tt][1].start:Oe[1].end),Qt.push({at:tt||ve,event:["exit",Ee,Oe[2]]})}if(Oe[1].type==="listItemPrefix"){let et={type:"listItem",_spread:!1,start:Object.assign({},Oe[1].start),end:void 0};Ee=et,Qt.push({at:ve,event:["enter",et,Oe[2]]}),un=void 0,Et=!0}}}let V=P.splice(G),Le=0;for(ve=-1;++ve<V.length;){for(;Le<Qt.length&&Qt[Le].at===G+ve;)P.push(Qt[Le++].event);P.push(V[ve])}P[G][1]._spread=ce}function i(P,G){return de;function de(ve){l.call(this,P(ve),ve),G&&G.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(P,G,de){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([G,de||void 0]),P.position={start:Gl(G.start),end:void 0}}function u(P){return G;function G(de){P&&P.call(this,de),c.call(this,de)}}function c(P,G){let de=this.stack.pop(),ve=this.tokenStack.pop();if(!ve)throw new Error("Cannot close `"+P.type+"` ("+$l({start:P.start,end:P.end})+"): it\u2019s not open");ve[0].type!==P.type&&(G?G.call(this,P,ve[0]):(ve[1]||PP).call(this,P,ve[0])),de.position.end=Gl(P.end)}function f(){return Es(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(P){if(this.data.expectingFirstListItemValue){let G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function h(){let P=this.resume(),G=this.stack[this.stack.length-1];G.lang=P}function g(){let P=this.resume(),G=this.stack[this.stack.length-1];G.meta=P}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){let P=this.resume(),G=this.stack[this.stack.length-1];G.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let P=this.resume(),G=this.stack[this.stack.length-1];G.value=P.replace(/(\r?\n|\r)$/g,"")}function b(P){let G=this.resume(),de=this.stack[this.stack.length-1];de.label=G,de.identifier=wr(this.sliceSerialize(P)).toLowerCase()}function v(){let P=this.resume(),G=this.stack[this.stack.length-1];G.title=P}function w(){let P=this.resume(),G=this.stack[this.stack.length-1];G.url=P}function k(P){let G=this.stack[this.stack.length-1];if(!G.depth){let de=this.sliceSerialize(P).length;G.depth=de}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function E(P){let G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function S(P){let de=this.stack[this.stack.length-1].children,ve=de[de.length-1];(!ve||ve.type!=="text")&&(ve=le(),ve.position={start:Gl(P.start),end:void 0},de.push(ve)),this.stack.push(ve)}function U(P){let G=this.stack.pop();G.value+=this.sliceSerialize(P),G.position.end=Gl(P.end)}function N(P){let G=this.stack[this.stack.length-1];if(this.data.atHardBreak){let de=G.children[G.children.length-1];de.position.end=Gl(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(S.call(this,P),U.call(this,P))}function q(){this.data.atHardBreak=!0}function ie(){let P=this.resume(),G=this.stack[this.stack.length-1];G.value=P}function fe(){let P=this.resume(),G=this.stack[this.stack.length-1];G.value=P}function he(){let P=this.resume(),G=this.stack[this.stack.length-1];G.value=P}function xe(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let G=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=G,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function Ce(){let P=this.stack[this.stack.length-1];if(this.data.inReference){let G=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=G,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function Fe(P){let G=this.sliceSerialize(P),de=this.stack[this.stack.length-2];de.label=Ov(G),de.identifier=wr(G).toLowerCase()}function D(){let P=this.stack[this.stack.length-1],G=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){let ve=P.children;de.children=ve}else de.alt=G}function st(){let P=this.resume(),G=this.stack[this.stack.length-1];G.url=P}function Ke(){let P=this.resume(),G=this.stack[this.stack.length-1];G.title=P}function T(){this.data.inReference=void 0}function at(){this.data.referenceType="collapsed"}function yt(P){let G=this.resume(),de=this.stack[this.stack.length-1];de.label=G,de.identifier=wr(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function Ut(P){this.data.characterReferenceType=P.type}function ln(P){let G=this.sliceSerialize(P),de=this.data.characterReferenceType,ve;de?(ve=kv(G,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=Qd(G);let oe=this.stack[this.stack.length-1];oe.value+=ve}function mt(P){let G=this.stack.pop();G.position.end=Gl(P.end)}function be(P){U.call(this,P);let G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(P)}function Tt(P){U.call(this,P);let G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(P)}function Dt(){return{type:"blockquote",children:[],position:void 0}}function vt(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function I(){return{type:"inlineCode",value:"",position:void 0}}function R(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function z(){return{type:"emphasis",children:[],position:void 0}}function ne(){return{type:"heading",depth:0,children:[],position:void 0}}function j(){return{type:"break",position:void 0}}function W(){return{type:"html",value:"",position:void 0}}function Y(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function se(){return{type:"link",title:null,url:"",children:[],position:void 0}}function K(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[],position:void 0}}function Z(P){return{type:"listItem",spread:P._spread,checked:null,children:[],position:void 0}}function $(){return{type:"paragraph",children:[],position:void 0}}function te(){return{type:"strong",children:[],position:void 0}}function le(){return{type:"text",value:"",position:void 0}}function me(){return{type:"thematicBreak",position:void 0}}}function Gl(e){return{line:e.line,column:e.column,offset:e.offset}}function zP(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?zP(e,r):LZ(e,r)}}function LZ(e,t){let n;for(n in t)if(BP.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{let r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function PP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$l({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$l({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$l({start:t.start,end:t.end})+") is still open")}function ep(e){let t=this;t.parser=n;function n(r){return NI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Wl=(function(e){if(e==null)return _Z;if(typeof e=="function")return Pv(e);if(typeof e=="object")return Array.isArray(e)?IZ(e):AZ(e);if(typeof e=="string")return EZ(e);throw new Error("Expected function, string, or object as test")});function IZ(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Wl(e[n]);return Pv(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function AZ(e){let t=e;return Pv(n);function n(r){let a=r,o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function EZ(e){return Pv(t);function t(n){return n&&n.type===e}}function Pv(e){return t;function t(n,r,a){return!!(TZ(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function _Z(){return!0}function TZ(e){return e!==null&&typeof e=="object"&&"type"in e}var qg=Wl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);var FP={}.hasOwnProperty;function HP(e,t){let n=t||{};function r(a,...o){let i=r.invalid,s=r.handlers;if(a&&FP.call(a,e)){let l=String(a[e]);i=FP.call(s,l)?s[l]:r.unknown}if(i)return i.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var DZ={}.hasOwnProperty;function OI(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)OI(e,t.extensions[n]);for(r in t)if(DZ.call(t,r))switch(r){case"extensions":break;case"unsafe":{VP(e[r],t[r]);break}case"join":{VP(e[r],t[r]);break}case"handlers":{RZ(e[r],t[r]);break}default:e.options[r]=t[r]}return e}function VP(e,t){t&&e.push(...t)}function RZ(e,t){t&&Object.assign(e,t)}function UP(e,t,n,r){let a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let i=n.indentLines(n.containerFlow(e,o.current()),MZ);return a(),i}function MZ(e,t,n){return">"+(n?"":" ")+e}function Bv(e,t){return qP(e,t.inConstruct,!0)&&!qP(e,t.notInConstruct,!1)}function qP(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function PI(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;){let o=n.unsafe[a];if(o.character===`
|
|
13
|
+
`&&!o.before&&!o.after&&Bv(n.stack,o))return/[\t ]/.test(r.before)?"":" "}return`\\
|
|
14
|
+
`}function jP(e,t){let n=String(e),r=n.indexOf(t),a=r,o=0,i=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>i&&(i=o):o=1,a=r+t.length,r=n.indexOf(t,a);return i}function tp(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function $P(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function GP(e,t,n,r){let a=$P(n),o=e.value||"";if(tp(e,n)){let f=n.enter("codeIndented"),d=n.indentLines(o,NZ);return f(),d}let i=n.createTracker(r),s=a.repeat(Math.max(jP(o,a)+1,3)),l=n.enter("codeFenced"),u=a==="`"?"GraveAccent":"Tilde",c=i.move(s);if(e.lang){let f=n.enter(`codeFencedLang${u}`);c+=i.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...i.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${u}`);c+=i.move(" "),c+=i.move(n.safe(e.meta,{before:c,after:`
|
|
15
|
+
`,encode:["`"],...i.current()})),f()}return c+=i.move(`
|
|
16
|
+
`),o&&(c+=i.move(o+`
|
|
17
|
+
`)),c+=i.move(s),l(),c}function NZ(e,t,n){return(n?"":" ")+e}function np(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function WP(e,t,n,r){let a=np(n),o=a==='"'?"Quote":"Apostrophe",i=n.enter("definition"),s=n.enter("label"),l=n.createTracker(r),u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!e.url||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
18
|
+
`,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),s()),i(),u}function KP(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function jg(e){let t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Sc(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function rp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function BI(e,t,n){let r=qr(e),a=qr(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function $g(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let s=e.charCodeAt(2);return s===45?2:s===91?5:xn(s)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,a=r,o=e.charCodeAt(a);if(!xn(o))return;for(;o===45||Cn(o);)o=e.charCodeAt(++a);let i=e.slice(r,a).toLowerCase();return!n&&o!==47&&Vg.includes(i)?1:Mv.includes(i)?6:7}var YP=new Map([["*",!1],["_",!0]]);function OZ(e,t,n){let r=new Set;for(let o of e){let i=n.get(o);if(i&&o.attention&&t.some(s=>s.attention===o.attention))for(let s of i.tokens)r.add(s.attention)}let a=[];for(let o of e)o.attention&&r.delete(o.attention)&&a.push(o.attention);return a.reverse(),a}function ZP(e,t,n){let r=[],a=new Map,o=new Map,i=0;for(;i<e.length;){if(!e[i].attention){i++;continue}let s=e[i].value.charAt(0),l=YP.get(s),u=i+1;for(;u<e.length&&e[u].attention&&e[u].value.charAt(0)===s;)u++;let c=i?e[i-1].value:t,f=qr(c.charCodeAt(c.length-1)),d=qr((u<e.length?e[u].value:n).charCodeAt(0)),p=!d||d===2&&!!f,h=!f||f===2&&!!d,g={tokens:e.slice(i,u),markers:[],start:0,end:0,open:l?p&&(!!f||!h):p,close:l?h&&(!!d||!p):h,split:l!==void 0};for(let x of g.tokens){a.set(x,[...g.tokens]),o.set(x,g);let m=x.value.length;for(;m--;)g.markers.push(x)}g.end=g.markers.length,r.push(g),i=u}for(BZ(r,a),i=-1;++i<e.length;){let s=a.get(e[i]);if(s)return{attention:OZ(e,s,o),index:i}}}function JP(e,t,n){return Lc(QP(e,t,n),n.before,n.after)}function zv(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?jg(n.value):Sc(n.value),a=rp(r.codePointAt(0));if(t)n.value=a+n.value.slice(r.length);else{let o=n.value.slice(0,n.value.length-r.length),i=0;for(;o.charCodeAt(o.length-1-i)===92;)i++;i%2&&(o+="\\"),n.value=o+a}}function PZ(e,t,n,r,a){for(let o of n.attention){let i=t.get(o)||o.sequences[0];for(let s of o.sequences){if(s===i)continue;let l=new Map(t);l.set(o,s);let u=Fv(e,l,r,a),c=ZP(u,r,a);if(!c||c.index>n.index)return{chosen:l,mistake:c,tokens:u}}}}function BZ(e,t){let n=new Map;for(let r of e){let a=r.tokens[0].value.charAt(0),o=n.get(a);o||(o=[],n.set(a,o));let i=r.close?o.length:0;for(;i--&&r.start<r.end;){let s=o[i],l=s.end-s.start,u=r.end-r.start;if(r.split?(s.close||r.open)&&u%3&&!((l+u)%3):l!==s.markers.length||l!==u)continue;let c=r.split?l>1&&u>1?2:1:u,f=s.markers.slice(s.end-c,s.end),d=r.markers.slice(r.start,r.start+c),p=f[0],h=d[0];if(p===f[c-1]&&p.value.length===c&&h===d[c-1]&&h.value.length===c&&p.attention===h.attention)t.delete(p),t.delete(h);else{let g=[...new Set([...f,...d])];for(let x of g){let m=t.get(x);m&&m.push(...g)}}s.end-=c,r.start+=c,s.start===s.end&&o.splice(i,1),i=o.length}r.open&&r.start<r.end&&o.push(r)}}function zZ(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let a of n)if(!Number.isSafeInteger(a)||a<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+a+"` as size, expected positive integer");let r=[];for(let a of t){if(a.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+a+"` as marker, expected a single ascii character");if(!Cv(a.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+a+"` as marker, expected ascii punctuation");for(let o of n)r.push(a.repeat(o))}return r}function QP(e,t,n){let r=t.indexStack,a=e.children||[],o=[],i=-1,s=n.before;r.push(-1);let l=t.createTracker(n);for(;++i<a.length;){let u=a[i],c;if(r[r.length-1]=i,i+1<a.length){let p=t.handle.handlers[a[i+1].type];p&&p.peek&&(p=p.peek),c=p?jg(p(a[i+1],e,t,{before:"",after:"",...l.current()})):""}else c=n.after;let f=o[o.length-1];typeof f=="string"&&(s==="\r"||s===`
|
|
19
|
+
`)&&u.type==="html"&&$g(u.value)!==7&&(o[o.length-1]=f.replace(/(\r?\n|\r)$/," "),s=" ",l=t.createTracker(n),l.move(Lc(o,n.before,n.after)));let d=t.handle.handlers[u.type];if(d&&d.attention){let p=Gg(u,d.attention,t,l);if(!p)continue;o.push(p),s=Sc(p.sequences[0])}else{let p=t.handle(u,e,t,{...l.current(),after:c,before:s});if(!p)continue;l.move(p),o.push(p),s=Sc(p)}}return r.pop(),o}function Gg(e,t,n,r){let{construct:a,markers:o,sizes:i}=t(e,n),s=zZ(e.type,o,i),l=s[0],u=n.enter(a),c=n.createTracker(r.current());c.move(l);let f=QP(e,n,{...c.current(),before:l,after:l});if(u(),f.length!==0)return r.move(l),r.move(Lc(f,l,l)),r.move(l),{children:f,sequences:s}}function XP(e,t,n,r){let a=Fv(e,t,n,r),o=ZP(a,n,r);for(;o;){let i=PZ(e,t,o,n,r);if(!i)return;t=i.chosen,a=i.tokens,o=i.mistake}return a}function e6(e,t,n,r){let a=n,o=-1;for(;++o<e.length;){let i=e[o];if(typeof i=="string"){a="";continue}let s=o===e.length-1?r:"",l=i.sequences.find(function(u){let c=u.charAt(0);return c!==a.charAt(0)&&c!==s.charAt(0)||e.length===1&&YP.has(c)&&u.length>n.length})||i.sequences[0];l!==i.sequences[0]&&t.set(i,l),e6(i.children,t,l,l),a=l}}function Fv(e,t,n,r){let a=[],o,i=Sc(n),s=-1;for(;++s<e.length;){let l=e[s];if(typeof l=="string"){let b={value:l,attention:void 0};o&&o===jg(l)&&zv([b],!0),o=void 0,a.push(b),b.value&&(i=Sc(b.value));continue}let u=t.get(l)||l.sequences[0],c=u.charAt(0),f=e[s+1],d=i,p=jg(f===void 0?r:typeof f=="string"?f:t.get(f)||f.sequences[0]),h=Fv(l.children,t,u,u),g=h[0].value,x=BI(d.charCodeAt(d.length-1),g.charCodeAt(0),c);x.inside&&zv(h,!0);let m=Sc(h[h.length-1].value),y=BI(p.charCodeAt(0),m.charCodeAt(m.length-1),c);y.inside&&zv(h,!1),x.outside&&d!==`
|
|
20
|
+
`&&d!=="\r"&&zv(a,!1),y.outside&&(o=p),a.push({value:u,attention:l},...h,{value:u,attention:l}),i=u.charAt(u.length-1)}return a}function Lc(e,t,n){let r=new Map;e6(e,r,t,n);let a=(r.size>0?XP(e,r,t,n):void 0)||XP(e,new Map,t,n)||Fv(e,new Map,t,n),o="";for(let i of a)o+=i.value;return o}Hv.attention=t6;Hv.peek=FZ;function Hv(e,t,n,r){let a=n.enter("phrasing"),o=Gg(e,t6,n,n.createTracker(r)),i=o?Lc([o],r.before,r.after):"";return a(),i}function t6(e,t){return{construct:"emphasis",markers:KP(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function FZ(e,t,n){return n.options.emphasis||"*"}var r6=[],Vv=!0,vi=!1,oo="skip";function Kl(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let a=!0,o,i,s,l;if(typeof n=="function"||n&&typeof n=="object"?(o=t,i=n,r&&(a=!1)):(i=t,n&&(a=!1)),typeof i=="function")s=i;else if(i&&typeof i=="object"){if(!(i.enter===null||i.enter===void 0))if(typeof i.enter=="function")s=i.enter;else throw new Error("Unexpected value `"+i.enter+"` for `visitors.enter`, expected optional visitor");if(typeof i.exit=="function")l=i.exit;else throw new Error("Unexpected value `"+i.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+i+"` for `enter` or `visitors`, expected visitor or object with visitors");let u=Wl(o),c=a?1:-1;f(e,void 0,[])();function f(d,p,h){let g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){let m=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(m?"<"+m+">":""))+")"})}return x;function x(){let m=!o||u(d,p,h[h.length-1]||void 0),y=r6;if(s&&m&&(y=n6(s(d,h,p)),y[0]===vi))return y;if("children"in d&&d.children){let b=d;if(b.children&&y[0]!==oo){let v=(a?-1:b.children.length)+c,w=[...h,b];for(;v>-1&&v<b.children.length;){let k=b.children[v],_=f(k,v,w)();if(_[0]===vi)return _;v=typeof _[1]=="number"?_[1]:v+c}}}if(l&&m){let b=n6(l(d,h,p));if(b[0]===oo)throw new Error("Unexpected value `"+b[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(b[0]===vi||typeof b[1]=="number")return b}return y}}}function n6(e){return Array.isArray(e)?e:typeof e=="number"?[Vv,e]:e==null?r6:[e]}function jr(e,t,n,r){let a,o,i;typeof n=="function"||n&&typeof n=="object"?(a=t,o=n,i=r):(o=t,i=n),typeof o=="function"?Kl(e,a,zI(o),i):Kl(e,a,HZ(o),i)}function HZ(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?zI(e.enter):e.enter,exit:typeof e.exit=="function"?zI(e.exit):e.exit}}function zI(e){return t;function t(n,r,a){return e(n,a,r[r.length-1])}}function Uv(e,t){let n=!1;return jr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,vi}),!!((!e.depth||e.depth<3)&&Es(e)&&(t.options.setext||n))}function a6(e,t,n,r){let a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Uv(e,n)){let f=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
|
|
21
|
+
`,after:`
|
|
22
|
+
`});return d(),f(),p+`
|
|
23
|
+
`+(a===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
24
|
+
`))+1))}let i="#".repeat(a),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(i+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
25
|
+
`,...o.current()}),c=u.charCodeAt(0);return(c===9||c===32)&&(u=rp(c)+u.slice(1)),u=u?i+" "+u:i,n.options.closeAtx&&(u+=" "+i),l(),s(),u}FI.peek=VZ;function FI(e){return e.value||""}function VZ(){return"<"}HI.peek=UZ;function HI(e,t,n,r){let a=np(n),o=a==='"'?"Quote":"Apostrophe",i=n.enter("image"),s=n.enter("label"),l=n.createTracker(r),u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/^<|[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),s()),u+=l.move(")"),i(),u}function UZ(){return"!"}VI.peek=qZ;function VI(e,t,n,r){let a=e.referenceType,o=n.enter("imageReference"),i=n.enter("label"),s=n.createTracker(r),l=s.move("!["),u=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=n.stack;n.stack=c.filter(function(d){return d!=="phrasing"}),i=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return i(),n.stack=c,o(),a==="full"||!u||u!==f?l+=s.move(f+"]"):a==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function qZ(){return"!"}UI.peek=jZ;function UI(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let i=n.unsafe[o],s=n.compilePattern(i);if(!i.atBreak)continue;let l;for(;l=s.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return a+r+a}function jZ(){return"`"}function qI(e,t){let n=Es(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jI.peek=$Z;function jI(e,t,n,r){let a=np(n),o=a==='"'?"Quote":"Apostrophe",i=n.createTracker(r);if(qI(e,n)){let h=n.stack;n.stack=h.filter(function(m){return m!=="phrasing"});let g=n.enter("autolink"),x=i.move("<");return x+=i.move(n.containerPhrasing(e,{before:x,after:">",...i.current()})),x+=i.move(">"),g(),n.stack=h,x}let s=n.enter("link"),l=n.enter("label"),u=i.move("["),c=n.containerPhrasing(e,{before:u,after:"](",...i.current()});u+=i.move(c),l(),u+=i.move("](");let f=/^<|[\0- \u007F]/.test(e.url),d=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!f&&(d===`
|
|
26
|
+
`||d==="\r")){let h=0;for(;h<c.length&&c.charCodeAt(h)!==93;)h+=c.charCodeAt(h)===92?2:1;c.charCodeAt(h+1)===58&&(p="")}return!e.url&&typeof p=="string"||f?(l=n.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(n.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(l=n.enter("destinationRaw"),u+=i.move(n.safe(e.url,{before:u,after:typeof p=="string"?" ":")",...i.current()}))),l(),typeof p=="string"&&(l=n.enter(`title${o}`),u+=i.move(" "+a),u+=i.move(n.safe(p,{before:u,after:a,...i.current()})),u+=i.move(a),l()),u+=i.move(")"),s(),u}function $Z(e,t,n){return qI(e,n)?"<":"["}$I.peek=GZ;function $I(e,t,n,r){let a=e.referenceType,o=n.enter("linkReference"),i=n.enter("label"),s=n.createTracker(r),l=s.move("["),u=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),i();let c=n.stack;n.stack=c.filter(function(d){return d!=="phrasing"}),i=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return i(),n.stack=c,o(),a==="full"||!u||u!==f?l+=s.move(f+"]"):a==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function GZ(){return"["}function ap(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function o6(e){let t=ap(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function i6(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function op(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function s6(e,t,n,r){let a=n.enter("list"),o=n.bulletCurrent,i=e.ordered?i6(n):ap(n),s=e.ordered?i==="."?")":".":o6(n),l=t&&n.bulletLastUsed?i===n.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),op(n)===i&&c){let f=-1;for(;++f<e.children.length;){let d=e.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(i=s),n.bulletCurrent=i;let u=n.containerFlow(e,r);return n.bulletLastUsed=i,n.bulletCurrent=o,a(),u}function l6(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function u6(e,t,n,r){let a=l6(n),o=n.bulletCurrent||ap(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let i=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);let s=n.createTracker(r);s.move(o+" ".repeat(i-o.length)),s.shift(i);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),c);return l(),u;function c(f,d,p){return d?(p?"":" ".repeat(i))+f:(p?o:o+" ".repeat(i-o.length))+f}}function c6(e,t,n,r){let a=n.enter("paragraph"),o=n.enter("phrasing"),i=n.containerPhrasing(e,r);return o(),a(),i}function f6(e,t,n,r){if(!e.children.some(function(s){return qg(s)}))return n.containerFlow(e,r);let o=n.enter("phrasing"),i=n.containerPhrasing(e,r);return o(),i}function d6(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}qv.attention=p6;qv.peek=WZ;function qv(e,t,n,r){let a=n.enter("phrasing"),o=Gg(e,p6,n,n.createTracker(r)),i=o?Lc([o],r.before,r.after):"";return a(),i}function p6(e,t){return{construct:"strong",markers:d6(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function WZ(e,t,n){return n.options.strong||"*"}function h6(e,t,n,r){let a=t?t.children:[],o=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:a[o+1],beforeNode:a[o-1]})}function m6(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function g6(e,t,n){let r=(op(n)+(n.options.ruleSpaces?" ":"")).repeat(m6(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Xl={blockquote:UP,break:PI,code:GP,definition:WP,emphasis:Hv,hardBreak:PI,heading:a6,html:FI,image:HI,imageReference:VI,inlineCode:UI,link:jI,linkReference:$I,list:s6,listItem:u6,paragraph:c6,root:f6,strong:qv,text:h6,thematicBreak:g6};var x6=[KZ];function KZ(e,t,n,r){if(t.type==="code"&&tp(t,r)&&(e.type==="list"||e.type===t.type&&tp(e,r)))return!1;if("spread"in n&&typeof n.spread=="boolean"){if(n.spread)return 1;if(e.type==="html"){let o=$g(e.value);if(o===void 0||o===6||o===7)return 1}if(e.type==="blockquote"&&t.type==="blockquote"||(e.type==="definition"||e.type==="paragraph")&&t.type==="list"&&(t.ordered&&typeof t.start=="number"&&t.start!==1||t.children.length>0&&t.children[0].children.length===0)||e.type==="paragraph"&&t.type==="thematicBreak"&&op(r)==="-"&&!r.options.ruleSpaces)return 1;let a=e;for(;(a.type==="blockquote"||a.type==="list"||a.type==="listItem")&&a.children.length>0;)a=a.children[a.children.length-1];if(a.type!=="definition"&&a.type!=="paragraph")return 0;if(t.type==="code"&&tp(t,r))return 1;if(t.type==="html"){let o=$g(t.value);if(o===void 0||o===7)return 1}return(e.type==="paragraph"||e!==a)&&(t.type==="definition"||t.type==="heading"&&Uv(t,r)||t.type==="paragraph")?1:0}}var Ic=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],GI=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
27
|
+
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\r",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\r",after:"\\r",inConstruct:"phrasing"},{character:`
|
|
28
|
+
`,before:"\\n",inConstruct:"phrasing"},{character:`
|
|
29
|
+
`,after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ic},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
30
|
+
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","destinationRaw","phrasing","titleApostrophe","titleQuote"]},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ic},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
31
|
+
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ic},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
32
|
+
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
33
|
+
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
34
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ic},{character:"<",inConstruct:"destinationLiteral"},{character:"<",before:"[( ]",inConstruct:"destinationRaw"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ic},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ic},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ic},{atBreak:!0,character:"~"},{character:"<",inConstruct:"autolink"},{character:">",inConstruct:"autolink"},{character:"\x7F",inConstruct:"autolink"}],b6=-1;for(;++b6<33;)GI.push({character:String.fromCharCode(b6),inConstruct:"autolink"});function y6(e){return e.label||!e.identifier?e.label||"":Ov(e.identifier)}function v6(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((e.beforeNode?"^":t?"("+t+")":"")+(/[$()*+.?[\\\]^{|}]/.test(e.character)?"\\":"")+e.character+(e.afterNode?"$":e.after?"(?:"+e.after+")":""),e.unicode?"gu":"g")}return e._compiled}function w6(e,t,n){let r=t.indexStack,a=e.children||[],o=t.createTracker(n),i=[],s=-1;for(r.push(-1);++s<a.length;){let l=a[s];r[r.length-1]=s,i.push(o.move(t.handle(l,e,t,{before:`
|
|
35
|
+
`,after:`
|
|
36
|
+
`,...o.current()}))),l.type!=="list"&&(t.bulletLastUsed=void 0),s<a.length-1&&i.push(o.move(XZ(l,a[s+1],e,t)))}return r.pop(),i.join("")}function XZ(e,t,n,r){let a=r.join.length;for(;a--;){let o=r.join[a](e,t,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
37
|
+
`.repeat(1+o);if(o===!1)return`
|
|
38
|
+
|
|
39
|
+
<!---->
|
|
40
|
+
|
|
41
|
+
`}return`
|
|
42
|
+
|
|
43
|
+
`}var YZ=/\r?\n|\r/g;function k6(e,t){let n=[],r=0,a=0,o;for(;o=YZ.exec(e);)i(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,a++;return i(e.slice(r)),n.join("");function i(s){n.push(t(s,a,!s))}}var WI={}.hasOwnProperty;function L6(e,t,n){let r=(n.before||"")+(t||"")+(n.after||""),a=[],o=[],i={},s=e.stack.includes("autolink"),l=n.before?n.before.length:0,u=r.length-(n.after?n.after.length:0),c=-1;for(;++c<e.unsafe.length;){let p=e.unsafe[c];if(!Bv(e.stack,p)||!C6(p.beforeNode,n.beforeNode)||!C6(p.afterNode,n.afterNode))continue;let h=e.compilePattern(p),g=p.beforeNode?l:0,x=r.slice(g,p.afterNode?u:void 0),m;for(;m=h.exec(x);){let y=!!(p.before||p.atBreak),b=!!p.after,v=g+m.index+(y?m[1].length:0);WI.call(i,v)?(i[v].before&&!y&&(i[v].before=!1),i[v].after&&!b&&(i[v].after=!1)):(a.push(v),i[v]={before:y,after:b})}}a.sort(ZZ);let f=l;for(c=-1;++c<a.length;){let p=a[c];if(!(p<f||p>=u)){if(r.charAt(p)==="_"&&p>0&&qr(r.charCodeAt(p-1))===void 0&&!WI.call(i,p-1)&&!(p-1===l&&/[*_]/.test(r.charAt(l-1)))){let h=p+1;for(;h<u&&r.charAt(h)==="_";)h++;let g=h-p-1;if(a[c+g]===h-1&&h<r.length&&qr(r.charCodeAt(h))===void 0&&!WI.call(i,h)&&!(h===u-1&&/[*_]/.test(r.charAt(u)))){c+=g;continue}}if(!(p+1<u&&a[c+1]===p+1&&i[p].after&&!i[p+1].before&&!i[p+1].after||p-1>=l&&a[c-1]===p-1&&i[p].before&&!i[p-1].before&&!i[p-1].after)){if(f!==p){let h=r.slice(f,p);o.push(s?h:S6(h,"\\"))}f=p+1,s?o.push("%"+r.charCodeAt(p).toString(16).toUpperCase().padStart(2,"0")):/[!-/:-@[-`{-~]/.test(r.charAt(p))&&(!n.encode||!n.encode.includes(r.charAt(p)))?o.push("\\"+r.charAt(p)):o.push(rp(r.charCodeAt(p)))}}}let d=r.slice(f,u);return o.push(s?d:S6(d,n.after)),o.join("")}function C6(e,t){return e?t?typeof e=="string"?e===t.type:e.includes(t.type):!1:!0}function ZZ(e,t){return e-t}function S6(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],a=[],o=e+t,i=-1,s=0,l;for(;l=n.exec(o);)r.push(l.index);for(;++i<r.length;)s!==r[i]&&a.push(e.slice(s,r[i])),a.push("\\"),s=r[i];return a.push(e.slice(s)),a.join("")}function I6(e){let t=e||{},n=t.now||{},r=t.lineShift||0,a=n.line||1,o=n.column||1;return{move:l,current:i,shift:s};function i(){return{now:{line:a,column:o},lineShift:r}}function s(u){r+=u}function l(u){let c=u||"",f=c.split(/\r?\n|\r/g),d=f[f.length-1];return a+=f.length-1,o=f.length===1?o+d.length:1+d.length+r,c}}function KI(e,t){let n=t||{},r={associationId:y6,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:tJ,containerFlow:nJ,createTracker:I6,compilePattern:v6,enter:o,handlers:{...Xl},handle:void 0,indentLines:k6,indexStack:[],join:[...x6],options:{},safe:rJ,stack:[],unsafe:[...GI]};OI(r,n),r.options.tightDefinitions&&r.join.push(eJ),r.handle=HP("type",{invalid:JZ,unknown:QZ,handlers:r.handlers});let a=r.handle(qg(e)?{type:"root",children:[e]}:e,void 0,r,{before:`
|
|
44
|
+
`,after:`
|
|
45
|
+
`,now:{line:1,column:1},lineShift:0});return a&&a.charCodeAt(a.length-1)!==10&&a.charCodeAt(a.length-1)!==13&&(a+=`
|
|
46
|
+
`),a;function o(i){return r.stack.push(i),s;function s(){r.stack.pop()}}}function JZ(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function QZ(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function eJ(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function tJ(e,t){return JP(e,this,t)}function nJ(e,t){return w6(e,this,t)}function rJ(e,t){return L6(this,e,t)}function ip(e){let t=this;t.compiler=n;function n(r){return KI(r,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function XI(e){if(e)throw e}var Gv=gr(O6(),1);function Wg(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function YI(){let e=[],t={run:n,use:r};return t;function n(...a){let o=-1,i=a.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);s(null,...a);function s(l,...u){let c=e[++o],f=-1;if(l){i(l);return}for(;++f<a.length;)(u[f]===null||u[f]===void 0)&&(u[f]=a[f]);a=u,c?P6(c,s)(...u):i(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function P6(e,t){let n;return r;function r(...i){let s=e.length>i.length,l;s&&i.push(a);try{l=e.apply(this,i)}catch(u){let c=u;if(s&&n)throw c;return a(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,a):l instanceof Error?a(l):o(l))}function a(i,...s){n||(n=!0,t(i,...s))}function o(i){a(null,i)}}var sp=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},i=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(i=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=s?s.line:void 0,this.name=$l(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(sp.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var To={basename:aJ,dirname:oJ,extname:iJ,join:sJ,sep:"/"};function aJ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kg(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,s=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else i<0&&(o=!0,i=a+1),s>-1&&(e.codePointAt(a)===t.codePointAt(s--)?s<0&&(r=a):(s=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function oJ(e){if(Kg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function iJ(e){Kg(e);let t=e.length,n=-1,r=0,a=-1,o=0,i;for(;t--;){let s=e.codePointAt(t);if(s===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),s===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function sJ(...e){let t=-1,n;for(;++t<e.length;)Kg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lJ(n)}function lJ(e){Kg(e);let t=e.codePointAt(0)===47,n=uJ(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uJ(e,t){let n="",r=0,a=-1,o=0,i=-1,s,l;for(;++i<=e.length;){if(i<e.length)s=e.codePointAt(i);else{if(s===47)break;s=47}if(s===47){if(!(a===i-1||o===1))if(a!==i-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=i,o=0;continue}}else if(n.length>0){n="",r=0,a=i,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,i):n=e.slice(a+1,i),r=i-a-1;a=i,o=0}else s===46&&o>-1?o++:o=-1}return n}function Kg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var B6={cwd:cJ};function cJ(){return"/"}function lp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function z6(e){if(typeof e=="string")e=new URL(e);else if(!lp(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return fJ(e)}function fJ(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let r=t.codePointAt(n+2);if(r===70||r===102){let a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}var ZI=["history","path","basename","stem","extname","dirname"],Xg=class{constructor(t){let n;t?lp(t)?n={path:t}:typeof t=="string"||dJ(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":B6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ZI.length;){let o=ZI[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)ZI.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?To.basename(this.path):void 0}set basename(t){QI(t,"basename"),JI(t,"basename"),this.path=To.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?To.dirname(this.path):void 0}set dirname(t){F6(this.basename,"dirname"),this.path=To.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?To.extname(this.path):void 0}set extname(t){if(JI(t,"extname"),F6(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=To.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){lp(t)&&(t=z6(t)),QI(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?To.basename(this.path,this.extname):void 0}set stem(t){QI(t,"stem"),JI(t,"stem"),this.path=To.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){let a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){let a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){let a=new sp(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function JI(e,t){if(e&&e.includes(To.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+To.sep+"`")}function QI(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function F6(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function dJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var H6=(function(e){let r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o});var pJ={}.hasOwnProperty,rA=class e extends H6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=YI()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let r=this.attachers[n];t.use(...r)}return t.data((0,Gv.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nA("data",this.frozen),this.namespace[t]=n,this):pJ.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nA("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=$v(t),r=this.parser||this.Parser;return eA("parse",r),r(String(n),n)}process(t,n){let r=this;return this.freeze(),eA("process",this.parser||this.Parser),tA("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,i){let s=$v(t),l=r.parse(s);r.run(l,s,function(c,f,d){if(c||!f||!d)return u(c);let p=f,h=r.stringify(p,d);mJ(h)?d.value=h:d.result=h,u(c,d)});function u(c,f){c||!f?i(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),eA("processSync",this.parser||this.Parser),tA("processSync",this.compiler||this.Compiler),this.process(t,a),U6("processSync","process",n),r;function a(o,i){n=!0,XI(o),r=i}}run(t,n,r){V6(t),this.freeze();let a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(i,s){let l=$v(n);a.run(t,l,u);function u(c,f,d){let p=f||t;c?s(c):i?i(p):r(void 0,p,d)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),U6("runSync","run",r),a;function o(i,s){XI(i),a=s,r=!0}}stringify(t,n){this.freeze();let r=$v(n),a=this.compiler||this.Compiler;return tA("stringify",a),V6(t),a(t,r)}use(t,...n){let r=this.attachers,a=this.namespace;if(nA("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[c,...f]=u;l(c,f)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(a.settings=(0,Gv.default)(!0,a.settings,u.settings))}function s(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){let f=u[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===u){d=f;break}if(d===-1)r.push([u,...c]);else if(c.length>0){let[p,...h]=c,g=r[d][1];Wg(g)&&Wg(p)&&(p=(0,Gv.default)(!0,g,p)),r[d]=[u,p,...h]}}}},Yg=new rA().freeze();function eA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nA(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function V6(e){if(!Wg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function U6(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function $v(e){return hJ(e)?e:new Xg(e)}function hJ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mJ(e){return typeof e=="string"||gJ(e)}function gJ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Cr(e){this.content=e}Cr.prototype={constructor:Cr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,a=r.find(e),o=r.content.slice();return a==-1?o.push(n||e,t):(o[a+1]=t,n&&(o[a]=n)),new Cr(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Cr(n)},addToStart:function(e,t){return new Cr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Cr(n)},addBefore:function(e,t,n){var r=this.remove(t),a=r.content.slice(),o=r.find(e);return a.splice(o==-1?a.length:o,0,t,n),new Cr(a)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Cr.from(e),e.size?new Cr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Cr.from(e),e.size?new Cr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Cr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Cr.from=function(e){if(e instanceof Cr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Cr(t)};var aA=Cr;function eB(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let a=e.child(r),o=t.child(r);if(a==o){n+=a.nodeSize;continue}if(!a.sameMarkup(o))return n;if(a.isText&&a.text!=o.text){let i=a.text,s=o.text,l=0;for(;i[l]==s[l];l++)n++;return l&&l<i.length&&l<s.length&&rB(i.charCodeAt(l-1))&&nB(i.charCodeAt(l))&&n--,n}if(a.content.size||o.content.size){let i=eB(a.content,o.content,n+1);if(i!=null)return i}n+=a.nodeSize}}function tB(e,t,n,r){for(let a=e.childCount,o=t.childCount;;){if(a==0||o==0)return a==o?null:{a:n,b:r};let i=e.child(--a),s=t.child(--o),l=i.nodeSize;if(i==s){n-=l,r-=l;continue}if(!i.sameMarkup(s))return{a:n,b:r};if(i.isText&&i.text!=s.text){let u=i.text,c=s.text,f=u.length,d=c.length;for(;f>0&&d>0&&u[f-1]==c[d-1];)f--,d--,n--,r--;return f&&d&&f<u.length&&rB(u.charCodeAt(f-1))&&nB(u.charCodeAt(f))&&(n++,r++),{a:n,b:r}}if(i.content.size||s.content.size){let u=tB(i.content,s.content,n-1,r-1);if(u)return u}n-=l,r-=l}}function nB(e){return e>=56320&&e<57344}function rB(e){return e>=55296&&e<56320}var re=class e{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,a=0,o){for(let i=0,s=0;s<n;i++){let l=this.content[i],u=s+l.nodeSize;if(u>t&&r(l,a+s,o||null,i)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,a+c)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,a){let o="",i=!0;return this.nodesBetween(t,n,(s,l)=>{let u=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?a?typeof a=="function"?a(s):a:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&r&&(i?i=!1:o+=r),o+=u},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,a=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(a[a.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)a.push(t.content[o]);return new e(a,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],a=0;if(n>t)for(let o=0,i=0;i<n;o++){let s=this.content[o],l=i+s.nodeSize;l>t&&((i<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-i),Math.min(s.text.length,n-i)):s=s.cut(Math.max(0,t-i-1),Math.min(s.content.size,n-i-1))),r.push(s),a+=s.nodeSize),i=l}return new e(r,a)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let a=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return a[t]=n,new e(a,o)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let a=this.content[n];t(a,r,n),r+=a.nodeSize}}findDiffStart(t,n=0){return eB(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return tB(this,t,n,r)}findIndex(t){if(t==0)return Wv(0,t);if(t==this.size)return Wv(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let a=this.child(n),o=r+a.nodeSize;if(o>=t)return o==t?Wv(n+1,o):Wv(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let a=0;a<t.length;a++){let o=t[a];r+=o.nodeSize,a&&o.isText&&t[a-1].sameMarkup(o)?(n||(n=t.slice(0,a)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};re.empty=new re([],0);var oA={index:0,offset:0};function Wv(e,t){return oA.index=e,oA.offset=t,oA}function Yv(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Yv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Yv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}var Ye=class e{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let a=0;a<t.length;a++){let o=t[a];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,a));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,a)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Yv(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((r,a)=>r.type.rank-a.type.rank),n}};Ye.none=[];var Yl=class extends Error{},ue=class e{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=oB(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(aB(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,a=n.openEnd||0;if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new e(re.fromJSON(t,n.content),r,a)}static maxOpen(t,n=!0){let r=0,a=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)a++;return new e(t,r,a)}};ue.empty=new ue(re.empty,0,0);function aB(e,t,n){let{index:r,offset:a}=e.findIndex(t),o=e.maybeChild(r),{index:i,offset:s}=e.findIndex(n);if(a==t||o.isText){if(s!=n&&!e.child(i).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(aB(o.content,t-a-1,n-a-1)))}function oB(e,t,n,r,a,o){let{index:i,offset:s}=e.findIndex(t),l=e.maybeChild(i);if(s==t||l.isText)return o&&r<=0&&a<=0&&!o.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=oB(l.content,t-s-1,n,i==0?r-1:0,i==e.childCount-1?a-1:0,l);return u&&e.replaceChild(i,l.copy(u))}function xJ(e,t,n){if(n.openStart>e.depth)throw new Yl("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Yl("Inconsistent open depths");return iB(e,t,n,0)}function iB(e,t,n,r){let a=e.index(r),o=e.node(r);if(a==t.index(r)&&r<e.depth-n.openStart){let i=iB(e,t,n,r+1);return o.copy(o.content.replaceChild(a,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let i=e.parent,s=i.content;return Ec(i,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:i,end:s}=bJ(n,e);return Ec(o,lB(e,i,s,t,r))}else return Ec(o,Zv(e,t,r))}function sB(e,t){if(!t.type.compatibleContent(e.type))throw new Yl("Cannot join "+t.type.name+" onto "+e.type.name)}function iA(e,t,n){let r=e.node(n);return sB(r,t.node(n)),r}function Ac(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Zg(e,t,n,r){let a=(t||e).node(n),o=0,i=t?t.index(n):a.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Ac(e.nodeAfter,r),o++));for(let s=o;s<i;s++)Ac(a.child(s),r);t&&t.depth==n&&t.textOffset&&Ac(t.nodeBefore,r)}function Ec(e,t){if(!e.type.validContent(t))throw new Yl("Invalid content for node "+e.type.name);return e.copy(t)}function lB(e,t,n,r,a){let o=e.depth>a&&iA(e,t,a+1),i=r.depth>a&&iA(n,r,a+1),s=[];return Zg(null,e,a,s),o&&i&&t.index(a)==n.index(a)?(sB(o,i),Ac(Ec(o,lB(e,t,n,r,a+1)),s)):(o&&Ac(Ec(o,Zv(e,t,a+1)),s),Zg(t,n,a,s),i&&Ac(Ec(i,Zv(n,r,a+1)),s)),Zg(r,null,a,s),new re(s)}function Zv(e,t,n){let r=[];if(Zg(null,e,n,r),e.depth>n){let a=iA(e,t,n+1);Ac(Ec(a,Zv(e,t,n+1)),r)}return Zg(t,null,n,r),new re(r)}function bJ(e,t){let n=t.depth-e.openStart,a=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)a=t.node(o).copy(re.from(a));return{start:a.resolveNoCache(e.openStart+n),end:a.resolveNoCache(a.content.size-e.openEnd-n)}}var Jv=class e{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],a=t.child(n);return r?t.child(n).cut(r):a}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],a=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)a+=r.child(o).nodeSize;return a}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ye.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),a=t.maybeChild(n);if(!r){let s=r;r=a,a=s}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!a||!o[i].isInSet(a.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,a=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!a||!r[o].isInSet(a.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qg(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],a=0,o=n;for(let i=t;;){let{index:s,offset:l}=i.content.findIndex(o),u=o-l;if(r.push(i,s,a+l),!u||(i=i.child(s),i.isText))break;o=u-1,a+=l+1}return new e(n,r,o)}static resolveCached(t,n){let r=q6.get(t);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==n)return i}else q6.set(t,r=new sA);let a=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%yJ,a}},sA=class{constructor(){this.elts=[],this.i=0}},yJ=12,q6=new WeakMap,Qg=class{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}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)}},vJ=Object.create(null),da=class e{constructor(t,n,r,a=Ye.none){this.type=t,this.attrs=n,this.marks=a,this.content=r||re.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,a=0){this.content.nodesBetween(t,n,r,a,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,a){return this.content.textBetween(t,n,r,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Yv(this.attrs,n||t.defaultAttrs||vJ)&&Ye.sameSet(this.marks,r||Ye.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ue.empty;let a=this.resolve(t),o=this.resolve(n),i=r?0:a.sharedDepth(n),s=a.start(i),u=a.node(i).content.cut(a.pos-s,o.pos-s);return new ue(u,a.depth-i,o.depth-i)}replace(t,n,r){return xJ(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:a}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(a==t||n.isText)return n;t-=a+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let a=this.content.child(n-1);return{node:a,index:n-1,offset:r-a.nodeSize}}resolve(t){return Jv.resolveCached(this,t)}resolveNoCache(t){return Jv.resolve(this,t)}rangeHasMark(t,n,r){let a=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(a=!0),!a)),a}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),uB(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=re.empty,a=0,o=r.childCount){let i=this.contentMatchAt(t).matchFragment(r,a,o),s=i&&i.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=a;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,a){if(a&&!this.type.allowsMarks(a))return!1;let o=this.contentMatchAt(t).matchType(r),i=o&&o.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),$6(this.type.attrs,this.attrs,"node",this.type.name);let t=Ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];$6(r.type.attrs,r.attrs,"mark",r.type.name),t=r.addToSet(t)}if(!Ye.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let a=re.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,a,r)}};da.prototype.text=void 0;var j6=(()=>{let{stack:e}=new Error("/");if(!e||!/\n\s*at\s/.test(e))return n=>n;let t=Object.create(null);return n=>(t[n],n)})(),lA=class e extends da{constructor(t,n,r,a){if(super(t,n,null,a),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uB(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return j6(this.text.slice(t,n))}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(j6(this.text.slice(t,n)))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}};function uB(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function $6(e,t,n,r){for(let a in t)if(!(a in e))throw new RangeError(`Unsupported attribute ${a} for ${n} of type ${r}`);for(let a in e)e[a].validate&&e[a].validate(t[a])}var _c=class e{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new uA(t,n);if(r.next==null)return e.empty;let a=cB(r);r.next&&r.err("Unexpected trailing text");let o=AJ(IJ(a));return EJ(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let a=this;for(let o=n;a&&o<r;o++)a=a.matchType(t.child(o).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let a=[this];function o(i,s){let l=i.matchFragment(t,r);if(l&&(!n||l.validEnd))return re.from(s.map(u=>u.createAndFill()));for(let u=0;u<i.next.length;u++){let{type:c,next:f}=i.next[u];if(!(c.isText||c.hasRequiredAttrs())&&a.indexOf(f)==-1){a.push(f);let d=o(f,s.concat(c));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let a=r.shift(),o=a.match;if(o.matchType(t)){let i=[];for(let s=a;s.type;s=s.via)i.push(s.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:s,next:l}=o.next[i];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!a.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:a}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let a=0;a<r.next.length;a++)t.indexOf(r.next[a].next)==-1&&n(r.next[a].next)}return n(this),t.map((r,a)=>{let o=a+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+t.indexOf(r.next[i].next);return o}).join(`
|
|
47
|
+
`)}};_c.empty=new _c(!0);var uA=class{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}};function cB(e){let t=[];do t.push(wJ(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function wJ(e){let t=[];do t.push(kJ(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function kJ(e){let t=LJ(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=CJ(e,t);else break;return t}function G6(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function CJ(e,t){let n=G6(e),r=n;return e.eat(",")&&(e.next!="}"?r=G6(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function SJ(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let a=[];for(let o in n){let i=n[o];i.isInGroup(t)&&a.push(i)}return a.length==0&&e.err("No node type or group '"+t+"' found"),a}function LJ(e){if(e.eat("(")){let t=cB(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=SJ(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function IJ(e){let t=[[]];return a(o(e,0),n()),t;function n(){return t.push([])-1}function r(i,s,l){let u={term:l,to:s};return t[i].push(u),u}function a(i,s){i.forEach(l=>l.to=s)}function o(i,s){if(i.type=="choice")return i.exprs.reduce((l,u)=>l.concat(o(u,s)),[]);if(i.type=="seq")for(let l=0;;l++){let u=o(i.exprs[l],s);if(l==i.exprs.length-1)return u;a(u,s=n())}else if(i.type=="star"){let l=n();return r(s,l),a(o(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return a(o(i.expr,s),l),a(o(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(s)].concat(o(i.expr,s));if(i.type=="range"){let l=s;for(let u=0;u<i.min;u++){let c=n();a(o(i.expr,l),c),l=c}if(i.max==-1)a(o(i.expr,l),l);else for(let u=i.min;u<i.max;u++){let c=n();r(l,c),a(o(i.expr,l),c),l=c}return[r(l)]}else{if(i.type=="name")return[r(s,void 0,i.value)];throw new Error("Unknown expr type")}}}}function fB(e,t){return t-e}function W6(e,t){let n=[];return r(t),n.sort(fB);function r(a){let o=e[a];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(a);for(let i=0;i<o.length;i++){let{term:s,to:l}=o[i];!s&&n.indexOf(l)==-1&&r(l)}}}function AJ(e){let t=Object.create(null);return n(W6(e,0));function n(r){let a=[];r.forEach(i=>{e[i].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let c=0;c<a.length;c++)a[c][0]==s&&(u=a[c][1]);W6(e,l).forEach(c=>{u||a.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=t[r.join(",")]=new _c(r.indexOf(e.length-1)>-1);for(let i=0;i<a.length;i++){let s=a[i][1].sort(fB);o.next.push({type:a[i][0],next:t[s.join(",")]||n(s)})}return o}}function EJ(e,t){for(let n=0,r=[e];n<r.length;n++){let a=r[n],o=!a.validEnd,i=[];for(let s=0;s<a.next.length;s++){let{type:l,next:u}=a.next[s];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function dB(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function pB(e,t){let n=Object.create(null);for(let r in e){let a=e[r],o=t&&t[r];if(o===void 0)if(a.hasDefault)o=a.default;else throw new RangeError("No value supplied for attribute "+r);else a.validate&&a.validate(o);n[r]=o}return n}function hB(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new cA(e,r,t[r]);return n}var io=class e{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=hB(t,r.attrs),this.defaultAttrs=dB(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_c.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:pB(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new da(this,this.computeAttrs(t),re.from(n),Ye.setFrom(r))}createChecked(t=null,n,r){return n=re.from(n),this.checkContent(n),new da(this,this.computeAttrs(t),n,Ye.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=re.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let a=this.contentMatch.matchFragment(n),o=a&&a.fillBefore(re.empty,!0);return o?new da(this,t,n.append(o),Ye.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ye.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,i)=>r[o]=new e(o,n,i));let a=n.spec.topNode||"doc";if(!r[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function _J(e,t,n){let r=n.split("|");return a=>{let o=a===null?"null":typeof a;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}var cA=class{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?_J(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},ex=class e{constructor(t,n,r,a){this.name=t,this.rank=n,this.schema=r,this.spec=a,this.attrs=hB(t,a.attrs),this.excluded=null;let o=dB(this.attrs);this.instance=o?new Ye(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ye(this,pB(this.attrs,t))}static compile(t,n){let r=Object.create(null),a=0;return t.forEach((o,i)=>r[o]=new e(o,a++,n,i)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}},Qv=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let a in t)n[a]=t[a];n.nodes=aA.from(t.nodes),n.marks=aA.from(t.marks||{}),this.nodes=io.compile(this.spec.nodes,this),this.marks=ex.compile(this.spec.marks,this);let r=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let o=this.nodes[a],i=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[i]||(r[i]=_c.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?K6(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let a in this.marks){let o=this.marks[a],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:K6(this,i.split(" "))}this.nodeFromJSON=a=>da.fromJSON(this,a),this.markFromJSON=a=>Ye.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,a){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof io){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,a)}text(t,n){let r=this.nodes.text;return new lA(r,r.defaultAttrs,t,Ye.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function K6(e,t){let n=[];for(let r=0;r<t.length;r++){let a=t[r],o=e.marks[a],i=o;if(o)n.push(o);else for(let s in e.marks){let l=e.marks[s];(a=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(a)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function TJ(e){return e.tag!=null}function DJ(e){return e.style!=null}var wi=class e{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(a=>{if(TJ(a))this.tags.push(a);else if(DJ(a)){let o=/[^=]*/.exec(a.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let o=t.nodes[a.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new ew(this,n,!1);return r.addAll(t,Ye.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new ew(this,n,!0);return r.addAll(t,Ye.none,n.from,n.to),ue.maxOpen(r.finish())}matchTag(t,n,r){for(let a=r?this.tags.indexOf(r)+1:0;a<this.tags.length;a++){let o=this.tags[a];if(NJ(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(t);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(t,n,r,a){for(let o=a?this.styles.indexOf(a)+1:0;o<this.styles.length;o++){let i=this.styles[o],s=i.style;if(!(s.indexOf(t)!=0||i.context&&!r.matchesContext(i.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(t){let n=[];function r(a){let o=a.priority==null?50:a.priority,i=0;for(;i<n.length;i++){let s=n[i];if((s.priority==null?50:s.priority)<o)break}n.splice(i,0,a)}for(let a in t.marks){let o=t.marks[a].spec.parseDOM;o&&o.forEach(i=>{r(i=Y6(i)),i.mark||i.ignore||i.clearMark||(i.mark=a)})}for(let a in t.nodes){let o=t.nodes[a].spec.parseDOM;o&&o.forEach(i=>{r(i=Y6(i)),i.node||i.ignore||i.mark||(i.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},mB={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},RJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gB={ol:!0,ul:!0},tx=1,fA=2,Jg=4;function X6(e,t,n){return t!=null?(t?tx:0)|(t==="full"?fA:0):e&&e.whitespace=="pre"?tx|fA:n&~Jg}var up=class{constructor(t,n,r,a,o,i){this.type=t,this.attrs=n,this.marks=r,this.solid=a,this.options=i,this.content=[],this.activeMarks=Ye.none,this.match=o||(i&Jg?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(re.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,a;return(a=r.findWrapping(t.type))?(this.match=r,a):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&tx)){let r=this.content[this.content.length-1],a;if(r&&r.isText&&(a=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-a[0].length))}}let n=re.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(re.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!mB.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}},ew=class{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let a=n.topNode,o,i=X6(null,n.preserveWhitespace,0)|(r?Jg:0);a?o=new up(a.type,a.attrs,Ye.none,!0,n.topMatch||a.type.contentMatch,i):r?o=new up(null,null,Ye.none,!0,null,i):o=new up(t.schema.topNodeType,null,Ye.none,!0,null,i),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,a=this.top,o=a.options&fA?"full":this.localPreserveWS||(a.options&tx)>0,{schema:i}=this.parser;if(o==="full"||a.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
48
|
+
`);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let s=r.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(i.linebreakReplacement.create(),n,!0),s[l]&&this.insertNode(i.text(s[l]),n,!/\S/.test(s[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=a.content[a.content.length-1],l=t.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let a=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let i=t.nodeName.toLowerCase(),s;gB.hasOwnProperty(i)&&this.parser.normalizeLists&&MJ(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:RJ.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,c=this.needsBlock;if(mB.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),u&&this.sync(o),this.needsBlock=c}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=a}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
49
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let o=this.parser.matchedStyles[a],i=r.getPropertyValue(o);if(i)for(let s=void 0;;){let l=this.parser.matchStyle(o,i,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(t,n,r,a){let o,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(i,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(a)this.addElement(t,r,a);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(s)&&this.open--}addAll(t,n,r,a){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=a==null?null:t.childNodes[a];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i,n);this.findAtPoint(t,o)}findPlace(t,n,r){let a,o;for(let i=this.open,s=0;i>=0;i--){let l=this.nodes[i],u=l.findWrapping(t);if(u&&(!a||a.length>u.length+s)&&(a=u,o=l,!u.length))break;if(l.solid){if(r)break;s+=2}}if(!a)return null;this.sync(o);for(let i=0;i<a.length;i++)n=this.enterInner(a[i],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let a=this.findPlace(t,n,r);if(a){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let i=Ye.none;for(let s of a.concat(t.marks))(o.type?o.type.allowsMarkType(s.type):Z6(s.type,t.type))&&(i=s.addToSet(i));return o.content.push(t.mark(i)),!0}return!1}enter(t,n,r,a){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,a)),o}enterInner(t,n,r,a=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(t);let s=X6(t,o,i.options);i.options&Jg&&i.content.length==0&&(s|=Jg);let l=Ye.none;return r=r.filter(u=>(i.type?i.type.allowsMarkType(u.type):Z6(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new up(t,n,l,a,null,s)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=tx)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let a=r.length-1;a>=0;a--)t+=r[a].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&t.nodeType==1&&t.contains(this.find[a].node)&&n.compareDocumentPosition(this.find[a].node)&(r?2:4)&&(this.find[a].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,a=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(a?0:1),i=(s,l)=>{for(;s>=0;s--){let u=n[s];if(u==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(i(s-1,l))return!0;return!1}else{let c=l>0||l==0&&a?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function MJ(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&gB.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function NJ(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Y6(e){let t={};for(let n in e)t[n]=e[n];return t}function Z6(e,t){let n=t.schema.nodes;for(let r in n){let a=n[r];if(!a.allowsMarkType(e))continue;let o=[],i=s=>{o.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:c}=s.edge(l);if(u==t||o.indexOf(c)<0&&i(c))return!0}};if(i(a.contentMatch))return!0}}var ki=class e{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Kv(n).createDocumentFragment());let a=r,o=[];return t.forEach(i=>{if(o.length||i.marks.length){let s=0,l=0;for(;s<o.length&&l<i.marks.length;){let u=i.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)a=o.pop()[1];for(;l<i.marks.length;){let u=i.marks[l++],c=this.serializeMark(u,i.isInline,n);c&&(o.push([u,a]),a.appendChild(c.dom),a=c.contentDOM||c.dom)}}a.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(t,n){if(t.isText)return Kv(n).createTextNode(t.text);let{dom:r,contentDOM:a}=Xv(Kv(n),this.nodes[t.type.name](t),null,t.attrs);if(a){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,a)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let a=t.marks.length-1;a>=0;a--){let o=this.serializeMark(t.marks[a],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let a=this.marks[t.type.name];return a&&Xv(Kv(r),a(t,n),null,t.attrs)}static renderSpec(t,n,r=null,a){return typeof n=="string"?{dom:t.createTextNode(n)}:Xv(t,n,r,a)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=J6(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return J6(t.marks)}};function J6(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Kv(e){return e.document||window.document}var Q6=new WeakMap;function OJ(e){let t=Q6.get(e);return t===void 0&&Q6.set(e,t=PJ(e)),t}function PJ(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let a=0;a<r.length;a++)n(r[a]);else for(let a in r)n(r[a])}return n(e),t}function Xv(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let a=t[0],o;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=OJ(r))&&o.indexOf(t)>-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 i=a.indexOf(" ");i>0&&(n=a.slice(0,i),a=a.slice(i+1));let s,l=n?e.createElementNS(n,a):e.createElement(a),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;f<t.length;f++){let d=t[f];if(d===0){if(f<t.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof d=="string")l.appendChild(e.createTextNode(d));else{let{dom:p,contentDOM:h}=Xv(e,d,n,r);if(l.appendChild(p),h){if(s)throw new RangeError("Multiple content holes");s=h}}}return{dom:l,contentDOM:s}}var wB=65535,kB=Math.pow(2,16);function BJ(e,t){return e+t*kB}function xB(e){return e&wB}function zJ(e){return(e-(e&wB))/kB}var CB=1,SB=2,tw=4,LB=8,ax=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&LB)>0}get deletedBefore(){return(this.delInfo&(CB|tw))>0}get deletedAfter(){return(this.delInfo&(SB|tw))>0}get deletedAcross(){return(this.delInfo&tw)>0}},Ts=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(t){let n=0,r=xB(t);if(!this.inverted)for(let a=0;a<r;a++)n+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[r*3]+n+zJ(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let a=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?a:0);if(l>t)break;let u=this.ranges[s+o],c=this.ranges[s+i],f=l+u;if(t<=f){let d=u?t==l?-1:t==f?1:n:n,p=l+a+(d<0?0:c);if(r)return p;let h=t==(n<0?l:f)?null:BJ(s/3,t-l),g=0;return u&&(g|=t==l?SB:t==f?CB:tw,(n<0?t!=l:t!=f)&&(g|=LB)),new ax(p,g,h)}a+=c-u}return r?t+a:new ax(t+a,0,null)}touches(t,n){let r=0,a=xB(n),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[s+o],c=l+u;if(t<=c&&s==a*3)return!0;r+=this.ranges[s+i]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let a=0,o=0;a<this.ranges.length;a+=3){let i=this.ranges[a],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),u=this.ranges[a+n],c=this.ranges[a+r];t(s,s+u,l,l+c),o+=c-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Ts.empty=new Ts([]);var ox=class e{constructor(t,n,r=0,a=t?t.length:0){this.mirror=n,this.from=r,this.to=a,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=t.from,r=this._maps.length;n<t.to;n++){let a=t.getMirror(n);a!=null&&(a=a<n&&a>=t.from?r+(a-t.from):void 0),this.appendMap(t._maps[n],a)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.to-1,r=this._maps.length+t._maps.length;n>=t.from;n--){let a=t.getMirror(n);a!=null&&(a=a>n&&a<t.to?r-(a-t.from)-1:void 0),this.appendMap(t._maps[n].invert(),a)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let a=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],s=i.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this._maps[l].recover(s.recover);continue}}a|=s.delInfo,t=s.pos}return r?t:new ax(t,a,null)}},dA=Object.create(null),Sn=class{getMap(){return Ts.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=dA[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in dA)throw new RangeError("Duplicate use of step JSON ID "+t);return dA[t]=n,n.prototype.jsonID=t,n}},Wn=class e{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,a){try{return e.ok(t.replace(n,r,a))}catch(o){if(o instanceof Yl)return e.fail(o.message);throw o}}};function gA(e,t,n){let r=[];for(let a=0;a<e.childCount;a++){let o=e.child(a);o.content.size&&(o=o.copy(gA(o.content,t,o))),o.isInline&&(o=t(o,n,a)),r.push(o)}return re.fromArray(r)}var Ds=class e extends Sn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),a=r.node(r.sharedDepth(this.to)),o=new ue(gA(n.content,(i,s)=>!i.isAtom||!s.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),a),n.openStart,n.openEnd);return Wn.fromReplace(t,this.from,this.to,o)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(r,a)=>{if(r.isInline&&r.isAtom){let o=this.mark.addToSet(r.marks);if(!Ye.sameSet(o,r.marks)){let i=Math.max(this.from,a),s=Math.min(this.to,a+r.nodeSize);nw(Zl,i,s,this.mark,n);for(let l of r.marks)l.isInSet(o)||nw(e,i,s,l,n)}}}),n.length==1?n[0]:new ix(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Sn.jsonID("addMark",Ds);var Zl=class e extends Sn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ue(gA(n.content,a=>a.mark(this.mark.removeFromSet(a.marks)),t),n.openStart,n.openEnd);return Wn.fromReplace(t,this.from,this.to,r)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(r,a)=>{r.isInline&&r.isAtom&&this.mark.isInSet(r.marks)&&nw(Ds,Math.max(this.from,a),Math.min(this.to,a+r.nodeSize),this.mark,n)}),n.length==1?n[0]:new ix(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Sn.jsonID("removeMark",Zl);function nw(e,t,n,r,a){let o=a.length?a[a.length-1]:null;o&&o instanceof e&&o.to==t&&o.mark.eq(r)?a[a.length-1]=new e(o.from,n,r):a.push(new e(t,n,r))}var ix=class e extends Sn{constructor(t){super(),this.steps=t}apply(t){for(let n of this.steps){let r=n.apply(t);if(!r.doc)return r;t=r.doc}return new Wn(t,null)}invert(t){return new e(this.steps.map(n=>n.invert(t)))}map(t){let n=[];for(let r of this.steps){let a=r.map(t);a&&n.push(a)}return n.length?new e(n):null}toJSON(){return{stepType:"markSet",steps:this.steps.map(t=>t.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(r=>r.stepType=="addMark"||r.stepType=="removeMark"))throw new RangeError("Invalid JSON for MarkSetStep");return new e(n.steps.map(r=>Sn.fromJSON(t,r)))}};Sn.jsonID("markSet",ix);var sx=class e extends Sn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Wn.fromReplace(t,this.pos,this.pos+1,new ue(re.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let a=0;a<n.marks.length;a++)if(!n.marks[a].isInSet(r))return new e(this.pos,n.marks[a]);return new e(this.pos,this.mark)}}return new cp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Sn.jsonID("addNodeMark",sx);var cp=class e extends Sn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Wn.fromReplace(t,this.pos,this.pos+1,new ue(re.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new sx(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Sn.jsonID("removeNodeMark",cp);var Rn=class e extends Sn{constructor(t,n,r,a=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=a}apply(t){return this.structure&&hA(t,this.from,this.to)?Wn.fail("Structure replace would overwrite content"):Wn.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ts([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ue.empty:new ue(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ue.empty:new ue(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,ue.fromJSON(t,n.slice),!!n.structure)}};Rn.MAP_BIAS=1;Sn.jsonID("replace",Rn);var sr=class e extends Sn{constructor(t,n,r,a,o,i,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=a,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(hA(t,this.from,this.gapFrom)||hA(t,this.gapTo,this.to)))return Wn.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Wn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Wn.fromReplace(t,this.from,this.to,r):Wn.fail("Content does not fit in gap")}getMap(){return new Ts([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),a=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||a<n.pos||o>r.pos||a>o?null:new e(n.pos,r.pos,a,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,ue.fromJSON(t,n.slice),n.insert,!!n.structure)}};Sn.jsonID("replaceAround",sr);function hA(e,t,n){let r=e.resolve(t),a=n-t,o=r.depth;for(;a>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,a--;if(a>0){let i=r.node(o).maybeChild(r.indexAfter(o));for(;a>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,a--}}return!1}function FJ(e,t,n,r){let a=[];e.doc.nodesBetween(t,n,(o,i,s)=>{if(!o.isInline)return;let l=o.marks;if(!r.isInSet(l)&&s.type.allowsMarkType(r.type)){let u=Math.max(i,t),c=Math.min(i+o.nodeSize,n);nw(Ds,u,c,r,a)}}),a.forEach(o=>e.step(o))}function HJ(e,t,n,r){let a=[],o=0;e.doc.nodesBetween(t,n,(i,s)=>{if(!i.isInline||!i.isAtom)return;o++;let l=null;if(r instanceof ex){let u=i.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let u=Math.min(s+i.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],d;for(let p=0;p<a.length;p++){let h=a[p];h.step==o-1&&f.eq(a[p].style)&&(d=h)}d?(d.to=u,d.step=o):a.push({style:f,from:Math.max(s,t),to:u,step:o})}}}),a.forEach(i=>e.step(new Zl(i.from,i.to,i.style)))}function xA(e,t,n,r=n.contentMatch,a=!0){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),c=s+u.nodeSize,f=r.matchType(u.type);if(!f)i.push(new Rn(s,c,ue.empty));else{r=f;for(let d=0;d<u.marks.length;d++)n.allowsMarkType(u.marks[d].type)||e.step(new Zl(s,c,u.marks[d]));if(a&&u.isText&&n.whitespace!="pre"){let d,p=/\r?\n|\r/g,h;for(;d=p.exec(u.text);)h||(h=new ue(re.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),i.push(new Rn(s+d.index,s+d.index+d[0].length,h))}}s=c}if(!r.validEnd){let l=r.fillBefore(re.empty,!0);e.replace(s,s,new ue(l,0,0))}for(let l=i.length-1;l>=0;l--)e.step(i[l])}function VJ(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pp(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,a=0,o=0;;--r){let i=e.$from.node(r),s=e.$from.index(r)+a,l=e.$to.indexAfter(r)-o;if(r<e.depth&&i.canReplace(s,l,n))return r;if(r==0||i.type.spec.isolating||!VJ(i,s,l))break;s&&(a=1),l<i.childCount&&(o=1)}return null}function UJ(e,t,n){let{$from:r,$to:a,depth:o}=t,i=r.before(o+1),s=a.after(o+1),l=i,u=s,c=re.empty,f=0;for(let h=o,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,c=re.from(r.node(h).copy(c)),f++):l--;let d=re.empty,p=0;for(let h=o,g=!1;h>n;h--)g||a.after(h+1)<a.end(h)?(g=!0,d=re.from(a.node(h).copy(d)),p++):u++;e.step(new sr(l,u,i,s,new ue(c.append(d),f,p),c.size-f,!0))}function Tc(e,t,n=null,r=e){let a=qJ(e,t),o=a&&jJ(r,t);return o?a.map(bB).concat({type:t,attrs:n}).concat(o.map(bB)):null}function bB(e){return{type:e,attrs:null}}function qJ(e,t){let{parent:n,startIndex:r,endIndex:a}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let i=o.length?o[0]:t;return n.canReplaceWith(r,a,i)?o:null}function jJ(e,t){let{parent:n,startIndex:r,endIndex:a}=e,o=n.child(r),i=t.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:t).contentMatch;for(let u=r;l&&u<a;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:i}function $J(e,t,n){let r=re.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let s=n[i].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=re.from(n[i].type.create(n[i].attrs,r))}let a=t.start,o=t.end;e.step(new sr(a,o,a,o,new ue(r,0,0),n.length,!0))}function GJ(e,t,n,r,a){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(i,s)=>{let l=typeof a=="function"?a(i):a;if(i.isTextblock&&!i.hasMarkup(r,l)&&WJ(e.doc,e.mapping.slice(o).map(s),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&AB(e,i,s,o),xA(e,e.mapping.slice(o).map(s,1),r,void 0,u===null);let c=e.mapping.slice(o),f=c.map(s,1),d=c.map(s+i.nodeSize,1);return e.step(new sr(f,d,f+1,d-1,new ue(re.from(r.create(l,null,i.marks)),0,0),1,!0)),u===!0&&IB(e,i,s,o),!1}})}function IB(e,t,n,r){t.forEach((a,o)=>{if(a.isText){let i,s=/\r?\n|\r/g;for(;i=s.exec(a.text);){let l=e.mapping.slice(r).map(n+1+o+i.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function AB(e,t,n,r){t.forEach((a,o)=>{if(a.type==a.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
50
|
+
`))}})}function WJ(e,t,n){let r=e.resolve(t),a=r.index();return r.parent.canReplaceWith(a,a+1,n)}function KJ(e,t,n,r,a){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let i=n.create(r,null,a||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,i);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new sr(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ue(re.from(i),0,0),1,!0))}function Dc(e,t,n=1,r){let a=e.resolve(t),o=a.depth-n,i=r&&r[r.length-1]||a.parent;if(o<0||a.parent.type.spec.isolating||!a.parent.canReplace(a.index(),a.parent.childCount)||!i.type.validContent(a.parent.content.cutByIndex(a.index(),a.parent.childCount)))return!1;for(let u=a.depth-1,c=n-2;u>o;u--,c--){let f=a.node(u),d=a.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!g.type.validContent(p))return!1}let s=a.indexAfter(o),l=r&&r[0];return a.node(o).canReplaceWith(s,s,l?l.type:a.node(o+1).type)}function XJ(e,t,n=1,r){let a=e.doc.resolve(t),o=re.empty,i=re.empty;for(let s=a.depth,l=a.depth-n,u=n-1;s>l;s--,u--){o=re.from(a.node(s).copy(o));let c=r&&r[u];i=re.from(c?c.type.create(c.attrs,i):a.node(s).copy(i))}e.step(new Rn(t,t,new ue(o.append(i),n,n),!0))}function Rc(e,t){let n=e.resolve(t),r=n.index();return ZJ(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function YJ(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let a=0;a<t.childCount;a++){let o=t.child(a),i=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(i),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function ZJ(e,t){return!!(e&&t&&!e.isLeaf&&YJ(e,t))}function JJ(e,t,n){let r=null,{linebreakReplacement:a}=e.doc.type.schema,o=e.doc.resolve(t-n),i=o.node().type;if(a&&i.inlineContent){let c=i.whitespace=="pre",f=!!i.contentMatch.matchType(a);c&&!f?r=!1:!c&&f&&(r=!0)}let s=e.steps.length;if(r===!1){let c=e.doc.resolve(t+n);AB(e,c.node(),c.before(),s)}i.inlineContent&&xA(e,t+n-1,i,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(s),u=l.map(t-n);if(e.step(new Rn(u,l.map(t+n,-1),ue.empty,!0)),r===!0){let c=e.doc.resolve(u);IB(e,c.node(),c.before(),e.steps.length)}return e}function QJ(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let a=r.depth-1;a>=0;a--){let o=r.index(a);if(r.node(a).canReplaceWith(o,o,n))return r.before(a+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let a=r.depth-1;a>=0;a--){let o=r.indexAfter(a);if(r.node(a).canReplaceWith(o,o,n))return r.after(a+1);if(o<r.node(a).childCount)return null}return null}function EB(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let a=n.content;for(let o=0;o<n.openStart;o++)a=a.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let i=r.depth;i>=0;i--){let s=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1;for(let l=0;l<2;l++){if(l){if(!s)break;s=-s}let u=r.index(i)+(s>0?1:0),c=r.node(i),f=!1;if(o==1)f=c.canReplace(u,u,a);else{let d=c.contentMatchAt(u).findWrapping(a.firstChild.type);f=d&&c.canReplaceWith(u,u,d[0])}if(f)return s==0?r.pos:s<0?r.before(i+1):r.after(i+1)}}return null}function lx(e,t,n=t,r=ue.empty){if(t==n&&!r.size)return null;let a=e.resolve(t),o=e.resolve(n);return _B(a,o,r)?new Rn(t,n,r):new mA(a,o,r).fit()}function _B(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var mA=class{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=re.empty;for(let a=0;a<=t.depth;a++){let o=t.node(a);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(a))})}for(let a=t.depth;a>0;a--)this.placed=re.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,a=this.close(t<0?this.$to:r.doc.resolve(t));if(!a)return null;let o=this.placed,i=r.depth,s=a.depth;for(;i&&s&&o.childCount==1;)o=o.firstChild.content,i--,s--;let l=new ue(o,i,s);return t>-1?new sr(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Rn(r.pos,a.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,a=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(a=0),o.type.spec.isolating&&a<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let a,o=null;r?(o=yB(this.unplaced.content,r-1).firstChild,a=o.content):a=this.unplaced.content;let i=a.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:u}=this.frontier[s],c,f=null;if(n==1&&(i?u.matchType(i.type)||(f=u.fillBefore(re.from(i),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&i&&(c=u.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced;return vB(t,-1)<=n?!1:(this.unplaced.size>1&&vB(t,1)>r&&r++,this.unplaced=new ue(t,n+1,r),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,a=yB(t,n);if(a.childCount<=1&&n>0){let o=t.size-n<=n+a.size;this.unplaced=new ue(nx(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ue(nx(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:a,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let i=this.unplaced,s=r?r.content:i.content,l=i.openStart-t,u=0,c=[],{match:f,type:d}=this.frontier[n];if(a){for(let g=0;g<a.childCount;g++)c.push(a.child(g));f=f.matchFragment(a)}let p=s.size+t-(i.content.size-i.openEnd);for(;u<s.childCount;){let g=s.child(u),x=f.matchType(g.type);if(!x)break;u++,(u>1||l==0||g.content.size)&&(f=x,c.push(TB(g.mark(d.allowedMarks(g.marks)),u==1?l:0,u==s.childCount?p:-1)))}let h=u==s.childCount;h||(p=-1),this.placed=rx(this.placed,n,re.from(c)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,x=c[c.length-1];x&&g<p;g++)this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),x=x.lastChild;this.unplaced=h?t==0?ue.empty:new ue(nx(i.content,t-1,1),t-1,p<0?i.openEnd:t-1):new ue(nx(i.content,t,u),t,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!pA(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,a=this.$to.after(r);for(;r>1&&a==this.$to.end(--r);)++a;return a}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:a}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),i=pA(t,n,a,r,o);if(i){for(let s=n-1;s>=0;s--){let{match:l,type:u}=this.frontier[s],c=pA(t,s,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:i,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=rx(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let a=t.node(r),o=a.type.contentMatch.fillBefore(a.content,!0,t.index(r));this.openFrontierNode(a.type,a.attrs,o)}return t}openFrontierNode(t,n=null,r){let a=this.frontier[this.depth];a.match=a.match.matchType(t),this.placed=rx(this.placed,this.depth,re.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(re.empty,!0);n.childCount&&(this.placed=rx(this.placed,this.frontier.length,n))}};function nx(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(nx(e.firstChild.content,t-1,n)))}function rx(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(rx(e.lastChild.content,t-1,n)))}function yB(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function TB(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,TB(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(re.empty,!0)))),e.copy(r)}function pA(e,t,n,r,a){let o=e.node(t),i=a?e.indexAfter(t):e.index(t);if(i==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,i);return s&&!eQ(n,o.content,i)?s:null}function eQ(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function tQ(e){return e.spec.defining||e.spec.definingForContent}function vB(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function nQ(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let a=e.doc.resolve(t),o=e.doc.resolve(n);if(_B(a,o,r))return e.step(new Rn(t,n,r));let i=RB(a,o);i[i.length-1]==0&&i.pop();let s=-(a.depth+1);i.unshift(s);for(let d=a.depth,p=a.pos-1;d>0;d--,p--){let h=a.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;i.indexOf(d)>-1?s=d:a.before(d)==p&&i.splice(1,0,-d)}let l=i.indexOf(s),u=[],c=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==r.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=tQ(p.type);if(h&&!p.sameMarkup(a.node(Math.abs(s)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+c+1)%(r.openStart+1),h=u[p];if(h)for(let g=0;g<i.length;g++){let x=i[(g+l)%i.length],m=!0;x<0&&(m=!1,x=-x);let y=a.node(x-1),b=a.index(x-1);if(y.canReplaceWith(b,b,h.type,h.marks))return e.replace(a.before(x),m?o.after(x):n,new ue(DB(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=i.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=i[d];p<0||(t=a.before(p),n=o.after(p))}}function DB(e,t,n,r,a){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(DB(o.content,t+1,n,r,o)))}if(t>r){let o=a.contentMatchAt(0),i=o.fillBefore(e).append(e);e=i.append(o.matchFragment(i).fillBefore(re.empty,!0))}return e}function rQ(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let a=QJ(e.doc,t,r.type);a!=null&&(t=n=a)}e.replaceRange(t,n,new ue(re.from(r),0,0))}function aQ(e,t,n){let r=e.doc.resolve(t),a=e.doc.resolve(n);if(r.parent.isTextblock&&a.parent.isTextblock&&r.start()!=a.start()&&r.parentOffset==0&&a.parentOffset==0){let i=r.sharedDepth(n),s=!1;for(let l=r.depth;l>i;l--)r.node(l).type.spec.isolating&&(s=!0);for(let l=a.depth;l>i;l--)a.node(l).type.spec.isolating&&(s=!0);if(!s){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=a.depth;l>0&&n==a.start(l);l--)n=a.before(l);r=e.doc.resolve(t),a=e.doc.resolve(n)}}let o=RB(r,a);for(let i=0;i<o.length;i++){let s=o[i],l=i==o.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),a.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),a.indexAfter(s-1))))return e.delete(r.before(s),a.after(s))}for(let i=1;i<=r.depth&&i<=a.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&a.end(i)-n!=a.depth-i&&r.start(i-1)==a.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),a.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}function RB(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let a=r;a>=0;a--){let o=e.start(a);if(o<e.pos-(e.depth-a)||t.end(a)>t.pos+(t.depth-a)||e.node(a).type.spec.isolating||t.node(a).type.spec.isolating)break;(o==t.start(a)||a==e.depth&&a==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&a&&t.start(a-1)==o-1)&&n.push(a)}return n}var rw=class e extends Sn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Wn.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let a=n.type.create(r,null,n.marks);return Wn.fromReplace(t,this.pos,this.pos+1,new ue(re.from(a),0,n.isLeaf?0:1))}getMap(){return Ts.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};Sn.jsonID("attr",rw);var aw=class e extends Sn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let a in t.attrs)n[a]=t.attrs[a];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Wn.ok(r)}getMap(){return Ts.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};Sn.jsonID("docAttr",aw);var fp=class extends Error{};fp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};fp.prototype=Object.create(Error.prototype);fp.prototype.constructor=fp;fp.prototype.name="TransformError";var dp=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ox}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new fp(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let a=this.mapping.maps[r];r&&(t=a.map(t,1),n=a.map(n,-1)),a.forEach((o,i,s,l)=>{t=Math.min(t,s),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ue.empty){let a=lx(this.doc,t,n,r);return a&&this.step(a),this}replaceWith(t,n,r){return this.replace(t,n,new ue(re.from(r),0,0))}delete(t,n){return this.replace(t,n,ue.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return nQ(this,t,n,r),this}replaceRangeWith(t,n,r){return rQ(this,t,n,r),this}deleteRange(t,n){return aQ(this,t,n),this}lift(t,n){return UJ(this,t,n),this}join(t,n=1){return JJ(this,t,n),this}wrap(t,n){return $J(this,t,n),this}setBlockType(t,n=t,r,a=null){return GJ(this,t,n,r,a),this}setNodeMarkup(t,n,r=null,a){return KJ(this,t,n,r,a),this}setNodeAttribute(t,n,r){return this.step(new rw(t,n,r)),this}setDocAttribute(t,n){return this.step(new aw(t,n)),this}addNodeMark(t,n){return this.step(new sx(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof Ye)n.isInSet(r.marks)&&this.step(new cp(t,n));else{let a=r.marks,o,i=[];for(;o=n.isInSet(a);)i.push(new cp(t,o)),a=o.removeFromSet(a);for(let s=i.length-1;s>=0;s--)this.step(i[s])}return this}split(t,n=1,r){return XJ(this,t,n,r),this}addMark(t,n,r){return FJ(this,t,n,r),this}removeMark(t,n,r){return HJ(this,t,n,r),this}clearIncompatible(t,n,r){return xA(this,t,n,r),this}};var bA=Object.create(null),Te=class{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Jl(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ue.empty){let r=n.content.lastChild,a=null;for(let s=0;s<n.openEnd;s++)a=r,r=r.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:u}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(l.pos),c.map(u.pos),s?ue.empty:n),s==0&&OB(t,o,(r?r.isInline:a&&a.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:i,$to:s}=a[o],l=t.mapping.slice(r),u=l.map(i.pos),c=l.map(s.pos);o?t.deleteRange(u,c):(t.replaceRangeWith(u,c,n),OB(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let a=t.parent.inlineContent?new ye(t):hp(t.node(0),t.parent,t.pos,t.index(),n,r);if(a)return a;for(let o=t.depth-1;o>=0;o--){let i=n<0?hp(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):hp(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(i)return i}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new $r(t.node(0))}static atStart(t){return hp(t,t,0,0,1)||new $r(t)}static atEnd(t){return hp(t,t,t.content.size,t.childCount,-1)||new $r(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=bA[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in bA)throw new RangeError("Duplicate use of selection JSON ID "+t);return bA[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ye.between(this.$anchor,this.$head).getBookmark()}};Te.prototype.visible=!0;var Jl=class{constructor(t,n){this.$from=t,this.$to=n}},MB=!1;function NB(e){!MB&&!e.parent.inlineContent&&(MB=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var ye=class e extends Te{constructor(t,n=t){NB(t),NB(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Te.near(r);let a=t.resolve(n.map(this.anchor));return new e(a.parent.inlineContent?a:r,r)}replace(t,n=ue.empty){if(super.replace(t,n),n==ue.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new iw(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let a=t.resolve(n);return new this(a,r==n?a:t.resolve(r))}static between(t,n,r){let a=t.pos-n.pos;if((!r||a)&&(r=a>=0?1:-1),!n.parent.inlineContent){let o=Te.findFrom(n,r,!0)||Te.findFrom(n,-r,!0);if(o)n=o.$head;else return Te.near(n,r)}return t.parent.inlineContent||(a==0?t=n:(t=(Te.findFrom(t,-r,!0)||Te.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=a<0&&(t=n))),new e(t,n)}};Te.jsonID("text",ye);var iw=class e{constructor(t,n){this.anchor=t,this.head=n}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(t){return ye.between(t.resolve(this.anchor),t.resolve(this.head))}},Ae=class e extends Te{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:a}=n.mapResult(this.anchor),o=t.resolve(a);return r?Te.near(o):new e(o)}content(){return new ue(re.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new vA(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};Ae.prototype.visible=!1;Te.jsonID("node",Ae);var vA=class e{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new iw(r,r):new e(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Ae.isSelectable(r)?new Ae(n):Te.near(n)}},$r=class e extends Te{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ue.empty){if(n==ue.empty){t.delete(0,t.doc.content.size);let r=Te.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return oQ}};Te.jsonID("all",$r);var oQ={map(){return this},resolve(e){return new $r(e)}};function hp(e,t,n,r,a,o=!1){if(t.inlineContent)return ye.create(e,n);for(let i=r-(a>0?0:1);a>0?i<t.childCount:i>=0;i+=a){let s=t.child(i);if(s.isAtom){if(!o&&Ae.isSelectable(s))return Ae.create(e,n-(a<0?s.nodeSize:0))}else{let l=hp(e,s,n+a,a<0?s.childCount:0,a,o);if(l)return l}n+=s.nodeSize*a}return null}function OB(e,t,n){let r=e.steps.length-1;if(r<t)return;let a=e.steps[r];if(!(a instanceof Rn||a instanceof sr))return;let o=e.mapping.maps[r],i;o.forEach((s,l,u,c)=>{i==null&&(i=c)}),e.setSelection(Te.near(e.doc.resolve(i),n))}var PB=1,ow=2,BB=4,wA=class extends dp{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|PB)&~ow,this.storedMarks=null,this}get selectionSet(){return(this.updated&PB)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ow,this}ensureMarks(t){return Ye.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ow)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ow,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ye.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let a=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(a.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let i=this.doc.resolve(n);o=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,a.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Te.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=BB,this}get scrolledIntoView(){return(this.updated&BB)>0}};function zB(e,t){return!t||!e?e:e.bind(t)}var Mc=class{constructor(t,n,r){this.name=t,this.init=zB(n.init,r),this.apply=zB(n.apply,r)}},iQ=[new Mc("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Mc("selection",{init(e,t){return e.selection||Te.atStart(t.doc)},apply(e){return e.selection}}),new Mc("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Mc("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],ux=class{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iQ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Mc(r.key,r.spec.state,r))})}},sw=class e{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let a=this.config.plugins[r];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),a=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=a?a[i].n:0,u=a?a[i].state:this,c=l<n.length&&s.spec.appendTransaction.call(s,l?n.slice(l):n,u,r);if(c&&r.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!a){a=[];for(let f=0;f<this.config.plugins.length;f++)a.push(f<i?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),o=!0}a&&(a[i]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new e(this.config),r=this.config.fields;for(let a=0;a<r.length;a++){let o=r[a];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new wA(this)}static create(t){let n=new ux(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let a=0;a<n.fields.length;a++)r[n.fields[a].name]=n.fields[a].init(t,r);return r}reconfigure(t){let n=new ux(this.schema,t.plugins),r=n.fields,a=new e(n);for(let o=0;o<r.length;o++){let i=r[o].name;a[i]=this.hasOwnProperty(i)?this[i]:r[o].init(t,a)}return a}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let a=t[r],o=a.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(a,this[a.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let a=new ux(t.schema,t.plugins),o=new e(a);return a.fields.forEach(i=>{if(i.name=="doc")o.doc=da.fromJSON(t.schema,n.doc);else if(i.name=="selection")o.selection=Te.fromJSON(o.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let s in r){let l=r[s],u=l.spec.state;if(l.key==i.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,s)){o[i.name]=u.fromJSON.call(l,t,n[s],o);return}}o[i.name]=i.init(t,o)}}),o}};function FB(e,t,n){for(let r in e){let a=e[r];a instanceof Function?a=a.bind(t):r=="handleDOMEvents"&&(a=FB(a,t,{})),n[r]=a}return n}var Be=class{constructor(t){this.spec=t,this.props={},t.props&&FB(t.props,this,this.props),this.key=t.key?t.key.key:HB("plugin")}getState(t){return t[this.key]}},yA=Object.create(null);function HB(e){return e in yA?e+"$"+ ++yA[e]:(yA[e]=0,e+"$")}var qe=class{constructor(t="key"){this.key=HB(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}};var lw=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function UB(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var CA=(e,t,n)=>{let r=UB(e,n);if(!r)return!1;let a=LA(r);if(!a){let i=r.blockRange(),s=i&&pp(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}let o=a.nodeBefore;if($B(e,a,t,-1))return!0;if(r.parent.content.size==0&&(mp(o,"end")||Ae.isSelectable(o)))for(let i=r.depth;;i--){let s=lx(e.doc,r.before(i),r.after(i),ue.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection(mp(o,"end")?Te.findFrom(l.doc.resolve(l.mapping.map(a.pos,-1)),-1):Ae.create(l.doc,a.pos-o.nodeSize)),t(l.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return o.isAtom&&a.depth==r.depth-1?(t&&t(e.tr.delete(a.pos-o.nodeSize,a.pos).scrollIntoView()),!0):!1},qB=(e,t,n)=>{let r=UB(e,n);if(!r)return!1;let a=LA(r);return a?sQ(e,a,t):!1};function sQ(e,t,n){let r=t.nodeBefore,a=r,o=t.pos-1;for(;!a.isTextblock;o--){if(a.type.spec.isolating)return!1;let c=a.lastChild;if(!c)return!1;a=c}let i=t.nodeAfter,s=i,l=t.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let u=lx(e.doc,o,l,ue.empty);if(!u||u.from!=o||u instanceof Rn&&u.slice.size>=l-o)return!1;if(n){let c=e.tr.step(u);c.setSelection(ye.create(c.doc,o)),n(c.scrollIntoView())}return!0}function mp(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var SA=(e,t,n)=>{let{$head:r,empty:a}=e.selection,o=r;if(!a)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=LA(r)}let i=o&&o.nodeBefore;return!i||!Ae.isSelectable(i)?!1:(t&&t(e.tr.setSelection(Ae.create(e.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)};function LA(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function lQ(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var uQ=(e,t,n)=>{let r=lQ(e,n);if(!r)return!1;let a=jB(r);if(!a)return!1;let o=a.nodeAfter;if($B(e,a,t,1))return!0;if(r.parent.content.size==0&&(mp(o,"start")||Ae.isSelectable(o))){let i=lx(e.doc,r.before(),r.after(),ue.empty);if(i&&i.slice.size<i.to-i.from){if(t){let s=e.tr.step(i);s.setSelection(mp(o,"start")?Te.findFrom(s.doc.resolve(s.mapping.map(a.pos)),1):Ae.create(s.doc,s.mapping.map(a.pos))),t(s.scrollIntoView())}return!0}}return o.isAtom&&a.depth==r.depth-1?(t&&t(e.tr.delete(a.pos,a.pos+o.nodeSize).scrollIntoView()),!0):!1},cQ=(e,t,n)=>{let{$head:r,empty:a}=e.selection,o=r;if(!a)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=jB(r)}let i=o&&o.nodeAfter;return!i||!Ae.isSelectable(i)?!1:(t&&t(e.tr.setSelection(Ae.create(e.doc,o.pos)).scrollIntoView()),!0)};function jB(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var fQ=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
51
|
+
`).scrollIntoView()),!0)};function IA(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var dQ=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let a=n.node(-1),o=n.indexAfter(-1),i=IA(a.contentMatchAt(o));if(!i||!a.canReplaceWith(o,o,i))return!1;if(t){let s=n.after(),l=e.tr.replaceWith(s,s,i.createAndFill());l.setSelection(Te.near(l.doc.resolve(s),1)),t(l.scrollIntoView())}return!0},pQ=(e,t)=>{let n=e.selection,{$from:r,$to:a}=n;if(n instanceof $r||r.parent.inlineContent||a.parent.inlineContent)return!1;let o=IA(a.parent.contentMatchAt(a.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let i=(!r.parentOffset&&a.index()<a.parent.childCount?r:a).pos,s=e.tr.insert(i,o.createAndFill());s.setSelection(ye.create(s.doc,i+1)),t(s.scrollIntoView())}return!0},hQ=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Dc(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),a=r&&pp(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)};function mQ(e){return(t,n)=>{if(t.selection instanceof Ae&&t.selection.node.isBlock){let{$from:p}=t.selection;return!p.parentOffset||!Dc(t.doc,p.pos)?!1:(n&&n(t.tr.split(p.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof ye||t.selection instanceof $r)&&r.deleteSelection();let{$from:a}=r.selection,o=r.steps.length,i=[],s,l,u=!1,c=!1;for(let p=a.depth;;p--)if(a.node(p).isBlock){u=a.end(p)==a.pos+(a.depth-p),c=a.start(p)==a.pos-(a.depth-p),l=IA(a.node(p-1).contentMatchAt(a.indexAfter(p-1)));let g=e&&e(a.parent,u,a);i.unshift(g||(u&&l?{type:l}:null)),s=p;break}else{if(p==1)return!1;i.unshift(null)}let f=a.pos,d=Dc(r.doc,f,i.length,i);if(d||(i[0]=l?{type:l}:null,d=Dc(r.doc,f,i.length,i)),!d)return!1;if(r.split(f,i.length,i),!u&&c&&a.node(s).type!=l){let p=r.mapping.slice(o),h=p.map(a.before(s)),g=r.doc.resolve(h);l&&a.node(s-1).canReplaceWith(g.index(),g.index()+1,l)&&r.setNodeMarkup(p.map(a.before(s)),l)}return n&&n(r.scrollIntoView()),!0}}var gQ=mQ();var xQ=(e,t)=>(t&&t(e.tr.setSelection(new $r(e.doc))),!0);function bQ(e,t,n){let r=t.nodeBefore,a=t.nodeAfter,o=t.index();return!r||!a||!r.type.compatibleContent(a.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(a.isTextblock||Rc(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function $B(e,t,n,r){let a=t.nodeBefore,o=t.nodeAfter,i,s,l=a.type.spec.isolating||o.type.spec.isolating;if(!l&&bQ(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(i=(s=a.contentMatchAt(a.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let p=t.pos+o.nodeSize,h=re.empty;for(let m=i.length-1;m>=0;m--)h=re.from(i[m].create(null,h));h=re.from(a.copy(h));let g=e.tr.step(new sr(t.pos-1,p,t.pos,p,new ue(h,1,0),i.length,!0)),x=g.doc.resolve(p+2*i.length);x.nodeAfter&&x.nodeAfter.type==a.type&&Rc(g.doc,x.pos)&&g.join(x.pos),n(g.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&l?null:Te.findFrom(t,1),f=c&&c.$from.blockRange(c.$to),d=f&&pp(f);if(d!=null&&d>=t.depth)return n&&n(e.tr.lift(f,d).scrollIntoView()),!0;if(u&&mp(o,"start",!0)&&mp(a,"end")){let p=a,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let g=o,x=1;for(;!g.isTextblock;g=g.firstChild)x++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let m=re.empty;for(let b=h.length-1;b>=0;b--)m=re.from(h[b].copy(m));let y=e.tr.step(new sr(t.pos-h.length,t.pos+o.nodeSize,t.pos+x,t.pos+o.nodeSize-x,new ue(m,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function GB(e){return function(t,n){let r=t.selection,a=e<0?r.$from:r.$to,o=a.depth;for(;a.node(o).isInline;){if(!o)return!1;o--}return a.node(o).isTextblock?(n&&n(t.tr.setSelection(ye.create(t.doc,e<0?a.start(o):a.end(o)))),!0):!1}}var yQ=GB(-1),vQ=GB(1);function uw(e,t=null){return function(n,r){let{$from:a,$to:o}=n.selection,i=a.blockRange(o),s=i&&Tc(i,e,t);return s?(r&&r(n.tr.wrap(i,s).scrollIntoView()),!0):!1}}function gp(e,t=null){return function(n,r){let a=!1;for(let o=0;o<n.selection.ranges.length&&!a;o++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(i,s,(l,u)=>{if(a)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)a=!0;else{let c=n.doc.resolve(u),f=c.index();a=c.parent.canReplaceWith(f,f+1,e)}})}if(!a)return!1;if(r){let o=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];o.setBlockType(s,l,e,t)}r(o.scrollIntoView())}return!0}}function wQ(e,t,n,r){for(let a=0;a<t.length;a++){let{$from:o,$to:i}=t[a],s=o.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(o.pos,i.pos,(l,u)=>{if(s||!r&&l.isAtom&&l.isInline&&u>=o.pos&&u+l.nodeSize<=i.pos)return!1;s=l.inlineContent&&l.type.allowsMarkType(n)}),s)return!0}return!1}function kQ(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:a}=e[n];r.doc.nodesBetween(r.pos,a.pos,(o,i)=>{if(o.isAtom&&o.content.size&&o.isInline&&i>=r.pos&&i+o.nodeSize<=a.pos)return i+1>r.pos&&t.push(new Jl(r,r.doc.resolve(i+1))),r=r.doc.resolve(i+1+o.content.size),!1}),r.pos<a.pos&&t.push(new Jl(r,a))}return t}function xp(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,a=(n&&n.enterInlineAtoms)!==!1,o=!(n&&n.includeWhitespace);return function(i,s){let{empty:l,$cursor:u,ranges:c}=i.selection;if(l&&!u||!wQ(i.doc,c,e,a))return!1;if(s)if(u)e.isInSet(i.storedMarks||u.marks())?s(i.tr.removeStoredMark(e)):s(i.tr.addStoredMark(e.create(t)));else{let f,d=i.tr;a||(c=kQ(c)),r?f=!c.some(p=>i.doc.rangeHasMark(p.$from.pos,p.$to.pos,e)):f=!c.every(p=>{let h=!1;return d.doc.nodesBetween(p.$from.pos,p.$to.pos,(g,x,m)=>{if(h)return!1;h=!e.isInSet(g.marks)&&!!m&&m.type.allowsMarkType(e)&&!(g.isText&&/^\s*$/.test(g.textBetween(Math.max(0,p.$from.pos-x),Math.min(g.nodeSize,p.$to.pos-x))))}),!h});for(let p=0;p<c.length;p++){let{$from:h,$to:g}=c[p];if(!f)d.removeMark(h.pos,g.pos,e);else{let x=h.pos,m=g.pos,y=h.nodeAfter,b=g.nodeBefore,v=o&&y&&y.isText?/^\s*/.exec(y.text)[0].length:0,w=o&&b&&b.isText?/\s*$/.exec(b.text)[0].length:0;x+v<m&&(x+=v,m-=w),d.addMark(x,m,e.create(t))}}s(d.scrollIntoView())}return!0}}function Nc(...e){return function(t,n,r){for(let a=0;a<e.length;a++)if(e[a](t,n,r))return!0;return!1}}var kA=Nc(lw,CA,SA),VB=Nc(lw,uQ,cQ),Rs={Enter:Nc(fQ,pQ,hQ,gQ),"Mod-Enter":dQ,Backspace:kA,"Mod-Backspace":kA,"Shift-Backspace":kA,Delete:VB,"Mod-Delete":VB,"Mod-a":xQ},WB={"Ctrl-h":Rs.Backspace,"Alt-Backspace":Rs["Mod-Backspace"],"Ctrl-d":Rs.Delete,"Ctrl-Alt-Backspace":Rs["Mod-Delete"],"Alt-Delete":Rs["Mod-Delete"],"Alt-d":Rs["Mod-Delete"],"Ctrl-a":yQ,"Ctrl-e":vQ};for(let e in Rs)WB[e]=Rs[e];var CQ=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,KB=CQ?WB:Rs;var Kn=class{constructor(t,n,r={}){this.match=t,this.match=t,this.handler=typeof n=="string"?SQ(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1,this.inCodeMark=r.inCodeMark!==!1}};function SQ(e){return function(t,n,r,a){let o=e;if(n[1]){let i=n[0].lastIndexOf(n[1]);o+=n[0].slice(i+n[1].length),r+=i;let s=r-a;s>0&&(o=n[0].slice(i-s,i)+o,r=a)}return t.tr.insertText(o,r,a)}}var XB=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let a=n[r],o;if(a.spec.isInputRules&&(o=a.getState(e))){if(t){let i=e.tr,s=o.transform;for(let l=s.steps.length-1;l>=0;l--)i.step(s.steps[l].invert(s.docs[l]));if(o.text){let l=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else i.delete(o.from,o.to);t(i)}return!0}}return!1},iCe=new Kn(/--$/,"\u2014",{inCodeMark:!1}),sCe=new Kn(/\.\.\.$/,"\u2026",{inCodeMark:!1}),lCe=new Kn(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),uCe=new Kn(/"$/,"\u201D",{inCodeMark:!1}),cCe=new Kn(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),fCe=new Kn(/'$/,"\u2019",{inCodeMark:!1});function cw(e,t,n,r){let a,o;return t instanceof io?o=t:(a=t,o=t.nodeType,n=t.getAttrs,r=t.joinPredicate),new Kn(e,(i,s,l,u)=>{let c=n instanceof Function?n(s):n,f=i.tr.delete(l,u),d=f.doc.resolve(l),p=d.blockRange(),h=p&&Tc(p,o,c);if(!h)return null;f.wrap(p,h);let g=f.doc.resolve(l-1).nodeBefore;return g&&g.type==o&&Rc(f.doc,l-1)&&(!r||r(s,g))&&f.join(l-1),f},a)}function AA(e,t,n){let r,a;return t instanceof io?a=t:(r=t,a=t.nodeType,n=t.getAttrs),new Kn(e,(o,i,s,l)=>{let u=o.doc.resolve(s),c=n instanceof Function?n(i):n;return u.node(-1).canReplaceWith(u.index(-1),u.indexAfter(-1),a)?o.tr.delete(s,l).setBlockType(s,s,a,c):null},r)}var Ql=typeof navigator<"u"?navigator:null,YB=typeof document<"u"?document:null,eu=Ql&&Ql.userAgent||"",_A=/Edge\/(\d+)/.exec(eu),t9=/MSIE \d/.exec(eu),TA=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(eu),fw=!!(t9||TA||_A),LQ=t9?document.documentMode:TA?+TA[1]:_A?+_A[1]:0,n9=!fw&&/gecko\/(\d+)/i.test(eu),IQ=n9&&+(/Firefox\/(\d+)/.exec(eu)||[0,0])[1],DA=!fw&&/Chrome\/(\d+)/.exec(eu),r9=!!DA,AQ=DA?+DA[1]:0,a9=!fw&&!!Ql&&/Apple Computer/.test(Ql.vendor),o9=a9&&(/Mobile\/\w+/.test(eu)||!!Ql&&Ql.maxTouchPoints>2),EQ=o9||(Ql?/Mac/.test(Ql.platform):!1),i9=/Android \d/.test(eu),s9=!!YB&&"webkitFontSmoothing"in YB.documentElement.style,_Q=s9?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Oc=Object.freeze({__proto__:null,android:i9,chrome:r9,chrome_version:AQ,gecko:n9,gecko_version:IQ,ie:fw,ie_version:LQ,ios:o9,mac:EQ,safari:a9,webkit:s9,webkit_version:_Q});function EA(e,t,n,r,a,o){if(e.composing)return!1;let i=e.state,s=i.doc.resolve(t);if(s.parent.type.spec.code)return!1;let l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,"\uFFFC")+r;for(let u of a){let c=u,f=c.match.exec(l),d=f&&f[0]&&c.handler(i,f,t-(f[0].length-r.length),n);if(d)return c.undoable!==!1&&d.setMeta(o,{transform:d,from:t,to:n,text:r}),e.dispatch(d),!0}return!1}var TQ=new qe("MILKDOWN_CUSTOM_INPUTRULES");function l9({rules:e}){let t=new Be({key:TQ,isInputRules:!0,state:{init(){return null},apply(n,r){let a=n.getMeta(this);return a||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,a,o){return EA(n,r,a,o,e,t)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&EA(n,r.pos,r.pos,"",e,t)}),!1),keydown:(n,r)=>!(i9&&r9&&r.key==="Enter")||n.composing?!1:n.someProp("handleKeyDown",a=>a(n,r))?(r.preventDefault(),!0):!1},handleKeyDown(n,r){if(r.key!=="Enter")return!1;let{$cursor:a}=n.state.selection;return a?EA(n,a.pos,a.pos,`
|
|
52
|
+
`,e,t):!1}}});return t}function u9(e){return e.some(t=>t.type.spec.code)}function ZB(e,t,n){if(t>=n)return!1;let r=!1;return e.doc.nodesBetween(t,n,a=>(a.isInline&&u9(a.marks)&&(r=!0),!r)),r}function DQ(e,t){var n;return u9((n=e.storedMarks)!=null?n:e.doc.resolve(t).marks())}function Pc(e,t,n={}){return new Kn(e,(r,a,o,i)=>{var s,l,u,c;let{tr:f}=r,d=a.length,p=a[d-1],h=a[0],g=[],x,m={group:p,fullMatch:h,start:o,end:i},y=(s=n.updateCaptured)==null?void 0:s.call(n,m);if(Object.assign(m,y),{group:p,fullMatch:h,start:o,end:i}=m,h===null||p?.trim()==="")return null;if(p){let b=h.search(/\S/),v=o+h.indexOf(p),w=v+p.length,k=ZB(r,o+b,v),_=w<i&&ZB(r,w,i);if(k||_||DQ(r,i))return null;g=(l=f.storedMarks)!=null?l:[],w<i&&f.delete(w,i),v>o&&f.delete(o+b,v),x=o+b+p.length;let E=(u=n.getAttr)==null?void 0:u.call(n,a);f.addMark(o,x,t.create(E)),f.setStoredMarks(g),(c=n.beforeDispatch)==null||c.call(n,{match:a,start:o,end:i,tr:f})}return f})}var RQ=Object.defineProperty,MQ=Object.defineProperties,NQ=Object.getOwnPropertyDescriptors,JB=Object.getOwnPropertySymbols,OQ=Object.prototype.hasOwnProperty,PQ=Object.prototype.propertyIsEnumerable,QB=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BQ=(e,t)=>{for(var n in t||(t={}))OQ.call(t,n)&&QB(e,n,t[n]);if(JB)for(var n of JB(t))PQ.call(t,n)&&QB(e,n,t[n]);return e},zQ=(e,t)=>MQ(e,NQ(t));function e9(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Bc(e,t,n){let a=e.state.doc.content.size,o=e9(t,0,a),i=e9(n,0,a),s=e.coordsAtPos(o),l=e.coordsAtPos(i,-1),u=Math.min(s.top,l.top),c=Math.max(s.bottom,l.bottom),f=Math.min(s.left,l.left),d=Math.max(s.right,l.right),p=d-f,h=c-u,m={top:u,bottom:c,left:f,right:d,width:p,height:h,x:f,y:u};return zQ(BQ({},m),{toJSON:()=>m})}function RA(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function FQ(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function c9(e){if(e.content.childCount===1){let t=e.content.firstChild;if(t?.type.name==="text"&&t.marks.length===0)return t;if(t?.type.name==="paragraph"&&t.childCount===1){let n=t.firstChild;if(n?.type.name==="text"&&n.marks.length===0)return n}}return!1}function pa(e){return t=>{for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r)){let a=t.before(n),o=t.after(n);return{from:a,to:o,node:r}}}}}function f9(e,t){return pa(n=>n.type===t)(e)}function d9(e,t){let n=t.nodes[e];if(!n)throw oP("node",e);return n}function MA(e){return t=>{for(let n=t.depth;n>0;n--){let r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}function p9(e){return t=>MA(e)(t.$from)}function h9(e,t){if(!(e instanceof Ae))return;let{node:n,$from:r}=e;if(FQ(t,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}var m9=(e,t)=>{let{selection:n,doc:r}=e;if(n instanceof Ae)return{hasNode:n.node.type===t,pos:n.from,target:n.node};let{from:a,to:o}=n,i=!1,s=-1,l=null;return r.nodesBetween(a,o,(u,c)=>l?!1:u.type===t?(i=!0,s=c,l=u,!1):!0),{hasNode:i,pos:s,target:l}};var Ms={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:"'"},pw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HQ=typeof navigator<"u"&&/Mac/.test(navigator.platform),VQ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Mn=0;Mn<10;Mn++)Ms[48+Mn]=Ms[96+Mn]=String(Mn);var Mn;for(Mn=1;Mn<=24;Mn++)Ms[Mn+111]="F"+Mn;var Mn;for(Mn=65;Mn<=90;Mn++)Ms[Mn]=String.fromCharCode(Mn+32),pw[Mn]=String.fromCharCode(Mn);var Mn;for(dw in Ms)pw.hasOwnProperty(dw)||(pw[dw]=Ms[dw]);var dw;function g9(e){var t=HQ&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||VQ&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?pw:Ms)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var UQ=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),qQ=typeof navigator<"u"&&/Win/.test(navigator.platform);function jQ(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,a,o,i;for(let s=0;s<t.length-1;s++){let l=t[s];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))a=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))UQ?i=!0:a=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),a&&(n="Ctrl-"+n),i&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function $Q(e){let t=Object.create(null);for(let n in e)t[jQ(n)]=e[n];return t}function NA(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function x9(e){return new Be({props:{handleKeyDown:cx(e)}})}function cx(e){let t=$Q(e);return function(n,r){let a=g9(r),o,i=t[NA(a,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(a.length==1&&a!=" "){if(r.shiftKey){let s=t[NA(a,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(qQ&&r.ctrlKey&&r.altKey)&&(o=Ms[r.keyCode])&&o!=a){let s=t[NA(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}var y9=class{},v9=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw gI();return e}}},GQ=class w9 extends y9{constructor(t,n,r){super(),this.type=t,this.content=n,this.attrs=r}push(t,...n){this.content.push(t,...n)}pop(){return this.content.pop()}static create(t,n,r){return new w9(t,n,r)}},Do,bp,fx,dx,px,yp,vp,Fc,k9=(Fc=class extends v9{constructor(n){super();X(this,Do);X(this,bp);X(this,fx);X(this,dx);X(this,px);X(this,yp);X(this,vp);B(this,Do,Ye.none),B(this,bp,r=>r.isText),B(this,fx,(r,a)=>{if(L(this,bp).call(this,r)&&L(this,bp).call(this,a)&&Ye.sameSet(r.marks,a.marks))return this.schema.text(r.text+a.text,r.marks)}),B(this,dx,r=>{let a=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.parseMarkdown.match(r));if(!a)throw rP(r);return a}),B(this,px,r=>{let a=L(this,dx).call(this,r);a.spec.parseMarkdown.runner(this,r,a)}),this.injectRoot=(r,a,o)=>(this.openNode(a,o),this.next(r.children),this),this.openNode=(r,a)=>(this.open(GQ.create(r,[],a)),this),B(this,yp,()=>{B(this,Do,Ye.none);let r=this.close();return L(this,vp).call(this,r.type,r.attrs,r.content)}),this.closeNode=()=>{try{L(this,yp).call(this)}catch(r){console.error(r)}return this},B(this,vp,(r,a,o)=>{let i=r.createAndFill(a,o,L(this,Do));if(!i)throw nP(r,a,o);return this.push(i),i}),this.addNode=(r,a,o)=>{try{L(this,vp).call(this,r,a,o)}catch(i){console.error(i)}return this},this.openMark=(r,a)=>{let o=r.create(a);return B(this,Do,o.addToSet(L(this,Do))),this},this.closeMark=r=>(B(this,Do,r.removeFromSet(L(this,Do))),this),this.addText=r=>{try{let a=this.top();if(!a)throw gI();let o=a.pop(),i=this.schema.text(r,L(this,Do));if(!o)return a.push(i),this;let s=L(this,fx).call(this,o,i);return s?(a.push(s),this):(a.push(o,i),this)}catch(a){return console.error(a),this}},this.build=()=>{let r;do r=L(this,yp).call(this);while(this.size());return r},this.next=(r=[])=>([r].flat().forEach(a=>L(this,px).call(this,a)),this),this.toDoc=()=>this.build(),this.run=(r,a)=>{let o=r.runSync(r.parse(a),a);return this.next(o),this},this.schema=n}},Do=new WeakMap,bp=new WeakMap,fx=new WeakMap,dx=new WeakMap,px=new WeakMap,yp=new WeakMap,vp=new WeakMap,Fc.create=(n,r)=>{let a=new Fc(n);return o=>(a.run(r,o),a.toDoc())},Fc),Hc,b9=(Hc=class extends y9{constructor(t,n,r,a={}){super(),this.type=t,this.children=n,this.value=r,this.props=a,this.push=(o,...i)=>{this.children||(this.children=[]),this.children.push(o,...i)},this.pop=()=>this.children?.pop()}},Hc.create=(t,n,r,a={})=>new Hc(t,n,r,a),Hc),WQ=e=>Object.prototype.hasOwnProperty.call(e,"size"),Gr,wp,hx,mx,gx,xx,kp,Cp,bx,yx,zc,tu,vx,Sp,Vc,C9=(Vc=class extends v9{constructor(n){super();X(this,Gr);X(this,wp);X(this,hx);X(this,mx);X(this,gx);X(this,xx);X(this,kp);X(this,Cp);X(this,bx);X(this,yx);X(this,zc);X(this,tu);X(this,vx);X(this,Sp);B(this,Gr,[]),B(this,wp,r=>{let a=Object.values({...this.schema.nodes,...this.schema.marks}).find(o=>o.spec.toMarkdown.match(r));if(!a)throw aP(r.type);return a}),B(this,hx,r=>L(this,wp).call(this,r).spec.toMarkdown.runner(this,r)),B(this,mx,(r,a)=>L(this,wp).call(this,r).spec.toMarkdown.runner(this,r,a)),B(this,gx,r=>{let a=s=>s.type.spec.priority??50,o=[...r].sort((s,l)=>a(s)-a(l)),i=[];return L(this,Gr).forEach(({mark:s})=>{let l=o.findIndex(u=>u.eq(s));l>=0&&i.push(...o.splice(l,1))}),i.concat(o)}),B(this,xx,r=>{let a=r?.marks,o=0;for(;o<L(this,Gr).length;){let{mark:i,spanning:s}=L(this,Gr)[o];if(s&&a?.some(l=>l.eq(i)))o++;else break}for(let i=L(this,Gr).length-1;i>=o;i--)L(this,Sp).call(this,L(this,Gr)[i].mark)}),B(this,kp,(r,a)=>{L(this,gx).call(this,r.marks).every(o=>!L(this,mx).call(this,o,r))&&L(this,hx).call(this,r),L(this,xx).call(this,a)}),B(this,Cp,r=>{let{children:a}=r;return a&&(r.children=a.reduce((o,i,s)=>{if(s===0)return[i];let l=o.at(-1);if(l&&l.isMark&&i.isMark){let{children:u,...c}=i,{children:f,...d}=l;if(i.type===l.type&&u&&f&&JSON.stringify(c)===JSON.stringify(d)){let p={...d,children:[...f,...u]};return o.slice(0,-1).concat(L(this,Cp).call(this,p))}}return o.concat(i)},[])),r}),B(this,bx,r=>{let a={...r.props,type:r.type};return r.children&&(a.children=r.children),r.value&&(a.value=r.value),a}),this.openNode=(r,a,o)=>(this.open(b9.create(r,void 0,a,o)),this),B(this,yx,(r,a)=>{let o="",i="",s=r.children;if(s){let u=s[0],c=s.at(-1);if(c&&c.type==="text"&&c.value.endsWith(" ")){let f=c.value,d=f.trimEnd();i=f.slice(d.length),c.value=d}if(u&&u.type==="text"&&u.value.startsWith(" ")){let f=u.value,d=f.trimStart();o=f.slice(0,f.length-d.length),u.value=d}}o.length&&L(this,tu).call(this,"text",void 0,o);let l=a();return i.length&&L(this,tu).call(this,"text",void 0,i),l}),B(this,zc,(r=!1)=>{let a=this.close(),o=()=>L(this,tu).call(this,a.type,a.children,a.value,a.props);return r?L(this,yx).call(this,a,o):o()}),this.closeNode=()=>(L(this,zc).call(this),this),B(this,tu,(r,a,o,i)=>{let s=b9.create(r,a,o,i),l=L(this,Cp).call(this,L(this,bx).call(this,s));return this.push(l),l}),this.addNode=(r,a,o,i)=>(L(this,tu).call(this,r,a,o,i),this),B(this,vx,(r,a,o,i)=>L(this,Gr).some(s=>s.mark.eq(r))?this:(L(this,Gr).push({mark:r,spanning:o==null}),this.openNode(a,o,{...i,isMark:!0}))),B(this,Sp,r=>{let a=-1;for(let o=L(this,Gr).length-1;o>=0;o--)if(L(this,Gr)[o].mark.eq(r)){a=o;break}a<0||(L(this,Gr).splice(a,1),L(this,zc).call(this,!0))}),this.withMark=(r,a,o,i)=>(L(this,vx).call(this,r,a,o,i),this),this.closeMark=r=>(L(this,Sp).call(this,r),this),this.build=()=>{let r=null;do r=L(this,zc).call(this);while(this.size());return r.children||(r.children=[]),r},this.next=r=>WQ(r)?(r.forEach((a,o,i)=>{L(this,kp).call(this,a,r.maybeChild(i+1)??void 0)}),this):(L(this,kp).call(this,r),this),this.toString=r=>r.stringify(this.build()),this.run=r=>(B(this,Gr,[]),this.next(r),this),this.schema=n}},Gr=new WeakMap,wp=new WeakMap,hx=new WeakMap,mx=new WeakMap,gx=new WeakMap,xx=new WeakMap,kp=new WeakMap,Cp=new WeakMap,bx=new WeakMap,yx=new WeakMap,zc=new WeakMap,tu=new WeakMap,vx=new WeakMap,Sp=new WeakMap,Vc.create=(n,r)=>{let a=new Vc(n);return o=>(a.run(o),a.toString(r))},Vc);var Wr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t};function Ep(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t}var FA=null;function Os(e,t,n){let r=FA||(FA=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r}function KQ(){FA=null}function hw(e,t,n,r){return n&&(L9(e,t,n,r,-1)||L9(e,t,n,r,1))}var S9=/^(img|br|input|textarea|hr)$/i;function L9(e,t,n,r,a){for(var o;;){if(e==n&&t==r)return!0;if(t==(a<0?0:Lr(e))){let i=e.parentNode;if(!i||!Ue(i)||mw(e)||S9.test(e.nodeName)||e.contentEditable=="false")return!1;t=Wr(e)+(a<0?0:1),e=i}else if(Ue(e)){let i=e.childNodes[t+(a<0?-1:0)];if(Ue(i)&&i.contentEditable=="false")if(!((o=i.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=a;else return!1;else{if(mw(i)||S9.test(i.nodeName))return!1;e=i,t=a<0?Lr(e):0}}else return!1}}function Lr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ue(e){return e.nodeType==1}function lr(e){return e.nodeType==3}function _p(e,t){return t?e.contains(Ue(t)?t:t.parentNode):!1}function r8(e,t){for(;;){if(lr(e)&&t)return e;if(Ue(e)&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Lr(e)}else if(e.parentNode&&!mw(e,!0))t=Wr(e),e=e.parentNode;else return null}}function a8(e,t){for(;;){if(lr(e)&&t<e.nodeValue.length)return e;if(Ue(e)&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!mw(e,!0))t=Wr(e)+1,e=e.parentNode;else return null}}function XQ(e,t,n){for(let r=t==0,a=t==Lr(e);r||a;){if(e==n)return!0;let o=Wr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,a=a&&o==Lr(e)}}function mw(e,t=!1){let n;for(let r=e;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&(!t||n.node.isBlock)&&(n.dom==e||n.contentDOM==e)}function Sw(e){return e.focusNode&&hw(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)}function o8(e,t){e.collapse(t.anchorNode,t.anchorOffset),(t.focusNode!=t.anchorNode||t.focusOffset!=t.anchorOffset)&&e.extend(t.focusNode,t.focusOffset)}function YQ(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ZQ(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function JQ(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Lr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Lr(r.startContainer),r.startOffset)}}}var Ci=typeof navigator<"u"?navigator:null,I9=typeof document<"u"?document:null,Tp=Ci&&Ci.userAgent||"",Ro=/gecko\/(\d+)/i.test(Tp)&&!/edge?\//i.test(Tp);Ro&&+(/Firefox\/(\d+)/.exec(Tp)||[0,0])[1];var HA=/Chrome\/(\d+)/.exec(Tp),Kr=!!HA,i8=HA?+HA[1]:0,Xr=!!Ci&&/Apple Computer/.test(Ci.vendor),Dp=Xr&&(/Mobile\/\w+/.test(Tp)||!!Ci&&Ci.maxTouchPoints>2),so=Dp||(Ci?/Mac/.test(Ci.platform):!1),s8=Ci?/Win/.test(Ci.platform):!1,Ps=/Android \d/.test(Tp),Lw=!!I9&&"webkitFontSmoothing"in I9.documentElement.style,QQ=Lw?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function eee(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ns(e,t){return typeof e=="number"?e:e[t]}function tee(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function A9(e,t,n){if(!VA(t)&&t.left==0)return;let r=e.someProp("scrollThreshold")||0,a=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let i=n||e.dom;i;){if(!Ue(i)){i=Ep(i);continue}let s=i==o.body,l=s?eee(o):tee(i),u=0,c=0;if(t.top<l.top+Ns(r,"top")?c=-(l.top-t.top+Ns(a,"top")):t.bottom>l.bottom-Ns(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+Ns(a,"top")-l.top:t.bottom-l.bottom+Ns(a,"bottom")),t.left<l.left+Ns(r,"left")?u=-(l.left-t.left+Ns(a,"left")):t.right>l.right-Ns(r,"right")&&(u=t.right-l.right+Ns(a,"right")),u||c)if(s)o.defaultView.scrollBy(u,c);else{let d=i.scrollLeft,p=i.scrollTop;c&&(i.scrollTop+=c),u&&(i.scrollLeft+=u);let h=i.scrollLeft-d,g=i.scrollTop-p;t={left:t.left-h,top:t.top-g,right:t.right-h,bottom:t.bottom-g}}let f=s?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:Ep(i)}}function nee(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,a;for(let o=(t.left+t.right)/2,i=n+1;i<Math.min(innerHeight,t.bottom);i+=5){let s=e.root.elementFromPoint(o,i);if(!s||s==e.dom||!e.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=n-20){r=s,a=l.top;break}}return{refDOM:r,refTop:a,stack:l8(e.dom)}}function l8(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ep(r));return t}function ree({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;u8(n,r==0?0:r-t)}function u8(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:a,left:o}=e[n];r.scrollTop!=a+t&&(r.scrollTop=a+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}var Lp=null;function c8(e){if(e.setActive)return e.setActive();if(Lp)return e.focus(Lp);let t=l8(e);e.focus(Lp==null?{get preventScroll(){return Lp={preventScroll:!0},!0}}:void 0),Lp||(Lp=!1,u8(t,0))}function f8(e,t){let n,r=2e8,a,o=0,i=t.top,s=t.top,l,u;for(let c=e.firstChild,f=0;c;c=c.nextSibling,f++){let d;if(Ue(c))d=c.getClientRects();else if(lr(c))d=Os(c).getClientRects();else continue;for(let p=0;p<d.length;p++){let h=d[p];if(h.top<=i&&h.bottom>=s){i=Math.max(h.bottom,i),s=Math.min(h.top,s);let g=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(g<r){n=c,r=g,a=g&&lr(n)?{left:h.right<t.left?h.right:h.left,top:t.top}:t,Ue(c)&&g&&(o=f+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(o=f+1)}}return!n&&l&&(n=l,a=u,r=0),n&&lr(n)?aee(n,a):!n||r?{node:e,offset:o}:f8(n,a)}function aee(e,t){let n=e.nodeValue.length,r=document.createRange(),a;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=nu(r,1);if(i.top!=i.bottom&&tE(t,i)){a={node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),a||{node:e,offset:0}}function tE(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oee(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function iee(e,t,n){let{node:r,offset:a}=f8(t,n),o=-1;if(Ue(r)&&!r.firstChild){let i=r.getBoundingClientRect();o=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return e.docView.posFromDOM(r,a,o)}function see(e,t,n,r){let a=-1;for(let o=t,i=!1;o!=e.dom;){let s=e.docView.nearestDesc(o,!0),l;if(!s)return null;if(Ue(s.dom)&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&l.left>r.left||l.top>r.top?a=s.posBefore:(!i&&l.right<r.left||l.bottom<r.top)&&(a=s.posAfter),i=!0),!s.contentDOM&&a<0&&!s.node.isText))return(s.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;o=s.dom.parentNode}return a>-1?a:e.docView.posFromDOM(t,n,-1)}function d8(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let a=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=a;;){let i=e.childNodes[o];if(Ue(i)){let s=i.getClientRects();for(let l=0;l<s.length;l++){let u=s[l];if(tE(t,u))return d8(i,t,u)}}if((o=(o+1)%r)==a)break}return e}function lee(e,t){let n=e.dom.ownerDocument,r,a=0,o=JQ(n,t.left,t.top);o&&({node:r,offset:a}=o);let i=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!i||!e.dom.contains(i)){let u=e.dom.getBoundingClientRect();if(!tE(t,u)||(i=d8(e.dom,t,u),!i))return null}if(Xr)for(let u=i;r&&u;u=Ep(u))u.draggable&&(r=void 0);if(i=oee(i,t),r){if(Ro&&Ue(r)&&(a=Math.min(a,r.childNodes.length),a<r.childNodes.length)){let c=r.childNodes[a],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&a++}let u;Lw&&a&&Ue(r)&&Ue(u=r.childNodes[a-1])&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&a--,r==e.dom&&a==r.childNodes.length-1&&Ue(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(a==0||!Ue(r)||r.childNodes[a-1].nodeName!="BR")&&(s=see(e,r,a,t))}s==null&&(s=iee(e,i,t));let l=e.docView.nearestDesc(i,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function VA(e){return e.top<e.bottom||e.left<e.right}function nu(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(VA(r))return r}return Array.prototype.find.call(n,VA)||e.getBoundingClientRect()}var uee=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function p8(e,t,n){let{node:r,offset:a,atom:o}=e.docView.domFromPos(t,n<0?-1:1),i=Lw||Ro;if(lr(r))if(i&&(uee.test(r.nodeValue)||(n<0?!a:a==r.nodeValue.length))){let l=nu(Os(r,a,a),n);if(Ro&&a&&/\s/.test(r.nodeValue[a-1])&&a<r.nodeValue.length){let u=nu(Os(r,a-1,a-1),-1);if(u.top==l.top){let c=nu(Os(r,a,a+1),-1);if(c.top!=l.top)return wx(c,c.left<u.left)}}return l}else{let l=a,u=a,c=n<0?1:-1;return n<0&&!a?(u++,c=-1):n>=0&&a==r.nodeValue.length?(l--,c=1):n<0?l--:u++,wx(nu(Os(r,l,u),c),c<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&a&&(n<0||a==Lr(r))){let l=r.childNodes[a-1];if(Ue(l))return OA(l.getBoundingClientRect(),!1)}if(o==null&&a<Lr(r)){let l=r.childNodes[a];if(Ue(l))return OA(l.getBoundingClientRect(),!0)}return OA(r.getBoundingClientRect(),n>=0)}if(o==null&&a&&(n<0||a==Lr(r))){let l=r.childNodes[a-1],u=lr(l)?Os(l,Lr(l)-(i?0:1)):Ue(l)&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return wx(nu(u,1),!1)}if(o==null&&a<Lr(r)){let l=r.childNodes[a];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?lr(l)?Os(l,0,i?0:1):Ue(l)?l:null:null;if(u)return wx(nu(u,-1),!0)}return wx(nu(lr(r)?Os(r):r,-n),n>=0)}function wx(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function OA(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function h8(e,t,n){let r=e.state,a=e.root.activeElement;r!=t&&e.updateState(t),a!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),a!=e.dom&&a&&a.focus()}}function cee(e,t,n){let r=t.selection,a=n=="up"?r.$from:r.$to;return h8(e,t,()=>{let{node:o}=e.docView.domFromPos(a.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let i=p8(e,a.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let l;if(Ue(s))l=s.getClientRects();else if(lr(s))l=Os(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})}var fee=/[\u0590-\u08ac]/;function dee(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let a=r.parentOffset,o=!a,i=a==r.parent.content.size,s=e.domSelection();return s?!fee.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?o:i:h8(e,t,()=>{let l=e.domSel.readRange(),u=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:f,focusOffset:d}=e.domSel.readRange(),p=f&&!_p(c,f)||l.focusNode==f&&l.focusOffset==d;return o8(s,l),u!=null&&(s.caretBidiLevel=u),p}):r.pos==r.start()||r.pos==r.end()}var E9=null,_9=null,T9=!1;function pee(e,t,n){return E9==t&&_9==n?T9:(E9=t,_9=n,T9=n=="up"||n=="down"?cee(e,t,n):dee(e,t,n))}var Gc=class{constructor(t,n,r,a){this.parent=t,this.children=n,this.dom=r,this.contentDOM=a,this.damage=0,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let a=this.children[n];if(a==t)return r;r+=a.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(t,n,r){if(this.contentDOM&&_p(this.contentDOM,t))if(r<0){let o,i;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}else{let o,i;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((i=o.pmViewDesc)&&i.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(i):this.posAtEnd}let a;if(t==this.dom&&this.contentDOM)a=n>Wr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM)){let o=t.compareDocumentPosition(this.contentDOM);o&16?a=n>Array.from(t.childNodes).findIndex(i=>i.contains(this.contentDOM)):a=!(o&4)}else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){a=!1;break}if(o.previousSibling)break}if(a==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){a=!0;break}if(o.nextSibling)break}}return a??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,a=t;a;a=a.parentNode){let o=this.getDesc(a),i;if(o&&(!n||o.node))if(r&&(i=o.nodeDOM)&&!(Ue(i)?_p(i,t):i==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let a=t;a;a=a.parentNode){let o=this.getDesc(a);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let a=this.children[n],o=r+a.size;if(r==t&&o!=r){for(;!a.border&&a.children.length;)for(let i=0;i<a.children.length;i++){let s=a.children[i];if(s.size){a=s;break}}return a}if(t<o)return a.descAt(t-r-a.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,a=0;for(let o=0;r<this.children.length;r++){let i=this.children[r],s=o+i.size;if(s>t){a=t-o;break}o=s}if(a)return this.children[r].domFromPos(a-this.children[r].border,n);for(;r>0;r--){let o=this.children[r-1];if(o.size||!(o instanceof xw||o instanceof gw&&o.side>=0))break}if(n<=0){let o,i=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,i=!1);return o&&n&&i&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Wr(o.dom)+1:0}}else{let o,i=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,i=!1);return o&&i&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Wr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let a=-1,o=-1;for(let i=r,s=0;;s++){let l=this.children[s],u=i+l.size;if(a==-1&&t<=u){let c=i+l.border;if(t>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=i;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){a=Wr(d.dom)+1;break}t-=d.size}a==-1&&(a=0)}if(a>-1&&(u>n||s==this.children.length-1)){n=u;for(let c=s+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Wr(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:t,to:n,fromOffset:a,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(!Ue(n)||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDamage(t){t&&(this.damage|=t,this.markParentDamage())}markParentDamage(){for(let t=this;;){let{parent:n}=t;if(!n||n.damage&1)break;n.damage|=1,t=n}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}},gw=class extends Gc{constructor(t,n,r,a){let o,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!o)return a;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){let s=Ue(i)?i:document.createElement("span");s!=i&&(s.appendChild(i),i=s),s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return!this.damage&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.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}},UA=class extends Gc{constructor(t,n,r,a){super(t,[],n,null),this.textDOM=r,this.text=a}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},qc=class e extends Gc{constructor(t,n,r,a,o){super(t,[],r,a),this.mark=n,this.spec=o}static create(t,n,r,a){let o=a.nodeViews[n.type.name],i=o&&o(n,a,r);return(!i||!i.dom)&&(i=ki.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.damage&4||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return!(this.damage&4)&&this.mark.eq(t)}markDamage(t){var n;this.damage|=t,(n=this.parent)===null||n===void 0||n.markDamage(2)}slice(t,n,r){let a=e.create(this.parent,this.mark,!0,r),o=this.children,i=this.size;n<i&&(o=jA(o,n,i,r)),t>0&&(o=jA(o,0,t,r));for(let s=0;s<o.length;s++)o[s].parent=a;return a.children=o,a}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},iu=class e extends Gc{constructor(t,n,r,a,o,i,s){super(t,[],o,i),this.node=n,this.outerDeco=r,this.innerDeco=a,this.nodeDOM=s}static create(t,n,r,a,o,i){let s=o.nodeViews[n.type.name],l,u=s&&s(n,o,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},r,a),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(!lr(c))throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=ki.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=g8(c,r,n),u?l=new bw(t,n,r,a,c,f||null,d,u):n.isText?new Lx(t,n,r,a,c,d):new e(t,n,r,a,c,f||null,d)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let a=this.children[r];if(this.dom.contains(a.dom.parentNode)){n.contentElement=a.dom.parentNode;break}}if(!n.contentElement){let r=t&&t.find(a=>Ue(a)&&t.indexOf(a.parentNode)<0&&this.dom.contains(a));r?n.contentElement=r:n.getContent=()=>re.empty}}return n}matchesNode(t,n,r){return!this.damage&&t.eq(this.node)&&yw(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,a=n,o=t.composing?this.localCompositionInfo(t,n):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new qA(this,i&&i.node,t),u=this.node.inlineContent,c=u&&this.node.isBlock;xee(this.node,this.innerDeco,(f,d,p)=>{f.spec.marks?l.syncToMarks(f.spec.marks,r,t,d):f.type.side>=0&&!p&&l.syncToMarks(d==this.node.childCount?Ye.none:this.node.child(d).marks,r,t,d),l.placeWidget(f,t,a)},(f,d,p,h)=>{l.syncToMarks(f.marks,r,t,h),c&&f.isAtom&&!f.isText&&l.addHackNode("IMG",l.top);let g;l.findNodeMatch(f,d,p,h)||s&&t.state.selection.from>a&&t.state.selection.to<a+f.nodeSize&&(g=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(f,d,p,g,t,a)||l.updateNextNode(f,d,p,t,h,a)||l.addNode(f,d,p,t,a),a+=f.nodeSize,u&&(c=f.isAtom&&!f.isText)}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.damage&2)&&(i&&this.protectLocalComposition(t,i),m8(this.contentDOM,this.children,t),Dp&&bee(this.dom))}localCompositionInfo(t,n){let{from:r,to:a}=t.state.selection;if(!(t.state.selection instanceof ye)||r<n||a>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let i=o.nodeValue,s=yee(this.node.content,i,r-n,a-n);return s<0?null:{node:o,pos:s,text:i}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:a}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new UA(this,o,n,a);t.input.compositionNodes.push(i),this.children=jA(this.children,r,r+a.length,t,i)}update(t,n,r,a,o){return this.damage&4||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,a,o),!0)}updateInner(t,n,r,a,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(a,o+1),this.damage=0}updateOuterDeco(t){if(yw(t,this.outerDeco))return;let n=!Ue(this.nodeDOM),r=this.dom;this.dom=nE(this.dom,this.nodeDOM,Ix(this.outerDeco,this.node,n),Ix(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){Ue(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){Ue(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function D9(e,t,n,r,a,o){o?nE(r,r,Ix(o,e,!1),Ix(t,e,!1)):g8(r,t,e);let i=new iu(void 0,e,t,n,r,r,r);return i.contentDOM&&i.updateChildren(a,0),i}var Lx=class e extends iu{constructor(t,n,r,a,o,i){super(t,n,r,a,o,null,i)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,a){return this.damage&4||this.damage&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.damage&8||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=t,this.damage=0,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return!1}slice(t,n,r){let a=this.node.cut(t,n),o=document.createTextNode(a.text);return new e(this.parent,a,this.outerDeco,this.innerDeco,o,o)}get domAtom(){return!1}isText(t){return this.node.text==t}},xw=class extends Gc{parseRule(){return{ignore:!0}}matchesHack(t){return!this.damage&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},bw=class extends iu{constructor(t,n,r,a,o,i,s,l){super(t,n,r,a,o,i,s),this.spec=l}update(t,n,r,a,o){if(this.damage&4)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,a,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,a,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}};function m8(e,t,n){let r=e.firstChild,a=!1;for(let o=0;o<t.length;o++){let i=t[o],s=i.dom;if(s.parentNode==e){for(;s!=r;)r=R9(r),a=!0;r=r.nextSibling}else a=!0,e.insertBefore(s,r);if(i instanceof qc){let l=r?r.previousSibling:e.lastChild;m8(i.contentDOM,i.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=R9(r),a=!0;a&&n.trackWrites==e&&(n.trackWrites=null)}var Cx=function(e){e&&(this.nodeName=e)};Cx.prototype=Object.create(null);var Uc=[new Cx];function Ix(e,t,n){if(e.length==0)return Uc;let r=n?Uc[0]:new Cx,a=[r];for(let o=0;o<e.length;o++){let i=e[o].type.attrs;if(i){i.nodeName&&a.push(r=new Cx(i.nodeName));for(let s in i){let l=i[s];l!=null&&(n&&a.length==1&&a.push(r=new Cx(t.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+l:s=="style"?r.style=(r.style?r.style+";":"")+l:s!="nodeName"&&(r[s]=l))}}}return a}function nE(e,t,n,r){if(n==Uc&&r==Uc)return t;let a=t;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(o){let l;s&&s.nodeName==i.nodeName&&a!=e&&(l=a.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(a),s=Uc[0]),a=l}hee(a,s||Uc[0],i)}return a}function hee(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)a.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<a.length;o++)r.indexOf(a[o])==-1&&e.classList.add(a[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,a;for(;a=r.exec(t.style);)e.style.removeProperty(a[1])}n.style&&(e.style.cssText+=n.style)}}function g8(e,t,n){return nE(e,e,Uc,Ix(t,n,!Ue(e)))}function yw(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function R9(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var qA=class{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=mee(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,a){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.damage=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;a<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let f=this.top.children[c];if(f.matchesMark(t[i])&&!this.isLocked(f.dom)){l=c;break}}if(l<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof qc&&!(c.damage&4)&&c.mark.type==t[i].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(t[i])&&(c.mark=t[i],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=qc.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,a){let o=-1,i;if(a>=this.preMatch.index&&(i=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&i.matchesNode(t,n,r))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let u=this.top.children[s];if(u.matchesNode(t,n,r)&&!this.preMatch.matched.has(u)){o=s;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,a,o,i){let s=this.top.children[a];return s.damage&4&&s.dom==s.contentDOM&&(s.damage=2),s.update(t,n,r,o,i)?(this.destroyBetween(this.index,a),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==r)return a}return-1}t=n}}updateNextNode(t,n,r,a,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof iu){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c=l.dom,f,d=this.isLocked(c)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&!(l.damage&4)&&yw(n,l.outerDeco));if(!d&&l.update(t,n,r,a,i))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,t,n,r,a,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=f,f.contentDOM&&(f.damage|=2,f.updateChildren(a,i+1),f.damage=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,a,o,i){if(t.damage&3||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!yw(r,t.outerDeco)||!a.eq(t.innerDeco))return null;let s=iu.create(this.top,n,r,a,o,i);if(s.contentDOM){s.children=t.children,t.children=[];for(let l of s.children)l.parent=s}return t.destroy(),s}addNode(t,n,r,a,o){let i=iu.create(this.top,t,n,r,a,o);i.contentDOM&&i.updateChildren(a,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,n,r){let a=this.index<this.top.children.length?this.top.children[this.index]:null;if(a&&a.matchesWidget(t)&&(t==a.widget||!a.widget.type.toDOM.parentNode))this.index++;else{let o=new gw(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof qc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Lx)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Xr||Kr)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let a=new xw(this.top,[],r,null);n!=this.top?n.children.push(a):n.children.splice(this.index++,0,a),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||Ue(t)&&t.contains(this.lock.parentNode))}};function mee(e,t){let n=t,r=n.children.length,a=[],o=e.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof qc)a.push(r-1),n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==t)break e;r=a.pop(),n=n.parent}let u=l.node;if(u){if(u!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}function gee(e,t){return e.type.side-t.type.side}function xee(e,t,n,r){let a=t.locals(e),o=0;if(a.length==0){for(let u=0;u<e.childCount;u++){let c=e.child(u);r(c,a,t.forChild(o,c),u),o+=c.nodeSize}return}let i=0,s=[],l=null;for(let u=0;;){let c,f;for(;i<a.length&&a[i].to==o;){let x=a[i++];x.widget&&(c?(f||(f=[c])).push(x):c=x)}if(c)if(f){f.sort(gee);for(let x=0;x<f.length;x++)n(f[x],u,!!l)}else n(c,u,!!l);let d,p;if(l)p=-1,d=l,l=null;else if(u<e.childCount)p=u,d=e.child(u++);else break;for(let x=0;x<s.length;x++)s[x].to<=o&&s.splice(x--,1);for(;i<a.length&&a[i].from<=o&&a[i].to>o;)s.push(a[i++]);let h=o+d.nodeSize;if(d.isText){let x=h;i<a.length&&a[i].from<x&&(x=a[i].from);for(let m=0;m<s.length;m++)s[m].to<x&&(x=s[m].to);x<h&&(l=d.cut(x-o),d=d.cut(0,x-o),h=x,p=-1)}else for(;i<a.length&&a[i].to<h;)i++;let g=d.isInline&&!d.isLeaf?s.filter(x=>!x.inline):s.slice();r(d,g,t.forChild(o,d),p),o=h}}function bee(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function yee(e,t,n,r){for(let a=0,o=0;a<e.childCount&&o<=r;){let i=e.child(a++),s=o;if(o+=i.nodeSize,!i.isText)continue;let l=i.text;for(;a<e.childCount;){let u=e.child(a++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){if(o>=r&&l.slice(r-t.length-s,r-s)==t)return r-t.length;let u=s<r?l.lastIndexOf(t,r-s-1):-1;if(u>=0&&u+t.length+s>=n)return s+u;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}return-1}function jA(e,t,n,r,a){let o=[];for(let i=0,s=0;i<e.length;i++){let l=e[i],u=s,c=s+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),a&&(o.push(a),a=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function $A(e,t){let{$anchor:n,$head:r}=e.selection,a=t>0?n.max(r):n.min(r),o=a.parent.inlineContent?a.depth?e.doc.resolve(t>0?a.after():a.before()):null:a;return o&&Te.findFrom(o,t)}function ru(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function M9(e,t,n){let r=e.state.selection;if(r instanceof ye)if(n.indexOf("s")>-1){let{$head:a}=r,o=a.textOffset?null:t<0?a.nodeBefore:a.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(a.pos+o.nodeSize*(t<0?-1:1));return ru(e,new ye(r.$anchor,i))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let a=$A(e.state,t);return a&&a instanceof Ae?ru(e,a):!1}else if(!so||n.indexOf("m")<0){let a=r.$head,o=a.textOffset?null:t<0?a.nodeBefore:a.nodeAfter,i;if(!o||o.isText)return!1;let s=t<0?a.pos-o.nodeSize:a.pos;return o.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM?Ae.isSelectable(o)?ru(e,new Ae(t<0?e.state.doc.resolve(a.pos-o.nodeSize):a)):ru(e,new ye(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1}}else return!1;else{if(r instanceof Ae&&r.node.isInline)return ru(e,new ye(t>0?r.$to:r.$from));{let a=$A(e.state,t);return a?ru(e,a):!1}}}function Sx(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR"):Ue(e)&&e.contentEditable=="false"}function Ip(e,t){return t<0?vee(e):wee(e)}function vee(e){let t=e.domSel.readRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let a,o,i=!1;for(Ro&&Ue(n)&&r<Lr(n)&&Sx(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(!Ue(n))break;let s=n.childNodes[r-1];if(Sx(s,-1))a=n,o=--r;else if(lr(s))n=s,r=n.nodeValue.length;else break}else{if(x8(n))break;{let s=n.previousSibling;for(;s&&Sx(s,-1);)a=n.parentNode,o=Wr(s),s=s.previousSibling;if(s)n=s,r=Lr(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}i?GA(e,n,r):a&&GA(e,a,o)}function wee(e){let t=e.domSel.readRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let a=Lr(n),o,i;for(;;)if(r<a){if(!Ue(n))break;let s=n.childNodes[r];if(Sx(s,1))o=n,i=++r;else break}else{if(x8(n))break;{let s=n.nextSibling;for(;s&&Sx(s,1);)o=s.parentNode,i=Wr(s)+1,s=s.nextSibling;if(s)n=s,r=0,a=Lr(n);else{if(n=n.parentNode,n==e.dom)break;r=a=0}}}o&&GA(e,o,i)}function x8(e){for(let t=e;t;t=t.parentNode){let n=t.pmViewDesc;if(n)return n.node?n.node.isBlock:!1}return!1}function GA(e,t,n){if(!lr(t)){let i,s;(s=a8(t,n))?(t=s,n=0):(i=r8(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection(),a=e.domSel.readRange();if(!r)return;Sw(a)?r.collapse(t,n):r.extend&&(r.collapse(a.anchorNode,a.anchorOffset),r.extend(t,n)),e.domSel.ignore();let{state:o}=e;setTimeout(()=>{e.state==o&&e.domSel.sync()},50)}function N9(e,t){let n=e.state.doc.resolve(t);if(!(Kr||s8)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}let r=e.dom;for(let o=n.depth;o>0;o--)if(n.node(o).isBlock){r=e.nodeDOM(n.before(o))||r;break}return getComputedStyle(r).direction=="rtl"?"rtl":"ltr"}function O9(e,t,n){let r=e.state.selection;if(r instanceof ye&&!r.empty||n.indexOf("s")>-1||so&&n.indexOf("m")>-1)return!1;let{$from:a,$to:o}=r;if(!a.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let i=$A(e.state,t);if(i&&i instanceof Ae)return ru(e,i)}if(!a.parent.inlineContent){let i=t<0?a:o,s=r instanceof $r?Te.near(i,t):Te.findFrom(i,t);return s?ru(e,s):!1}return!1}function P9(e,t){if(!(e.state.selection instanceof ye))return!0;let{$head:n,$anchor:r,empty:a}=e.state.selection;if(!n.sameParent(r))return!0;if(!a)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let i=e.state.tr;return t<0?i.delete(n.pos-o.nodeSize,n.pos):i.delete(n.pos,n.pos+o.nodeSize),e.dispatch(i),!0}return!1}function B9(e,t,n){e.domObserver.stopped(()=>t.contentEditable=n)}function kee(e){if(!Xr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSel.readRange();if(t&&Ue(t)&&n==0&&t.firstChild&&Ue(t.firstChild)&&t.firstChild.contentEditable=="false"){let r=t.firstChild;B9(e,r,"true"),setTimeout(()=>B9(e,r,"false"),20)}return!1}function Cee(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function See(e,t){let n=t.keyCode,r=Cee(t);if(n==8||so&&n==72&&r=="c")return P9(e,-1)||Ip(e,-1);if(n==46&&!t.shiftKey||so&&n==68&&r=="c")return P9(e,1)||Ip(e,1);if(n==13||n==27)return!0;if(n==37||so&&n==66&&r=="c"){let a=n==37?N9(e,e.state.selection.from)=="ltr"?-1:1:-1;return M9(e,a,r)||Ip(e,a)}else if(n==39||so&&n==70&&r=="c"){let a=n==39?N9(e,e.state.selection.from)=="ltr"?1:-1:1;return M9(e,a,r)||Ip(e,a)}else{if(n==38||so&&n==80&&r=="c")return O9(e,-1,r)||Ip(e,-1);if(n==40||so&&n==78&&r=="c")return kee(e)||O9(e,1,r)||Ip(e,1);if(r==(so?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function rE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:a,openEnd:o}=t;for(;a>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){a--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let i=e.someProp("clipboardSerializer")||ki.fromSchema(e.state.schema),s=C8(),l=s.createElement("div");l.appendChild(i.serializeFragment(r,{document:s}));let u=l.firstChild,c,f=0;for(;u&&Ue(u)&&(c=k8[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=s.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),f++}u=l.firstChild}u&&Ue(u)&&u.setAttribute("data-pm-slice",`${a} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
|
|
53
|
+
|
|
54
|
+
`);return{dom:l,text:d,slice:t}}function b8(e,t,n,r,a){let o=a.parent.type.spec.code,i,s;if(!n&&!t)return null;let l=!!t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return s=new ue(re.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
55
|
+
`))),0,0),e.someProp("transformPasted",d=>{s=d(s,e,!0)}),s;let f=e.someProp("clipboardTextParser",d=>d(t,a,r,e));if(f)s=f;else{let d=a.marks(),{schema:p}=e.state,h=ki.fromSchema(p);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let x=i.appendChild(document.createElement("p"));g&&x.appendChild(h.serializeNode(p.text(g,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),i=Eee(n),Lw&&_ee(i);let u=i&&i.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=i.firstChild;for(;d&&!Ue(d);)d=d.nextSibling;if(!d)break;i=d}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||wi.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||c),context:a,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Lee.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)s=Tee(z9(s,+c[1],+c[2]),c[4]);else if(s=ue.maxOpen(Iee(s.content,a),!0),s.openStart||s.openEnd){let f=0,d=0;for(let p=s.content.firstChild;f<s.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=s.content.lastChild;d<s.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);s=z9(s,f,d)}return e.someProp("transformPasted",f=>{s=f(s,e,r)}),s}var Lee=/^(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 Iee(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let a=t.node(n).contentMatchAt(t.index(n)),o,i=[];if(e.forEach(s=>{if(!i)return;let l=a.findWrapping(s.type),u;if(!l)return i=null;if(u=i.length&&o.length&&v8(l,o,s,i[i.length-1],0))i[i.length-1]=u;else{i.length&&(i[i.length-1]=w8(i[i.length-1],o.length));let c=y8(s,l);i.push(c),a=a.matchType(c.type),o=l}}),i)return re.from(i)}return e}function y8(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,re.from(e));return e}function v8(e,t,n,r,a){if(a<e.length&&a<t.length&&e[a]==t[a]){let o=v8(e,t,n,r.lastChild,a+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(a==e.length-1?n.type:e[a+1]))return r.copy(r.content.append(re.from(y8(n,e,a+1))))}}function w8(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,w8(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(re.empty,!0);return e.copy(n.append(r))}function WA(e,t,n,r,a,o){let i=t<0?e.firstChild:e.lastChild,s=i.content;return e.childCount>1&&(o=0),a<r-1&&(s=WA(s,t,n,r,a+1,o)),a>=n&&(s=t<0?i.contentMatchAt(0).fillBefore(s,o<=a).append(s):s.append(i.contentMatchAt(i.childCount).fillBefore(re.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(s))}function z9(e,t,n){return t<e.openStart&&(e=new ue(WA(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ue(WA(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var k8={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function C8(){return document.implementation.createHTMLDocument("title")}var kx=null;function Aee(e){let t=window.trustedTypes;if(!t)return e;if(!kx){if(kx=t.defaultPolicy)try{return kx.createHTML(e)}catch{}kx=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return kx.createHTML(e)}function Eee(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=C8(),r=n.body,a=/<([a-z][^>\s]+)/i.exec(e),o;if((o=a&&k8[a[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=Aee(e),o)for(let i=0;i<o.length;i++)r=r.querySelector(o[i])||r;for(let i=0;i<n.styleSheets.length;i++){let s=n.styleSheets[i];for(let l=0;l<s.rules.length;l++){let u=s.rules[l];if(u instanceof CSSStyleRule){let c=r.querySelectorAll(u.selectorText);for(let f=0;f<c.length;f++)c[f].style.cssText+=u.style.cssText}}}return r}function _ee(e){let t=e.querySelectorAll(Kr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Tee(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:a,openStart:o,openEnd:i}=e;for(let s=r.length-2;s>=0;s-=2){let l=n.nodes[r[s]];if(!l||l.hasRequiredAttrs()||!l.createAndFill(null,a))break;try{a=re.from(l.create(r[s+1],a))}catch{break}o++,i++}return new ue(a,o,i)}var Ba=class e{constructor(t,n,r,a){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=a}static from(t){return t instanceof e?t:new e(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}};Ba.null=new Ba(null,0,null,0);var KA=class{constructor(t){this.view=t,this.range=Ba.null,this.active=!1,this.synced=!1,this.suppress=!1,this.currentDocument=null,this.onSelectionChange=this.onSelectionChange.bind(this)}ensureListener(){let t=this.view.dom.ownerDocument;t!=this.currentDocument&&(this.currentDocument&&this.currentDocument.removeEventListener("selectionchange",this.onSelectionChange),this.currentDocument=t,t.addEventListener("selectionchange",this.onSelectionChange))}destroy(){this.currentDocument&&(this.currentDocument.removeEventListener("selectionchange",this.onSelectionChange),this.currentDocument=null),this.active=!1,this.range=Ba.null}suppressChanges(){this.suppress=!0,setTimeout(()=>this.suppress=!1,50)}onSelectionChange(){if(this.suppress&&this.view.hasFocus())return this.sync();this.read()&&this.view.domObserver.flush(!1)}readRange(){let{view:t}=this,n=t.dom.isConnected!==!1&&t.domSelection();return n?Xr&&t.root.nodeType===11&&ZQ(t.dom.ownerDocument)==t.dom?Ba.from(Dee(t,n)||n):Ba.from(n):Ba.null}read(){this.ensureListener();let t=I8(this.view);if(!t){this.active=!1,this.range=Ba.null;return}return this.active=!0,this.range.eq(t)?!1:(this.range=t,this.synced=!1,!0)}sync(t=!1){let{view:n}=this;n.docView&&(this.ensureListener(),n.domObserver.stopped(()=>{Pee(n,n.state.selection);let r=n.state.selection;if(n.input.mouseDown||S8(n)){let{desc:a,start:o}=L8(n.docView,r.from,r.to,0);n.cursorWrapper?Oee(n):a instanceof bw&&a.spec.setSelection?a.spec.setSelection(r.anchor-o,r.head-o,n.root):Ree(n,t,a,o),this.synced=this.active=!0}r.visible==n.dom.classList.contains("ProseMirror-hideselection")&&(r.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),Nee(n))),this.range=this.readRange()}))}ignore(t=this.readRange()){this.range=Ba.from(t),this.synced=!0}deactivate(){this.range=Ba.null,this.active=this.synced=!1}};function Dee(e,t){if(t.getComposedRanges){let a=t.getComposedRanges(e.root)[0];if(a)return F9(e,a)}let n;function r(a){a.preventDefault(),a.stopImmediatePropagation(),n=a.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?F9(e,n):null}function F9(e,t){let n=t.startContainer,r=t.startOffset,a=t.endContainer,o=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return hw(i.node,i.offset,a,o)&&([n,r,a,o]=[a,o,n,r]),new Ba(n,r,a,o)}function aE(e,t,n=null){let r=e.state.doc;if(!t.focusNode)return null;let a=e.docView.nearestDesc(t.focusNode),o=a&&a.size==0,i=e.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(i<0)return null;let s=r.resolve(i),l,u;if(Sw(t)){for(l=i;a&&!a.node;)a=a.parent;if(a&&a.node.isAtom&&Ae.isSelectable(a.node)&&a.parent&&!(a.node.isInline&&XQ(t.focusNode,t.focusOffset,a.dom))){let f=a.posBefore;u=new Ae(i==f?s:r.resolve(f))}else if(Ro&&n=="key"&&i>e.state.selection.to&&Ue(t.focusNode)&&t.focusOffset==t.focusNode.childNodes.length&&a&&a.posAtStart>e.state.selection.to)for(let f=t.focusNode;;f=f.parentNode){if(getComputedStyle(f).overflow!="visible"){u=Te.findFrom(r.resolve(a.posAtStart),1);break}if(f==a.dom||f.nextSibling||!f.parentNode||!Ue(f.parentNode))break}}else{if(t instanceof e.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=i,d=i;for(let p=0;p<t.rangeCount;p++){let h=t.getRangeAt(p);f=Math.min(f,e.docView.posFromDOM(h.startContainer,h.startOffset,1)),d=Math.max(d,e.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(f<0)return null;[l,i]=d==e.state.selection.anchor?[d,f]:[f,d],s=r.resolve(i)}else l=e.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let f=n=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;u=Rp(e,c,s,f)}return u}function S8(e){return e.editable?e.hasFocus():A8(e,e.domSel.readRange())&&(!document.activeElement||document.activeElement.contains(e.dom))}function Ree(e,t,n,r){let a=e.state.selection,{anchor:o,head:i}=a,s,l;H9&&!(a instanceof ye)&&(a.$from.parent.inlineContent||(s=V9(e,a.from)),!a.empty&&!a.$from.parent.inlineContent&&(l=V9(e,a.to)));let u=n.domFromPos(o-r,o>r?-1:1),c=i==o?u:n.domFromPos(i-r,i>r?-1:1);Mee(o,i,u,c,e,t),H9&&(s&&U9(s),l&&U9(l))}function L8(e,t,n,r=0){for(let a=0,o=r;a<e.children.length;a++){let i=e.children[a],s=o+i.size;if(t>o&&n<s)return L8(i,t,n,o+i.border);o=s}return{desc:e,start:r}}function Mee(e,t,n,r,a,o){let i=!1;if((Ro||Xr)&&e==t){let{node:l,offset:u}=n;if(lr(l)){if(i=!!(u&&l.nodeValue[u-1]==`
|
|
56
|
+
`),i&&u==l.nodeValue.length)for(let c=l,f;c;c=c.parentNode){if(f=c.nextSibling){f.nodeName=="BR"&&(n=r={node:f.parentNode,offset:Wr(f)+1});break}let d=c.pmViewDesc;if(d&&d.node&&d.node.isBlock)break}}else{let c=l.childNodes[u-1];i=c&&(c.nodeName=="BR"||c.contentEditable=="false")}}let s=a.domSel.readRange();if(Ro&&s.focusNode&&s.focusNode!=r.node&&Ue(s.focusNode)){let l=s.focusNode.childNodes[s.focusOffset];l&&l.contentEditable=="false"&&(o=!0)}!(o||i&&Xr)&&hw(n.node,n.offset,s.anchorNode,s.anchorOffset)&&hw(r.node,r.offset,s.focusNode,s.focusOffset)||o8(a.domSelection(),{focusNode:r.node,focusOffset:r.offset,anchorNode:n.node,anchorOffset:n.offset})}var H9=Xr||Kr&&i8<63;function V9(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),a=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Xr&&a&&a.contentEditable=="false")return PA(a);if((!a||a.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(a)return PA(a);if(o)return PA(o)}}function PA(e){return e.contentEditable="true",Xr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function U9(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Nee(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSel.readRange(),r=n.anchorNode,a=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=a)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!S8(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function Oee(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom;n.nodeName=="IMG"?t.collapse(n.parentNode,Wr(n)+1):t.collapse(n,0)}function Pee(e,t){if(t instanceof Ae){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(q9(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else q9(e)}function q9(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Rp(e,t,n,r){let a=e.someProp("createSelectionBetween",o=>o(e,t,n))||ye.between(t,n,r);return e.someProp("adjustSelectionFromDOM",o=>{a=o(e,a)}),a}function I8(e){if(e.editable&&!e.hasFocus())return null;let t=e.domSel.readRange();return t&&A8(e,t)?t:null}function A8(e,t){if(!t.anchorNode)return!1;try{return _p(e.dom,t.anchorNode)&&(e.editable||_p(e.dom,t.focusNode))}catch{return!1}}var Yr={},Zr={},Bee={touchstart:!0,touchmove:!0},XA=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastKeyDispatched=!1,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 zee(e){for(let t in Yr){let n=Yr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Hee(e,r)&&(e.input.composing&&(r.type=="keydown"||r.type=="beforeinput")&&r.isComposing===!1&&T8(e,!0),!oE(e,r)&&(e.editable||!(r.type in Zr))&&n(e,r))},Bee[t]?{passive:!0}:void 0)}Xr&&e.dom.addEventListener("input",()=>null),YA(e)}function Iw(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Fee(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function YA(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>oE(e,r))})}function oE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Hee(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Vee(e,t){!oE(e,t)&&Yr[t.type]&&(e.editable||!(t.type in Zr))&&Yr[t.type](e,t)}function au(e,t){let{input:n}=e;return n.lastKeyDispatched||e.composing?!1:(n.lastKeyDispatched=!0,typeof t=="string"&&(t=YQ(t=="Backspace"?8:13,t)),e.someProp("handleKeyDown",r=>r(e,t)))}Zr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),e.input.lastKeyDispatched=!1,!(Ps&&Kr&&n.keyCode==13)){if(Dp&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(au(e,"Enter"),e.input.lastIOSEnter=0)},200);return}n.keyCode!=229&&e.domObserver.forceFlush(!0),au(e,n)||See(e,n)?n.preventDefault():Iw(e,"key")}};Zr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Zr.keypress=(e,t)=>{let n=t;if(Xee(e)||!n.charCode||n.ctrlKey&&!n.altKey||so&&n.metaKey)return;if(e.someProp("handleKeyPress",a=>a(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ye)||!r.$from.sameParent(r.$to)){let a=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(a).scrollIntoView();!/[\r\n]/.test(a)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,a,o))&&e.dispatch(o()),n.preventDefault()}};function Ax(e){return{left:e.clientX,top:e.clientY}}function Uee(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function iE(e,t,n,r,a){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let i=o.depth+1;i>0;i--)if(e.someProp(t,s=>i>o.depth?s(e,n,o.nodeAfter,o.before(i),a,!0):s(e,n,o.node(i),o.before(i),a,!1)))return!0;return!1}function E8(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function qee(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Ae.isSelectable(r)?(E8(e,new Ae(n)),!0):!1}function jee(e,t){if(t==-1)return!1;let n=e.state.selection,r,a;n instanceof Ae&&(r=n.node);let o=e.state.doc.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i);if(Ae.isSelectable(s)){r&&n.$from.depth>0&&i>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?a=o.before(n.$from.depth):a=o.before(i);break}}return a!=null?(E8(e,Ae.create(e.state.doc,a)),!0):!1}function $ee(e,t,n,r,a){return iE(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(a?jee(e,n):qee(e,n))}function Gee(e,t,n,r){return iE(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",a=>a(e,t,r))}function Wee(e,t,n,r){return iE(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",a=>a(e,t,r))}function j9(e,t,n){if(t==-1)return e.inlineContent?ye.create(e,0,e.content.size):null;let r=e.resolve(t);for(let a=r.depth+1;a>0;a--){let o=a>r.depth?r.nodeAfter:r.node(a),i=r.before(a);if(o.inlineContent)return ye.create(e,i+1,i+1+o.content.size);if(n&&Ae.isSelectable(o))return Ae.create(e,i)}return null}var ZA=/[\w_\u00a1-\uffff]+/g;try{ZA=new RegExp("[\\p{L}\\p{N}_]+","gu")}catch{}function $9(e,t){let n=e.resolve(t),r=n.node(),a="",o=t,i=t;for(let g=n.indexAfter(),x=!1;g>0;g--){let m=r.child(g-1);if(!m.text)break;let y=o==t?t-n.posAtIndex(g-1):m.text.length,b=y;for(;b>0;b--)if(/\S/.test(m.text[b-1]))x=!0;else if(x)break;if(a=m.text.slice(b,y)+a,o-=y-b,b||o<t-50)break}for(let g=n.index(),x=!1;g<r.childCount;g++){let m=r.child(g);if(!m.text)break;let y=i==t?t-n.posAtIndex(g):0,b=y;for(;b<m.text.length;b++)if(/\S/.test(m.text[b]))x=!0;else if(x)break;if(a+=m.text.slice(y,b),i+=b-y,b<m.text.length||i>t+50)break}let s=o,l=i;if(Intl.Segmenter){for(let g of new Intl.Segmenter(void 0,{granularity:"word"}).segment(a))if(g.isWordLike){let x=g.index+o,m=x+g.segment.length;if(m<t)s=m;else if(x>t){l=x;break}else return ye.create(e,x,m)}}else{ZA.lastIndex=0;for(let g;g=ZA.exec(a);){let x=g.index+o,m=x+g[0].length;if(m<t)s=m;else if(x>t){l=x;break}else return ye.create(e,x,m)}}let u=a.slice(s-o,t-o),c=a.slice(t-o,l-o),f=/\S*$/.exec(u)[0].length,d=/^\S*/.exec(c)[0].length;if(f||d)return ye.create(e,t-f,t+d);let p=/\s*$/.exec(u)[0].length,h=/^\s*/.exec(c)[0].length;return ye.create(e,t-p,t+h)}var _8=so?"metaKey":"ctrlKey";Yr.mousedown=(e,t)=>{let n=t,r=Date.now();if(e.input.shiftKey=n.shiftKey,e.input.lastTouch>r-500)return!1;Wc(e);let a="singleClick";r-e.input.lastClick.time<500&&Uee(n,e.input.lastClick)&&!n[_8]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Ax(n));if(o)if(n.button==0){if(!e.hasFocus()){c8(e.dom);let s=e.root.activeElement;s&&!s.contains(e.dom)&&s.blur()}(e.input.mouseDown=new JA(e,o,n,a)).mightDrag||n.preventDefault()}else Iw(e,"pointer")};var JA=class{constructor(t,n,r,a){var o;this.view=t,this.startPos=n,this.event=r,this.type=a,this.didMove=!1,this.lastPos=-1,this.anchorRange=null,this.startDoc=t.state.doc,this.selectNode=!!r[_8],this.extend=r.shiftKey,this.anchorDoc=this.startDoc;let i=G9(t);if(this.extend){let s=t.state.selection;this.anchorRange=s instanceof Ae?{from:s.from,to:s.to}:{from:s.anchor,to:s.anchor};let l=s instanceof Ae?t.nodeDOM(s.from).getBoundingClientRect():t.coordsAtPos(s.anchor);this.anchorOffset={x:(l.left+l.right)/2-i.x,y:(l.top+l.bottom)/2-i.y}}else this.anchorOffset={x:r.clientX-i.x,y:r.clientY-i.y};if(a=="singleClick"){let{selection:s}=t.state,l,u,c=!1;if(s instanceof Ae&&s.from<=n.pos&&s.to>=n.pos)u=s.from,l=s.node,c=!0;else if(n.inside>-1)l=t.state.doc.nodeAt(n.inside),u=n.inside;else{let f=t.state.doc.resolve(n.pos);l=f.parent,u=f.depth?f.before():-1}if(c||u>-1&&l.type.spec.draggable&&l.type.spec.selectable!==!1){let f=(o=t.docView.descAt(u))===null||o===void 0?void 0:o.nodeDOM;this.mightDrag={node:l,elt:f,pos:u,addAttr:!1},f&&!f.draggable&&(this.mightDrag.addAttr=!0,t.domObserver.stopped(()=>f.draggable=!0))}else this.mightDrag=Kee(t,r)}else this.mightDrag=!1;t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),this.mightDrag||this.select(this.startPos,!0)}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null),typeof this.mightDrag=="object"&&this.mightDrag.addAttr&&this.view.domObserver.stopped(()=>this.mightDrag.elt.removeAttribute("draggable"))}maybeRunHandler(t,n){return(this.type=="singleClick"?$ee:this.type=="doubleClick"?Gee:Wee)(this.view,t.pos,t.inside,n,this.selectNode)}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.startPos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ax(t))),n&&(this.didMove||this.maybeRunHandler(n,t)||this.select(n,!0),t.preventDefault())}move(t){if(t.buttons==0){this.done();return}if(!this.didMove&&(Math.abs(this.event.x-t.clientX)>8||Math.abs(this.event.y-t.clientY)>8)&&(this.didMove=!0,this.mightDrag=!1),!this.mightDrag){let n=this.view.posAtCoords(Ax(t));n&&this.select(n,!1)}t.preventDefault()}select(t,n){if(t.pos==this.lastPos)return;this.lastPos=t.pos;let{view:r}=this,{doc:a}=r.state,o=this.type=="singleClick"?W9(r,a,t):this.type=="doubleClick"?$9(a,t.pos):j9(a,t.inside,n);o&&(n&&!this.extend?this.anchorRange=o:(!n||this.extend)&&(a.eq(this.anchorDoc)||this.restoreAnchor(),this.anchorRange&&this.anchorRange.from<o.from?o=Rp(r,a.resolve(this.anchorRange.from),a.resolve(o.to)):this.anchorRange&&this.anchorRange.to>o.to&&(o=Rp(r,a.resolve(this.anchorRange.to),a.resolve(o.from)))),o.eq(r.state.selection)||r.dispatch(r.state.tr.setSelection(o).setMeta("pointer",!0).scrollIntoView()))}restoreAnchor(){let t=G9(this.view),n=this.view.posAtCoords({left:this.anchorOffset.x+t.x,top:this.anchorOffset.y+t.y});if(!n)this.anchorRange=null;else{let{doc:r}=this.view.state;this.anchorRange=this.type=="singleClick"?W9(this.view,r,n):this.type=="doubleClick"?$9(r,n.pos):j9(r,n.inside,!1),this.anchorDoc=this.view.state.doc}}};function G9(e){let t=e.dom.getBoundingClientRect();return{x:t.left-e.dom.scrollLeft,y:t.top-e.dom.scrollTop}}function W9(e,t,n){if(n.inside>-1){let a=t.nodeAt(n.inside);if(a.isAtom&&Ae.isSelectable(a))return Ae.create(t,n.inside)}let r=t.resolve(n.pos);return Rp(e,r,r)}function Kee(e,t){let{selection:n}=e.state;if(n.empty)return!1;let r=e.domSelection();if(!r||r.rangeCount==0)return!0;let a=r.getRangeAt(0).getClientRects();for(let o=0;o<a.length;o++){let i=a[o];if(i.left<=t.clientX&&i.right>=t.clientX&&i.top<=t.clientY&&i.bottom>=t.clientY)return!0}return!1}Yr.touchstart=e=>{e.input.lastTouch=Date.now(),Wc(e),Iw(e,"pointer")};Yr.touchmove=e=>{e.input.lastTouch=Date.now(),Iw(e,"pointer")};Yr.contextmenu=e=>Wc(e);function Xee(e,t){return e.composing?!0:Xr&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Yee=Ps?5e3:-1;Zr.compositionstart=Zr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ye&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Kr&&s8&&Zee(e)))e.markCursor=e.state.storedMarks||n.marks(),Wc(e,!0),e.markCursor=null;else if(Wc(e,!t.selection.empty),Ro&&e.domSel.active&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(let{focusNode:r,focusOffset:a}=e.domSel.range;r&&Ue(r)&&a!=0;){let o=a<0?r.lastChild:r.childNodes[a-1];if(!o)break;if(lr(o)){let i=e.domSelection();i&&i.collapse(o,o.nodeValue.length);break}else r=o,a=-1}e.input.composing=!0}D8(e,Yee)};function Zee(e){let{focusNode:t,focusOffset:n}=e.domSel.range;if(!t||!Ue(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return Ue(r)&&r.contentEditable=="false"}Zr.compositionend=(e,t)=>{e.composing&&T8(e)};function T8(e,t=!1){e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,t?Wc(e):D8(e,20)}function D8(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Wc(e),t))}function R8(e){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());for(let t;t=e.input.compositionNodes.pop();)t.markParentDamage()}function Jee(e){let t=e.domSel.range;if(!e.domSel.active||!t.focusNode)return null;let n=r8(t.focusNode,t.focusOffset),r=a8(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let a=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!a||!a.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function Wc(e,t=!1){if(!(Ps&&e.domObserver.flushingSoon>=0)&&(e.domObserver.forceFlush(),R8(e),t||e.docView&&e.docView.damage)){let n=aE(e,e.domSel.readRange()),r=e.state.selection;n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state)}}function Qee(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),a=document.createRange();a.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(a),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Ex=Dp&&QQ<604;Yr.copy=Zr.cut=(e,t)=>{let n=t,r=e.state.selection,a=n.type=="cut";if(r.empty)return;let o=Ex?null:n.clipboardData,i=r.content(),{dom:s,text:l}=rE(e,i);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",l)):Qee(e,s),a&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ete(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function tte(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let a=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?_x(e,r.value,null,a,t):_x(e,r.textContent,r.innerHTML,a,t)},50)}function _x(e,t,n,r,a){let o=b8(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,a,o||ue.empty)))return!0;if(!o)return!1;let i=ete(o),s=i?e.state.tr.replaceSelectionWith(i,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function M8(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Zr.paste=(e,t)=>{let n=t;if(e.composing&&!Ps)return;let r=Ex?null:n.clipboardData,a=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&_x(e,M8(r),r.getData("text/html"),a,n)?n.preventDefault():tte(e,n)};var vw=class{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}},nte=so?"altKey":"ctrlKey";function N8(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[nte]}Yr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let a=e.state.selection,o=a.empty?null:e.posAtCoords(Ax(n)),i;if(!(o&&o.pos>=a.from&&o.pos<=(a instanceof Ae?a.to-1:a.to))){if(r&&typeof r.mightDrag=="object")i=Ae.create(e.state.doc,r.mightDrag.pos);else if(n.target&&Ue(n.target)){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(i=Ae.create(e.state.doc,f.posBefore))}}let s=(i||e.state.selection).content(),{dom:l,text:u,slice:c}=rE(e,s);(!n.dataTransfer.files.length||!Kr||i8>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ex?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ex||n.dataTransfer.setData("text/plain",u),e.dragging=new vw(c,N8(e,n),i)};Yr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Zr.dragover=Zr.dragenter=(e,t)=>t.preventDefault();Zr.drop=(e,t)=>{try{rte(e,t,e.dragging)}finally{e.dragging=null}};function rte(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Ax(t));if(!r)return;let a=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",p=>{o=p(o,e,!1)}):o=b8(e,M8(t.dataTransfer),Ex?null:t.dataTransfer.getData("text/html"),!1,a);let i=!!(n&&N8(e,t));if(e.someProp("handleDrop",p=>p(e,t,o||ue.empty,i))){t.preventDefault();return}if(!o)return;t.preventDefault();let s=o?EB(e.state.doc,a.pos,o):a.pos;s==null&&(s=a.pos);let l=e.state.tr;if(i){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(s),c=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(f))return;let d=l.doc.resolve(u);if(c&&Ae.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new Ae(d));else{let p=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,x,m)=>p=m),l.setSelection(Rp(e,d,l.doc.resolve(p)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}Yr.focus=e=>{if(e.input.lastFocus=Date.now(),!e.focused&&(e.domObserver.stopped(()=>e.dom.classList.add("ProseMirror-focused")),e.focused=!0,e.domSel.read(),!e.domSel.synced)){let t=e.domSel.range;setTimeout(()=>{let n=e.domSel.readRange();n&&t.eq(n)&&e.domSel.sync()},20)}};Yr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stopped(()=>e.dom.classList.remove("ProseMirror-focused")),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domSel.deactivate(),e.focused=!1)};Yr.beforeinput=(e,t)=>{if(Ps&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||e.domObserver.pendingRecords().length||(e.dom.blur(),e.focus(),au(e,"Backspace")))return;let{$cursor:a}=e.state.selection;a&&a.pos>0&&e.dispatch(e.state.tr.delete(a.pos-1,a.pos).scrollIntoView())},50)}};for(let e in Zr)Yr[e]=Zr[e];function Tx(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Dx=class{constructor(t){this.frag=t,this.index=0,this.off=0}nodeAt(t){for(;this.off<=t&&this.index<this.frag.childCount;){let n=this.frag.child(this.index);if(this.off==t)return n;this.off+=n.nodeSize,this.index++}return null}},ww=class e{constructor(t,n){this.toDOM=t,this.spec=n||$c,this.side=this.spec.side||0}map(t,n,r,a){let{pos:o,deleted:i}=t.mapResult(n.from+a,this.side<0?-1:1);return i?null:new Ht(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Tx(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}},jc=class e{constructor(t,n){this.attrs=t,this.spec=n||$c}map(t,n,r,a){let o=t.map(n.from+a,this.spec.inclusiveStart?-1:1)-r,i=t.map(n.to+a,this.spec.inclusiveEnd?1:-1)-r;return o>=i?null:new Ht(o,i,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof e&&Tx(this.attrs,t.attrs)&&Tx(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},QA=class e{constructor(t,n){this.attrs=t,this.spec=n||$c}map(t,n,r,a){let o=t.mapResult(n.from+a,1);if(o.deleted)return null;let i=t.mapResult(n.to+a,-1);return i.deleted||i.pos<=o.pos?null:new Ht(o.pos-r,i.pos-r,this)}valid(t,n,r){let a=r.nodeAt(n.from);return!!a&&!a.isText&&n.from+a.nodeSize==n.to}eq(t){return this==t||t instanceof e&&Tx(this.attrs,t.attrs)&&Tx(this.spec,t.spec)}destroy(){}},Ht=class e{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new e(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new e(t,t,new ww(n,r))}static inline(t,n,r,a){return new e(t,n,new jc(r,a))}static node(t,n,r,a){return new e(t,n,new QA(r,a))}get spec(){return this.type.spec}get inline(){return this.type instanceof jc}get widget(){return this.type instanceof ww}},Ap=[],$c={},Ct=class e{constructor(t,n){this.local=t.length?t:Ap,this.children=n.length?n:Ap}static create(t,n){return n.length?Cw(n,t,0,$c):Sr}find(t,n,r){let a=[];return this.findInner(t??0,n??1e9,a,0,r),a}findInner(t,n,r,a,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];if(s.from>n)break;s.to>=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+a,s.to+a))}for(let i=0;i<this.children.length&&!(this.children[i]>=n);i+=3)if(this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,n-s,r,a+s,o)}}map(t,n,r){return this==Sr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||$c)}mapInner(t,n,r,a,o){let i;if(this.local.length){let s=new Dx(n.content);for(let l=0;l<this.local.length;l++){let u=this.local[l].map(t,r,a);u&&u.type.valid(n,u,s)?(i||(i=[])).push(u):o.onRemove&&o.onRemove(this.local[l].spec)}}return this.children.length?ate(this.children,i||[],t,n,r,a,o):i?new e(i.sort(ou),Ap):Sr}add(t,n){return n.length?this==Sr?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let a,o=0;t.forEach((s,l)=>{let u=l+r,c;if(c=P8(n,s,u)){for(a||(a=this.children.slice());o<a.length&&a[o]<l;)o+=3;a[o]==l?a[o+2]=a[o+2].addInner(s,c,u+1):a.splice(o,0,l,l+s.nodeSize,Cw(c,s,u+1,$c)),o+=3}});let i=O8(o?B8(n):n,-r).sort(ou);if(i.length){let s=new Dx(t.content);for(let l=0;l<i.length;l++)i[l].type.valid(t,i[l],s)||i.splice(l--,1)}return new e(i.length?this.local.concat(i).sort(ou):this.local,a||this.children)}remove(t){return t.length==0||this==Sr?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,a=this.local;for(let o=0;o<r.length;o+=3){let i,s=r[o]+n,l=r[o+1]+n;for(let c=0,f;c<t.length;c++)(f=t[c])&&f.from>s&&f.to<l&&(t[c]=null,(i||(i=[])).push(f));if(!i)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(i,s+1);u!=Sr?r[o+2]=u:(r.splice(o,3),o-=3)}if(a.length){for(let o=0,i;o<t.length;o++)if(i=t[o])for(let s=0;s<a.length;s++)a[s].eq(i,n)&&(a==this.local&&(a=this.local.slice()),a.splice(s--,1))}return r==this.children&&a==this.local?this:a.length||r.length?new e(a,r):Sr}forChild(t,n){if(this==Sr)return this;if(n.isLeaf)return e.empty;let r,a,o=0,i=this.children.length/3;for(;o<i;){let u=o+i>>>1,c=u*3,f=this.children[c];if(f<t)o=u+1;else if(f>t)i=u;else{r=this.children[c+2];break}}let s=t+1,l=s+n.content.size;for(let u=0;u<this.local.length;u++){let c=this.local[u];if(c.from<l&&c.to>s&&c.type instanceof jc){let f=Math.max(s,c.from)-s,d=Math.min(l,c.to)-s;f<d&&(a||(a=[])).push(c.copy(f,d))}}if(a){let u=new e(a.sort(ou),Ap);return r?new kw([u,r]):u}return r||Sr}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return sE(this.localsInner(t))}localsInner(t){if(this==Sr)return Ap;if(t.inlineContent||!this.local.some(jc.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof jc||n.push(this.local[r]);return n}forEachSet(t){t(this)}};Ct.empty=new Ct([],[]);Ct.removeOverlap=sE;var Sr=Ct.empty,kw=class e{constructor(t){this.members=t}map(t,n){let r=this.members.map(a=>a.map(t,n,$c));return e.from(r)}forChild(t,n){if(n.isLeaf)return Ct.empty;let r=[];for(let a=0;a<this.members.length;a++){let o=this.members[a].forChild(t,n);o!=Sr&&(o instanceof e?r=r.concat(o.members):r.push(o))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let a=0;a<this.members.length;a++){let o=this.members[a].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let i=0;i<o.length;i++)n.push(o[i])}}return n?sE(r?n:n.sort(ou)):Ap}static from(t){switch(t.length){case 0:return Sr;case 1:return t[0];default:return new e(t.every(n=>n instanceof Ct)?t:t.reduce((n,r)=>n.concat(r instanceof Ct?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}};function ate(e,t,n,r,a,o,i){let s=e.slice();for(let u=0,c=o;u<n.maps.length;u++){let f=0;n.maps[u].forEach((d,p,h,g)=>{let x=g-h-(p-d);for(let m=0;m<s.length;m+=3){let y=s[m+1];if(y<0||d>y+c-f)continue;let b=s[m]+c-f;p>=b?s[m+1]=d<=b?-2:-1:d>=c&&x&&(s[m]+=x,s[m+1]+=x)}f+=x}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(s[u+1]==-2){l=!0,s[u+1]=-1;continue}let c=n.map(e[u]+o),f=c-a;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(e[u+1]+o,-1),p=d-a,{index:h,offset:g}=r.content.findIndex(f),x=r.maybeChild(h);if(x&&g==f&&g+x.nodeSize==p){let m=s[u+2].mapInner(n,x,c+1,e[u]+o+1,i);m!=Sr?(s[u]=f,s[u+1]=p,s[u+2]=m):(s[u+1]=-2,l=!0)}else l=!0}if(l){let u=ote(s,e,t,n,a,o,i),c=Cw(u,r,0,i);t=c.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,d=0;f<c.children.length;f+=3){let p=c.children[f];for(;d<s.length&&s[d]<p;)d+=3;s.splice(d,0,c.children[f],c.children[f+1],c.children[f+2])}}return new Ct(t.sort(ou),s)}function O8(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let a=e[r];n.push(new Ht(a.from+t,a.to+t,a.type))}return n}function ote(e,t,n,r,a,o,i){function s(l,u){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(r,a,u);f?n.push(f):i.onRemove&&i.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)s(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&s(e[l+2],t[l]+o+1);return n}function P8(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,a=null;for(let o=0,i;o<e.length;o++)(i=e[o])&&i.from>n&&i.to<r&&((a||(a=[])).push(i),e[o]=null);return a}function B8(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Cw(e,t,n,r){let a=[],o=!1;t.forEach((s,l)=>{let u=P8(e,s,l+n);if(u){o=!0;let c=Cw(u,s,n+l+1,r);c!=Sr&&a.push(l,l+s.nodeSize,c)}});let i=O8(o?B8(e):e,-n).sort(ou);if(i.length){let s=new Dx(t.content);for(let l=0;l<i.length;l++)i[l].type.valid(t,i[l],s)||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1))}return i.length||a.length?new Ct(i,a):Sr}function ou(e,t){return e.from-t.from||e.to-t.to}function sE(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let a=n+1;a<t.length;a++){let o=t[a];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[a]=o.copy(o.from,r.to),K9(t,a+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),K9(t,a,r.copy(o.from,r.to)));break}}}return t}function K9(e,t,n){for(;t<e.length&&ou(n,e[t])>0;)t++;e.splice(t,0,n)}function BA(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Sr&&t.push(r)}),e.cursorWrapper&&t.push(Ct.create(e.state.doc,[e.cursorWrapper.deco])),kw.from(t)}function ite(e,t,n,r){let{node:a,fromOffset:o,toOffset:i,from:s,to:l}=e.docView.parseRange(t,n),u=e.domSel.range,c,f=u.anchorNode;if(f&&_p(e.dom,f)&&(c=[{node:f,offset:u.anchorOffset}],Sw(u)||c.push({node:u.focusNode,offset:u.focusOffset})),Kr&&e.input.lastKeyCode===8)for(let m=i;m>o;m--){let y=a.childNodes[m-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){i=m;break}if(!b||b.size)break}let d=e.state.doc,p=e.someProp("domParser")||wi.fromSchema(e.state.schema),h=d.resolve(s),g=null,x=p.parse(a,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:ste(r),context:h});if(c&&c[0].pos!=null){let m=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=m),g={anchor:m+s,head:y+s}}return{doc:x,sel:g,from:s,to:l}}var ste=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(Xr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Xr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},lte=/^(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 ute(e,t,n,r,a,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let E=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,M=aE(e,e.domSel.range,E);if(M&&!e.state.selection.eq(M)&&e.domSel.active){if(Kr&&Ps&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&au(e,"Enter"))return;let S=e.state.tr.setSelection(M);E=="pointer"?S.setMeta("pointer",!0):E=="key"&&S.scrollIntoView(),i&&S.setMeta("composition",i),e.dispatch(S)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let u=e.state.selection,c=ite(e,t,n,o),f=e.state.doc,d=f.slice(c.from,c.to),p,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(p=e.state.selection.to,h="end"):(p=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let g=pte(d.content,c.doc.content,c.from,p,h);if(g&&e.input.domChangeCount++,(Dp&&e.input.lastIOSEnter>Date.now()-225||Ps)&&o.some(E=>Ue(E)&&!lte.test(E.nodeName))&&(!g||g.endA>=g.endB)&&au(e,"Enter")){e.input.lastIOSEnter=0;return}if(!g)if(a&&u instanceof ye&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))g={start:u.from,endA:u.to,endB:u.to};else{if(c.sel){let E=X9(e,e.state.doc,c.sel);if(E&&!E.eq(e.state.selection)){let M=e.state.tr.setSelection(E);i&&M.setMeta("composition",i),e.dispatch(M)}}return}e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof ye&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to));let x=c.doc.resolveNoCache(g.start-c.from),m=c.doc.resolveNoCache(g.endB-c.from),y=f.resolve(g.start),b=x.sameParent(m)&&x.parent.inlineContent&&y.end()>=g.endA;if((Dp&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!b&&dte(c.doc,x.pos,m.pos))&&au(e,"Enter")){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>g.start&&(b?g.endA>g.start&&g.endB==g.start:fte(f,g.start,g.endA,x,m))&&au(e,"Backspace")){Ps&&Kr&&e.domSel.suppressChanges();return}Kr&&g.endB==g.start&&(e.input.lastChromeDelete=Date.now()),Ps&&!b&&x.start()!=m.start()&&m.parentOffset==0&&x.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==g.endA&&(g.endB-=2,m=c.doc.resolveNoCache(g.endB-c.from),setTimeout(()=>au(e,"Enter"),20));let v=g.start,w=g.endA,k=E=>{let M=E||e.state.tr.replace(v,w,c.doc.slice(g.start-c.from,g.endB-c.from));if(c.sel){let S=X9(e,M.doc,c.sel);S&&!(Kr&&e.composing&&S.empty&&(g.start!=g.endB||e.input.lastChromeDelete<Date.now()-100)&&(S.head==v||S.head==M.mapping.map(w)-1))&&M.setSelection(S)}return i&&M.setMeta("composition",i),M.scrollIntoView()},_;if(b)if(x.pos==m.pos){let E=k(e.state.tr.delete(v,w)),M=f.resolve(g.start).marksAcross(f.resolve(g.endA));M&&E.ensureMarks(M),e.dispatch(E)}else if(g.endA==g.endB&&(_=cte(x.parent.content.cut(x.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,g.endA-y.start())))){let E=k(e.state.tr);_.type=="add"?E.addMark(v,w,_.mark):E.removeMark(v,w,_.mark),e.dispatch(E)}else if(x.parent.child(x.index()).isText&&x.index()==m.index()-(m.textOffset?0:1)){let E=x.parent.textBetween(x.parentOffset,m.parentOffset),M=()=>k(e.state.tr.insertText(E,v,w));e.someProp("handleTextInput",S=>S(e,v,w,E,M))||e.dispatch(M())}else e.dispatch(k());else e.dispatch(k())}function X9(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Rp(e,t.resolve(n.anchor),t.resolve(n.head))}function cte(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,a=n,o=r,i,s,l;for(let c=0;c<r.length;c++)a=r[c].removeFromSet(a);for(let c=0;c<n.length;c++)o=n[c].removeFromSet(o);if(a.length==1&&o.length==0)s=a[0],i="add",l=c=>c.mark(s.addToSet(c.marks));else if(a.length==0&&o.length==1)s=o[0],i="remove",l=c=>c.mark(s.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<t.childCount;c++)u.push(l(t.child(c)));if(re.from(u).eq(e))return{mark:s,type:i}}function fte(e,t,n,r,a){if(n-t<=a.pos-r.pos||zA(r,!0,!1)<a.pos)return!1;let o=e.resolve(t);if(!r.parent.inlineContent){let s=o.nodeAfter;return s!=null&&n==t+s.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let i=e.resolve(zA(o,!0,!0));return!i.parent.isTextblock||i.pos>n||zA(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function dte(e,t,n){let r=0,a=0;return e.nodesBetween(t,n,(o,i)=>{o.isTextblock&&i>=t&&i<n?r++:(o.isText?/\S/.test(o.text.slice(Math.max(0,t-i),Math.min(o.nodeSize,n-i))):o.isLeaf)&&a++}),a==0&&r==1}function zA(e,t,n){let r=e.depth,a=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,a++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,a++}return a}function pte(e,t,n,r,a){let o=e.findDiffStart(t,n),i=n+e.size,s=n+t.size;if(o==null)return null;let{a:l,b:u}=e.findDiffEnd(t,i,s);if(a=="end"){let c=Math.max(0,o-Math.min(l,u));r-=l+c-o}if(l<o&&i<s){let c=r<=o&&r>=l?o-r:0;o-=c,u=o+(u-l),l=o}else if(u<o){let c=r<=o&&r>=u?o-r:0;o-=c,l=o+(l-u),u=o}return{start:o,endA:l,endB:u}}var hte={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eE=class{constructor(t){this.view=t,this.queue=[],this.flushingSoon=-1,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.started=!1,this.observer=new window.MutationObserver(n=>{for(let r=0;r<n.length;r++)this.queue.push(n[r]);Xr&&t.composing&&n.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()})}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(t=!1){this.flushingSoon>-1?(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush(!0)):t&&this.flush(!0)}start(){this.observer.takeRecords(),this.observer.observe(this.view.dom,hte),this.started=!0}stop(){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect(),this.started=!1}stopped(t){if(!this.started)return t();this.stop();try{return t()}finally{this.start()}}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Ep(o))n.add(o);for(let o=t.anchorNode;o;o=Ep(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:lr(r)?r.parentNode:r}))return this.view.domSel.ignore(t),!0}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(t=!0){let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]),t&&n.domSel.read();let a=!n.domSel.suppress&&!n.domSel.synced&&!!I8(n)&&!this.ignoreSelectionChange(n.domSel.range),o=-1,i=-1,s=!1,l=[];if(n.editable)for(let c=0;c<r.length;c++){let f=this.registerMutation(r[c],l);f&&(o=o<0?f.from:Math.min(f.from,o),i=i<0?f.to:Math.max(f.to,i),f.typeOver&&(s=!0))}if(l.some(c=>c.nodeName=="BR")&&(n.input.lastKeyCode==8||n.input.lastKeyCode==46||Kr&&(n.composing||n.input.compositionEndedAt>Date.now()-50)&&r.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let f=c.nextSibling;for(;f&&Ue(f);){if(f.contentEditable=="false"){c.parentNode.removeChild(c);break}f=f.firstChild}}}else if(Ro&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=n.domSel.range;for(let d of c){let p=d.parentNode;p&&p.nodeName=="LI"&&(!f||gte(n,f)!=p)&&d.remove()}}}let u=null;o<0&&a&&n.domSel.active&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Sw(n.domSel.range)&&(u=aE(n,n.domSel.range))&&u.eq(Te.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,n.domSel.sync(),n.scrollToSelection()):(o>-1||a)&&(o>-1&&mte(n),n.input.badSafariComposition&&(n.input.badSafariComposition=!1,xte(n,l)),ute(this.view,o,i,a,s,l),n.docView&&n.docView.damage?n.updateState(n.state):a&&n.domSel.sync())}registerMutation(t,n){var r;if(n.indexOf(t.target)>-1)return null;let a;for(let o=t.target;o&&!(a=this.view.docView.getDesc(o));o=o.parentNode);if(t.type=="attributes"&&(a==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!a||a.ignoreMutation(t))return null;if(t.type=="childList"){for(let f=0;f<t.addedNodes.length;f++){let d=t.addedNodes[f];n.push(d),lr(d)&&(this.lastChangedTextNode=d)}if(a.contentDOM&&a.contentDOM!=a.dom&&!a.contentDOM.contains(t.target))return a.markDamage(4),{from:a.posBefore,to:a.posAfter};let o=t.previousSibling,i=t.nextSibling,s=o&&o.parentNode==t.target?Wr(o)+1:0,l=a.localPosFromDOM(t.target,s,-1),u=i&&i.parentNode==t.target?Wr(i):t.target.childNodes.length,c=a.localPosFromDOM(t.target,u,1);return a.markDamage(!((r=a.contentDOM)===null||r===void 0)&&r.contains(t.target)?2:4),{from:l,to:c}}else return t.type=="attributes"?(a.markDamage(4),{from:a.posAtStart-a.border,to:a.posAtEnd+a.border}):(this.lastChangedTextNode=t.target,a.markDamage(a instanceof Lx&&t.target==a.nodeDOM?8:4),{from:a.posAtStart,to:a.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}},Y9=new WeakMap,Z9=!1;function mte(e){if(!Y9.has(e)&&(Y9.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ro,Z9)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."),Z9=!0}}function gte(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function xte(e,t){var n;let{focusNode:r,focusOffset:a}=e.domSel.range;for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=o.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let s=i;for(;;){let l=s.firstChild;if(!l||!Ue(l)||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;s=l}s.insertBefore(o,s.firstChild),r==o&&e.domSelection().collapse(o,a)}else o.parentNode.removeChild(o)}}var Rx=class{constructor(t,n){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 XA,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(n8),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=e8(this),Q9(this),this.nodeViews=t8(this),this.docView=D9(this.state.doc,J9(this),BA(this),this.dom,this),this.domObserver=new eE(this),this.domSel=new KA(this),this.domObserver.start(),this.domSel.read(),zee(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&YA(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(n8),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let a=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(R8(this),i=!0),this.state=t;let s=a.plugins!=t.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=t8(this);yte(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&YA(this),this.editable=e8(this),Q9(this);let l=BA(this),u=J9(this),c=a.plugins!=t.plugins&&!a.doc.eq(t.doc)?"reset":t.scrollToSelection>a.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,u,l);(f||!t.selection.eq(a.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&nee(this);i&&this.domObserver.stopped(()=>{let p=f&&Kr&&!this.composing&&!a.selection.empty&&!t.selection.empty&&bte(a.selection,t.selection);if(f){let h=Kr?this.trackWrites=this.domSel.range.focusNode:null;if(this.composing&&(this.input.compositionNode=Jee(this)),o||!this.docView.update(t.doc,u,l,this,-1)){let g=this.docView.outerDeco;this.docView.destroy(),this.docView=D9(t.doc,u,l,this.dom,this,g)}h&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}this.domSel.sync(p)}),this.updatePluginViews(a),!((r=this.dragging)===null||r===void 0)&&r.node&&!a.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,a),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&ree(d)}scrollToSelection(){let t=this.domSel.range.focusNode;if(!(!t||!this.domSel.active)){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ae){let n=this.docView.domAfterPos(this.state.selection.from);Ue(n)&&A9(this,n.getBoundingClientRect(),t)}else A9(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,a=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)a=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==r.node&&(a=o)}this.dragging=new vw(t.slice,t.move,a<0?void 0:Ae.create(this.state.doc,a))}someProp(t,n){let r=this._props&&this._props[t],a;if(r!=null&&(a=n?n(r):r))return a;for(let i=0;i<this.directPlugins.length;i++){let s=this.directPlugins[i].props[t];if(s!=null&&(a=n?n(s):s))return a}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let s=o[i].props[t];if(s!=null&&(a=n?n(s):s))return a}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.editable&&c8(this.dom),this.domSel.sync()}get root(){let t=this.dom.isConnected!==!1;t||(this._root=null);let n=this._root;if(n==null&&t){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return n||document}updateRoot(){this._root=null}posAtCoords(t){return lee(this,t)}coordsAtPos(t,n=1){return p8(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let a=this.docView.posFromDOM(t,n,r);if(a==null)throw new RangeError("DOM position not inside the editor");return a}endOfTextblock(t,n){return pee(this,n||this.state,t)}pasteHTML(t,n){return _x(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return _x(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return rE(this,t)}destroy(){this.docView&&(Fee(this),this.domSel.destroy(),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],BA(this),this,-1),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,KQ())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return Vee(this,t)}domSelection(){return this.root.getSelection()}};Rx.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function J9(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Ht.node(0,e.state.doc.content.size,t)]}function Q9(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ht.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function e8(e){return!e.someProp("editable",t=>t(e.state)===!1)}function bte(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function t8(e){let t=Object.create(null);function n(r){for(let a in r)Object.prototype.hasOwnProperty.call(t,a)||(t[a]=r[a])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function yte(e,t){let n=0,r=0;for(let a in e){if(e[a]!=t[a])return!0;n++}for(let a in t)r++;return n!=r}function n8(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function Hs(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}var V8={text:(e,t,n,r)=>{let a=e.value;return/^[^*_\\]*\s+$/.test(a)?a:n.safe(a,{...r,encode:[]})},strong:(e,t,n,r)=>{let a=e.marker||n.options.strong||"*",o=n.enter("strong"),i=n.createTracker(r),s=i.move(a+a);return s+=i.move(n.containerPhrasing(e,{before:s,after:a,...i.current()})),s+=i.move(a+a),o(),s},emphasis:(e,t,n,r)=>{let a=e.marker||n.options.emphasis||"*",o=n.enter("emphasis"),i=n.createTracker(r),s=i.move(a);return s+=i.move(n.containerPhrasing(e,{before:s,after:a,...i.current()})),s+=i.move(a),o(),s}},it=Ie({},"editorView"),Mx=Ie({},"editorState"),lE=Ie([],"initTimer"),Bw=Ie({},"editor"),qp=Ie([],"inputRules"),Si=Ie([],"prosePlugins"),jp=Ie([],"remarkPlugins"),$p=Ie([],"nodeView"),Gp=Ie([],"markView"),Qc=Ie(Yg().use(ep).use(ip),"remark"),Mp=Ie({handlers:V8,encode:[]},"remarkStringifyOptions"),Aw=ao("ConfigReady");function vte(e){let t=n=>(n.record(Aw),async()=>(await e(n),n.done(Aw),()=>{n.clearTimer(Aw)}));return Hs(t,{displayName:"Config"}),t}var Fs=ao("InitReady");function wte(e){let t=n=>(n.inject(Bw,e).inject(Si,[]).inject(jp,[]).inject(qp,[]).inject($p,[]).inject(Gp,[]).inject(Mp,{handlers:V8,encode:[]}).inject(Qc,Yg().use(ep).use(ip)).inject(lE,[Aw]).record(Fs),async()=>{await n.waitTimers(lE);let r=n.get(Mp);return n.set(Qc,Yg().use(ep).use(ip,r)),n.done(Fs),()=>{n.remove(Bw).remove(Si).remove(jp).remove(qp).remove($p).remove(Gp).remove(Mp).remove(Qc).remove(lE).clearTimer(Fs)}});return Hs(t,{displayName:"Init"}),t}var Ir=ao("SchemaReady"),Ew=Ie([],"schemaTimer"),Ar=Ie({},"schema"),Np=Ie([],"nodes"),Op=Ie([],"marks");function z8(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var U8=e=>(e.inject(Ar,{}).inject(Np,[]).inject(Op,[]).inject(Ew,[Fs]).record(Ir),async()=>{await e.waitTimers(Ew);let t=e.get(Qc),n=e.get(jp).reduce((i,s)=>i.use(s.plugin,s.options),t);e.set(Qc,n);let r=Object.fromEntries(e.get(Np).map(([i,s])=>[i,z8(s)])),a=Object.fromEntries(e.get(Op).map(([i,s])=>[i,z8(s)])),o=new Qv({nodes:r,marks:a});return e.set(Ar,o),e.done(Ir),()=>{e.remove(Ar).remove(Np).remove(Op).remove(Ew).clearTimer(Ir)}});Hs(U8,{displayName:"Schema"});var Kc,lo,F8,q8=(F8=class{constructor(){X(this,Kc);X(this,lo);B(this,Kc,new xI),B(this,lo,null),this.setCtx=e=>{B(this,lo,e)},this.chain=()=>{if(L(this,lo)==null)throw yv();let e=L(this,lo),t=[],n=this.get.bind(this),r={run:()=>{let o=Nc(...t),i=e.get(it);return o(i.state,i.dispatch,i)},inline:o=>(t.push(o),r),pipe:a.bind(this)};function a(o,i){let s=n(o);return t.push(s(i)),r}return r}}get ctx(){return L(this,lo)}create(e,t){let n=e.create(L(this,Kc).sliceMap);return n.set(t),n}get(e){return L(this,Kc).get(e).get()}remove(e){return L(this,Kc).remove(e)}call(e,t){if(L(this,lo)==null)throw yv();let n=this.get(e)(t),r=L(this,lo).get(it);return n(r.state,r.dispatch,r)}inline(e){if(L(this,lo)==null)throw yv();let t=L(this,lo).get(it);return e(t.state,t.dispatch,t)}},Kc=new WeakMap,lo=new WeakMap,F8);function j8(e="cmdKey"){return Ie((()=>()=>!1),e)}var ge=Ie(new q8,"commands"),_w=Ie([Ir],"commandsTimer"),Pp=ao("CommandsReady"),$8=e=>{let t=new q8;return t.setCtx(e),e.inject(ge,t).inject(_w,[Ir]).record(Pp),async()=>(await e.waitTimers(_w),e.done(Pp),()=>{e.remove(ge).remove(_w).clearTimer(Pp)})};Hs($8,{displayName:"Commands"});function kte(e){return e.Backspace=Nc(XB,lw,qB,SA),e}var Xc,ha,H8,G8=(H8=class{constructor(){X(this,Xc);X(this,ha);B(this,Xc,null),B(this,ha,[]),this.setCtx=e=>{B(this,Xc,e)},this.add=e=>(L(this,ha).push(e),()=>{B(this,ha,L(this,ha).filter(t=>t!==e))}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([n,r])=>{if(typeof r=="function"){let a={key:n,onRun:()=>r};L(this,ha).push(a),t.push(()=>{B(this,ha,L(this,ha).filter(o=>o!==a))})}else L(this,ha).push(r),t.push(()=>{B(this,ha,L(this,ha).filter(a=>a!==r))})}),()=>{t.forEach(n=>n())}},this.addBaseKeymap=()=>{let e=kte(KB);return this.addObjectKeymap(e)},this.build=()=>{let e={};return L(this,ha).forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([t,n])=>{let r=n.sort((o,i)=>(i.priority??50)-(o.priority??50));return[t,(o,i,s)=>{let l=L(this,Xc);if(l==null)throw qd();let u=r.map(c=>c.onRun(l));return Nc(...u)(o,i,s)}]}))}}get ctx(){return L(this,Xc)}},Xc=new WeakMap,ha=new WeakMap,H8),Bx=Ie(new G8,"keymap"),uE=Ie([Ir],"keymapTimer"),Bp=ao("KeymapReady"),Cte=e=>{let t=new G8;return t.setCtx(e),e.inject(Bx,t).inject(uE,[Ir]).record(Bp),async()=>(await e.waitTimers(uE),e.done(Bp),()=>{e.remove(Bx).remove(uE).clearTimer(Bp)})},Tw=ao("ParserReady"),W8=(()=>{throw qd()}),ga=Ie(W8,"parser"),cE=Ie([],"parserTimer"),K8=e=>(e.inject(ga,W8).inject(cE,[Ir]).record(Tw),async()=>{await e.waitTimers(cE);let t=e.get(Qc),n=e.get(Ar);return e.set(ga,k9.create(n,t)),e.done(Tw),()=>{e.remove(ga).remove(cE).clearTimer(Tw)}});Hs(K8,{displayName:"Parser"});var zp=ao("SerializerReady"),fE=Ie([],"serializerTimer"),X8=(()=>{throw qd()}),Mo=Ie(X8,"serializer"),Y8=e=>(e.inject(Mo,X8).inject(fE,[Ir]).record(zp),async()=>{await e.waitTimers(fE);let t=e.get(Qc),n=e.get(Ar);return e.set(Mo,C9.create(n,t)),e.done(zp),()=>{e.remove(Mo).remove(fE).clearTimer(zp)}});Hs(Y8,{displayName:"Serializer"});var Nx=Ie("","defaultValue"),Dw=Ie(e=>e,"stateOptions"),Rw=Ie([],"editorStateTimer"),Mw=ao("EditorStateReady");function Ste(e,t,n){if(typeof e=="string")return t(e);if(e.type==="html")return wi.fromSchema(n).parse(e.dom);if(e.type==="json")return da.fromJSON(n,e.value);throw Q4(e)}var Lte=new qe("MILKDOWN_STATE_TRACKER"),Z8=e=>(e.inject(Nx,"").inject(Mx,{}).inject(Dw,t=>t).inject(Rw,[Tw,zp,Pp,Bp]).record(Mw),async()=>{await e.waitTimers(Rw);let t=e.get(Ar),n=e.get(ga),r=e.get(qp),a=e.get(Dw),o=e.get(Si),i=Ste(e.get(Nx),n,t),s=e.get(Bx),l=s.addBaseKeymap(),u=[...o,new Be({key:Lte,state:{init:()=>{},apply:(d,p,h,g)=>{e.set(Mx,g)}}}),l9({rules:r}),x9(s.build())];e.set(Si,u);let c=a({schema:t,doc:i,plugins:u}),f=sw.create(c);return e.set(Mx,f),e.done(Mw),()=>{l(),e.remove(Nx).remove(Mx).remove(Dw).remove(Rw).clearTimer(Mw)}});Hs(Z8,{displayName:"EditorState"});var Wp=Ie([],"pasteRule"),Nw=Ie([Ir],"pasteRuleTimer"),Ow=ao("PasteRuleReady"),J8=e=>(e.inject(Wp,[]).inject(Nw,[Ir]).record(Ow),async()=>(await e.waitTimers(Nw),e.done(Ow),()=>{e.remove(Wp).remove(Nw).clearTimer(Ow)}));Hs(J8,{displayName:"PasteRule"});var Ox=ao("EditorViewReady"),Pw=Ie([],"editorViewTimer"),ef=Ie({},"editorViewOptions"),Px=Ie(null,"root"),dE=Ie(null,"rootDOM"),pE=Ie({},"rootAttrs");function Ite(e,t){let n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set(dE,n);let r=t.get(pE);return Object.entries(r).forEach(([a,o])=>n.setAttribute(a,o)),n}function Ate(e){e.classList.add("editor"),e.setAttribute("role","textbox")}var Ete=new qe("MILKDOWN_VIEW_CLEAR"),Q8=e=>(e.inject(Px,document.body).inject(it,{}).inject(ef,{}).inject(dE,null).inject(pE,{}).inject(Pw,[Mw,Ow]).record(Ox),async()=>{await e.wait(Fs);let t=e.get(Px)||document.body,n=typeof t=="string"?document.querySelector(t):t;e.update(Si,l=>[new Be({key:Ete,view:u=>{let c=n?Ite(n,e):void 0;return(()=>{if(c&&n){let d=u.dom;n.replaceChild(c,d),c.appendChild(d)}})(),{destroy:()=>{c?.parentNode&&c?.parentNode.replaceChild(u.dom,c),c?.remove()}}}}),...l]),await e.waitTimers(Pw);let r=e.get(Mx),a=e.get(ef),o=Object.fromEntries(e.get($p)),i=Object.fromEntries(e.get(Gp)),s=new Rx(n,{state:r,nodeViews:o,markViews:i,transformPasted:(l,u,c)=>(e.get(Wp).sort((f,d)=>(d.priority??50)-(f.priority??50)).map(f=>f.run).forEach(f=>{l=f(l,u,c)}),l),...a});return Ate(s.dom),e.set(it,s),e.done(Ox),()=>{s?.destroy(),e.remove(Px).remove(it).remove(ef).remove(dE).remove(pE).remove(Pw).clearTimer(Ox)}});Hs(Q8,{displayName:"EditorView"});var Ux=(function(e){return e.Idle="Idle",e.OnCreate="OnCreate",e.Created="Created",e.OnDestroy="OnDestroy",e.Destroyed="Destroyed",e})({}),Yc,za,Bs,Fp,zx,Fx,ma,zs,Zc,Hx,Jc,Hp,Vx,su,Vp,Up,ez=(Up=class{constructor(){X(this,Yc);X(this,za);X(this,Bs);X(this,Fp);X(this,zx);X(this,Fx);X(this,ma);X(this,zs);X(this,Zc);X(this,Hx);X(this,Jc);X(this,Hp);X(this,Vx);X(this,su);X(this,Vp);B(this,Yc,!1),B(this,za,"Idle"),B(this,Bs,[]),B(this,Fp,()=>{}),B(this,zx,new xI),B(this,Fx,new hP),B(this,ma,new Map),B(this,zs,new Map),B(this,Zc,new pP(L(this,zx),L(this,Fx))),B(this,Hx,()=>{let t=vte(async r=>{await Promise.all(L(this,Bs).map(a=>Promise.resolve(a(r))))}),n=[U8,K8,Y8,$8,Cte,J8,Z8,Q8,wte(this),t];L(this,Jc).call(this,n,L(this,zs))}),B(this,Jc,(t,n)=>{t.forEach(r=>{let a=L(this,Zc).produce(L(this,Yc)?r.meta:void 0),o=r(a);n.set(r,{ctx:a,handler:o,cleanup:void 0})})}),B(this,Hp,(t,n=!1)=>Promise.all([t].flat().map(async r=>{let a=L(this,ma).get(r)?.cleanup;return n?L(this,ma).delete(r):L(this,ma).set(r,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof a=="function"?a():a}))),B(this,Vx,async()=>{await Promise.all([...L(this,zs).entries()].map(async([t,{cleanup:n}])=>typeof n=="function"?n():n)),L(this,zs).clear()}),B(this,su,t=>{B(this,za,t),L(this,Fp).call(this,t)}),B(this,Vp,t=>[...t.entries()].map(async([n,r])=>{let{ctx:a,handler:o}=r;if(!o)return;let i=await o();t.set(n,{ctx:a,handler:o,cleanup:i})})),this.enableInspector=(t=!0)=>(B(this,Yc,t),this),this.onStatusChange=t=>(B(this,Fp,t),this),this.config=t=>(L(this,Bs).push(t),this),this.removeConfig=t=>(B(this,Bs,L(this,Bs).filter(n=>n!==t)),this),this.use=t=>{let n=[t].flat();return n.flat().forEach(r=>{L(this,ma).set(r,{ctx:void 0,handler:void 0,cleanup:void 0})}),L(this,za)==="Created"&&L(this,Jc).call(this,n,L(this,ma)),this},this.remove=async t=>L(this,za)==="OnCreate"?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(n=>{setTimeout(()=>{n(this.remove(t))},50)})):(await L(this,Hp).call(this,[t].flat(),!0),this),this.create=async()=>L(this,za)==="OnCreate"?this:(L(this,za)==="Created"&&await this.destroy(),L(this,su).call(this,"OnCreate"),L(this,Hx).call(this),L(this,Jc).call(this,[...L(this,ma).keys()],L(this,ma)),await Promise.all([L(this,Vp).call(this,L(this,zs)),L(this,Vp).call(this,L(this,ma))].flat()),L(this,su).call(this,"Created"),this),this.destroy=async(t=!1)=>L(this,za)==="Destroyed"||L(this,za)==="OnDestroy"?this:L(this,za)==="OnCreate"?new Promise(n=>{setTimeout(()=>{n(this.destroy(t))},50)}):(t&&B(this,Bs,[]),L(this,su).call(this,"OnDestroy"),await L(this,Hp).call(this,[...L(this,ma).keys()],t),await L(this,Vx).call(this),L(this,su).call(this,"Destroyed"),this),this.action=t=>t(L(this,Zc)),this.inspect=()=>L(this,Yc)?[...L(this,zs).values(),...L(this,ma).values()].map(({ctx:t})=>t?.inspector?.read()).filter(t=>!!t):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new Up}get ctx(){return L(this,Zc)}get status(){return L(this,za)}},Yc=new WeakMap,za=new WeakMap,Bs=new WeakMap,Fp=new WeakMap,zx=new WeakMap,Fx=new WeakMap,ma=new WeakMap,zs=new WeakMap,Zc=new WeakMap,Hx=new WeakMap,Jc=new WeakMap,Hp=new WeakMap,Vx=new WeakMap,su=new WeakMap,Vp=new WeakMap,Up);var _te=e=>crypto.getRandomValues(new Uint8Array(e)),Tte=(e,t,n)=>{let r=256-256%e.length;if(r===256){let a=e.length-1;return(o=t)=>{if(!o)return"";let i="";for(;;){let s=n(o),l=o|=0;for(;l--;)if(i+=e[s[l]&a],i.length>=o)return i}}}return(a=t)=>{if(!a)return"";let o="",i=Math.ceil(1.6*256*a/r);for(;;){let s=n(i),l=i;for(;l--;)if(s[l]<r&&(o+=e[s[l]%e.length],o.length>=a))return o}}},Kp=(e,t=21)=>Tte(e,t|0,_te);var tSe=Kp("abcedfghicklmn",10);function tz(e,t,n){let r=e.findIndex(([o])=>o===t);if(r===-1)return[...e,n];let a=e.slice();return a[r]=n,a}function Se(e,t){let n=j8(e),r=a=>async()=>{r.key=n,await a.wait(Pp);let o=t(a);return a.get(ge).create(n,o),r.run=i=>a.get(ge).call(e,i),()=>{a.get(ge).remove(n)}};return r}function Er(e){let t=n=>async()=>{await n.wait(Ir);let r=e(n);return n.update(qp,a=>[...a,r]),t.inputRule=r,()=>{n.update(qp,a=>a.filter(o=>o!==r))}};return t}function nz(e){let t=n=>async()=>{await n.wait(Ir);let r=e(n);return n.update(Wp,a=>[...a,r]),t.pasteRule=r,()=>{n.update(Wp,a=>a.filter(o=>o!==r))}};return t}function Dte(e,t){let n=r=>async()=>{let a=t(r);return r.update(Op,o=>tz(o,e,[e,a])),n.id=e,n.schema=a,()=>{r.update(Op,o=>o.filter(([i])=>i!==e))}};return n.type=r=>{let a=r.get(Ar).marks[e];if(!a)throw iP(e);return a},n}function zw(e,t){let n=r=>async()=>{let a=t(r);return r.update(Np,o=>tz(o,e,[e,a])),n.id=e,n.schema=a,()=>{r.update(Np,o=>o.filter(([i])=>i!==e))}};return n.type=r=>{let a=r.get(Ar).nodes[e];if(!a)throw vv(e);return a},n}function rt(e){let t,n=r=>async()=>(await r.wait(Ir),t=e(r),r.update(Si,a=>[...a,t]),()=>{r.update(Si,a=>a.filter(o=>o!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function hE(e){let t=n=>async()=>{await n.wait(Bp);let r=n.get(Bx),a=e(n),o=r.addObjectKeymap(a);return t.keymap=a,()=>{o()}};return t}function Xp(e,t){let n=r=>async()=>{await r.wait(Ir);let a=t(r);return e.type(r)instanceof io?r.update($p,o=>[...o,[e.id,a]]):r.update(Gp,o=>[...o,[e.id,a]]),n.view=a,n.type=e,()=>{e.type(r)instanceof io?r.update($p,o=>o.filter(i=>i[0]!==e.id)):r.update(Gp,o=>o.filter(i=>i[0]!==e.id))}};return n}function He(e,t){let n=Ie(e,t),r=a=>(a.inject(n),()=>()=>{a.remove(n)});return r.key=n,r}function pn(e,t){let n=He(t,e),r=zw(e,o=>o.get(n.key)(o)),a=[n,r];return a.id=r.id,a.node=r,a.type=o=>r.type(o),a.ctx=n,a.key=n.key,a.extendSchema=o=>pn(e,o(t)),a}function lu(e,t){let n=He(t,e),r=Dte(e,o=>o.get(n.key)(o)),a=[n,r];return a.id=r.id,a.mark=r,a.type=o=>r.type(o),a.ctx=n,a.key=n.key,a.extendSchema=o=>lu(e,o(t)),a}function ur(e,t){let n=He(Object.fromEntries(Object.entries(t).map(([o,{shortcuts:i,priority:s}])=>[o,{shortcuts:i,priority:s}])),`${e}Keymap`),r=hE(o=>{let i=o.get(n.key),s=Object.entries(t).flatMap(([l,{command:u}])=>{let c=i[l],f=[c.shortcuts].flat(),d=c.priority;return f.map(p=>[p,{key:p,onRun:u,priority:d}])});return Object.fromEntries(s)}),a=[n,r];return a.ctx=n,a.shortcuts=r,a.key=n.key,a.keymap=r.keymap,a}var uo=(e,t=()=>({}))=>He(t,`${e}Attr`),tf=(e,t=()=>({}))=>He(t,`${e}Attr`);function No(e,t,n){let r=He(n??{},e),a=i=>async()=>{await i.wait(Fs);let s={plugin:t(i),options:i.get(r.key)};return i.update(jp,l=>[...l,s]),()=>{i.update(jp,l=>l.filter(u=>u!==s))}},o=[r,a];return o.id=e,o.plugin=a,o.options=r,o}function rz(e){return t=>{let n=t.get(it),r=t.get(Ar),a=t.get(Mo);if(!e)return a(n.state.doc);let o=n.state.doc.slice(e.from,e.to,!0),i=r.topNodeType.createAndFill(null,o.content);return i?a(i):(console.error("No document found"),"")}}function Rte(e,t){this.v=e,this.k=t}function az(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Mte(e){if(Array.isArray(e))return e}function Nte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return s}}function Ote(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pte(e,t){return Mte(e)||Nte(e,t)||Bte(e,t)||Ote()}function Bte(e,t){if(e){if(typeof e=="string")return az(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?az(e,t):void 0}}function Fw(e){var t,n;function r(o,i){try{var s=e[o](i),l=s.value,u=l instanceof Rte;Promise.resolve(u?l.v:l).then(function(c){if(u){var f=o==="return"&&l.k?o:"next";if(!l.k||c.done)return r(f,c);c=e[f](c).value}a(!!s.done,c)},function(c){r("throw",c)})}catch(c){a(2,c)}}function a(o,i){o===2?t.reject(i):t.resolve({value:i,done:o}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(o,i){return new Promise(function(s,l){var u={key:o,arg:i,resolve:s,reject:l,next:null};n?n=n.next=u:(t=n=u,r(o,i))})},typeof e.return!="function"&&(this.return=void 0)}Fw.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Fw.prototype.next=function(e){return this._invoke("next",e)},Fw.prototype.throw=function(e){return this._invoke("throw",e)},Fw.prototype.return=function(e){return this._invoke("return",e)};var wz=Object.entries,zte=Object.keys,oz=Object.setPrototypeOf,Fte=Object.isFrozen,kz=Object.getPrototypeOf,Cz=Object.getOwnPropertyDescriptor,Nn=Object.freeze,hn=Object.seal,cu=Object.create,Sz=typeof Reflect<"u"&&Reflect,Vw=Sz.apply,LE=Sz.construct;Nn||(Nn=function(t){return t});hn||(hn=function(t){return t});Vw||(Vw=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return t.apply(n,a)});LE||(LE=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new t(...r)});var Oo=Yt(Array.prototype.forEach),Hte=Yt(Array.prototype.lastIndexOf),iz=Yt(Array.prototype.pop),qx=Yt(Array.prototype.push),sz=Yt(Array.prototype.slice),Vte=Yt(Array.prototype.splice),Yp=Array.isArray,mE=IE(Set),gE=Yt(Set.prototype.add),jx=Yt(Set.prototype.has),Ute=Yt(Set.prototype.delete),qte=IE(Map),lz=Yt(Map.prototype.get),uz=Yt(Map.prototype.set),Vs=Yt(String.prototype.toLowerCase),xE=Yt(String.prototype.toString),jte=Yt(String.prototype.match),$x=Yt(String.prototype.replace),bE=Yt(String.prototype.indexOf),$te=Yt(String.prototype.trim),Gte=Yt(Number.prototype.toString),Wte=Yt(Boolean.prototype.toString),cz=typeof BigInt>"u"?null:Yt(BigInt.prototype.toString),fz=typeof Symbol>"u"?null:Yt(Symbol.prototype.toString),_r=Yt(Object.prototype.hasOwnProperty),Gx=Yt(Object.prototype.toString),Kte=RegExp.prototype.test,Ln=function(t,n){return t instanceof RegExp&&(t.lastIndex=0),Vw(Kte,t,[n])},Li=IE(TypeError);function Yt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return Vw(e,t,r)}}function IE(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return LE(e,n)}}function xt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vs;if(oz&&oz(e,null),!Yp(t))return e;let r=t.length;for(;r--;){let a=t[r];if(typeof a=="string"){let o=n(a);o!==a&&(Fte(t)||(t[r]=o),a=o)}e[a]=!0}return e}function Xte(e){for(let t=0;t<e.length;t++)_r(e,t)||(e[t]=null);return e}function Uw(e){let t=cu(null);for(let r of wz(e)){var n=Pte(r,2);let a=n[0],o=n[1];_r(e,a)&&(Yp(o)?t[a]=Xte(o):o&&typeof o=="object"&&o.constructor===Object?t[a]=Uw(o):t[a]=o)}return t}function Wx(e){let t=cu(null),n=zte(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function Yte(e){switch(typeof e){case"string":return e;case"number":return Gte(e);case"boolean":return Wte(e);case"bigint":return cz?cz(e):"0";case"symbol":return fz?fz(e):"Symbol()";case"undefined":return Gx(e);case"function":case"object":{if(e===null)return Gx(e);let t=e,n=Fa(t,"toString");if(typeof n=="function"){let r=n(t);return typeof r=="string"?r:Gx(r)}return Gx(e)}default:return Gx(e)}}function Fa(e,t){for(;e!==null;){let r=Cz(e,t);if(r){if(r.get)return Yt(r.get);if(typeof r.value=="function")return Yt(r.value)}e=kz(e)}function n(){return null}return n}function Zte(e,t){for(;e!==null;){let n=Cz(e,t);if(n)return n.get?Yt(n.get):null;e=kz(e)}return null}function Jte(e){if(!e)return!1;try{return Ln(e,""),!0}catch{return!1}}var dz=Nn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),yE=Nn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vE=Nn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Qte=Nn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),wE=Nn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ene=Nn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pz=Nn(["#text"]),hz=Nn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),kE=Nn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mz=Nn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Hw=Nn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tne=hn(/{{[\w\W]*|^[\w\W]*}}/g),nne=hn(/<%[\w\W]*|^[\w\W]*%>/g),rne=hn(/\${[\w\W]*/g),gz=hn(/{{|}}|\${|<%|%>/),ane=hn(/[^\t\n\f\r ]/),xz=hn(/\u0000/g),one=hn(/^data-[\-\w.\u00B7-\uFFFF]+$/),ine=hn(/^aria-[\-\w]+$/),bz=hn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sne=hn(/^(?:\w+script|data):/i),lne=hn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),une=hn(/^html$/i),cne=hn(/^[a-z][.\w]*(-[.\w]+)+$/i),CE=hn(/<[/\w!]/g),fne=hn(/<[/\w]/g),dne=hn(/<[/\w]|^-?>|--!?>|<!-$/g),pne=hn(/<\/no(script|embed|frames)/i),yz=hn(/\/>/i),hne=hn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),mne=hn(/^[\r\n\t ]+/),tn={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},gne=Nn(xt({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),xne=Nn(xt({},["textarea","title"])),bne=Nn(xt({},["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","meta","param","source","track","wbr"])),yne=function(){return typeof window>"u"?null:window},vne=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(r=n.getAttribute(a));let o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},vz=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},uu=function(t,n,r,a){return _r(t,n)&&Yp(t[n])?xt(a.base?Wx(a.base):{},t[n],a.transform):r},SE=function(t,n,r){let a=_r(t,n)?t[n]:void 0;return a&&typeof a=="object"?Uw(a):r};function Lz(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yne(),t=pe=>Lz(pe);if(t.version="3.5.0",t.removed=[],!e||!e.document||e.document.nodeType!==tn.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,a=r.currentScript,o=e.HTMLTemplateElement,i=e.Node,s=e.Element,l=e.NodeFilter,u=e.DOMParser,c=e.trustedTypes,f=s.prototype,d=Fa(f,"cloneNode"),p=Fa(f,"remove"),h=Fa(f,"removeChild"),g=Fa(f,"removeAttributeNode"),x=Fa(f,"nextSibling"),m=Fa(f,"childNodes"),y=Fa(f,"parentNode"),b=Fa(f,"shadowRoot"),v=Fa(f,"attributes"),w=i&&i.prototype?Fa(i.prototype,"nodeType"):null,k=i&&i.prototype?Fa(i.prototype,"nodeName"):null,_=i&&i.prototype?Fa(i.prototype,"ownerDocument"):null,E=function(C){return w?w(C):C.nodeType},M=function(C){return k?k(C):C.nodeName},S=Zte(f,"namespaceURI"),U=function(C){return S?S(C):C.namespaceURI},N=function(C){return E(C)===tn.element?v(C):null};if(typeof o=="function"){let pe=n.createElement("template");pe.content&&pe.content.ownerDocument&&(n=pe.content.ownerDocument)}let q,ie="",fe,he=!1,xe=0,Ce=function(){if(xe>0)throw Li('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Fe=function(C){Ce(),xe++;try{return q.createHTML(C)}finally{xe--}},D=function(C){return q&&Oe?Fe(C):C},st=function(C){Ce(),xe++;try{return q.createScriptURL(C)}finally{xe--}},Ke=function(){return he||(fe=vne(c,a),he=!0),fe},T=n,at=T.implementation,yt=T.createNodeIterator,Ut=T.createDocumentFragment,ln=T.getElementsByTagName,mt=r.importNode,be=vz();t.isSupported=typeof wz=="function"&&typeof y=="function"&&at&&at.createHTMLDocument!==void 0;let Tt=tne,Dt=nne,vt=rne,I=one,R=ine,z=sne,ne=lne,j=cne,W=bz,Y=null,se=xt({},[...dz,...yE,...vE,...wE,...pz]),K=null,Z=xt({},[...hz,...kE,...mz,...Hw]),$=null,te=null,le=null,me=Object.seal(cu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),P=!0,G=!0,de=!1,ve=!0,oe=!1,ce=!0,Ee=!1,tt=!1,un=null,Et=null,Qt=!1,V=!1,Le=!1,Oe=!1,et=!0,lt=!1,An="user-content-",cn=!0,wt=!1,Je=null,zt=null,Qn=!1,mr=null,Bu=xt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Xi=null,Yi=xt({},["audio","video","img","source","image","track"]),go=null,rl=xt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",En="http://www.w3.org/2000/svg",fn="http://www.w3.org/1999/xhtml",yn=fn,Vn=!1,Zi=null,xo=xt({},[$e,En,fn],xE),en=Nn(xt({},["mi","mo","mn","ms","mtext"])),Zo=null,al=Nn(xt({},["annotation-xml"])),Of=null,cb=Nn(cu(null)),fb=xt({},["title","style","font","a","script"]),Ji=null,db=["application/xhtml+xml","text/html"],pb="text/html",rn=null,ol=null,zu=null,hb=n.createElement("form"),rm=function(C){return C instanceof RegExp||C instanceof Function},Fu=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!C||typeof C!="object")&&(C={}),C=Uw(C),Ji=db.indexOf(C.PARSER_MEDIA_TYPE)===-1?pb:C.PARSER_MEDIA_TYPE,rn=Ji==="application/xhtml+xml"?xE:Vs,Y=uu(C,"ALLOWED_TAGS",se,{transform:rn}),K=uu(C,"ALLOWED_ATTR",Z,{transform:rn}),Zi=uu(C,"ALLOWED_NAMESPACES",xo,{transform:xE}),go=uu(C,"ADD_URI_SAFE_ATTR",rl,{transform:rn,base:rl}),Xi=uu(C,"ADD_DATA_URI_TAGS",Yi,{transform:rn,base:Yi}),mr=uu(C,"FORBID_CONTENTS",Bu,{transform:rn}),te=uu(C,"FORBID_TAGS",cu(null),{transform:rn}),le=uu(C,"FORBID_ATTR",cu(null),{transform:rn}),Qn=_r(C,"USE_PROFILES")?C.USE_PROFILES&&typeof C.USE_PROFILES=="object"?Uw(C.USE_PROFILES):C.USE_PROFILES:!1,P=C.ALLOW_ARIA_ATTR!==!1,G=C.ALLOW_DATA_ATTR!==!1,de=C.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=C.SAFE_FOR_TEMPLATES||!1,ce=C.SAFE_FOR_XML!==!1,Ee=C.WHOLE_DOCUMENT||!1,V=C.RETURN_DOM||!1,Le=C.RETURN_DOM_FRAGMENT||!1,Oe=C.RETURN_TRUSTED_TYPE||!1,Qt=C.FORCE_BODY||!1,et=C.SANITIZE_DOM!==!1,lt=C.SANITIZE_NAMED_PROPS||!1,cn=C.KEEP_CONTENT!==!1,wt=C.IN_PLACE||!1,W=Jte(C.ALLOWED_URI_REGEXP)?C.ALLOWED_URI_REGEXP:bz,yn=typeof C.NAMESPACE=="string"?C.NAMESPACE:fn,Zo=SE(C,"MATHML_TEXT_INTEGRATION_POINTS",en),Of=SE(C,"HTML_INTEGRATION_POINTS",al);let O=SE(C,"CUSTOM_ELEMENT_HANDLING",cb);if($=cu(null),_r(O,"tagNameCheck")&&rm(O.tagNameCheck)&&($.tagNameCheck=O.tagNameCheck),_r(O,"attributeNameCheck")&&rm(O.attributeNameCheck)&&($.attributeNameCheck=O.attributeNameCheck),_r(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),hn($),oe&&(G=!1),Le&&(V=!0),Qn&&((_r(C,"ALLOWED_TAGS")||_r(C,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Y=xt({},pz),K=cu(null),Qn.html===!0&&(xt(Y,dz),xt(K,hz)),Qn.svg===!0&&(xt(Y,yE),xt(K,kE),xt(K,Hw)),Qn.svgFilters===!0&&(xt(Y,vE),xt(K,kE),xt(K,Hw)),Qn.mathMl===!0&&(xt(Y,wE),xt(K,mz),xt(K,Hw))),me.tagCheck=null,me.attributeCheck=null,_r(C,"ADD_TAGS")&&(typeof C.ADD_TAGS=="function"?me.tagCheck=C.ADD_TAGS:Yp(C.ADD_TAGS)&&(Y===se&&(Y=Wx(Y)),xt(Y,C.ADD_TAGS,rn))),_r(C,"ADD_ATTR")&&(typeof C.ADD_ATTR=="function"?me.attributeCheck=C.ADD_ATTR:Yp(C.ADD_ATTR)&&(K===Z&&(K=Wx(K)),xt(K,C.ADD_ATTR,rn))),_r(C,"ADD_FORBID_CONTENTS")&&Yp(C.ADD_FORBID_CONTENTS)&&(mr===Bu&&(mr=Wx(mr)),xt(mr,C.ADD_FORBID_CONTENTS,rn)),cn&&(Y["#text"]=!0),Ee&&xt(Y,["html","head","body"]),Y.table&&(Y.tbody=!0,delete te.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let F=q;q=C.TRUSTED_TYPES_POLICY;try{ie=Fe("")}catch(Q){throw q=F,Q}}else C.TRUSTED_TYPES_POLICY===null?(q=void 0,ie=""):(q===void 0&&(q=Ke()),q&&typeof ie=="string"&&(ie=Fe("")));ol=Nn(C)},am=xt({},[...yE,...vE,...Qte]),om=xt({},[...wE,...ene]),mb=function(C,O,F){return O===fn?C==="svg":O===$e?C==="svg"&&(F==="annotation-xml"||Zo[F]):!!am[C]},gb=function(C,O,F){return O===fn?C==="math":O===En?C==="math"&&Of[F]:!!om[C]},xb=function(C,O,F){return O===En&&!Of[F]||O===$e&&!Zo[F]?!1:!om[C]&&(fb[C]||!am[C])},bb=function(C){let O=U(C),F=Vs(M(C)),Q=y(C),ke=yn,Me="template";return Q&&E(Q)===tn.element&&(ke=U(Q),Me=Vs(M(Q))),Zi[O]?O===En?mb(F,ke,Me):O===$e?gb(F,ke,Me):O===fn?xb(F,ke,Me):Ji==="application/xhtml+xml":!1},bo=function(C){qx(t.removed,{element:C}),_R(C);try{y(C).removeChild(C)}catch{if(p(C),!y(C))throw Li("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},im=function(C,O,F){try{g(C,O)}catch{try{C.removeAttribute(F)}catch{}}},yb=function(C){um(C);let O=m(C);O&&Oo(sz(O),F=>{try{h(C,F)}catch{}}),E(C)===tn.element&&sm(C,!1)},Sa=function(C,O,F){if(!F)try{F=O.getAttributeNode(C)}catch{F=null}if(qx(t.removed,{attribute:F||null,from:O}),F)im(O,F,C);else try{O.removeAttribute(C)}catch{}if(C==="is")if(V||Le)try{bo(O)}catch{}else try{O.setAttribute(C,"")}catch{}},sm=function(C,O){let F=v(C);if(F)for(let Q=F.length-1;Q>=0;--Q){let ke=F[Q],Me=ke&&ke.name;typeof Me=="string"&&!(O&&K[rn(Me)])&&im(C,ke,Me)}},lm=function(C,O){let F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Q=[C];for(;Q.length>0;){let ke=Q.pop();if(O(ke)===!1)continue;if(F&&E(ke)===tn.element){let ze=b(ke);Pf(ze)&&Q.push(ze)}let Me=m(ke);if(Me)for(let ze=Me.length-1;ze>=0;--ze)Q.push(Me[ze])}},um=function(C){lm(C,O=>{E(O)===tn.element&&sm(O,!0)})},Qi=function(C){let O=[];return lm(C,F=>{O.push(F)},!0),O},Hu=function(C,O){let F=mE();Oo(Qi(C),Q=>{E(Q)===tn.element&&gE(F,Q)}),Oo(O,Q=>{E(Q)===tn.element&&!jx(F,Q)&&sm(Q,!0)})},cm=function(C,O){let F=!1;return Oo(t.removed,Q=>{Q.element&&(F=F||Q.element===C,um(Q.element))}),Hu(C,O),F},ht=function(C,O){yb(C),cm(C,O)},De=8,Re=function(C,O){let F=Je,Q=null,ke=()=>(Q||(Q=mE(),Oo(O,Me=>{gE(Q,Me)})),Q);for(let Me=0;;Me++){let ze=Qi(C),qt=[C],es=!1;if(Oo(ze,Qo=>{E(Qo)===tn.documentFragment?qx(qt,Qo):!es&&!jx(F,Qo)&&(es=jx(ke(),Qo))}),!es)return;if(Me>=De)throw Li("the tree kept changing during in-place sanitization; refusing to return it");Oo(qt,(Qo,ei)=>{gt(Qo,ei>0,C,ke())})}},gt=function(C,O,F,Q){let ke=vb(C),Me;for(;Me=ke.nextNode();)!jx(Q,Me)||jx(Je,Me)||(O&&Jo(be.uponSanitizeShadowNode,Me,null),tS(Me,F))},JC=function(C){if(!Je)return;gE(Je,C);let O=lz(zt,C);if(O!==void 0){if(O>=De)throw Li("the tree kept changing during in-place sanitization; refusing to return it");uz(zt,C,O+1)}},_R=function(C){Je&&(Ute(Je,C),lz(zt,C)===void 0&&uz(zt,C,0))},TR=function(C,O){return ce?C==="patchsrc"?!0:C==="for"&&O!=="label"&&O!=="output":!1},E$=function(C){ce&&lm(C,O=>{let F=E(O);if(F===tn.processingInstruction||F===tn.comment&&Ln(fne,O.data)){try{p(O)}catch{}return!1}if(F===tn.element){let Q=O,ke=rn(M(O));try{Q.hasAttribute&&Q.hasAttribute("patchsrc")&&Q.removeAttribute("patchsrc"),Q.hasAttribute&&Q.hasAttribute("for")&&TR("for",ke)&&Q.removeAttribute("for")}catch{}}return!0})},DR=function(C){let O=null,F=null;if(Qt)C="<remove></remove>"+C;else{let Me=jte(C,mne);F=Me&&Me[0]}Ji==="application/xhtml+xml"&&yn===fn&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");let Q=q?Fe(C):C;if(yn===fn)try{O=new u().parseFromString(Q,Ji)}catch{}if(!O||!O.documentElement){O=at.createDocument(yn,"template",null);try{O.documentElement.innerHTML=Vn?ie:Q}catch{}}let ke=O.body||O.documentElement;return C&&F&&ke.insertBefore(n.createTextNode(F),ke.childNodes[0]||null),yn===fn?ln.call(O,Ee?"html":"body")[0]:Ee?O.documentElement:ke},vb=function(C){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,F=_?_(C):C.ownerDocument;return yt.call(F||C,C,(O?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},wb=function(C){return C=$x(C,Tt," "),C=$x(C,Dt," "),C=$x(C,vt," "),C},QC=function(C){var O;eS(C);let F=(O=C.querySelectorAll)===null||O===void 0?void 0:O.call(C,"template");F&&Oo(F,Q=>{Pf(Q.content)&&QC(Q.content)})},_$="table,tbody,thead,tfoot,tr,colgroup",T$=xt({},["caption","colgroup","col","thead","tbody","tfoot","tr","td","th","style","script","template"]),D$=function(C){var O;if(Ji==="application/xhtml+xml")return;let F=(O=C.querySelectorAll)===null||O===void 0?void 0:O.call(C,_$);!F||F.length===0||Oo(F,Q=>{Oo(sz(m(Q)),ke=>{let Me=E(ke);if(!(Me===tn.text?Ln(ane,ke.data):Me===tn.element&&!T$[Vs(M(ke))]))return;let ze=Q;for(;ze&&Vs(M(ze))!=="table";)ze=ze===C?null:y(ze);let qt=ze&&ze!==C?y(ze):null;if(qt)try{qt.insertBefore(ke,ze)}catch{}})})},eS=function(C){D$(C),C.normalize();let O=vb(C,!0),F=null,Q=O.nextNode();for(;Q;){let ke=Q.data;if(Ln(xz,ke)&&(ke=$x(ke,xz,""),Q.data=ke),Ln(gz,ke)&&(ke=wb(ke),Q.data=ke),ke&&E(Q)===tn.text){if(F){let Me=F.data,ze=Me[Me.length-1]+ke[0];Ln(gz,ze)&&(F.data=wb(Me+ke[0]))}F=Q}Q=O.nextNode()}},kb=function(C){let O=k?k(C):null;return typeof O!="string"||rn(O)!=="form"?!1:typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||C.attributes!==v(C)||typeof C.removeAttribute!="function"||typeof C.removeAttributeNode!="function"||typeof C.getAttributeNode!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function"||C.nodeType!==w(C)||C.childNodes!==m(C)},RR=function(C){if(!w||typeof C!="object"||C===null)return null;try{let O=w(C);return typeof O=="number"?O:null}catch{return null}},Pf=function(C){return RR(C)===tn.documentFragment},fm=function(C){return RR(C)!==null};function Jo(pe,C,O){pe.length!==0&&Oo(pe,F=>{F.call(t,C,O,ol)})}let R$=function(C,O){let F=!!bne[O],Q=!!gne[O];return!F&&!Q&&!xne[O]||U(C)!==fn?!1:F?C.hasChildNodes():fm(C.firstElementChild)?!0:Q&&typeof C.textContent=="string"&&Ln(CE,C.textContent)},M$=function(C,O,F){return!!(ce&&F===tn.element&&C.hasChildNodes()&&!fm(C.firstElementChild)&&Ln(CE,C.textContent)&&Ln(CE,C.innerHTML)||ce&&F===tn.element&&R$(C,O)||F===tn.processingInstruction||ce&&F===tn.comment&&Ln(dne,C.data))},Cb=function(C,O){if(C instanceof RegExp)return Ln(C,O);if(C instanceof Function){for(var F=arguments.length,Q=new Array(F>2?F-2:0),ke=2;ke<F;ke++)Q[ke-2]=arguments[ke];return!!C(O,...Q)}return!1},N$=function(C,O,F){if(!te[O]&&OR(O)&&Cb($.tagNameCheck,O))return!1;if(cn&&!mr[O]&&!mr[Vs(O)]){let Q=y(C),ke=m(C);if(ke&&Q){let Me=ke.length;for(let ze=Me-1;ze>=0;--ze){let qt=C===F?d(ke[ze],!0):ke[ze];Q.insertBefore(qt,x(C))}}}return bo(C),!0},MR=function(C,O,F,Q){return C.length===0?O:O===F||O===Q?Wx(O):O},dm=function(C,O){return C===O||y(C)!==null?!1:(wt&&um(C),_R(C),!0)},O$=function(C,O){if(JC(C),Jo(be.beforeSanitizeElements,C,null),dm(C,O))return!0;if(kb(C))return bo(C),!0;let F=rn(M(C)),Q=E(C);if(Y=MR(be.uponSanitizeElement,Y,se,un),Jo(be.uponSanitizeElement,C,{tagName:F,allowedTags:Y}),dm(C,O))return!0;if(M$(C,F,Q))return bo(C),!0;if((te[F]||!(me.tagCheck instanceof Function&&me.tagCheck(F))&&!Y[F])&&N$(C,F,O))return!0;if(Q===tn.element&&!bb(C)||(F==="noscript"||F==="noembed"||F==="noframes")&&Ln(pne,C.innerHTML))return bo(C),!0;if(oe&&Q===tn.text){let ke=C.textContent,Me=wb(ke);ke!==Me&&(qx(t.removed,{element:C.cloneNode()}),C.textContent=Me)}return Jo(be.afterSanitizeElements,C,null),dm(C,O)},NR=function(C,O,F){if(le[O]||TR(O,C)||et&&(O==="id"||O==="name")&&(F in n||F in hb))return!1;let Q=K[O]||me.attributeCheck instanceof Function&&me.attributeCheck(O,C);if(G&&Ln(I,O)||P&&Ln(R,O))return!0;if(!Q)return OR(C)&&Cb($.tagNameCheck,C)&&Cb($.attributeNameCheck,O,C)||O==="is"&&$.allowCustomizedBuiltInElements&&Cb($.tagNameCheck,F);if(go[O])return!0;let ke=$x(F,ne,"");return Ln(W,ke)||(O==="src"||O==="xlink:href"||O==="href")&&C!=="script"&&bE(F,"data:")===0&&Xi[C]||de&&!Ln(z,ke)?!0:!F},P$=xt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),OR=function(C){return!P$[Vs(C)]&&Ln(j,C)},B$=function(C,O,F,Q){if(q&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!F)switch(c.getAttributeType(C,O)){case"TrustedHTML":return Fe(Q);case"TrustedScriptURL":return st(Q)}return Q},z$=function(C,O,F,Q){try{return F?C.setAttributeNS(F,O,Q):C.setAttribute(O,Q),kb(C)?(bo(C),!1):!0}catch{return Sa(O,C),!1}},PR=function(C,O){return ce&&Ln(hne,O)?!0:Vs(C)==="attributename"&&bE(O,"href")!==-1},F$=function(C,O){if(Jo(be.beforeSanitizeAttributes,C,null),dm(C,O))return;let F=N(C);if(!F||kb(C))return;K=MR(be.uponSanitizeAttribute,K,Z,Et);let Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0},ke=F.length,Me=rn(M(C));for(;ke--;){let ze=F[ke];if(!ze)continue;let qt=ze.name,es=ze.namespaceURI,Qo=ze.value,ei=rn(qt),Vu=Qo,vn=qt==="value"?Vu:$te(Vu),pm=!1;if(Q.attrName=ei,Q.attrValue=vn,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Jo(be.uponSanitizeAttribute,C,Q),vn=Q.attrValue,lt&&(ei==="id"||ei==="name")&&bE(vn,An)!==0&&(Sa(qt,C,ze),vn=An+vn,pm=!0),PR(qt,vn)){Sa(qt,C,ze);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){Sa(qt,C,ze);continue}if(!ve&&Ln(yz,vn)){Sa(qt,C,ze);continue}if(oe&&(vn=wb(vn)),!NR(Me,ei,vn)){Sa(qt,C,ze);continue}vn=B$(Me,ei,es,vn),vn!==Vu&&z$(C,qt,es,vn)&&pm&&iz(t.removed)}}Jo(be.afterSanitizeAttributes,C,null),dm(C,O)},tS=function(C,O){O$(C,O),F$(C,O),Pf(C.content)&&nS(C.content)},nS=function(C){let O=null,F=vb(C);for(Jo(be.beforeSanitizeShadowDOM,C,null);O=F.nextNode();)if(Jo(be.uponSanitizeShadowNode,O,null),tS(O,C),E(O)===tn.element){let Q=b(O);Pf(Q)&&(rS(Q),nS(Q))}oe&&eS(C),Jo(be.afterSanitizeShadowDOM,C,null)},rS=function(C){let O=[{node:C,shadow:null}];for(;O.length>0;){let F=O.pop();if(F.shadow){nS(F.shadow);continue}let Q=F.node,ke=E(Q)===tn.element,Me=m(Q);if(Me)for(let ze=Me.length-1;ze>=0;--ze)O.push({node:Me[ze],shadow:null});if(ke){let ze=k?k(Q):null;if(typeof ze=="string"&&rn(ze)==="template"){let qt=Q.content;Pf(qt)&&O.push({node:qt,shadow:null})}}if(ke){let ze=b(Q);Pf(ze)&&O.push({node:null,shadow:ze},{node:ze,shadow:null})}}},H$=function(C){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,Q=null,ke=null,Me=null;if(Vn=!C,Vn&&(C="<!-->"),typeof C!="string"&&!fm(C)&&(C=Yte(C),typeof C!="string"))throw Li("dirty is not a string, aborting");if(!t.isSupported)return C;tt?(Y=un,K=Et):Fu(O),zu=ol,t.removed=[];let ze=wt&&typeof C!="string"&&fm(C),qt=[],es=Je,Qo=zt;if(ze){E$(C),qt=Qi(C);let vn=M(C);if(typeof vn=="string"){let pm=rn(vn);if(!Y[pm]||te[pm])throw ht(C,qt),Li("root node is forbidden and cannot be sanitized in-place")}if(kb(C))throw ht(C,qt),Li("root node is clobbered and cannot be sanitized in-place");Je=mE(),zt=qte()}else if(fm(C))F=DR("<!---->"),Q=F.ownerDocument.importNode(C,!0),Q.nodeType===tn.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?F=Q:F.appendChild(Q),rS(F);else{if(!V&&!oe&&!Ee&&C.indexOf("<")===-1)return D(C);if(F=DR(C),!F)return V?null:Oe?ie:""}F&&Qt&&bo(F.firstChild);let ei=ze?C:F;try{ze&&rS(C);let vn=vb(ei);for(;ke=vn.nextNode();)tS(ke,ei);ze&&Re(C,qt)}catch(vn){throw ze&&ht(C,qt),vn}finally{Je=es,zt=Qo}if(ze){if(cm(C,qt))throw Li("a node selected for removal could not be safely returned; refusing to sanitize in place");return oe&&QC(C),C}if(V){if(oe&&QC(F),Le)for(Me=Ut.call(F.ownerDocument);F.firstChild;)Me.appendChild(F.firstChild);else Me=F;return(K.shadowroot||K.shadowrootmode)&&(Me=mt.call(r,Me,!0)),Me}oe&&eS(F);let Vu=Ee?F.outerHTML:F.innerHTML;return Ee&&Y["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Ln(une,F.ownerDocument.doctype.name)&&(Vu="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
|
|
58
|
+
`+Vu),D(Vu)};return t.sanitize=function(pe){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=zu,F=Y,Q=K,ke=t.removed;zu=null;try{return H$(pe,C)}finally{zu=O,O&&(tt||Fu(O),Y=F,K=Q,t.removed=ke)}},t.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fu(pe),tt=!0,un=Y,Et=K},t.clearConfig=function(){ol=null,tt=!1,un=null,Et=null,q=fe,ie=""},t.isValidAttribute=function(pe,C,O){ol||Fu({});let F=rn(pe),Q=rn(C);return typeof O=="string"&&(PR(C,O)||!ve&&Ln(yz,O))?!1:NR(F,Q,O)},t.addHook=function(pe,C){typeof C=="function"&&_r(be,pe)&&qx(be[pe],C)},t.removeHook=function(pe,C){if(_r(be,pe)){if(C!==void 0){let O=Hte(be[pe],C);return O===-1?void 0:Vte(be[pe],O,1)[0]}return iz(be[pe])}},t.removeHooks=function(pe){_r(be,pe)&&(be[pe]=[])},t.removeAllHooks=function(){be=vz()},t}var Po=Lz();function Zp(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Pt={},nf=[],Jr=()=>{},AE=()=>!1,Jp=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qp=e=>e.startsWith("onUpdate:"),sn=Object.assign,Xx=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},wne=Object.prototype.hasOwnProperty,dt=(e,t)=>wne.call(e,t),We=Array.isArray,fu=e=>eh(e)==="[object Map]",Kx=e=>eh(e)==="[object Set]",Iz=e=>eh(e)==="[object Date]";var Ze=e=>typeof e=="function",bn=e=>typeof e=="string",Bo=e=>typeof e=="symbol",Ot=e=>e!==null&&typeof e=="object",EE=e=>(Ot(e)||Ze(e))&&Ze(e.then)&&Ze(e.catch),kne=Object.prototype.toString,eh=e=>kne.call(e),_E=e=>eh(e).slice(8,-1),TE=e=>eh(e)==="[object Object]",qw=e=>bn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,th=Zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var Cne=1e4,jw=e=>{let t=Object.create(null),n=0;return(r=>{let a=t[r];return a!==void 0?a:(++n>Cne&&(t=Object.create(null),n=1),t[r]=e(r))})},Sne=/-\w/g,Qr=jw(e=>e.replace(Sne,t=>t.slice(1).toUpperCase())),Lne=/\B([A-Z])/g,Us=jw(e=>e.replace(Lne,"-$1").toLowerCase()),Yx=jw(e=>e.charAt(0).toUpperCase()+e.slice(1)),Zx=jw(e=>e?`on${Yx(e)}`:""),co=(e,t)=>!Object.is(e,t),Jx=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},nh=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},DE=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var Az,du=()=>Az||(Az=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Qx(e){if(We(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],a=bn(r)?_ne(r):Qx(r);if(a)for(let o in a)t[o]=a[o]}return t}else if(bn(e)||Ot(e))return e}var Ine=/;(?![^(]*\))/g,Ane=/:([^]+)/,Ene=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _ne(e){let t={};return e.replace(Ene,n=>n.startsWith("/*")?"":n).split(Ine).forEach(n=>{if(n){let r=n.split(Ane);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function e1(e){let t="";if(bn(e))t=e;else if(We(e))for(let n=0;n<e.length;n++){let r=e1(e[n]);r&&(t+=r+" ")}else if(Ot(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}var Dz="itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",Rz=Zp(Dz),Tne=Zp(Dz+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function $w(e){return!!e||e===""}function Dne(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let a=0;r&&a<e.length;a++)r=rh(e[a],t[a],n);return r}function Ez(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),a=new Uint8Array(r.length);for(let o of e){let i=-1;for(let s=0;s<r.length;s++)if(!a[s]&&rh(o,r[s],n)){i=s;break}if(i<0)return!1;a[i]=1}return!0}function Rne(e,t,n){let r=fu(e),a=fu(t);if(r||a||(r=Kx(e),a=Kx(t),r||a))return r&&a?Ez(e,t,n):!1;let o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(let s in e){let l=dt(e,s),u=dt(t,s);if(l&&!u||!l&&u||!rh(e[s],t[s],n))return!1}return Tz(e)===Tz(t)}function _z(e,t,n,r){n||(n=[new Map,new Map]);let[a,o]=n;if(a.has(e)||o.has(t))return a.get(e)===t&&o.get(t)===e;a.set(e,t),o.set(t,e);let i=r(e,t,n);return a.delete(e),o.delete(t),i}function rh(e,t,n){if(e===t)return!0;let r=Iz(e),a=Iz(t);return r||a?r&&a?e.getTime()===t.getTime():!1:(r=Bo(e),a=Bo(t),r||a?e===t:(r=We(e),a=We(t),r||a?r&&a?_z(e,t,n,Dne):!1:(r=Ot(e),a=Ot(t),r||a?!r||!a?!1:_z(e,t,n,Rne):String(e)===String(t))))}function Tz(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!="function"&&typeof e.valueOf!="function"?eh(e):String(e)}function Mne(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var cr,a1=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&cr&&(cr.active?(this.parent=cr,this.index=(cr.scopes||(cr.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){let a=this.scopes.slice();for(t=0,n=a.length;t<n;t++)a[t].resume()}let r=this.effects.slice();for(t=0,n=r.length;t<n;t++)r[t].resume()}}run(t){if(this._active){let n=cr;try{return cr=this,t()}finally{cr=n}}}on(){++this._on===1&&(this.prevScope=cr,cr=this)}off(){if(this._on>0&&--this._on===0){if(cr===this)cr=this.prevScope;else{let t=cr;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){let a=this.scopes.slice();for(n=0,r=a.length;n<r;n++)a[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){let a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}};function Pz(){return cr}var Zt;var RE=new WeakSet,oh=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,cr&&(cr.active?cr.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,RE.has(this)&&(RE.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||zz(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mz(this),Fz(this);let t=Zt,n=zo;Zt=this,zo=!0;try{return this.fn()}finally{Hz(this),Zt=t,zo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)$E(t);this.deps=this.depsTail=void 0,Mz(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?RE.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){OE(this)&&this.run()}get dirty(){return OE(this)}},Bz=0,n1,r1;function zz(e,t=!1){if(e.flags|=8,t){e.next=r1,r1=e;return}e.next=n1,n1=e}function qE(){Bz++}function jE(){if(--Bz>0)return;if(r1){let t=r1;for(r1=void 0;t;){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;n1;){let t=n1;for(n1=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Fz(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hz(e){let t,n=e.depsTail,r=n;for(;r;){let a=r.prevDep;r.version===-1?(r===n&&(n=a),$E(r),Nne(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=a}e.deps=t,e.depsTail=n}function OE(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Vz(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Vz(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===o1)||(e.globalVersion=o1,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!OE(e))))return;e.flags|=2;let t=e.dep,n=Zt,r=zo;Zt=e,zo=!0;try{Fz(e);let a=e.fn(e._value);(t.version===0||co(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{Zt=n,zo=r,Hz(e),e.flags&=-3}}function $E(e,t=!1){let{dep:n,prevSub:r,nextSub:a}=e;if(r&&(r.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)$E(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Nne(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var zo=!0,Uz=[];function Fo(){Uz.push(zo),zo=!1}function Ho(){let e=Uz.pop();zo=e===void 0?!0:e}function Mz(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=Zt;Zt=void 0;try{t()}finally{Zt=n}}}var o1=0,PE=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},i1=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Zt||!zo||Zt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Zt)n=this.activeLink=new PE(Zt,this),Zt.deps?(n.prevDep=Zt.depsTail,Zt.depsTail.nextDep=n,Zt.depsTail=n):Zt.deps=Zt.depsTail=n,qz(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){let r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Zt.depsTail,n.nextDep=void 0,Zt.depsTail.nextDep=n,Zt.depsTail=n,Zt.deps===n&&(Zt.deps=r)}return n}trigger(t){this.version++,o1++,this.notify(t)}notify(t){qE();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{jE()}}};function qz(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)qz(r)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var BE=new WeakMap,af=Symbol(""),zE=Symbol(""),s1=Symbol("");function fr(e,t,n){if(zo&&Zt){let r=BE.get(e);r||BE.set(e,r=new Map);let a=r.get(n);a||(r.set(n,a=new i1),a.map=r,a.key=n),a.track()}}function Ai(e,t,n,r,a,o){let i=BE.get(e);if(!i){o1++;return}let s=l=>{l&&l.trigger()};if(qE(),t==="clear")i.forEach(s);else{let l=We(e),u=l&&qw(n);if(l&&n==="length"){let c=Number(r);i.forEach((f,d)=>{(d==="length"||d===s1||!Bo(d)&&d>=c)&&s(f)})}else switch((n!==void 0||i.has(void 0))&&s(i.get(n)),u&&s(i.get(s1)),t){case"add":l?u&&s(i.get("length")):(s(i.get(af)),fu(e)&&s(i.get(zE)));break;case"delete":l||(s(i.get(af)),fu(e)&&s(i.get(zE)));break;case"set":fu(e)&&s(i.get(af));break}}jE()}function ah(e){let t=bt(e);return t===e||(fr(t,"iterate",s1),Ha(e))?t:Vo(e)?$s(e)?t.map(n=>pu(Uo(n))):t.map(pu):t.map(Uo)}function Qw(e){return fr(e=bt(e),"iterate",s1),e}function Ii(e,t){return Vo(e)?pu($s(e)?Uo(t):t):Uo(t)}var One={__proto__:null,[Symbol.iterator](){return ME(this,Symbol.iterator,e=>Ii(this,e))},concat(...e){return ah(this).concat(...e.map(t=>We(t)?ah(t):t))},entries(){return ME(this,"entries",e=>(e[1]=Ii(this,e[1]),e))},every(e,t){return qs(this,"every",e,t,void 0,arguments)},filter(e,t){return qs(this,"filter",e,t,n=>n.map(r=>Ii(this,r)),arguments)},find(e,t){return qs(this,"find",e,t,n=>Ii(this,n),arguments)},findIndex(e,t){return qs(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return qs(this,"findLast",e,t,n=>Ii(this,n),arguments)},findLastIndex(e,t){return qs(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return qs(this,"forEach",e,t,void 0,arguments)},includes(...e){return NE(this,"includes",e)},indexOf(...e){return NE(this,"indexOf",e)},join(e){return ah(this).join(e)},lastIndexOf(...e){return NE(this,"lastIndexOf",e)},map(e,t){return qs(this,"map",e,t,void 0,arguments)},pop(){return t1(this,"pop")},push(...e){return t1(this,"push",e)},reduce(e,...t){return Oz(this,"reduce",e,t)},reduceRight(e,...t){return Oz(this,"reduceRight",e,t)},shift(){return t1(this,"shift")},some(e,t){return qs(this,"some",e,t,void 0,arguments)},splice(...e){return t1(this,"splice",e)},toReversed(){return ah(this).toReversed()},toSorted(e){return ah(this).toSorted(e)},toSpliced(...e){return ah(this).toSpliced(...e)},unshift(...e){return t1(this,"unshift",e)},values(){return ME(this,"values",e=>Ii(this,e))}};function ME(e,t,n){let r=Qw(e),a=r[t],o=a.call(r);if(r!==e&&!Ha(e)){if(o[Symbol.toStringTag]==="Array Iterator"){let i=Object.create(Object.getPrototypeOf(o));return i.next=()=>Nz(o.next(),n),a!==jz[t]&&Object.defineProperties(i,{return:{get(){let s=o.return;return typeof s=="function"?s.bind(o):s}},throw:{get(){let s=o.throw;return typeof s=="function"?s.bind(o):s}}}),i}o._next=o.next,o.next=()=>Nz(o._next(),n)}return o}function Nz(e,t){return e.done||(e.value=t(e.value)),e}var jz=Array.prototype;function qs(e,t,n,r,a,o){let i=Qw(e),s=i!==e&&!Ha(e),l=i[t];if(l!==jz[t]){let f=l.apply(e,o);return s?Uo(f):f}let u=n;i!==e&&(s?u=function(f,d){return n.call(this,Ii(e,f),d,e)}:n.length>2&&(u=function(f,d){return n.call(this,f,d,e)}));let c=l.call(i,u,r);return s&&a?a(c):c}function Oz(e,t,n,r){let a=Qw(e),o=a!==e&&!Ha(e),i=n,s=!1;a!==e&&(o?(s=r.length===0,i=function(u,c,f){return s&&(s=!1,u=Ii(e,u)),n.call(this,u,Ii(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));let l=a[t](i,...r);return s?Ii(e,l):l}function NE(e,t,n){let r=bt(e);fr(r,"iterate",s1);let a=r[t](...n);return(a===-1||a===!1)&&u1(n[0])?(n[0]=bt(n[0]),r[t](...n)):a}function t1(e,t,n=[]){Fo(),qE();let r=bt(e)[t].apply(e,n);return jE(),Ho(),r}var Pne=Zp("__proto__,__v_isRef,__isVue"),$z=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Bo));function Bne(e){Bo(e)||(e=String(e));let t=bt(this);return fr(t,"has",e),t.hasOwnProperty(e)}var Xw=class{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;let a=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(a?o?Gne:Kz:o?Wz:Gz).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let i=We(t);if(!a){let l;if(i&&(l=One[n]))return l;if(n==="hasOwnProperty")return Bne}let s=Reflect.get(t,n,Xn(t)?t:r);if((Bo(n)?$z.has(n):Pne(n))||(a||fr(t,"get",n),o))return s;if(Xn(s)){let l=i&&qw(n)?s:s.value;return a&&Ot(l)?Zw(l):l}return Ot(s)?a?Zw(s):l1(s):s}},Yw=class extends Xw{constructor(t=!1){super(!1,t)}set(t,n,r,a){let o=t[n],i=We(t)&&qw(n);if(!this._isShallow){let u=Vo(o);if(!Ha(r)&&!Vo(r)&&(o=bt(o),r=bt(r)),!i&&Xn(o)&&!Xn(r))return u||(o.value=r),!0}let s=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,Xn(t)?t:a);return t===bt(a)&&l&&(s?co(r,o)&&Ai(t,"set",n,r,o):Ai(t,"add",n,r)),l}deleteProperty(t,n){let r=dt(t,n),a=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&Ai(t,"delete",n,void 0,a),o}has(t,n){let r=Reflect.has(t,n);return(!Bo(n)||!$z.has(n))&&fr(t,"has",n),r}ownKeys(t){return fr(t,"iterate",We(t)?"length":af),Reflect.ownKeys(t)}},FE=class extends Xw{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}},zne=new Yw,Fne=new FE,Hne=new Yw(!0);var HE=e=>e,Gw=e=>Reflect.getPrototypeOf(e);function Vne(e,t,n){return function(...r){let a=this.__v_raw,o=bt(a),i=fu(o),s=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=a[e](...r),c=n?HE:t?pu:Uo;return!t&&fr(o,"iterate",l?zE:af),sn(Object.create(u),{next(){let{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:s?[c(f[0]),c(f[1])]:c(f),done:d}}})}}function Ww(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Une(e,t){let n={get(a){let o=this.__v_raw,i=bt(o),s=bt(a);e||(co(a,s)&&fr(i,"get",a),fr(i,"get",s));let{has:l}=Gw(i),u=t?HE:e?pu:Uo;if(l.call(i,a))return u(o.get(a));if(l.call(i,s))return u(o.get(s));o!==i&&o.get(a)},get size(){let a=this.__v_raw;return!e&&fr(bt(a),"iterate",af),a.size},has(a){let o=this.__v_raw,i=bt(o),s=bt(a);return e||(co(a,s)&&fr(i,"has",a),fr(i,"has",s)),a===s?o.has(a):o.has(a)||o.has(s)},forEach(a,o){let i=this,s=i.__v_raw,l=bt(s),u=t?HE:e?pu:Uo;return!e&&fr(l,"iterate",af),s.forEach((c,f)=>a.call(o,u(c),u(f),i))}};return sn(n,e?{add:Ww("add"),set:Ww("set"),delete:Ww("delete"),clear:Ww("clear")}:{add(a){let o=bt(this),i=Gw(o),s=bt(a),l=!t&&!Ha(a)&&!Vo(a)?s:a;return i.has.call(o,l)||co(a,l)&&i.has.call(o,a)||co(s,l)&&i.has.call(o,s)||(o.add(l),Ai(o,"add",l,l)),this},set(a,o){!t&&!Ha(o)&&!Vo(o)&&(o=bt(o));let i=bt(this),{has:s,get:l}=Gw(i),u=s.call(i,a);u||(a=bt(a),u=s.call(i,a));let c=l.call(i,a);return i.set(a,o),u?co(o,c)&&Ai(i,"set",a,o,c):Ai(i,"add",a,o),this},delete(a){let o=bt(this),{has:i,get:s}=Gw(o),l=i.call(o,a);l||(a=bt(a),l=i.call(o,a));let u=s?s.call(o,a):void 0,c=o.delete(a);return l&&Ai(o,"delete",a,void 0,u),c},clear(){let a=bt(this),o=a.size!==0,i=void 0,s=a.clear();return o&&Ai(a,"clear",void 0,void 0,i),s}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=Vne(a,e,t)}),n}function GE(e,t){let n=Une(e,t);return(r,a,o)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_isShallow"?t:a==="__v_raw"?r:Reflect.get(dt(n,a)&&a in r?n:r,a,o)}var qne={get:GE(!1,!1)},jne={get:GE(!1,!0)},$ne={get:GE(!0,!1)};var Gz=new WeakMap,Wz=new WeakMap,Kz=new WeakMap,Gne=new WeakMap;function Wne(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function l1(e){return Vo(e)?e:KE(e,!1,zne,qne,Gz)}function WE(e){return KE(e,!1,Hne,jne,Wz)}function Zw(e){return KE(e,!0,Fne,$ne,Kz)}function KE(e,t,n,r,a){if(!Ot(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let o=a.get(e);if(o)return o;let i=Wne(_E(e));if(i===0)return e;let s=new Proxy(e,i===2?r:n);return a.set(e,s),s}function $s(e){return Vo(e)?$s(e.__v_raw):!!(e&&e.__v_isReactive)}function Vo(e){return!!(e&&e.__v_isReadonly)}function Ha(e){return!!(e&&e.__v_isShallow)}function u1(e){return e?!!e.__v_raw:!1}function bt(e){let t=e&&e.__v_raw;return t?bt(t):e}function XE(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&nh(e,"__v_skip",!0),e}var Uo=e=>Ot(e)?l1(e):e,pu=e=>Ot(e)?Zw(e):e;function Xn(e){return e?e.__v_isRef===!0:!1}function Ne(e){return Xz(e,!1)}function ih(e){return Xz(e,!0)}function Xz(e,t){return Xn(e)?e:new VE(e,t)}var VE=class{constructor(t,n){this.dep=new i1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:bt(t),this._value=n?t:Uo(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){let n=this._rawValue,r=this.__v_isShallow||Ha(t)||Vo(t);t=r?t:bt(t),co(t,n)&&(this._rawValue=t,this._value=r?t:Uo(t),this.dep.trigger())}};function YE(e){return Xn(e)?e.value:e}var Kne={get:(e,t,n)=>t==="__v_raw"?e:YE(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let a=e[t];return Xn(a)&&!Xn(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function ek(e){return $s(e)?e:new Proxy(e,Kne)}var UE=class{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new i1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=o1-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Zt!==this)return zz(this,!0),!0}get value(){let t=this.dep.track();return Vz(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Yz(e,t,n=!1){let r,a;return Ze(e)?r=e:(r=e.get,a=e.set),new UE(r,a,n)}var Kw={},Jw=new WeakMap,rf;function Zz(e,t=!1,n=rf){if(n){let r=Jw.get(n);r||Jw.set(n,r=[]),r.push(e)}}function Jz(e,t,n=Pt){let{immediate:r,deep:a,once:o,scheduler:i,augmentJob:s,call:l}=n,u=w=>{(n.onWarn||Mne)("Invalid watch source: ",w,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=w=>a?w:Ha(w)||a===!1||a===0?js(w,1):js(w),f,d,p,h,g=!1,x=!1;if(Xn(e)?(d=()=>e.value,g=Ha(e)):$s(e)?(d=()=>c(e),g=!0):We(e)?(x=!0,g=e.some(w=>$s(w)||Ha(w)),d=()=>e.map(w=>{if(Xn(w))return w.value;if($s(w))return c(w);if(Ze(w))return l?l(w,2):w()})):Ze(e)?t?d=l?()=>l(e,2):e:d=()=>{if(p){Fo();try{p()}finally{Ho()}}let w=rf;rf=f;try{return l?l(e,3,[h]):e(h)}finally{rf=w}}:d=Jr,t&&a){let w=d,k=a===!0?1/0:a;d=()=>js(w(),k)}let m=Pz(),y=()=>{f.stop(),m&&m.active&&Xx(m.effects,f)};if(o&&t){let w=t;t=(...k)=>{try{return w(...k)}finally{y()}}}let b=x?new Array(e.length).fill(Kw):Kw,v=w=>{if(!(!(f.flags&1)||!f.dirty&&!w))if(t){let k=f.run();if(w||a||g||(x?k.some((_,E)=>co(_,b[E])):co(k,b))){let _=rf;Fo();try{p&&p(),rf=f;let E=[k,b===Kw?void 0:x&&b[0]===Kw?[]:b,h];b=k,l?l(t,3,E):t(...E)}finally{rf=_,Ho()}}}else f.run()};return s&&s(v),f=new oh(d),f.scheduler=i?()=>i(v,!1):v,h=w=>Zz(w,!1,f),p=f.onStop=()=>{let w=Jw.get(f);if(w){if(l)l(w,4);else for(let k of w)k();Jw.delete(f)}},t?r?v(!0):b=f.run():i?i(v.bind(null,!0),!0):f.run(),y.pause=f.pause.bind(f),y.resume=f.resume.bind(f),y.stop=y,y}function js(e,t=1/0,n){if(t<=0||!Ot(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Xn(e))js(e.value,t,n);else if(We(e))for(let r=0;r<e.length;r++)js(e[r],t,n);else if(Kx(e)||fu(e))e.forEach(r=>{js(r,t,n)});else if(TE(e)){for(let r in e)js(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&js(e[r],t,n)}return e}function C1(e,t,n,r){try{return r?e(...r):e()}catch(a){ck(a,t,n)}}function po(e,t,n,r){if(Ze(e)){let a=C1(e,t,n,r);return a&&EE(a)&&a.catch(o=>{ck(o,t,n,void 0,!0)}),a}if(We(e)){let a=[];for(let o=0;o<e.length;o++)a.push(po(e[o],t,n,r));return a}}function ck(e,t,n,r=!0,a=!1){let o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Pt;if(t){let l=t.parent,u=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){let f=l.ec;if(f&&!l.isUnmounted&&(!a||l.scope.active)){for(let d=0;d<f.length;d++)if(f[d](e,u,c)===!1)return}l=l.parent}if(i){Fo(),C1(i,null,10,[e,u,c]),Ho();return}}Jne(e,n,o,r,s)}function Jne(e,t,n,r=!0,a=!1){if(a)throw e;console.error(e)}var na=[],qo=-1,_i=[],hu=null,sh=0,h7=Promise.resolve(),rk=null;function S1(e){let t=rk||h7;return e?t.then(this?e.bind(this):e):t}function Qne(e){let t=qo+1,n=na.length;for(;t<n;){let r=t+n>>>1,a=na[r],o=b1(a);o<e||o===e&&a.flags&2?t=r+1:n=r}return t}function l_(e){if(!(e.flags&1)){let t=b1(e),n=na[na.length-1];!n||!(e.flags&2)&&t>=b1(n)?na.push(e):na.splice(Qne(t),0,e),e.flags|=1,m7()}}function m7(){rk||(rk=h7.then(y7))}function g7(e){if(!We(e))hu&&e.id===-1?hu.splice(sh+1,0,e):e.flags&1||(_i.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)_i.push(e[t]);m7()}function x7(e,t,n,r=qo+1){for(;r<na.length;r++){let a=na[r];if(a&&a.flags&2){if(e&&a.id!==e.uid||t!==void 0&&!(a.id>=t))continue;na.splice(r,1),r=e?r-1:qo,a.flags&4&&(a.flags&=-2),a(),a.flags&4||(a.flags&=-2)}}}function b7(e,t,n=0){if(_i.length){let r=_i,a=0;if(t){r=[];for(let i=0;i<_i.length;i++){let s=_i[i];(s.i!==void 0?!s.i||s.i.uid<n:t.has(s))?_i[a++]=s:r.push(s)}}let o=[...new Set(r)].sort((i,s)=>b1(i)-b1(s));if(_i.length=a,hu){for(let i=0;i<o.length;i++)hu.push(o[i]);return}for(hu=o,sh=0;sh<hu.length;sh++){let i=hu[sh];i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2}hu=null,sh=0}}var ZE=!1;function ere(e,t){if(ZE){e();return}let n=t===void 0?void 0:new Set(_i);e(),ZE=!0;try{x7(void 0,t),b7(void 0,n,t)}finally{ZE=!1}}var b1=e=>e.id==null?e.flags&2?-1:1/0:e.id;function y7(e){let t=Jr;try{for(qo=0;qo<na.length;qo++){let n=na[qo];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),C1(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;qo<na.length;qo++){let n=na[qo];n&&(n.flags&=-2)}qo=-1,na.length=0,b7(e),rk=null,(na.length||_i.length)&&y7(e)}}var Di,f1=[],n_=!1;function fk(e,...t){Di?Di.emit(e,...t):n_||f1.push({event:e,args:t})}function v7(e,t){var n,r;Di=e,Di?(Di.enabled=!0,f1.forEach(({event:a,args:o})=>Di.emit(a,...o)),f1=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{v7(o,t)}),setTimeout(()=>{Di||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,n_=!0,f1=[])},3e3)):(n_=!0,f1=[])}function tre(e,t){fk("app:init",e,t,{Fragment:nn,Text:I1,Comment:Mi,Static:x1})}function nre(e){fk("app:unmount",e)}var rre=u_("component:added"),w7=u_("component:updated"),are=u_("component:removed"),ore=e=>{Di&&typeof Di.cleanupBuffer=="function"&&!Di.cleanupBuffer(e)&&are(e)};function u_(e){return t=>{fk(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}function ire(e,t,n){fk("component:emit",e.appContext.app,e,t,n)}var Ri=null,k7=null;function ak(e){let t=Ri;return Ri=e,k7=e&&e.type.__scopeId||null,t}function sre(e,t=Ri,n){if(!t||e._n)return e;let r=(...a)=>{r._d&&sk(-1);let o=ak(t),i=ch.length,s;try{s=e(...a)}finally{for(let l=ch.length;l>i;l--)Zre();ak(o),r._d&&sk(1)}return __VUE_PROD_DEVTOOLS__&&w7(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function of(e,t,n,r){let a=e;if(r==="beforeMount")e._mount=e;else if(r==="beforeUpdate"){let s=t&&t._mount;s&&(s._latest=e,e._mount=s)}else if(r==="mounted"){let s=e._latest;e._mount=e._latest=void 0,s&&(a=s,s._mount=void 0)}let o=a.dirs,i=t&&t.dirs;for(let s=0;s<o.length;s++){let l=o[s];i?l.oldValue=i[s].value:r==="mounted"&&l.oldValue!==void 0&&(l=sn({},l,{oldValue:void 0}));let u=l.dir[r];u&&(Fo(),po(u,n,8,[e.el,l,a,t]),Ho())}}function lre(e,t){if(ra){let n=ra.provides,r=ra.parent&&ra.parent.provides;r===n&&(n=ra.provides=Object.create(r)),n[e]=t}}function tk(e,t,n=!1){let r=K7();if(r||uh){let a=uh?uh._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(a&&e in a)return a[e];if(arguments.length>1)return n&&Ze(t)?t.call(r&&r.proxy):t}}var ure=Symbol.for("v-scx"),cre=()=>{{let e=tk(ure);return e}};function dh(e,t){return c_(e,null,t)}function jo(e,t,n){return c_(e,t,n)}function c_(e,t,n=Pt){let{immediate:r,deep:a,flush:o,once:i}=n,s=sn({},n),l=t&&r||!t&&o!=="post",u;if(k1){if(o==="sync"){let p=cre();u=p.__watcherHandles||(p.__watcherHandles=[])}else if(!l){let p=()=>{};return p.stop=Jr,p.resume=Jr,p.pause=Jr,p}}let c=ra;s.call=(p,h,g)=>po(p,c,h,g);let f=!1;o==="post"?s.scheduler=p=>{p.i=c,ta(p,c&&c.suspense)}:o!=="sync"&&(f=!0,s.scheduler=(p,h)=>{h?p():l_(p)}),s.augmentJob=p=>{t&&(p.flags|=4),f&&(p.flags|=2,c&&(p.id=c.uid,p.i=c))};let d=Jz(e,t,s);return k1&&(u?u.push(d):l&&d()),d}function fre(e,t,n){let r=this.proxy,a=bn(e)?e.includes(".")?C7(r,e):()=>r[e]:e.bind(r,r),o;Ze(t)?o=t:(o=t.handler,n=t);let i=A1(this),s=c_(a,o.bind(r),n);return i(),s}function C7(e,t){let n=t.split(".");return()=>{let r=e;for(let a=0;a<n.length&&r;a++)r=r[n[a]];return r}}var dre=Symbol("_vte"),dk=e=>e.__isTeleport;var JE=Symbol("_leaveCb");function pre(e){let t=e[0];if(e.length>1){let n=!1;for(let r of e)if(r.type!==Mi){t=r,n=!0;break}}return t}function S7(e){if(!f_(e))return dk(e.type)&&e.children?pre(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ze(n.default))return n.default()}}function lh(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;lh(dk(n.type)&&S7(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let r=n.isHydrating?n.pendingBranch:n.activeBranch;r&&lh(r,t.clone(r))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===nn&&We(e.children)){let n=R7(e.children,!1);n&&lh(n,t)}}function r_(e){if(e.component)return r_(e.component.subTree);if(e.type===nn){let t=We(e.children)&&R7(e.children,!1);return t?r_(t):void 0}if(e.type!==Mi)return e}function Yn(e,t){return Ze(e)?sn({name:e.name},t,{setup:e}):e}function L7(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Qz(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var ok=new WeakMap;function p1(e,t,n,r,a=!1){if(We(e)){e.forEach((g,x)=>p1(g,t&&(We(t)?t[x]:t),n,r,a));return}if(h1(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&p1(e,t,n,r.component.subTree);return}let o=r.shapeFlag&4?g_(r.component):r.el,i=a?null:o,{i:s,r:l}=e,u=t&&t.r,c=s.refs===Pt?s.refs={}:s.refs,f=s.setupState,d=bt(f),p=f===Pt?AE:g=>Qz(c,g)?!1:dt(d,g),h=(g,x)=>!(x&&Qz(c,x));if(u!=null&&u!==l){if(e7(t),bn(u))c[u]=null,p(u)&&(f[u]=null);else if(Xn(u)){let g=t;h(u,g.k)&&(u.value=null),g.k&&(c[g.k]=null)}}if(Ze(l))C1(l,s,12,[i,c]);else{let g=bn(l),x=Xn(l);if(g||x){let m=()=>{if(e.f){let y=g?p(l)?f[l]:c[l]:h(l)||!e.k?l.value:c[e.k];if(a)We(y)&&Xx(y,o);else if(We(y))y.includes(o)||y.push(o);else if(g)c[l]=[o],p(l)&&(f[l]=c[l]);else{let b=[o];h(l,e.k)&&(l.value=b),e.k&&(c[e.k]=b)}}else g?(c[l]=i,p(l)&&(f[l]=i)):x&&(h(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){let y=()=>{m(),ok.delete(e)};y.id=-1,ok.set(e,y),ta(y,n)}else e7(e),m()}}}function e7(e){let t=ok.get(e);t&&(t.flags|=8,ok.delete(e))}var MSe=du().requestIdleCallback||(e=>setTimeout(e,1)),NSe=du().cancelIdleCallback||(e=>clearTimeout(e));var h1=e=>!!e.type.__asyncLoader;var f_=e=>e.type.__isKeepAlive;function hre(e,t){I7(e,"a",t)}function mre(e,t){I7(e,"da",t)}function I7(e,t,n=ra){let r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(y1(t,r,n),n){let a=n.parent;for(;a&&a.parent;)f_(a.parent.vnode)&&gre(r,t,n,a),a=a.parent}}function gre(e,t,n,r){let a=y1(t,e,r,!0),o=y1("um",()=>Xx(r[t],a),n);o.flags=16}function y1(e,t,n=ra,r=!1){if(n){let a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Fo();let s=A1(n),l=po(t,n,e,i);return s(),Ho(),l});return r?a.unshift(o):a.push(o),o}}var Ks=e=>(t,n=ra)=>{(!k1||e==="sp")&&y1(e,(...r)=>t(...r),n)},xre=Ks("bm"),L1=Ks("m"),A7=Ks("bu"),E7=Ks("u"),bre=Ks("bum"),ph=Ks("um"),yre=Ks("sp"),vre=Ks("rtg"),wre=Ks("rtc");function kre(e,t=ra){y1("ec",e,t)}var Cre=Symbol.for("v-ndc");var a_=e=>e?X7(e)?g_(e):a_(e.parent):null;var m1=sn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>a_(e.parent),$root:e=>a_(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?d_(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{l_(e.update)}),$nextTick:e=>e.n||(e.n=S1.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?fre.bind(e):Jr});var QE=(e,t)=>e!==Pt&&!e.__isScriptSetup&&dt(e,t),Sre={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:n,setupState:r,data:a,props:o,accessCache:i,type:s,appContext:l}=e;if(t[0]!=="$"){let d=i[t];if(d!==void 0)switch(d){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else{if(QE(r,t))return i[t]=1,r[t];if(__VUE_OPTIONS_API__&&a!==Pt&&dt(a,t))return i[t]=2,a[t];if(dt(o,t))return i[t]=3,o[t];if(n!==Pt&&dt(n,t))return i[t]=4,n[t];(!__VUE_OPTIONS_API__||o_)&&(i[t]=0)}}let u=m1[t],c,f;if(u)return t==="$attrs"&&fr(e.attrs,"get",""),u(e);if((c=s.__cssModules)&&(c=c[t]))return c;if(n!==Pt&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:a,ctx:o}=e;return QE(a,t)?(a[t]=n,!0):__VUE_OPTIONS_API__&&r!==Pt&&dt(r,t)?(r[t]=n,!0):dt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:a,props:o,type:i}},s){let l;return!!(n[s]||__VUE_OPTIONS_API__&&e!==Pt&&s[0]!=="$"&&dt(e,s)||QE(t,s)||dt(o,s)||dt(r,s)||dt(m1,s)||dt(a.config.globalProperties,s)||(l=i.__cssModules)&&l[s])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function t7(e){return We(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}var o_=!0;function Lre(e){let t=d_(e),n=e.proxy,r=e.ctx;o_=!1,t.beforeCreate&&n7(t.beforeCreate,e,"bc");let{data:a,computed:o,methods:i,watch:s,provide:l,inject:u,created:c,beforeMount:f,mounted:d,beforeUpdate:p,updated:h,activated:g,deactivated:x,beforeDestroy:m,beforeUnmount:y,destroyed:b,unmounted:v,render:w,renderTracked:k,renderTriggered:_,errorCaptured:E,serverPrefetch:M,expose:S,inheritAttrs:U,components:N,directives:q,filters:ie}=t;if(u&&Ire(u,r,null),i)for(let xe in i){let Ce=i[xe];Ze(Ce)&&(r[xe]=Ce.bind(n))}if(a){let xe=a.call(n,n);Ot(xe)&&(e.data=l1(xe))}if(o_=!0,o)for(let xe in o){let Ce=o[xe],Fe=Ze(Ce)?Ce.bind(n,n):Ze(Ce.get)?Ce.get.bind(n,n):Jr,D=!Ze(Ce)&&Ze(Ce.set)?Ce.set.bind(n):Jr,st=aa({get:Fe,set:D});Object.defineProperty(r,xe,{enumerable:!0,configurable:!0,get:()=>st.value,set:Ke=>st.value=Ke})}if(s)for(let xe in s)_7(s[xe],r,n,xe);if(l){let xe=Ze(l)?l.call(n):l;Reflect.ownKeys(xe).forEach(Ce=>{lre(Ce,xe[Ce])})}c&&n7(c,e,"c");function he(xe,Ce){We(Ce)?Ce.forEach(Fe=>xe(Fe.bind(n))):Ce&&xe(Ce.bind(n))}if(he(xre,f),he(L1,d),he(A7,p),he(E7,h),he(hre,g),he(mre,x),he(kre,E),he(wre,k),he(vre,_),he(bre,y),he(ph,v),he(yre,M),We(S))if(S.length){let xe=e.exposed||(e.exposed={});S.forEach(Ce=>{Object.defineProperty(xe,Ce,{get:()=>n[Ce],set:Fe=>n[Ce]=Fe,enumerable:!0})})}else e.exposed||(e.exposed={});w&&e.render===Jr&&(e.render=w),U!=null&&(e.inheritAttrs=U),N&&(e.components=N),q&&(e.directives=q),M&&L7(e)}function Ire(e,t,n=Jr){We(e)&&(e=i_(e));for(let r in e){let a=e[r],o;Ot(a)?"default"in a?o=tk(a.from||r,a.default,!0):o=tk(a.from||r):o=tk(a),Xn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function n7(e,t,n){po(We(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function _7(e,t,n,r){let a=r.includes(".")?C7(n,r):()=>n[r];if(bn(e)){let o=t[e];Ze(o)&&jo(a,o)}else if(Ze(e))jo(a,e.bind(n));else if(Ot(e))if(We(e))e.forEach(o=>_7(o,t,n,r));else{let o=Ze(e.handler)?e.handler.bind(n):t[e.handler];Ze(o)&&jo(a,o,e)}}function d_(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,s=o.get(t),l;return s?l=s:!a.length&&!n&&!r?l=t:(l={},a.length&&a.forEach(u=>ik(l,u,i,!0)),ik(l,t,i)),Ot(t)&&o.set(t,l),l}function ik(e,t,n,r=!1){let{mixins:a,extends:o}=t;o&&ik(e,o,n,!0),a&&a.forEach(i=>ik(e,i,n,!0));for(let i in t)if(!(r&&i==="expose")){let s=Are[i]||n&&n[i];e[i]=s?s(e[i],t[i]):t[i]}return e}var Are={data:r7,props:a7,emits:a7,methods:d1,computed:d1,beforeCreate:ea,created:ea,beforeMount:ea,mounted:ea,beforeUpdate:ea,updated:ea,beforeDestroy:ea,beforeUnmount:ea,destroyed:ea,unmounted:ea,activated:ea,deactivated:ea,errorCaptured:ea,serverPrefetch:ea,components:d1,directives:d1,watch:_re,provide:r7,inject:Ere};function r7(e,t){return t?e?function(){return sn(Ze(e)?e.call(this,this):e,Ze(t)?t.call(this,this):t)}:t:e}function Ere(e,t){return d1(i_(e),i_(t))}function i_(e){if(We(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ea(e,t){return e?[...new Set([].concat(e,t))]:t}function d1(e,t){return e?sn(Object.create(null),e,t):t}function a7(e,t){return e?We(e)&&We(t)?[...new Set([...e,...t])]:sn(Object.create(null),t7(e),t7(t??{})):t}function _re(e,t){if(!e)return t;if(!t)return e;let n=sn(Object.create(null),e);for(let r in t)n[r]=ea(e[r],t[r]);return n}function T7(){return{app:null,config:{isNativeTag:AE,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Tre=0;function Dre(e,t){return function(r,a=null){Ze(r)||(r=sn({},r)),a!=null&&!Ot(a)&&(a=null);let o=T7(),i=new WeakSet,s=[],l=!1,u=o.app={_uid:Tre++,_component:r,_props:a,_container:null,_context:o,_instance:null,version:d7,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&Ze(c.install)?(i.add(c),c.install(u,...f)):Ze(c)&&(i.add(c),c(u,...f))),u},mixin(c){return __VUE_OPTIONS_API__&&(o.mixins.includes(c)||o.mixins.push(c)),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,d){if(!l){let p=u._ceVNode||fo(r,a);return p.appContext=o,d===!0?d="svg":d===!1&&(d=void 0),f&&t?t(p,c):e(p,c,d),l=!0,u._container=c,c.__vue_app__=u,__VUE_PROD_DEVTOOLS__&&(u._instance=p.component,tre(u,d7)),g_(p.component)}},onUnmount(c){s.push(c)},unmount(){l&&(po(s,u._instance,16),e(null,u._container),__VUE_PROD_DEVTOOLS__&&(u._instance=null,nre(u)),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){let f=uh;uh=u;try{return c()}finally{uh=f}}};return u}}var uh=null;var Rre=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Qr(t)}Modifiers`]||e[`${Us(t)}Modifiers`];function Mre(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||Pt,a=n,o=t.startsWith("update:"),i=o&&Rre(r,t.slice(7));i&&(i.trim&&(a=n.map(c=>bn(c)?c.trim():c)),i.number&&(a=a.map(DE))),__VUE_PROD_DEVTOOLS__&&ire(e,t,a);let s,l=r[s=Zx(t)]||r[s=Zx(Qr(t))];!l&&o&&(l=r[s=Zx(Us(t))]),l&&po(l,e,6,a);let u=r[s+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,po(u,e,6,a)}}var Nre=new WeakMap;function D7(e,t,n=!1){let r=__VUE_OPTIONS_API__&&n?Nre:t.emitsCache,a=r.get(e);if(a!==void 0)return a;let o=e.emits,i={},s=!1;if(__VUE_OPTIONS_API__&&!Ze(e)){let l=u=>{let c=D7(u,t,!0);c&&(s=!0,sn(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!s?(Ot(e)&&r.set(e,null),null):(We(o)?o.forEach(l=>i[l]=null):sn(i,o),Ot(e)&&r.set(e,i),i)}function pk(e,t){return!e||!Jp(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Us(t))||dt(e,t))}function e_(e){let{type:t,vnode:n,proxy:r,withProxy:a,propsOptions:[o],slots:i,attrs:s,emit:l,render:u,renderCache:c,props:f,data:d,setupState:p,ctx:h,inheritAttrs:g}=e,x=ak(e),m,y;try{if(n.shapeFlag&4){let w=a||r,k=w;m=Ti(u.call(k,w,c,f,p,d,h)),y=s}else{let w=t;m=Ti(w.length>1?w(f,{attrs:s,slots:i,emit:l}):w(f,null)),y=t.props?s:Ore(s)}}catch(w){ch.length=0,ck(w,e,1),m=fo(Mi)}let b=m,v;if(y&&g!==!1){let w=Object.keys(y),{shapeFlag:k}=b;w.length&&k&7&&(o&&w.some(Qp)&&(y=Pre(y,o)),b=fh(b,y,!1,!0))}if(n.dirs&&(b=fh(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition){let w=dk(b.type)&&S7(b)||b;lh(w,n.transition)}return m=b,ak(x),m}function R7(e,t=!0){let n;for(let r=0;r<e.length;r++){let a=e[r];if(v1(a)){if(a.type!==Mi||a.children==="v-if"){if(n)return;n=a}}else return}return n}var Ore=e=>{let t;for(let n in e)(n==="class"||n==="style"||Jp(n))&&((t||(t={}))[n]=e[n]);return t},Pre=(e,t)=>{let n={};for(let r in e)(!Qp(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Bre(e,t,n){let{props:r,children:a,component:o}=e,{props:i,children:s,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?o7(r,i,u):!!i;if(l&8){let c=t.dynamicProps;for(let f=0;f<c.length;f++){let d=c[f];if(M7(i,r,d)&&!pk(u,d))return!0}}}else return(a||s)&&(!s||!s.$stable)?!0:r===i?!1:r?i?o7(r,i,u):!0:!!i;return!1}function o7(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let a=0;a<r.length;a++){let o=r[a];if(!dt(e,o)||M7(t,e,o)&&!pk(n,o))return!0}return!1}function M7(e,t,n){let r=e[n],a=t[n];return n==="style"&&Ot(r)&&Ot(a)?!rh(r,a):r!==a}function zre({vnode:e,parent:t,suspense:n},r){for(;t;){let a=t.subTree;if(a.suspense&&a.suspense.activeBranch===e&&(a.suspense.vnode.el=a.el=r,e=a),a===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var N7={},O7=()=>Object.create(N7),P7=e=>Object.getPrototypeOf(e)===N7;function Fre(e,t,n,r=!1){let a={},o=O7();e.propsDefaults=Object.create(null),B7(e,t,a,o);for(let i in e.propsOptions[0])i in a||(a[i]=void 0);n?e.props=r?a:WE(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function Hre(e,t,n,r){let{props:a,attrs:o,vnode:{patchFlag:i}}=e,s=bt(a),[l]=e.propsOptions,u=!1;if((r||i>0)&&!(i&16)){if(i&8){let c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let d=c[f];if(pk(e.emitsOptions,d))continue;let p=t[d];if(l)if(dt(o,d))p!==o[d]&&(o[d]=p,u=!0);else{let h=Qr(d);a[h]=s_(l,s,h,p,e,!1)}else p!==o[d]&&(o[d]=p,u=!0)}}}else{B7(e,t,a,o)&&(u=!0);let c;for(let f in s)(!t||!dt(t,f)&&((c=Us(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(a[f]=s_(l,s,f,void 0,e,!0)):delete a[f]);if(o!==s)for(let f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Ai(e.attrs,"set","")}function B7(e,t,n,r){let[a,o]=e.propsOptions,i=!1,s;if(t)for(let l in t){if(th(l))continue;let u=t[l],c;a&&dt(a,c=Qr(l))?!o||!o.includes(c)?n[c]=u:(s||(s={}))[c]=u:pk(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){let l=bt(n),u=s||Pt;for(let c=0;c<o.length;c++){let f=o[c];n[f]=s_(a,l,f,u[f],e,!dt(u,f))}}return i}function s_(e,t,n,r,a,o){let i=e[n];if(i!=null){let s=dt(i,"default");if(s&&r===void 0){let l=i.default;if(i.type!==Function&&!i.skipFactory&&Ze(l)){let{propsDefaults:u}=a;if(n in u)r=u[n];else{let c=A1(a);r=u[n]=l.call(null,t),c()}}else r=l;a.ce&&a.ce._setProp(n,r)}i[0]&&(o&&!s?r=!1:i[1]&&(r===""||r===Us(n))&&(r=!0))}return r}var Vre=new WeakMap;function z7(e,t,n=!1){let r=__VUE_OPTIONS_API__&&n?Vre:t.propsCache,a=r.get(e);if(a)return a;let o=e.props,i={},s=[],l=!1;if(__VUE_OPTIONS_API__&&!Ze(e)){let c=f=>{l=!0;let[d,p]=z7(f,t,!0);sn(i,d),p&&s.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return Ot(e)&&r.set(e,nf),nf;if(We(o))for(let c=0;c<o.length;c++){let f=Qr(o[c]);i7(f)&&(i[f]=Pt)}else if(o)for(let c in o){let f=Qr(c);if(i7(f)){let d=o[c],p=i[f]=We(d)||Ze(d)?{type:d}:sn({},d),h=p.type,g=!1,x=!0;if(We(h))for(let m=0;m<h.length;++m){let y=h[m],b=Ze(y)&&y.name;if(b==="Boolean"){g=!0;break}else b==="String"&&(x=!1)}else g=Ze(h)&&h.name==="Boolean";p[0]=g,p[1]=x,(g||dt(p,"default"))&&s.push(f)}}let u=[i,s];return Ot(e)&&r.set(e,u),u}function i7(e){return e[0]!=="$"&&!th(e)}var p_=e=>e==="_"||e==="_ctx"||e==="$stable",h_=e=>We(e)?e.map(Ti):[Ti(e)],Ure=(e,t,n)=>{if(t._n)return t;let r=sre((...a)=>h_(t(...a)),n);return r._c=!1,r},F7=(e,t,n)=>{let r=e._ctx;for(let a in e){if(p_(a))continue;let o=e[a];if(Ze(o))t[a]=Ure(a,o,r);else if(o!=null){let i=h_(o);t[a]=()=>i}}},H7=(e,t)=>{let n=h_(t);e.slots.default=()=>n},V7=(e,t,n)=>{for(let r in t)(n||!p_(r))&&(e[r]=t[r])},qre=(e,t,n)=>{let r=e.slots=O7();if(e.vnode.shapeFlag&32){let a=t._;a?(V7(r,t,n),n&&nh(r,"_",a,!0)):F7(t,r)}else t&&H7(e,t)},jre=(e,t,n)=>{let{vnode:r,slots:a}=e,o=!0,i=Pt;if(r.shapeFlag&32){let s=t._;s?n&&s===1?o=!1:V7(a,t,n):(o=!t.$stable,F7(t,a)),i=t}else t&&(H7(e,t),i={default:1});if(o)for(let s in a)!p_(s)&&i[s]==null&&delete a[s]};function $re(){let e=[];typeof __VUE_OPTIONS_API__!="boolean"&&(du().__VUE_OPTIONS_API__=!0),typeof __VUE_PROD_DEVTOOLS__!="boolean"&&(du().__VUE_PROD_DEVTOOLS__=!1),typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(du().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}var ta=Yre;function U7(e){return Gre(e)}function Gre(e,t){$re();let n=du();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&v7(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);let{insert:r,remove:a,patchProp:o,createElement:i,createText:s,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:d,setScopeId:p=Jr,insertStaticContent:h}=e,g=(I,R,z,ne=null,j=null,W=null,Y=void 0,se=null,K=!!R.dynamicChildren)=>{if(I===R)return;I&&!c1(I,R)&&(ne=mt(I),T(I,j,W,!0),I=null),R.patchFlag===-2&&(K=!1,R.dynamicChildren=null),R.dynamicChildren&&I&&I.dynamicChildren&&I.dynamicChildren.hasOnce&&(R.dynamicChildren===nf&&(R.dynamicChildren=[]),R.dynamicChildren.hasOnce=!0);let{type:Z,ref:$,shapeFlag:te}=R;switch(Z){case I1:x(I,R,z,ne);break;case Mi:m(I,R,z,ne);break;case x1:I==null&&y(R,z,ne,Y);break;case nn:q(I,R,z,ne,j,W,Y,se,K);break;default:te&1?k(I,R,z,ne,j,W,Y,se,K):te&6?ie(I,R,z,ne,j,W,Y,se,K):(te&64||te&128)&&Z.process(I,R,z,ne,j,W,Y,se,K,Tt)}$!=null&&j?p1($,I&&I.ref,W,R||I,!R):$==null&&I&&I.ref!=null&&p1(I.ref,null,W,I,!0)},x=(I,R,z,ne)=>{if(I==null)r(R.el=s(R.children),z,ne);else{let j=R.el=I.el;R.children!==I.children&&u(j,R.children)}},m=(I,R,z,ne)=>{I==null?r(R.el=l(R.children||""),z,ne):R.el=I.el},y=(I,R,z,ne)=>{[I.el,I.anchor]=h(I.children,R,z,ne,I.el,I.anchor)},b=(I,R,z,ne)=>{if(R.children!==I.children){let j=d(I.anchor);w(I),[R.el,R.anchor]=h(R.children,z,j,ne)}else R.el=I.el,R.anchor=I.anchor},v=({el:I,anchor:R},z,ne)=>{let j;for(;I&&I!==R;)j=d(I),r(I,z,ne),I=j;r(R,z,ne)},w=({el:I,anchor:R})=>{let z;for(;I&&I!==R;)z=d(I),a(I),I=z;a(R)},k=(I,R,z,ne,j,W,Y,se,K)=>{if(R.type==="svg"?Y="svg":R.type==="math"&&(Y="mathml"),I==null)_(R,z,ne,j,W,Y,se,K);else{let Z=I.el&&I.el._isVueCE?I.el:null;try{Z&&Z._beginPatch(),S(I,R,j,W,Y,se,K)}finally{Z&&Z._endPatch()}}},_=(I,R,z,ne,j,W,Y,se)=>{let K,Z,{props:$,shapeFlag:te,transition:le,dirs:me}=I;if(K=I.el=i(I.type,W,$&&$.is,$),te&8?c(K,I.children):te&16&&M(I.children,K,null,ne,j,t_(I,W),Y,se),me&&of(I,null,ne,"created"),E(K,I,I.scopeId,Y,ne),$){for(let G in $)G!=="value"&&!th(G)&&o(K,G,null,$[G],W,ne);"value"in $&&o(K,"value",null,$.value,W),(Z=$.onVnodeBeforeMount)&&Ei(Z,ne,I)}__VUE_PROD_DEVTOOLS__&&(nh(K,"__vnode",I,!0),nh(K,"__vueParentComponent",ne,!0)),me&&of(I,null,ne,"beforeMount");let P=Wre(j,le);P?le.beforeEnter(K):le&&!le.persisted&&(K[Xre]=!0),r(K,R,z),((Z=$&&$.onVnodeMounted)||P||me)&&ta(()=>{let de;Z&&Ei(Z,ne,I),P&&le.enter(K),me&&of(I,null,ne,"mounted")},j)},E=(I,R,z,ne,j)=>{if(z&&p(I,z),ne)for(let W=0;W<ne.length;W++)p(I,ne[W]);if(j){let W=j.subTree;if(R===W||$7(W.type)&&(W.ssContent===R||W.ssFallback===R)){let Y=j.vnode;E(I,Y,Y.scopeId,Y.slotScopeIds,j.parent)}}},M=(I,R,z,ne,j,W,Y,se,K=0)=>{for(let Z=K;Z<I.length;Z++){let $=I[Z]=se?Gs(I[Z]):Ti(I[Z]);g(null,$,R,z,ne,j,W,Y,se)}},S=(I,R,z,ne,j,W,Y)=>{let se=R.el=I.el;__VUE_PROD_DEVTOOLS__&&(se.__vnode=R);let{patchFlag:K,dynamicChildren:Z,dirs:$}=R;K|=I.patchFlag&16;let te=I.props||Pt,le=R.props||Pt,me;if(z&&sf(z,!1),(me=le.onVnodeBeforeUpdate)&&Ei(me,z,R,I),$&&of(R,I,z,"beforeUpdate"),z&&sf(z,!0),Z&&(!I.dynamicChildren||I.dynamicChildren.length!==Z.length)&&(K=0,Y=!1,Z=null),(te.innerHTML&&le.innerHTML==null||te.textContent&&le.textContent==null)&&c(se,""),Z?U(I.dynamicChildren,Z,se,z,ne,t_(R,j),W):Y||Fe(I,R,se,null,z,ne,t_(R,j),W,!1),K>0){if(K&16)N(se,te,le,z,j);else if(K&2&&te.class!==le.class&&o(se,"class",null,le.class,j),K&4&&o(se,"style",te.style,le.style,j),K&8){let P=R.dynamicProps;for(let G=0;G<P.length;G++){let de=P[G],ve=te[de],oe=le[de];(oe!==ve||de==="value")&&o(se,de,ve,oe,j,z)}}K&1&&I.children!==R.children&&c(se,R.children)}else!Y&&Z==null&&N(se,te,le,z,j);((me=le.onVnodeUpdated)||$)&&ta(()=>{me&&Ei(me,z,R,I),$&&of(R,I,z,"updated")},ne)},U=(I,R,z,ne,j,W,Y)=>{for(let se=0;se<R.length;se++){let K=I[se],Z=R[se],$=K.el||g1(K),te=$&&(K.type===nn||!c1(K,Z)||K.shapeFlag&198)?f($):z;g(K,Z,te,null,ne,j,W,Y,!0)}},N=(I,R,z,ne,j)=>{if(R!==z){if(R!==Pt)for(let W in R)!th(W)&&!(W in z)&&o(I,W,R[W],null,j,ne);for(let W in z){if(th(W))continue;let Y=z[W],se=R[W];Y!==se&&W!=="value"&&o(I,W,se,Y,j,ne)}"value"in z&&o(I,"value",R.value,z.value,j)}},q=(I,R,z,ne,j,W,Y,se,K)=>{let Z=R.el=I?I.el:s(""),$=R.anchor=I?I.anchor:s(""),{patchFlag:te,dynamicChildren:le,slotScopeIds:me}=R;me&&(se=se?se.concat(me):me),I==null?(r(Z,z,ne),r($,z,ne),M(R.children||[],z,$,j,W,Y,se,K)):te>0&&te&64&&le&&I.dynamicChildren&&I.dynamicChildren.length===le.length?(U(I.dynamicChildren,le,z,j,W,Y,se),(R.key!=null||j&&R===j.subTree)&&q7(I,R,!0)):Fe(I,R,z,$,j,W,Y,se,K)},ie=(I,R,z,ne,j,W,Y,se,K)=>{R.slotScopeIds=se,I==null?R.shapeFlag&512?j.ctx.activate(R,z,ne,Y,K):fe(R,z,ne,j,W,Y,K):he(I,R,K)},fe=(I,R,z,ne,j,W,Y)=>{let se=I.component=oae(I,ne,j);if(f_(I)&&(se.ctx.renderer=Tt),iae(se,!1,Y),se.asyncDep){if(j&&j.registerDep(se,xe,Y,W),!I.el){let K=se.subTree=fo(Mi);m(null,K,R,z),I.placeholder=K.el}}else xe(se,I,R,z,j,W,Y)},he=(I,R,z)=>{let ne=R.component=I.component;if(Bre(I,R,z))if(ne.asyncDep&&!ne.asyncResolved){R.el=I.el,R.placeholder=I.placeholder,Ce(ne,R,z);return}else ne.next=R,ne.update();else R.el=I.el,R.placeholder=I.placeholder,ne.vnode=R},xe=(I,R,z,ne,j,W,Y)=>{let se=()=>{if(I.isMounted){let{next:te,bu:le,u:me,parent:P,vnode:G}=I;{let Ee=j7(I);if(Ee){te&&(te.el=G.el,Ce(I,te,Y)),Ee.asyncDep.then(()=>{let tt=()=>{I.job.flags&8||(j&&j.pendingBranch?ta(tt,j):Z())};tt.flags=48,ta(tt,j)});return}}let de=te,ve;sf(I,!1),te?(te.el=G.el,Ce(I,te,Y)):te=G,le&&Jx(le),(ve=te.props&&te.props.onVnodeBeforeUpdate)&&Ei(ve,P,te,G),sf(I,!0);let oe=e_(I),ce=I.subTree;I.subTree=oe,g(ce,oe,f(ce.el||g1(ce)),mt(ce),I,j,W),te.el=oe.el,de===null&&zre(I,oe.el),me&&ta(me,j),(ve=te.props&&te.props.onVnodeUpdated)&&ta(()=>Ei(ve,P,te,G),j),__VUE_PROD_DEVTOOLS__&&w7(I)}else{let te,{el:le,props:me}=R,{bm:P,m:G,parent:de,root:ve,type:oe}=I,ce=h1(R);if(sf(I,!1),P&&Jx(P),!ce&&(te=me&&me.onVnodeBeforeMount)&&Ei(te,de,R),sf(I,!0),le&&vt){let Ee=()=>{I.subTree=e_(I),vt(le,I.subTree,I,j,null)};ce&&oe.__asyncHydrate?oe.__asyncHydrate(le,I,Ee):Ee()}else{ve.ce&&ve.ce._hasShadowRoot()&&ve.ce._injectChildStyle(oe,I.parent?I.parent.type:void 0);let Ee=I.subTree=e_(I);g(null,Ee,z,ne,I,j,W),R.el=Ee.el}if(G&&ta(G,j),!ce&&(te=me&&me.onVnodeMounted)){let Ee=R;ta(()=>Ei(te,de,Ee),j)}(R.shapeFlag&256||de&&h1(de.vnode)&&de.vnode.shapeFlag&256)&&I.a&&ta(I.a,j),I.isMounted=!0,__VUE_PROD_DEVTOOLS__&&rre(I),R=z=ne=null}};I.scope.on();let K=I.effect=new oh(se);I.scope.off();let Z=I.update=K.run.bind(K),$=I.job=K.runIfDirty.bind(K);$.i=I,$.id=I.uid,K.scheduler=()=>l_($),sf(I,!0),Z()},Ce=(I,R,z)=>{R.component=I;let ne=I.vnode.props;I.vnode=R,I.next=null,Hre(I,R.props,ne,z),jre(I,R.children,z),Fo(),x7(I),Ho()},Fe=(I,R,z,ne,j,W,Y,se,K=!1)=>{let Z=I&&I.children,$=I?I.shapeFlag:0,te=R.children,{patchFlag:le,shapeFlag:me}=R;if(le>0){if(le&128){st(Z,te,z,ne,j,W,Y,se,K);return}else if(le&256){D(Z,te,z,ne,j,W,Y,se,K);return}}me&8?($&16&&ln(Z,j,W),te!==Z&&c(z,te)):$&16?me&16?st(Z,te,z,ne,j,W,Y,se,K):ln(Z,j,W,!0):($&8&&c(z,""),me&16&&M(te,z,ne,j,W,Y,se,K))},D=(I,R,z,ne,j,W,Y,se,K)=>{I=I||nf,R=R||nf;let Z=I.length,$=R.length,te=Math.min(Z,$),le;for(le=0;le<te;le++){let me=R[le]=K?Gs(R[le]):Ti(R[le]);g(I[le],me,z,null,j,W,Y,se,K)}Z>$?ln(I,j,W,!0,!1,te):M(R,z,ne,j,W,Y,se,K,te)},st=(I,R,z,ne,j,W,Y,se,K)=>{let Z=0,$=R.length,te=I.length-1,le=$-1;for(;Z<=te&&Z<=le;){let me=I[Z],P=R[Z]=K?Gs(R[Z]):Ti(R[Z]);if(c1(me,P))g(me,P,z,null,j,W,Y,se,K);else break;Z++}for(;Z<=te&&Z<=le;){let me=I[te],P=R[le]=K?Gs(R[le]):Ti(R[le]);if(c1(me,P))g(me,P,z,null,j,W,Y,se,K);else break;te--,le--}if(Z>te){if(Z<=le){let me=le+1,P=me<$?R[me].el:ne;for(;Z<=le;)g(null,R[Z]=K?Gs(R[Z]):Ti(R[Z]),z,P,j,W,Y,se,K),Z++}}else if(Z>le)for(;Z<=te;)T(I[Z],j,W,!0),Z++;else{let me=Z,P=Z,G=new Map;for(Z=P;Z<=le;Z++){let Et=R[Z]=K?Gs(R[Z]):Ti(R[Z]);Et.key!=null&&G.set(Et.key,Z)}let de,ve=0,oe=le-P+1,ce=!1,Ee=0,tt=new Array(oe);for(Z=0;Z<oe;Z++)tt[Z]=0;for(Z=me;Z<=te;Z++){let Et=I[Z];if(ve>=oe){T(Et,j,W,!0);continue}let Qt;if(Et.key!=null)Qt=G.get(Et.key);else for(de=P;de<=le;de++)if(tt[de-P]===0&&c1(Et,R[de])){Qt=de;break}Qt===void 0?T(Et,j,W,!0):(tt[Qt-P]=Z+1,Qt>=Ee?Ee=Qt:ce=!0,g(Et,R[Qt],z,null,j,W,Y,se,K),ve++)}let un=ce?Kre(tt):nf;for(de=un.length-1,Z=oe-1;Z>=0;Z--){let Et=P+Z,Qt=R[Et],V=R[Et+1],Le=Et+1<$?V.el||g1(V):ne;tt[Z]===0?g(null,Qt,z,Le,j,W,Y,se,K):ce&&(de<0||Z!==un[de]?Ke(Qt,z,Le,2):de--)}}},Ke=(I,R,z,ne,j=null)=>{let{el:W,type:Y,transition:se,children:K,shapeFlag:Z}=I;if(Z&6){Ke(I.component.subTree,R,z,ne);return}if(Z&128){I.suspense.move(R,z,ne);return}if(Z&64){Y.move(I,R,z,Tt);return}if(Y===nn){r(W,R,z);for(let te=0;te<K.length;te++)Ke(K[te],R,z,ne);r(I.anchor,R,z);return}if(Y===x1){v(I,R,z);return}if(ne!==2&&Z&1&&se)if(ne===0)se.persisted&&!W[JE]?r(W,R,z):(se.beforeEnter(W),r(W,R,z),ta(()=>se.enter(W),j));else{let{leave:te,delayLeave:le,afterLeave:me}=se,P=()=>{I.ctx.isUnmounted?a(W):r(W,R,z)},G=()=>{let de=W._isLeaving||!!W[JE];W._isLeaving&&W[JE](!0),se.persisted&&!de?P():te(W,()=>{P(),me&&me()})};le?le(W,P,G):G()}else r(W,R,z)},T=(I,R,z,ne=!1,j=!1)=>{let{type:W,props:Y,ref:se,children:K,dynamicChildren:Z,shapeFlag:$,patchFlag:te,dirs:le,cacheIndex:me,memo:P}=I;if((te===-2||Z&&Z.hasOnce)&&(j=!1),se!=null&&(Fo(),p1(se,null,z,I,!0),Ho()),me!=null&&(!I.ctx||I.ctx===R)&&(R.renderCache[me]=void 0),$&256&&R.ctx.deactivate(I))return;let G=$&1&&le,de=!h1(I),ve;if(de&&(ve=Y&&Y.onVnodeBeforeUnmount)&&Ei(ve,R,I),$&6)Ut(I.component,z,ne);else{if($&128){I.suspense.unmount(z,ne);return}G&&of(I,null,R,"beforeUnmount"),$&64?I.type.remove(I,R,z,Tt,ne):Z&&!Z.hasOnce&&(W!==nn||te>0&&te&64)?ln(Z,R,z,!1,!0):(W===nn&&te&384||!j&&$&16)&&ln(K,R,z),ne&&at(I)}let oe=P!=null&&me==null;(de&&(ve=Y&&Y.onVnodeUnmounted)||G||oe)&&ta(()=>{ve&&Ei(ve,R,I),G&&of(I,null,R,"unmounted"),oe&&(I.el=null)},z)},at=I=>{let{type:R,el:z,anchor:ne,transition:j}=I,W=R===nn;if(W&&!j){yt(z,ne);return}if(R===x1){w(I),j&&!j.persisted&&j.afterLeave&&j.afterLeave();return}let Y=W?r_(I):I,se=()=>{W?f(z)&&yt(z,ne):a(z),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(Y&&Y.shapeFlag&1&&j&&!j.persisted){let{leave:K,delayLeave:Z}=j,$=Y.el,te=()=>K($,se);Z?Z($,se,te):te()}else se()},yt=(I,R)=>{let z;for(;I!==R;)z=d(I),a(I),I=z;a(R)},Ut=(I,R,z)=>{let{bum:ne,scope:j,job:W,subTree:Y,um:se,m:K,a:Z}=I;s7(K),s7(Z),ne&&Jx(ne),j.stop(),W?(W.flags|=8,T(Y,I,R,z)):Y&&(Y.transition=I.vnode.transition,T(Y,I,R,z)),se&&ta(se,R);let $=()=>{I.isUnmounted=!0};$.flags=16,ta($,R),__VUE_PROD_DEVTOOLS__&&ore(I)},ln=(I,R,z,ne=!1,j=!1,W=0)=>{for(let Y=W;Y<I.length;Y++)T(I[Y],R,z,ne,j)},mt=I=>{if(I.shapeFlag&6)return mt(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();let R=d(I.anchor||I.el),z=R&&R[dre];return z?d(z):R},be=(I,R,z)=>{let ne=I&&R._vnode?void 0:I&&I.component?I.component.uid:aae();ere(()=>{I==null?R._vnode&&T(R._vnode,null,null,!0):g(R._vnode||null,I,R,null,null,null,z),R._vnode=I},ne)},Tt={p:g,um:T,m:Ke,r:at,mt:fe,mc:M,pc:Fe,pbc:U,n:mt,o:e},Dt,vt;return t&&([Dt,vt]=t(Tt)),{render:be,hydrate:Dt,createApp:Dre(be,Dt)}}function t_({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function sf({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wre(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function q7(e,t,n=!1){let r=e.children,a=t.children;if(We(r)&&We(a))for(let o=0;o<r.length;o++){let i=r[o],s=a[o];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=a[o]=Gs(a[o]),s.el=i.el),!n&&s.patchFlag!==-2&&q7(i,s)),s.type===I1&&(s.patchFlag===-1&&(s=a[o]=Gs(s)),s.el=i.el),s.type===Mi&&!s.el&&(s.el=i.el)}}function Kre(e){let t=e.slice(),n=[0],r,a,o,i,s,l=e.length;for(r=0;r<l;r++){let u=e[r];if(u!==0){if(a=n[n.length-1],e[a]<u){t[r]=a,n.push(r);continue}for(o=0,i=n.length-1;o<i;)s=o+i>>1,e[n[s]]<u?o=s+1:i=s;u<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function j7(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:j7(t)}function s7(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function g1(e){if(e.placeholder)return e.placeholder;let t=e.component;if(t)return g1(t.subTree);let n=e.suspense;return n&&n.activeBranch?g1(n.activeBranch):null}var $7=e=>e.__isSuspense;var Xre=Symbol("_deferredEnter");function Yre(e,t){t&&t.pendingBranch?We(e)?t.effects.push(...e):t.effects.push(e):g7(e)}var nn=Symbol.for("v-fgt"),I1=Symbol.for("v-txt"),Mi=Symbol.for("v-cmt"),x1=Symbol.for("v-stc"),ch=[],Ws=null;function Zre(){ch.pop(),Ws=ch[ch.length-1]||null}var m_=1;function sk(e,t=!1){m_+=e,e<0&&Ws&&t&&(Ws.hasOnce=!0)}function v1(e){return e?e.__v_isVNode===!0:!1}function c1(e,t){return e.type===t.type&&e.key===t.key}var G7=({key:e})=>e??null,nk=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bn(e)||Xn(e)||Ze(e)?{i:Ri,r:e,k:t,f:!!n}:e:null);function Jre(e,t=null,n=null,r=0,a=null,o=e===nn?0:1,i=!1,s=!1){let l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&G7(t),ref:t&&nk(t),scopeId:k7,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Ri};return s?(lk(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=bn(n)?8:16),m_>0&&!i&&Ws&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Ws.push(l),l}var fo=Qre;function Qre(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===Cre)&&(e=Mi),v1(e)){let s=fh(e,t,!0);return n&&lk(s,n),m_>0&&!o&&Ws&&(s.shapeFlag&6?Ws[Ws.indexOf(e)]=s:Ws.push(s)),s.patchFlag=-2,s}if(cae(e)&&(e=e.__vccOpts),t){t=eae(t);let{class:s,style:l}=t;s&&!bn(s)&&(t.class=e1(s)),Ot(l)&&(u1(l)&&!We(l)&&(l=sn({},l)),t.style=Qx(l))}let i=bn(e)?1:$7(e)?128:dk(e)?64:Ot(e)?4:Ze(e)?2:0;return Jre(e,t,n,r,a,i,o,!0)}function eae(e){return e?u1(e)?sn({},e):P7(e)?sn({},e[Z7]||e):e:null}function fh(e,t,n=!1,r=!1){let{props:a,ref:o,patchFlag:i,children:s,transition:l}=e,u=t?nae(a||{},t):a,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&G7(u),ref:t&&t.ref?n&&o?We(o)?o.concat(nk(t)):[o,nk(t)]:nk(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==nn?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fh(e.ssContent),ssFallback:e.ssFallback&&fh(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return l&&r&&lh(c,l.clone(c)),c}function tae(e=" ",t=0){return fo(I1,null,e,t)}function Ti(e){return e==null||typeof e=="boolean"?fo(Mi):We(e)?fo(nn,null,e.slice()):v1(e)?Gs(e):fo(I1,null,String(e))}function Gs(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fh(e)}function lk(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(We(t))n=16;else if(typeof t=="object")if(r&65){let a=t.default;a&&(a._c&&(a._d=!1),lk(e,a()),a._c&&(a._d=!0));return}else{n=32;let a=t._;!a&&!P7(t)?t._ctx=Ri:a===3&&Ri&&(Ri.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Ze(t)){if(r&65){lk(e,{default:t});return}t={default:t,_ctx:Ri},n=32}else t=String(t),r&64?(n=16,t=[tae(t)]):n=8;e.children=t,e.shapeFlag|=n}function nae(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let a in r)if(a==="class")t.class!==r.class&&(t.class=e1([t.class,r.class]));else if(a==="style")t.style=Qx([t.style,r.style]);else if(Jp(a)){let o=t[a],i=r[a];i&&o!==i&&!(We(o)&&o.includes(i))?t[a]=o?[].concat(o,i):i:i==null&&o==null&&!Qp(a)&&(t[a]=i)}else a!==""&&(t[a]=r[a])}return t}function Ei(e,t,n,r=null){po(e,t,7,[n,r])}var rae=T7(),W7=0;function aae(){return W7}function oae(e,t,n){let r=e.type,a=(t?t.appContext:e.appContext)||rae,o={uid:W7++,vnode:e,type:r,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new a1(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(a.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:z7(r,a),emitsOptions:D7(r,a),emit:null,emitted:null,propsDefaults:Pt,inheritAttrs:r.inheritAttrs,ctx:Pt,data:Pt,props:Pt,attrs:Pt,slots:Pt,refs:Pt,setupState:Pt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Mre.bind(null,o),e.ce&&e.ce(o),o}var ra=null,K7=()=>ra||Ri,uk,w1;{let e=du(),t=(n,r)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(r),o=>{a.length>1?a.forEach(i=>i(o)):a[0](o)}};uk=t("__VUE_INSTANCE_SETTERS__",n=>ra=n),w1=t("__VUE_SSR_SETTERS__",n=>k1=n)}var A1=e=>{let t=ra;return uk(e),e.scope.on(),()=>{e.scope.off(),uk(t)}},l7=()=>{ra&&ra.scope.off(),uk(null)};function X7(e){return e.vnode.shapeFlag&4}var k1=!1;function iae(e,t=!1,n=!1){t&&w1(t);let{props:r,children:a}=e.vnode,o=X7(e);Fre(e,r,o,t),qre(e,a,n||t);let i=o?sae(e,t):void 0;return t&&w1(!1),i}function sae(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Sre);let{setup:r}=n;if(r){Fo();let a=e.setupContext=r.length>1?uae(e):null,o=A1(e),i=C1(r,e,0,[e.props,a]),s=EE(i);if(Ho(),o(),(s||e.sp)&&!h1(e)&&L7(e),s){if(i.then(l7,l7),t)return i.then(l=>{w1(!0);try{u7(e,l,t)}finally{w1(!1)}}).catch(l=>{ck(l,e,0,void 0,!0),e.ssrRender=(u,c)=>c("<!---->")});e.asyncDep=i}else u7(e,i,t)}else Y7(e,t)}function u7(e,t,n){Ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ot(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=ek(t)),Y7(e,n)}var c7,f7;function Y7(e,t,n){let r=e.type;if(!e.render){if(!t&&c7&&!r.render){let a=r.template||__VUE_OPTIONS_API__&&d_(e).template;if(a){let{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:s,compilerOptions:l}=r,u=sn(sn({isCustomElement:o,delimiters:s},i),l);r.render=c7(a,u)}}e.render=r.render||Jr,f7&&f7(e)}if(__VUE_OPTIONS_API__){let a=A1(e);Fo();try{Lre(e)}finally{Ho(),a()}}}var Z7=Symbol(),lae={get(e,t){return fr(e,"get",""),t===Z7?e:e[t]}};function uae(e){let t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,lae),slots:e.slots,emit:e.emit,expose:t}}function g_(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ek(XE(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in m1)return m1[n](e)},has(t,n){return n in t||n in m1}})):e.proxy}function cae(e){return Ze(e)&&"__vccOpts"in e}var aa=(e,t)=>Yz(e,t,k1);function H(e,t,n){try{sk(-1);let r=arguments.length;return r===2?Ot(t)&&!We(t)?v1(t)?fo(e,null,[t]):fo(e,t):fo(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&v1(n)&&(n=[n]),fo(e,t,n))}finally{sk(1)}}var d7="3.5.46";var y_,J7=typeof window<"u"&&window.trustedTypes;if(J7)try{y_=J7.createPolicy("vue",{createHTML:e=>e})}catch{}var lF=y_?e=>y_.createHTML(e):e=>e,fae="http://www.w3.org/2000/svg",dae="http://www.w3.org/1998/Math/MathML",Xs=typeof document<"u"?document:null,Q7=Xs&&Xs.createElement("template"),pae={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let a=t==="svg"?Xs.createElementNS(fae,e):t==="mathml"?Xs.createElementNS(dae,e):n?Xs.createElement(e,{is:n}):Xs.createElement(e);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>Xs.createTextNode(e),createComment:e=>Xs.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xs.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){let i=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{Q7.innerHTML=lF(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);let s=Q7.content;if(r==="svg"||r==="mathml"){let l=s.firstChild;for(;l.firstChild;)s.appendChild(l.firstChild);s.removeChild(l)}t.insertBefore(s,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};var hae=Symbol("_vtc");function mae(e,t,n){let r=e[hae];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}var eF=Symbol("_vod"),gae=Symbol("_vsh");var xae=Symbol("");var bae=/(?:^|;)\s*display\s*:/;function yae(e,t,n){let r=e.style,a=bn(n),o=!1;if(n&&!a){if(t)if(bn(t))for(let i of t.split(";")){let s=i.slice(0,i.indexOf(":")).trim();n[s]==null&&E1(r,s,"")}else for(let i in t)n[i]==null&&E1(r,i,"");for(let i in n){i==="display"&&(o=!0);let s=n[i];s!=null?wae(e,i,!bn(t)&&t?t[i]:void 0,s)||E1(r,i,s):E1(r,i,"")}}else if(a){if(t!==n){let i=r[xae];i&&(n+=";"+i),r.cssText=n,o=bae.test(n)}}else t&&e.removeAttribute("style");eF in e&&((!a||t!==n)&&(e[eF]=o?r.display:""),e[gae]&&(r.display="none"))}var hk=/\s*!important$/;function E1(e,t,n){if(We(n))n.forEach(r=>E1(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))hk.test(n)?e.setProperty(t,n.replace(hk,""),"important"):e.setProperty(t,n);else{let r=vae(e,t);hk.test(n)?e.setProperty(Us(r),n.replace(hk,""),"important"):e[r]=n}}var tF=["Webkit","Moz","ms"],x_={};function vae(e,t){let n=x_[t];if(n)return n;let r=Qr(t);if(r!=="filter"&&r in e)return x_[t]=r;r=Yx(r);for(let a=0;a<tF.length;a++){let o=tF[a]+r;if(o in e)return x_[t]=o}return t}function wae(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bn(r)&&n===r}var nF="http://www.w3.org/1999/xlink";function rF(e,t,n,r,a,o=Rz(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(nF,t.slice(6,t.length)):e.setAttributeNS(nF,t,n):n==null||o&&!$w(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Bo(n)?String(n):n)}function aF(e,t,n,r,a){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?lF(n):n);return}let o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){let s=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(s!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){let s=typeof e[t];s==="boolean"?n=$w(n):n==null&&s==="string"?(n="",i=!0):s==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(a||t)}function kae(e,t,n,r){e.addEventListener(t,n,r)}function Cae(e,t,n,r){e.removeEventListener(t,n,r)}var oF=Symbol("_vei");function Sae(e,t,n,r,a=null){let o=e[oF]||(e[oF]={}),i=o[t];if(r&&i)i.value=r;else{let[s,l]=Aae(t);if(r){let u=o[t]=Tae(r,a);kae(e,s,u,l)}else i&&(Cae(e,s,i,l),o[t]=void 0)}}var Lae=/(Once|Passive|Capture)$/,Iae=/^on:?(?:Once|Passive|Capture)$/;function Aae(e){let t,n;for(;(n=e.match(Lae))&&!Iae.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Us(e.slice(2)),t]}var b_=0,Eae=Promise.resolve(),_ae=()=>b_||(Eae.then(()=>b_=0),b_=Date.now());function Tae(e,t){let n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;let a=n.value;if(We(a)){let o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};let i=a.slice(),s=[r];for(let l=0;l<i.length&&!r._stopped;l++){let u=i[l];u&&po(u,t,5,s)}}else po(a,t,5,[r])};return n.value=e,n.attached=_ae(),n}var iF=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Dae=(e,t,n,r,a,o)=>{let i=a==="svg";t==="class"?mae(e,r,i):t==="style"?yae(e,n,r):Jp(t)?Qp(t)||Sae(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rae(e,t,r,i))?(aF(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&rF(e,t,r,i,o,t!=="value")):e._isVueCE&&(Mae(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bn(r)))?aF(e,Qr(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),rF(e,t,r,i))};function Rae(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&iF(t)&&Ze(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return iF(t)&&bn(n)?!1:t in e}function Mae(e,t){let n=e._def.props;if(!n)return!1;let r=Qr(t);return Array.isArray(n)?n.some(a=>Qr(a)===r):Object.keys(n).some(a=>Qr(a)===r)}var Nae=sn({patchProp:Dae},pae),sF;function Oae(){return sF||(sF=U7(Nae))}var xa=((...e)=>{let t=Oae().createApp(...e),{mount:n}=t;return t.mount=r=>{let a=Bae(r);if(!a)return;let o=t._component;!Ze(o)&&!o.render&&!o.template&&(o.template=a.innerHTML),a.nodeType===1&&(a.textContent="");let i=n(a,!1,Pae(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),i},t});function Pae(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bae(e){return bn(e)?document.querySelector(e):e}function uF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=uF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zae(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=uF(e))&&(r&&(r+=" "),r+=t);return r}var Tr=zae;var Fae=Object.defineProperty,cF=Object.getOwnPropertySymbols,Hae=Object.prototype.hasOwnProperty,Vae=Object.prototype.propertyIsEnumerable,fF=(e,t,n)=>t in e?Fae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uae=(e,t)=>{for(var n in t||(t={}))Hae.call(t,n)&&fF(e,n,t[n]);if(cF)for(var n of cF(t))Vae.call(t,n)&&fF(e,n,t[n]);return e};function T1(e,t){return Object.assign(e,{meta:Uae({package:"@milkdown/components"},t)}),e}var qae={imageIcon:"\u{1F30C}",captionIcon:"\u{1F4AC}",uploadButton:"Upload file",confirmButton:"Confirm \u23CE",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},D1=He(qae,"imageBlockConfigCtx");T1(D1,{displayName:"Config<image-block>",group:"ImageBlock"});function jae(e){return jr(e,"paragraph",(t,n,r)=>{var a,o;if(((a=t.children)==null?void 0:a.length)!==1)return;let i=(o=t.children)==null?void 0:o[0];if(!i||i.type!=="image")return;let{url:s,alt:l,title:u}=i,c={type:"image-block",url:s,alt:l,title:u};r.children.splice(n,1,c)})}var k_=No("remark-image-block",()=>()=>jae);T1(k_.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"});T1(k_.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var $ae=Object.defineProperty,dF=Object.getOwnPropertySymbols,Gae=Object.prototype.hasOwnProperty,Wae=Object.prototype.propertyIsEnumerable,pF=(e,t,n)=>t in e?$ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kae=(e,t)=>{for(var n in t||(t={}))Gae.call(t,n)&&pF(e,n,t[n]);if(dF)for(var n of dF(t))Wae.call(t,n)&&pF(e,n,t[n]);return e},v_="image-block",R1=pn("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${v_}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw Vr(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number((t=e.getAttribute("ratio"))!=null?t:1)}}}],toDOM:e=>["img",Kae({"data-type":v_},e.attrs)],parseMarkdown:{match:({type:e})=>e==="image-block",runner:(e,t,n)=>{var r;let a=t.url,o=(r=t.title)!=null?r:"",i=Number(t.alt||1);(Number.isNaN(i)||i===0)&&(i=1),e.addNode(n,{src:a,caption:o,ratio:i})}},toMarkdown:{match:e=>e.type.name==="image-block",runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));T1(R1.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"});function mk(...e){}var Xae=Kp("abcdefghijklmnopqrstuvwxyz0123456789",8);function w_(e){return`${e}-${Xae()}`}mk(H);function _1({icon:e,class:t,onClick:n}){return H("span",{class:Tr("milkdown-icon",t),onPointerdown:n,innerHTML:e?Po.sanitize(e.trim()):void 0})}_1.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};mk(H,nn);var Yae=Yn({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:a,uploadButton:o,confirmButton:i,uploadPlaceholderText:s,className:l,onImageLoadError:u}){var c,f;let d=Ne(!1),p=Ne(),h=Ne((c=t.value)!=null?c:""),g=w_("milkdown-image-link"),x=w_("milkdown-image-upload"),m=Ne(((f=t.value)==null?void 0:f.length)!==0),y=k=>{let E=k.target.value;m.value=E.length!==0,h.value=E},b=k=>{var _,E;k.key==="Enter"&&n((E=(_=p.value)==null?void 0:_.value)!=null?E:"")},v=()=>{var k,_;n((_=(k=p.value)==null?void 0:k.value)!=null?_:"")},w=k=>{var _;let E=(_=k.target.files)==null?void 0:_[0];E&&r(E).then(M=>{M&&(n(M),m.value=!0)}).catch(M=>{console.error("An error occurred while uploading image"),console.error(M)})};return()=>H("div",{class:Tr("image-edit",l)},H(_1,{icon:a,class:"image-icon"}),H("div",{class:Tr("link-importer",d.value&&"focus")},H("input",{id:g,ref:p,draggable:"true",onDragstart:k=>{k.preventDefault(),k.stopPropagation()},disabled:e.value,class:"link-input-area",value:h.value,onInput:y,onKeydown:b,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!m.value&&H("div",{class:"placeholder"},H("input",{disabled:e.value,class:"hidden",id:x,type:"file",accept:"image/*",onChange:w}),H("label",{class:"uploader",for:x},H(_1,{icon:o})),H("span",{class:"text",onClick:()=>{var k;return(k=p.value)==null?void 0:k.focus()}},s))),h.value&&H(nn,null,H("div",{class:"image-preview"},H("img",{src:h.value,alt:"",onError:k=>Promise.resolve(u?.(k)).catch(()=>{})})),H("div",{class:"confirm",onClick:()=>v()},H(_1,{icon:i}))))}});mk(H,nn);var Zae=Yn({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:a,config:o}){var i;let s=Ne(),l=Ne(),u=Ne(!!((i=t.value)!=null&&i.length)),c=w_("milkdown-image-caption"),f=Ne(0),d=()=>{var b;let v=s.value;if(!v)return;let w=v.closest(".milkdown-image-block");if(!w)return;let k=w.getBoundingClientRect().width;if(!k)return;o.maxWidth&&o.maxWidth<k&&(k=o.maxWidth);let _=v.naturalHeight,E=v.naturalWidth,M=E<k?_:k*(_/E);o.maxHeight&&M>o.maxHeight&&(M=o.maxHeight);let S=(M*((b=n.value)!=null?b:1)).toFixed(2);v.dataset.origin=M.toFixed(2),v.dataset.height=S,v.style.height=`${S}px`,o.maxWidth&&(v.style.maxWidth=`${o.maxWidth}px`)},p=b=>{b.preventDefault(),b.stopPropagation(),!r.value&&(u.value=!u.value)},h=b=>{let w=b.target.value;f.value&&window.clearTimeout(f.value),f.value=window.setTimeout(()=>{a("caption",w)},1e3)},g=b=>{let w=b.target.value;f.value&&(window.clearTimeout(f.value),f.value=0),a("caption",w)},x=b=>{b.preventDefault();let v=s.value;if(!v)return;let w=v.getBoundingClientRect().top,k=b.clientY-w;k<100&&(k=100),o.maxHeight&&k>o.maxHeight&&(k=o.maxHeight);let _=Number(k).toFixed(2);v.dataset.height=_,v.style.height=`${_}px`},m=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",m);let b=s.value;if(!b)return;let v=Number(b.dataset.origin),w=Number(b.dataset.height),k=Number.parseFloat(Number(w/v).toFixed(2));Number.isNaN(k)||a("ratio",k)},y=b=>{r.value||(b.preventDefault(),b.stopPropagation(),window.addEventListener("pointermove",x),window.addEventListener("pointerup",m))};return()=>H(nn,null,H("div",{class:"image-wrapper"},H("div",{class:"operation"},H("div",{class:"operation-item",onPointerdown:p},H(_1,{icon:o.captionIcon}))),H("img",{ref:s,"data-type":v_,onLoad:d,src:e.value,alt:t.value,onError:b=>{var v;return Promise.resolve((v=o.onImageLoadError)==null?void 0:v.call(o,b)).catch(()=>{})}}),H("div",{ref:l,class:"image-resize-handle",onPointerdown:y})),u.value&&H("input",{id:c,draggable:"true",onDragstart:b=>{b.preventDefault(),b.stopPropagation()},class:"caption-input",placeholder:o?.captionPlaceholderText,onInput:h,onBlur:g,value:t.value}))}}),Jae=Object.defineProperty,hF=Object.getOwnPropertySymbols,Qae=Object.prototype.hasOwnProperty,eoe=Object.prototype.propertyIsEnumerable,mF=(e,t,n)=>t in e?Jae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,toe=(e,t)=>{for(var n in t||(t={}))Qae.call(t,n)&&mF(e,n,t[n]);if(hF)for(var n of hF(t))eoe.call(t,n)&&mF(e,n,t[n]);return e};mk(H,nn);var noe=Yn({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let{src:t}=e;return()=>{var n;return(n=t.value)!=null&&n.length?H(Zae,toe({},e)):H(Yae,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:r=>e.setAttr("src",r),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),gF=Xp(R1.node,e=>(t,n,r)=>{let a=Ne(t.attrs.src),o=Ne(t.attrs.caption),i=Ne(t.attrs.ratio),s=Ne(!1),l=Ne(!n.editable),u=(x,m)=>{if(!n.editable)return;let y=r();y!=null&&n.dispatch(n.state.tr.setNodeAttribute(y,x,x==="src"?Po.sanitize(m):m))},c=e.get(D1.key),f=xa(noe,{src:a,caption:o,ratio:i,selected:s,readonly:l,setAttr:u,config:c}),d=document.createElement("div");d.className="milkdown-image-block";let p=dh(()=>{s.value?d.classList.add("selected"):d.classList.remove("selected")}),h=c.proxyDomURL,g=x=>{if(!h)a.value=x.attrs.src;else{let m=h(x.attrs.src);typeof m=="string"?a.value=m:m.then(y=>{a.value=y}).catch(console.error)}i.value=x.attrs.ratio,o.value=x.attrs.caption,l.value=!n.editable};return g(t),f.mount(d),{dom:d,update:x=>x.type!==t.type?!1:(g(x),!0),stopEvent:x=>x.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{p(),f.unmount(),d.remove()}}});T1(gF,{displayName:"NodeView<image-block>",group:"ImageBlock"});var dLe=[k_,R1,gF,D1].flat();function C_(e){if(!e)return!1;if(Array.isArray(e))return e.length>1?!1:C_(e[0]);let t=e.content;return t?C_(t):e.type==="text"}function roe(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-clipboard",...t}}),e}function xF(e,t){let n=c9(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var S_=rt(e=>{let t=e.get(Ar);e.update(ef,r=>({...r,editable:r.editable??(()=>!0),transformPastedHTML:(a,o)=>{let i=r.transformPastedHTML;return i&&(a=i(a,o)),a.includes("docs-internal-guid")&&(a=a.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1"),a=a.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),a}}));let n=new qe("MILKDOWN_CLIPBOARD");return new Be({key:n,props:{handlePaste:(r,a,o)=>{let i=e.get(ga),s=r.props.editable?.(r.state),{clipboardData:l}=a;if(!s||!l||r.state.selection.$from.node().type.spec.code)return!1;let u=l.getData("text/plain"),c=l.getData("vscode-editor-data");if(c){let h=JSON.parse(c)?.mode;if(u&&h){let{tr:g}=r.state,x=d9("code_block",t);return g.replaceSelectionWith(x.create({language:h})).setSelection(ye.near(g.doc.resolve(Math.max(0,g.selection.from-2)))).insertText(u.replace(/\r\n?/g,`
|
|
59
|
+
`)),r.dispatch(g),!0}}let f=l.getData("text/html");if(f.length===0&&u.length===0)return!1;if(f.length>0&&o)return xF(r,o);let d=wi.fromSchema(t),p;if(f.length===0){let h=i(u);if(!h||typeof h=="string")return!1;p=ki.fromSchema(t).serializeFragment(h.content)}else{let h=document.createElement("template");h.innerHTML=f,p=h.content.cloneNode(!0),h.remove()}return xF(r,d.parseSlice(p))},clipboardTextSerializer:r=>{let a=e.get(Mo);if(C_(r.content.toJSON()))return r.content.textBetween(0,r.content.size,`
|
|
60
|
+
|
|
61
|
+
`);let o=t.topNodeType.createAndFill(void 0,r.content);return o?a(o):""}}})});roe(S_,{displayName:"Prose<clipboard>"});var gk=200,dr=function(){};dr.prototype.append=function(t){return t.length?(t=dr.from(t),!this.length&&t||t.length<gk&&this.leafAppend(t)||this.length<gk&&t.leafPrepend(this)||this.appendInner(t)):this};dr.prototype.prepend=function(t){return t.length?dr.from(t).append(this):this};dr.prototype.appendInner=function(t){return new aoe(this,t)};dr.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?dr.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};dr.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};dr.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};dr.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var a=[];return this.forEach(function(o,i){return a.push(t(o,i))},n,r),a};dr.from=function(t){return t instanceof dr?t:t&&t.length?new bF(t):dr.empty};var bF=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(a,o){return a==0&&o==this.length?this:new t(this.values.slice(a,o))},t.prototype.getInner=function(a){return this.values[a]},t.prototype.forEachInner=function(a,o,i,s){for(var l=o;l<i;l++)if(a(this.values[l],s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(a,o,i,s){for(var l=o-1;l>=i;l--)if(a(this.values[l],s+l)===!1)return!1},t.prototype.leafAppend=function(a){if(this.length+a.length<=gk)return new t(this.values.concat(a.flatten()))},t.prototype.leafPrepend=function(a){if(this.length+a.length<=gk)return new t(a.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(dr);dr.empty=new bF([]);var aoe=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,a,o,i){var s=this.left.length;if(a<s&&this.left.forEachInner(r,a,Math.min(o,s),i)===!1||o>s&&this.right.forEachInner(r,Math.max(a-s,0),Math.min(this.length,o)-s,i+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,a,o,i){var s=this.left.length;if(a>s&&this.right.forEachInvertedInner(r,a-s,Math.max(o,s)-s,i+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(a,s),o,i)===!1)return!1},t.prototype.sliceInner=function(r,a){if(r==0&&a==this.length)return this;var o=this.left.length;return a<=o?this.left.slice(r,a):r>=o?this.right.slice(r-o,a-o):this.left.slice(r,o).append(this.right.slice(0,a-o))},t.prototype.leafAppend=function(r){var a=this.right.leafAppend(r);if(a)return new t(this.left,a)},t.prototype.leafPrepend=function(r){var a=this.left.leafPrepend(r);if(a)return new t(a,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(dr),L_=dr;var ooe=500,uf=class e{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let a,o;n&&(a=this.remapping(r,this.items.length),o=a.maps.length);let i=t.tr,s,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){a||(a=this.remapping(r,d+1),o=a.maps.length),o--,c.push(f);return}if(a){c.push(new Ni(f.map));let p=f.step.map(a.slice(o)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],u.push(new Ni(h,void 0,void 0,u.length+c.length))),o--,h&&a.appendMap(h,o)}else i.maybeStep(f.step);if(f.selection)return s=a?f.selection.map(a.slice(o)):f.selection,l=new e(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:s}}addTransform(t,n,r,a){let o=[],i=this.eventCount,s=this.items,l=!a&&s.length?s.get(s.length-1):null;for(let c=0;c<t.steps.length;c++){let f=t.steps[c].invert(t.docs[c]),d=new Ni(t.mapping.maps[c],f,n),p;(p=l&&l.merge(d))&&(d=p,c?o.pop():s=s.slice(0,s.length-1)),o.push(d),n&&(i++,n=void 0),a||(l=d)}let u=i-r.depth;return u>soe&&(s=ioe(s,u),i-=u),new e(s.append(o),i)}remapping(t,n){let r=new ox;return this.items.forEach((a,o)=>{let i=a.mirrorOffset!=null&&o-a.mirrorOffset>=t?r.maps.length-a.mirrorOffset:void 0;r.appendMap(a.map,i)},t,n),r}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(n=>new Ni(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],a=this.items.length-n,o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach(d=>{d.selection&&s--},a);let l=n;this.items.forEach(d=>{let p=o.getMirror(--l);if(p==null)return;i=Math.min(i,p);let h=o.maps[p];if(d.step){let g=t.steps[p].invert(t.docs[p]),x=d.selection&&d.selection.map(o.slice(l+1,p));x&&s++,r.push(new Ni(h,g,x))}else r.push(new Ni(h))},a);let u=[];for(let d=n;d<i;d++)u.push(new Ni(o.maps[d]));let c=this.items.slice(0,a).append(u).append(r),f=new e(c,s);return f.emptyItemCount()>ooe&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,a=[],o=0;return this.items.forEach((i,s)=>{if(s>=t)a.push(i),i.selection&&o++;else if(i.step){let l=i.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=i.selection&&i.selection.map(n.slice(r));c&&o++;let f=new Ni(u.invert(),l,c),d,p=a.length-1;(d=a.length&&a[p].merge(f))?a[p]=d:a.push(f)}}else i.map&&r--},this.items.length,0),new e(L_.from(a.reverse()),o)}};uf.empty=new uf(L_.empty,0);function ioe(e,t){let n;return e.forEach((r,a)=>{if(r.selection&&t--==0)return n=a,!1}),e.slice(n)}var Ni=class e{constructor(t,n,r,a){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=a}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Oi=class{constructor(t,n,r,a,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=a,this.prevComposition=o}},soe=20;function loe(e,t,n,r){let a=n.getMeta(lf),o;if(a)return a.historyState;n.getMeta(doe)&&(e=new Oi(e.done,e.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(i&&i.getMeta(lf))return i.getMeta(lf).redo?new Oi(e.done.addTransform(n,void 0,r,xk(t)),e.undone,yF(n.mapping.maps),e.prevTime,e.prevComposition):new Oi(e.done,e.undone.addTransform(n,void 0,r,xk(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),l=e.prevTime==0||!i&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!uoe(n,e.prevRanges)),u=i?I_(e.prevRanges,n.mapping):yF(n.mapping.maps);return new Oi(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,xk(t)),uf.empty,u,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Oi(e.done.rebased(n,o),e.undone.rebased(n,o),I_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Oi(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),I_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function uoe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,a)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&a>=t[o]&&(n=!0)}),n}function yF(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,a,o,i)=>t.push(o,i));return t}function I_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let a=t.map(e[r],1),o=t.map(e[r+1],-1);a<=o&&n.push(a,o)}return n}function coe(e,t){for(let n=0;n<t.steps.length;n++){let r=t.mapping.maps[n],a=-1;if(r.forEach((o,i)=>a=i),a<0){let o=t.steps[n];(o instanceof Ds||o instanceof Zl)&&(a=o.to)}if(a>-1)return Te.near(e.doc.resolve(a))}return e.selection}function foe(e,t,n){let r=xk(t),a=lf.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let i=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,coe(t,o.transform).getBookmark(),a,r),l=new Oi(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(i).setMeta(lf,{redo:n,historyState:l})}var A_=!1,vF=null;function xk(e){let t=e.plugins;if(vF!=t){A_=!1,vF=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){A_=!0;break}}return A_}var lf=new qe("history"),doe=new qe("closeHistory");function wF(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Be({key:lf,state:{init(){return new Oi(uf.empty,uf.empty,null,0,-1)},apply(t,n,r){return loe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,a=r=="historyUndo"?E_:r=="historyRedo"?__:null;return!a||!t.editable?!1:(n.preventDefault(),a(t.state,t.dispatch))}}}})}function bk(e,t){return(n,r)=>{let a=lf.getState(n);if(!a||(e?a.undone:a.done).eventCount==0)return!1;if(r){let o=foe(a,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}var E_=bk(!1,!0),__=bk(!0,!0),SLe=bk(!1,!1),LLe=bk(!0,!1);function hh(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e}var T_=Se("Undo",()=>()=>E_);hh(T_,{displayName:"Command<undo>"});var D_=Se("Redo",()=>()=>__);hh(D_,{displayName:"Command<redo>"});var R_=He({},"historyProviderConfig");hh(R_,{displayName:"Ctx<historyProviderConfig>"});var kF=rt(e=>wF(e.get(R_.key)));hh(kF,{displayName:"Ctx<historyProviderPlugin>"});var M_=ur("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{let t=e.get(ge);return()=>t.call(T_.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{let t=e.get(ge);return()=>t.call(D_.key)}}});hh(M_.ctx,{displayName:"KeymapCtx<history>"});hh(M_.shortcuts,{displayName:"Keymap<history>"});var CF=[R_,kF,M_,T_,D_].flat();function poe(e,t){let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof ye||r instanceof $r))return e;let{to:a}=r,o=t.type==="space"?Array(t.size).fill(" ").join(""):" ";return e.insertText(o,a)}var M1=He({type:"space",size:2},"indentConfig");M1.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var SF=hE(e=>({Tab:(t,n)=>{let r=e.get(M1.key),{tr:a}=t,o=poe(a,r);return o.docChanged?(n?.(o),!0):!1}}));SF.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var LF=[M1,SF];var hoe=typeof global=="object"&&global&&global.Object===Object&&global,IF=hoe;var moe=typeof self=="object"&&self&&self.Object===Object&&self,goe=IF||moe||Function("return this")(),yk=goe;var xoe=yk.Symbol,mh=xoe;var AF=Object.prototype,boe=AF.hasOwnProperty,yoe=AF.toString,N1=mh?mh.toStringTag:void 0;function voe(e){var t=boe.call(e,N1),n=e[N1];try{e[N1]=void 0;var r=!0}catch{}var a=yoe.call(e);return r&&(t?e[N1]=n:delete e[N1]),a}var EF=voe;var woe=Object.prototype,koe=woe.toString;function Coe(e){return koe.call(e)}var _F=Coe;var Soe="[object Null]",Loe="[object Undefined]",TF=mh?mh.toStringTag:void 0;function Ioe(e){return e==null?e===void 0?Loe:Soe:TF&&TF in Object(e)?EF(e):_F(e)}var DF=Ioe;function Aoe(e){return e!=null&&typeof e=="object"}var RF=Aoe;var Eoe="[object Symbol]";function _oe(e){return typeof e=="symbol"||RF(e)&&DF(e)==Eoe}var MF=_oe;var Toe=/\s/;function Doe(e){for(var t=e.length;t--&&Toe.test(e.charAt(t)););return t}var NF=Doe;var Roe=/^\s+/;function Moe(e){return e&&e.slice(0,NF(e)+1).replace(Roe,"")}var OF=Moe;function Noe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var cf=Noe;var PF=NaN,Ooe=/^[-+]0x[0-9a-f]+$/i,Poe=/^0b[01]+$/i,Boe=/^0o[0-7]+$/i,zoe=parseInt;function Foe(e){if(typeof e=="number")return e;if(MF(e))return PF;if(cf(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=cf(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=OF(e);var n=Poe.test(e);return n||Boe.test(e)?zoe(e.slice(2),n?2:8):Ooe.test(e)?PF:+e}var N_=Foe;var Hoe=function(){return yk.Date.now()},vk=Hoe;var Voe="Expected a function",Uoe=Math.max,qoe=Math.min;function joe(e,t,n){var r,a,o,i,s,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(Voe);t=N_(t)||0,cf(n)&&(c=!!n.leading,f="maxWait"in n,o=f?Uoe(N_(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(k){var _=r,E=a;return r=a=void 0,u=k,i=e.apply(E,_),i}function h(k){return u=k,s=setTimeout(m,t),c?p(k):i}function g(k){var _=k-l,E=k-u,M=t-_;return f?qoe(M,o-E):M}function x(k){var _=k-l,E=k-u;return l===void 0||_>=t||_<0||f&&E>=o}function m(){var k=vk();if(x(k))return y(k);s=setTimeout(m,g(k))}function y(k){return s=void 0,d&&r?p(k):(r=a=void 0,i)}function b(){s!==void 0&&clearTimeout(s),u=0,r=l=a=s=void 0}function v(){return s===void 0?i:y(vk())}function w(){var k=vk(),_=x(k);if(r=arguments,a=this,l=k,_){if(s===void 0)return h(l);if(f)return clearTimeout(s),s=setTimeout(m,t),p(l)}return s===void 0&&(s=setTimeout(m,t)),i}return w.cancel=b,w.flush=v,w}var Ys=joe;var $oe="Expected a function";function Goe(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError($oe);return cf(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),Ys(e,t,{leading:r,maxWait:t,trailing:a})}var mu=Goe;var BF=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},O1=Ie(new BF,"listener"),Woe=new qe("MILKDOWN_LISTENER"),O_=e=>(e.inject(O1,new BF),async()=>{await e.wait(Fs);let{listeners:t}=e.get(O1);t.beforeMount.forEach(u=>u(e)),await e.wait(zp);let n=e.get(Mo),r=null,a=null,o=null,i=null,s=Ys(()=>{if(!i)return;let{doc:u}=i;if(t.updated.length>0&&r&&!r.eq(u)&&t.updated.forEach(c=>{c(e,u,r)}),t.markdownUpdated.length>0&&r&&!r.eq(u)){let c=n(u);t.markdownUpdated.forEach(f=>{f(e,c,a)}),a=c}r=u,i=null},200),l=new Be({key:Woe,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(u=>u(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(u=>u(e)),!1),blur:()=>(t.blur.forEach(u=>u(e)),!1)}},state:{init:(u,c)=>{r=c.doc,a=n(c.doc)},apply:u=>{let c=u.selection;(!o&&c||o&&!c.eq(o))&&(t.selectionUpdated.forEach(f=>{f(e,c,o)}),o=c),!(!(u.docChanged||u.storedMarksSet)||u.getMeta("addToHistory")===!1)&&(i=u,s())}}});e.update(Si,u=>u.concat(l)),await e.wait(Ox),t.mounted.forEach(u=>u(e))});O_.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};var P_=He({shouldAppend:e=>!(!e||["heading","paragraph"].includes(e.type.name)),getNode:e=>e.schema.nodes.paragraph.create()},"trailingConfig");P_.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var zF=rt(e=>{let t=new qe("MILKDOWN_TRAILING"),{shouldAppend:n,getNode:r}=e.get(P_.key),a=new Be({key:t,state:{init:(o,i)=>{let s=i.tr.doc.lastChild;return n(s,i)},apply:(o,i,s,l)=>{if(!o.docChanged)return i;let u=o.doc.lastChild;return n(u,l)}},appendTransaction:(o,i,s)=>{let{doc:l,tr:u}=s,c=r?.(s),f=a.getState(s),d=l.content.size;if(!(!f||!c))return u.insert(d,c)}});return a});zF.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};var FF=[P_,zF];function Koe(e){return new Promise(t=>{let n=new FileReader;n.addEventListener("load",()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})}var Xoe=async(e,t)=>{let n=[];for(let a=0;a<e.length;a++){let o=e.item(a);o&&o.type.includes("image")&&n.push(o)}let{image:r}=t.nodes;if(!r)throw vv("image");return(await Promise.all(n.map(a=>Koe(a)))).map(({alt:a,src:o})=>r.createAndFill({src:o,alt:a}))},ff=He({uploader:Xoe,enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{let n=document.createElement("span");return n.textContent="Upload in progress...",Ht.widget(e,n,t)}},"uploadConfig");ff.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var HF=rt(e=>{let t=new qe("MILKDOWN_UPLOAD"),n=(a,o)=>{let i=t.getState(a);if(!i)return-1;let s=i.find(void 0,void 0,l=>l.id===o);return s.length?s[0]?.from??-1:-1},r=(a,o,i)=>{if(!i||i.length<=0)return!1;let s=Symbol("upload symbol"),l=e.get(Ar),{uploader:u,getInsertPos:c}=e.get(ff.key),{tr:f}=a.state,d=o instanceof DragEvent?a.posAtCoords({left:o.clientX,top:o.clientY})?.pos??f.selection.from:f.selection.from,p=typeof c=="function"?c(o,e,d):d;return a.dispatch(f.setMeta(t,{add:{id:s,pos:p}})),u(i,l,e,p).then(h=>{let g=n(a.state,s);g<0||a.dispatch(a.state.tr.replaceWith(g,g,h).setMeta(t,{remove:{id:s}}))}).catch(h=>{console.error(h)}),!0};return new Be({key:t,state:{init(){return Ct.empty},apply(a,o){let i=o.map(a.mapping,a.doc),s=a.getMeta(this);if(!s)return i;if(s.add){let{uploadWidgetFactory:l}=e.get(ff.key),u=l(s.add.pos,{id:s.add.id});return i.add(a.doc,[u])}if(s.remove){let l=i.find(void 0,void 0,u=>u.id===s.remove.id);return i.remove(l)}return i}},props:{decorations(a){return this.getState(a)},handlePaste:(a,o)=>{let{enableHtmlFileUploader:i}=e.get(ff.key);return!(o instanceof ClipboardEvent)||!i&&o.clipboardData?.getData("text/html")?!1:r(a,o,o.clipboardData?.files)},handleDrop:(a,o)=>o instanceof DragEvent?r(a,o,o.dataTransfer?.files):!1}})});HF.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var VF=[ff,HF];function gh(e,t){return e instanceof io?t==e:e.indexOf(t)>-1}function UF(e,t){return function(n,r){let{$from:a,$to:o,node:i}=n.selection;if(i&&i.isBlock||a.depth<2||!a.sameParent(o))return!1;let s=a.node(-1);if(!gh(e,s.type))return!1;if(a.parent.content.size==0&&a.node(-1).childCount==a.indexAfter(-1)){if(a.depth==3||!gh(e,a.node(-3).type)||a.index(-2)!=a.node(-2).childCount-1)return!1;if(r){let f=re.empty,d=a.index(-1)?1:a.index(-2)?2:3;for(let m=a.depth-d;m>=a.depth-3;m--)f=re.from(a.node(m).copy(f));let p=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3;f=f.append(re.from(a.node(-3).type.createAndFill()));let h=a.before(a.depth-(d-1)),g=n.tr.replace(h,a.after(-p),new ue(f,4-d,0)),x=-1;g.doc.nodesBetween(h,g.doc.content.size,(m,y)=>{if(x>-1)return!1;m.isTextblock&&m.content.size==0&&(x=y+1)}),x>-1&&g.setSelection(Te.near(g.doc.resolve(x))),r(g.scrollIntoView())}return!0}let l=o.pos==a.end()?s.contentMatchAt(0).defaultType:null,u=n.tr.delete(a.pos,o.pos),c=l||t?[t?{type:s.type,attrs:t}:null,l?{type:l}:null]:void 0;return Dc(u.doc,a.pos,2,c)?(r&&r(u.split(a.pos,2,c).scrollIntoView()),!0):!1}}function qF(e){return function(t,n){let{$from:r,$to:a}=t.selection,o=r.blockRange(a,i=>i.childCount>0&&gh(e,i.firstChild.type));return o?n?gh(e,r.node(o.depth-1).type)?Yoe(t,n,o):Zoe(t,n,o):!0:!1}}function Yoe(e,t,n){let r=e.tr,a=n.end,o=n.$to.end(n.depth),i=n.parent.child(n.endIndex-1).type;a<o&&(r.step(new sr(a-1,o,a,o,new ue(re.from(i.create(null,n.parent.copy())),1,0),1,!0)),n=new Qg(r.doc.resolve(n.$from.pos),r.doc.resolve(o),n.depth));let s=pp(n);if(s==null)return!1;r.lift(n,s);let l=r.doc.resolve(r.mapping.map(a,-1)-1);return Rc(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),t(r.scrollIntoView()),!0}function Zoe(e,t,n){let r=e.tr,a=n.parent;for(let p=n.end,h=n.endIndex-1,g=n.startIndex;h>g;h--)p-=a.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),i=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,l=n.endIndex==a.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(s?0:1),c+1,i.content.append(l?re.empty:re.from(a))))return!1;let f=o.pos,d=f+i.nodeSize;return r.step(new sr(f-(s?1:0),d+(l?1:0),f+1,d-1,new ue((s?re.empty:re.from(a.copy(re.empty))).append(l?re.empty:re.from(a.copy(re.empty))),s?0:1,l?0:1),s?0:1)),t(r.scrollIntoView()),!0}function jF(e){return function(t,n){let{$from:r,$to:a}=t.selection,o=r.blockRange(a,u=>u.childCount>0&&gh(e,u.firstChild.type));if(!o)return!1;let i=o.startIndex;if(i==0)return!1;let s=o.parent,l=s.child(i-1);if(!gh(e,l.type))return!1;if(n){let u=l.lastChild&&l.lastChild.type==s.type,c=re.from(u?l.lastChild.lastChild.type.create():null),f=new ue(re.from(l.type.create(null,re.from(s.type.create(null,c)))),u?3:1,0),d=o.start,p=o.end;n(t.tr.step(new sr(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function B_(e){let t=new Map;if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return jr(e,"definition",function(r){let a=$F(r.identifier);a&&!t.get(a)&&t.set(a,r)}),n;function n(r){let a=$F(r);return t.get(a)}}function $F(e){return String(e||"").toUpperCase()}function wk(){return function(e){let t=B_(e);jr(e,function(n,r,a){if(n.type==="definition"&&a!==void 0&&typeof r=="number")return a.children.splice(r,1),[oo,r];if(n.type==="imageReference"||n.type==="linkReference"){let o=t(n.identifier);if(o&&a&&typeof r=="number")return a.children[r]=n.type==="imageReference"?{type:"image",url:o.url,title:o.title,alt:n.alt}:{type:"link",url:o.url,title:o.title,children:n.children},[oo,r]}})}}function Joe(e){let t={...e};return t.position&&(t.position={start:{...t.position.start},end:{...t.position.end}}),delete t.children,t}var Qoe="<br />",eie=/^<br\s*\/?\s*>$/i,tie=e=>typeof e=="string"&&eie.test(e.trim());function WF(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name==="hardbreak")){e.next(t.content);return}let n=[];t.content.forEach((r,a,o)=>{o!==t.childCount-1&&n.push(r)}),e.next(re.fromArray(n))}function J(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}var z_=tf("emphasis");J(z_,{displayName:"Attr<emphasis>",group:"Emphasis"});var xu=lu("emphasis",e=>({attrs:{marker:{default:e.get(Mp).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:t=>t==="italic"}],toDOM:t=>["em",e.get(z_.key)(t)],parseMarkdown:{match:t=>t.type==="emphasis",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="emphasis",runner:(t,n)=>{t.withMark(n,"emphasis",void 0,{marker:n.attrs.marker})}}}));J(xu.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});J(xu.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var P1=Se("ToggleEmphasis",e=>()=>xp(xu.type(e)));J(P1,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var KF=Er(e=>Pc(/(?:^|[^*])\*([^*]+)\*$/,xu.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("*")?{}:{fullMatch:t.slice(1),start:n+1}}));J(KF,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var XF=Er(e=>Pc(/\b_(?![_\s])(.*?[^_\s])_$/,xu.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("_")?{}:{fullMatch:t.slice(1),start:n+1}}));J(XF,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var B1=ur("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{let t=e.get(ge);return()=>t.call(P1.key)}}});J(B1.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});J(B1.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var F_=tf("strong");J(F_,{displayName:"Attr<strong>",group:"Strong"});var df=lu("strong",e=>({attrs:{marker:{default:e.get(Mp).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:t=>t==="bold"},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:t=>["strong",e.get(F_.key)(t)],parseMarkdown:{match:t=>t.type==="strong",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="strong",runner:(t,n)=>{t.withMark(n,"strong",void 0,{marker:n.attrs.marker})}}}));J(df.mark,{displayName:"MarkSchema<strong>",group:"Strong"});J(df.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var z1=Se("ToggleStrong",e=>()=>xp(df.type(e)));J(z1,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var YF=Er(e=>Pc(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,df.type(e),{getAttr:t=>({marker:t[0].startsWith("*")?"*":"_"})}));J(YF,{displayName:"InputRule<strong>",group:"Strong"});var F1=ur("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{let t=e.get(ge);return()=>t.call(z1.key)}}});J(F1.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});J(F1.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var H_=tf("inlineCode");J(H_,{displayName:"Attr<inlineCode>",group:"InlineCode"});var Pi=lu("inlineCode",e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(H_.key)(t)],parseMarkdown:{match:t=>t.type==="inlineCode",runner:(t,n,r)=>{t.openMark(r),t.addText(n.value),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="inlineCode",runner:(t,n,r)=>(t.withMark(n,"inlineCode",r.text||""),!0)}}));J(Pi.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});J(Pi.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var H1=Se("ToggleInlineCode",e=>()=>(t,n)=>{let{selection:r,tr:a}=t;if(r.empty)return!1;let{from:o,to:i}=r;return t.doc.rangeHasMark(o,i,Pi.type(e))?(n?.(a.removeMark(o,i,Pi.type(e))),!0):(Object.keys(t.schema.marks).filter(s=>s!==Pi.type.name).map(s=>t.schema.marks[s]).forEach(s=>{a.removeMark(o,i,s)}),n?.(a.addMark(o,i,Pi.type(e).create())),!0)});J(H1,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var ZF=Er(e=>Pc(/(?:`)([^`]+)(?:`)$/,Pi.type(e)));J(ZF,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var V1=ur("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{let t=e.get(ge);return()=>t.call(H1.key)}}});J(V1.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});J(V1.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var nie=new Set(["http:","https:","mailto:","tel:","ftp:"]);function rie(e){return e<=32||e>=127&&e<=160||e>=8203&&e<=8205||e===8232||e===8233||e===65279}function aie(e){let t="";for(let n of e)rie(n.codePointAt(0)??0)||(t+=n);return t}function Sk(e){if(typeof e!="string")return"";let t=e.trim();if(!t)return"";let n=aie(t),r=/^([a-z][a-z0-9+.-]*):/i.exec(n)?.[1];return!r||nie.has(`${r.toLowerCase()}:`)?t:""}var V_=tf("link");J(V_,{displayName:"Attr<link>",group:"Link"});var Va=lu("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(V_.key)(t),...t.attrs,href:Sk(t.attrs.href)}],parseMarkdown:{match:t=>t.type==="link",runner:(t,n,r)=>{let a=n.url,o=n.title;t.openMark(r,{href:a,title:o}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="link",runner:(t,n)=>{t.withMark(n,"link",void 0,{title:n.attrs.title,url:n.attrs.href})}}}));J(Va.mark,{displayName:"MarkSchema<link>",group:"Link"});var JF=Se("ToggleLink",e=>(t={})=>xp(Va.type(e),t));J(JF,{displayName:"Command<toggleLinkCommand>",group:"Link"});var QF=Se("UpdateLink",e=>(t={})=>(n,r)=>{if(!r)return!1;let a,o=-1,{selection:i}=n,{from:s,to:l}=i;if(n.doc.nodesBetween(s,s===l?l+1:l,(h,g)=>{if(Va.type(e).isInSet(h.marks))return a=h,o=g,!1}),!a)return!1;let u=a.marks.find(({type:h})=>h===Va.type(e));if(!u)return!1;let c=o,f=o+a.nodeSize,{tr:d}=n,p=Va.type(e).create({...u.attrs,...t});return p?(r(d.removeMark(c,f,u).addMark(c,f,p).setSelection(new ye(d.selection.$anchor)).scrollIntoView()),!0):!1});J(QF,{displayName:"Command<updateLinkCommand>",group:"Link"});var eH=zw("doc",()=>({content:"block+",parseMarkdown:{match:({type:e})=>e==="root",runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name==="doc",runner:(e,t)=>{e.openNode("root");let n=t.childCount>0?t.child(t.childCount-1):null,r=n?.type.name==="paragraph"&&n.content.size===0?t.content.cut(0,t.content.size-n.nodeSize):t.content;e.next(r)}}}));J(eH,{displayName:"NodeSchema<doc>",group:"Doc"});var tH=Object.freeze(["root","blockquote","listItem","footnoteDefinition"]),oie=new Set(["paragraph","heading","tableCell","link","linkReference","emphasis","strong","delete","footnote"]),kk=He(tH,"blockContainerTypes");J(kk,{displayName:"Ctx<blockContainerTypes>",group:"Remark"});var GF=new Set;function nH(e){let t=e.isInjected(kk.key)?e.get(kk.key):tH,n=new Set;for(let r of t){if(oie.has(r)){GF.has(r)||(GF.add(r),console.warn(`[milkdown/preset-commonmark] "${r}" holds phrasing content and cannot be a block container; it is ignored in blockContainerTypes.`));continue}n.add(r)}return n}var iie=new Set(["paragraph","tableCell"]);function sie(e,t){return Kl(e,n=>n.type==="html"&&tie(n.value),(n,r)=>{let a=r[r.length-1];if(a){if(iie.has(a.type)){a.children.length===1&&(a.children=[]);return}if(t.has(a.type)){let o=n;return o.children=[],delete o.value,o.type="paragraph",oo}}})}var Lk=No("remark-preserve-empty-line",e=>()=>t=>sie(t,nH(e)));J(Lk.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});J(Lk.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var U_=uo("paragraph");J(U_,{displayName:"Attr<paragraph>",group:"Paragraph"});var ba=pn("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(U_.key)(t),0],parseMarkdown:{match:t=>t.type==="paragraph",runner:(t,n,r)=>{t.openNode(r),n.children?t.next(n.children):t.addText(n.value||""),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="paragraph",runner:(t,n)=>{t.openNode("paragraph"),(!n.content||n.content.size===0)&&lie(e)?t.addNode("html",void 0,Qoe):WF(t,n),t.closeNode()}}}));function lie(e){return e.isInjected(Lk.options.key)}J(ba.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});J(ba.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var q_=Se("TurnIntoText",e=>()=>gp(ba.type(e)));J(q_,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var j_=ur("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{let t=e.get(ge);return()=>t.call(q_.key)}}});J(j_.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});J(j_.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var uie=Array(6).fill(0).map((e,t)=>t+1);function cie(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")}var Ik=He(cie,"headingIdGenerator");J(Ik,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var $_=uo("heading");J($_,{displayName:"Attr<heading>",group:"Heading"});var ya=pn("heading",e=>{let t=e.get(Ik.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:uie.map(n=>({tag:`h${n}`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw Vr(r);return{level:n,id:r.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get($_.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:n})=>n==="heading",runner:(n,r,a)=>{let o=r.depth;n.openNode(a,{level:o}),n.next(r.children),n.closeNode()}},toMarkdown:{match:n=>n.type.name==="heading",runner:(n,r)=>{n.openNode("heading",void 0,{depth:r.attrs.level}),WF(n,r),n.closeNode()}}}});J(ya.node,{displayName:"NodeSchema<heading>",group:"Heading"});J(ya.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var rH=Er(e=>AA(/^(?<hashes>#+)\s$/,ya.type(e),t=>{let n=t.groups?.hashes?.length||0,{$from:r}=e.get(it).state.selection,a=r.node();if(a.type.name==="heading"){let o=Number(a.attrs.level)+Number(n);return o>6&&(o=6),{level:o}}return{level:n}}));J(rH,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var gu=Se("WrapInHeading",e=>t=>(t??(t=1),t<1?gp(ba.type(e)):gp(ya.type(e),{level:t})));J(gu,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var G_=Se("DowngradeHeading",e=>()=>(t,n,r)=>{let{$from:a}=t.selection,o=a.node();if(o.type!==ya.type(e)||!t.selection.empty||a.parentOffset!==0)return!1;let i=o.attrs.level-1;return i?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...o.attrs,level:i})),!0):gp(ba.type(e))(t,n,r)});J(G_,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var W_=ur("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{let t=e.get(ge);return()=>t.call(gu.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{let t=e.get(ge);return()=>t.call(G_.key)}}});J(W_.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});J(W_.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var K_=uo("blockquote");J(K_,{displayName:"Attr<blockquote>",group:"Blockquote"});var pf=pn("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(K_.key)(t),0],parseMarkdown:{match:({type:t})=>t==="blockquote",runner:(t,n,r)=>{t.openNode(r).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="blockquote",runner:(t,n)=>{t.openNode("blockquote").next(n.content).closeNode()}}}));J(pf.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});J(pf.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var aH=Er(e=>cw(/^\s*>\s$/,pf.type(e)));J(aH,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var X_=Se("WrapInBlockquote",e=>()=>uw(pf.type(e)));J(X_,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var Y_=ur("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{let t=e.get(ge);return()=>t.call(X_.key)}}});J(Y_.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});J(Y_.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var Z_=uo("codeBlock",()=>({pre:{},code:{}}));J(Z_,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var bu=pn("code_block",e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{language:t.dataset.language}}}],toDOM:t=>{let n=e.get(Z_.key)(t),r=t.attrs.language,a=r&&r.length>0?{"data-language":r}:void 0;return["pre",{...n.pre,...a},["code",n.code,0]]},parseMarkdown:{match:({type:t})=>t==="code",runner:(t,n,r)=>{let a=n.lang??"",o=n.value;t.openNode(r,{language:a}),o&&t.addText(o),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="code_block",runner:(t,n)=>{t.addNode("code",void 0,n.content.firstChild?.text||"",{lang:n.attrs.language})}}}));J(bu.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});J(bu.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var oH=Er(e=>AA(/^```(?<language>[a-z]*)?[\s\n]$/,bu.type(e),t=>({language:t.groups?.language??""})));J(oH,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var J_=Se("CreateCodeBlock",e=>(t="")=>gp(bu.type(e),{language:t}));J(J_,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var fie=Se("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0?(r?.(n.tr.setNodeAttribute(e,"language",t)),!0):!1);J(fie,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Q_=ur("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{let t=e.get(ge);return()=>t.call(J_.key)}}});J(Q_.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});J(Q_.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var eT=uo("image");J(eT,{displayName:"Attr<image>",group:"Image"});var xh=pn("image",e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",title:t.getAttribute("title")||t.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(eT.key)(t),...t.attrs}],parseMarkdown:{match:({type:t})=>t==="image",runner:(t,n,r)=>{let a=n.url,o=n.alt??"",i=n.title??"";t.addNode(r,{src:a,alt:o,title:i})}},toMarkdown:{match:t=>t.type.name==="image",runner:(t,n)=>{t.addNode("image",void 0,void 0,{title:n.attrs.title,url:n.attrs.src,alt:n.attrs.alt})}}}));J(xh.node,{displayName:"NodeSchema<image>",group:"Image"});J(xh.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var iH=Se("InsertImage",e=>(t={})=>(n,r)=>{if(!r)return!0;let{src:a="",alt:o="",title:i=""}=t,s=xh.type(e).create({src:a,alt:o,title:i});return s&&r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0});J(iH,{displayName:"Command<insertImageCommand>",group:"Image"});var sH=Se("UpdateImage",e=>(t={})=>(n,r)=>{let a=h9(n.selection,xh.type(e));if(!a)return!1;let{node:o,pos:i}=a,s={...o.attrs},{src:l,alt:u,title:c}=t;return l!==void 0&&(s.src=l),u!==void 0&&(s.alt=u),c!==void 0&&(s.title=c),r?.(n.tr.setNodeMarkup(i,void 0,s).scrollIntoView()),!0});J(sH,{displayName:"Command<updateImageCommand>",group:"Image"});var die=Er(e=>new Kn(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,a)=>{let[o,i,s="",l]=n;return o?t.tr.replaceWith(r,a,xh.type(e).create({src:s,alt:i,title:l})):null}));J(die,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var Ck=uo("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));J(Ck,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var U1=pn("hardbreak",e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?["span",e.get(Ck.key)(t)," "]:["br",e.get(Ck.key)(t)],parseMarkdown:{match:({type:t})=>t==="break",runner:(t,n,r)=>{t.addNode(r,{isInline:!!n.data?.isInline})}},leafText:()=>`
|
|
62
|
+
`,toMarkdown:{match:t=>t.type.name==="hardbreak",runner:(t,n)=>{n.attrs.isInline?t.addNode("text",void 0,`
|
|
63
|
+
`):t.addNode("break")}}}));J(U1.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});J(U1.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var tT=Se("InsertHardbreak",e=>()=>(t,n)=>{let{selection:r,tr:a}=t;if(!(r instanceof ye))return!1;if(r.empty){let o=r.$from.node();if(o.childCount>0&&o.lastChild?.type.name==="hardbreak")return n?.(a.replaceRangeWith(r.to-1,r.to,t.schema.node("paragraph")).setSelection(Te.near(a.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(a.setMeta("hardbreak",!0).replaceSelectionWith(U1.type(e).create(),!1).scrollIntoView()),!0});J(tT,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var nT=ur("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{let t=e.get(ge);return()=>t.call(tT.key)}}});J(nT.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});J(nT.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var rT=uo("hr");J(rT,{displayName:"Attr<hr>",group:"Hr"});var hf=pn("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(rT.key)(t)],parseMarkdown:{match:({type:t})=>t==="thematicBreak",runner:(t,n,r)=>{t.addNode(r)}},toMarkdown:{match:t=>t.type.name==="hr",runner:t=>{t.addNode("thematicBreak")}}}));J(hf.node,{displayName:"NodeSchema<hr>",group:"Hr"});J(hf.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var lH=Er(e=>new Kn(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,a)=>{let{tr:o}=t;return n[0]&&o.replaceWith(r-1,a,hf.type(e).create()),o}));J(lH,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var uH=Se("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;let r=ba.node.type(e).create(),{tr:a,selection:o}=t,{from:i}=o,s=hf.type(e).create();if(!s)return!0;let l=a.replaceSelectionWith(s).insert(i,r),u=Te.findFrom(l.doc.resolve(i),1,!0);return u&&n(l.setSelection(u).scrollIntoView()),!0});J(uH,{displayName:"Command<insertHrCommand>",group:"Hr"});var aT=uo("bulletList");J(aT,{displayName:"Attr<bulletList>",group:"BulletList"});var yu=pn("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{spread:t.dataset.spread==="true"}}}],toDOM:t=>["ul",{...e.get(aT.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!n,runner:(t,n,r)=>{let a=n.spread??!1;t.openNode(r,{spread:a}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="bullet_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!1,spread:n.attrs.spread}).next(n.content).closeNode()}}}));J(yu.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});J(yu.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var cH=Er(e=>cw(/^\s*([-+*])\s$/,yu.type(e)));J(cH,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var oT=Se("WrapInBulletList",e=>()=>uw(yu.type(e)));J(oT,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var iT=ur("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{let t=e.get(ge);return()=>t.call(oT.key)}}});J(iT.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});J(iT.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var sT=uo("orderedList");J(sT,{displayName:"Attr<orderedList>",group:"OrderedList"});var vu=pn("ordered_list",e=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{spread:t.dataset.spread==="true",order:t.hasAttribute("start")?Number(t.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(sT.key)(t),...t.attrs.order===1?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!!n,runner:(t,n,r)=>{let a=n.spread??!0;t.openNode(r,{spread:a,order:n.start??1}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="ordered_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!0,start:n.attrs.order??1,spread:n.attrs.spread}),t.next(n.content),t.closeNode()}}}));J(vu.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});J(vu.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var fH=Er(e=>cw(/^\s*(\d+)\.\s$/,vu.type(e),t=>({order:Number(t[1])}),(t,n)=>n.childCount+n.attrs.order===Number(t[1])));J(fH,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var lT=Se("WrapInOrderedList",e=>()=>uw(vu.type(e)));J(lT,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var uT=ur("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{let t=e.get(ge);return()=>t.call(lT.key)}}});J(uT.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});J(uT.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var cT=uo("listItem");J(cT,{displayName:"Attr<listItem>",group:"ListItem"});var va=pn("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"\u2022",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:t=>{if(!(t instanceof HTMLElement))throw Vr(t);return{label:t.dataset.label,listType:t.dataset.listType,spread:t.dataset.spread==="true"}}}],toDOM:t=>["li",{...e.get(cT.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t})=>t==="listItem",runner:(t,n,r)=>{let a=n.label!=null?`${n.label}.`:"\u2022",o=n.label!=null?"ordered":"bullet",i=n.spread??!0;t.openNode(r,{label:a,listType:o,spread:i}),t.next(n.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="list_item",runner:(t,n)=>{t.openNode("listItem",void 0,{spread:n.attrs.spread}),t.next(n.content),t.closeNode()}}}));J(va.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});J(va.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var fT=Se("SinkListItem",e=>()=>jF(va.type(e)));J(fT,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var dT=Se("LiftListItem",e=>()=>qF(va.type(e)));J(dT,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var pT=Se("SplitListItem",e=>()=>(t,n,r)=>UF(va.type(e))(t,n&&(a=>{let{$from:o}=t.selection;if(o.parent.content.size===0&&o.node(-1).childCount===o.indexAfter(-1)){let{$from:i}=a.selection;a.setNodeMarkup(i.before(-1),void 0,o.node(-3).attrs)}n(a)}),r));J(pT,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function pie(e){return(t,n,r)=>{let{selection:a}=t;if(!(a instanceof ye))return!1;let{empty:o,$from:i}=a;return!o||i.parentOffset!==0||i.node(-1).type!==va.type(e)?!1:CA(t,n,r)}}var hT=Se("LiftFirstListItem",e=>()=>pie(e));J(hT,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var mT=ur("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{let t=e.get(ge);return()=>t.call(pT.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{let t=e.get(ge);return()=>t.call(fT.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{let t=e.get(ge);return()=>t.call(dT.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{let t=e.get(ge);return()=>t.call(hT.key)}}});J(mT.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});J(mT.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var dH=zw("text",()=>({group:"inline",parseMarkdown:{match:({type:e})=>e==="text",runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name==="text",runner:(e,t)=>{e.addNode("text",void 0,t.text)}}}));J(dH,{displayName:"NodeSchema<text>",group:"Text"});var gT=uo("html");J(gT,{displayName:"Attr<html>",group:"Html"});var xT=pn("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{let n=document.createElement("span"),r={...e.get(gT.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:t=>({value:t.dataset.value??""})}],parseMarkdown:{match:({type:t})=>t==="html",runner:(t,n,r)=>{t.addNode(r,{value:n.value})}},toMarkdown:{match:t=>t.type.name==="html",runner:(t,n)=>{t.addNode("html",void 0,n.attrs.value)}}}));J(xT.node,{displayName:"NodeSchema<html>",group:"Html"});J(xT.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var hie=[eH,U_,ba,Ik,$_,ya,Ck,U1,K_,pf,Z_,bu,rT,hf,eT,xh,aT,yu,sT,vu,cT,va,z_,xu,F_,df,H_,Pi,V_,Va,gT,xT,dH].flat(),mie=[aH,cH,fH,oH,lH,rH].flat(),gie=[KF,XF,ZF,YF],mf=Se("IsMarkSelected",()=>e=>t=>{if(!e)return!1;let{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),bT=Se("IsNoteSelected",()=>e=>t=>e?m9(t,e).hasNode:!1),Zn=Se("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr,{$from:r,$to:a}=n.selection,{pos:o}=r,{pos:i}=a,s=o-r.node().content.size;return s<0?!1:(n=n.deleteRange(s,i),t?.(n),!0)}),Bi=Se("SetBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:a=null}=e??{};if(!r)return!1;let o=t.tr,{from:i,to:s}=o.selection;try{o.setBlockType(i,s,r,a)}catch{return!1}return n?.(o),!0}),bh=Se("WrapInBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:a=null}=e??{};if(!r)return!1;let o=t.tr;try{let{$from:i,$to:s}=o.selection,l=i.blockRange(s),u=l&&Tc(l,r,a);if(!u)return!1;o=o.wrap(l,u)}catch{return!1}return n?.(o),!0}),yh=Se("AddBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:a=null}=e??{};if(!r)return!1;let o=t.tr;try{let i=r instanceof da?r:r.createAndFill(a);if(!i)return!1;o.replaceSelectionWith(i)}catch{return!1}return n?.(o),!0}),yT=Se("SelectTextNearPos",()=>e=>(t,n)=>{let{pos:r}=e??{};if(r==null)return!1;let a=(i,s,l)=>Math.min(Math.max(i,s),l),o=t.tr;try{let i=t.doc.resolve(a(r,0,t.doc.content.size));o.setSelection(ye.near(i))}catch{return!1}return n?.(o.scrollIntoView()),!0}),xie=[q_,X_,gu,G_,J_,tT,uH,iH,sH,lT,oT,fT,pT,dT,hT,P1,H1,z1,JF,QF,mf,bT,Zn,Bi,bh,yh,yT],bie=[Y_,Q_,nT,W_,mT,uT,iT,j_,B1,V1,F1].flat(),vT=No("remarkAddOrderInList",()=>()=>e=>{jr(e,"list",t=>{if(t.ordered){let n=t.start??1;t.children.forEach((r,a)=>{r.label=a+n})}})});J(vT.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});J(vT.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var wT=No("remarkLineBreak",()=>()=>e=>{let t=/(?<![\t ])[\t ]*(?:\r?\n|\r)/g;jr(e,"text",(n,r,a)=>{if(!n.value||typeof n.value!="string")return;let o=[],i=0;t.lastIndex=0;let s=t.exec(n.value);for(;s;){let l=s.index;i!==l&&o.push({type:"text",value:n.value.slice(i,l)}),o.push({type:"break",data:{isInline:!0}}),i=l+s[0].length,s=t.exec(n.value)}if(o.length>0&&a&&typeof r=="number")return i<n.value.length&&o.push({type:"text",value:n.value.slice(i)}),a.children.splice(r,1,...o),r+o.length})});J(wT.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});J(wT.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var kT=No("remarkInlineLink",()=>wk);J(kT.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});J(kT.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var yie=e=>!!e.children,vie=e=>e.type==="html";function wie(e,t){return n(e,0,null)[0];function n(r,a,o){if(yie(r)){let i=[];for(let s=0,l=r.children.length;s<l;s++){let u=r.children[s];if(u){let c=n(u,s,r);if(c)for(let f=0,d=c.length;f<d;f++){let p=c[f];p&&i.push(p)}}}r.children=i}return t(r,a,o)}}var CT=No("remarkHTMLTransformer",e=>()=>t=>{let n=nH(e);wie(t,(r,a,o)=>vie(r)?(o&&n.has(o.type)&&(r.children=[Joe(r)],delete r.value,r.type="paragraph"),[r]):[r])});J(CT.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});J(CT.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var ST=No("remarkMarker",()=>()=>(e,t)=>{let n=r=>t.value.charAt(r.position.start.offset);jr(e,r=>["strong","emphasis"].includes(r.type),r=>{r.marker=n(r)})});J(ST.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});J(ST.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var pH=rt(()=>{let e=!1,t=new qe("MILKDOWN_INLINE_NODES_CURSOR"),n=new Be({key:t,state:{init(){return!1},apply(r){if(!r.selection.empty)return!1;let a=r.selection.$from,o=a.nodeBefore,i=a.nodeAfter;return!!(o&&i&&o.isInline&&!o.isText&&i.isInline&&!i.isText)}},props:{handleDOMEvents:{compositionend:(r,a)=>e?(e=!1,requestAnimationFrame(()=>{if(n.getState(r.state)){let o=r.state.selection.from;a.preventDefault(),r.dispatch(r.state.tr.insertText(a.data||"",o))}}),!0):!1,compositionstart:r=>(n.getState(r.state)&&(e=!0),!1),beforeinput:(r,a)=>{if(n.getState(r.state)&&a instanceof InputEvent&&a.data&&!e){let o=r.state.selection.from;return a.preventDefault(),r.dispatch(r.state.tr.insertText(a.data||"",o)),!0}return!1}},decorations(r){if(n.getState(r)){let a=r.selection.$from.pos,o=document.createElement("span"),i=Ht.widget(a,o,{side:-1}),s=document.createElement("span"),l=Ht.widget(a,s);return setTimeout(()=>{o.contentEditable="true",s.contentEditable="true"}),Ct.create(r.doc,[i,l])}return Ct.empty}}});return n});J(pH,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var hH=rt(e=>new Be({key:new qe("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,r)=>{if(!t.length)return;let a=U1.type(e),o;return t.forEach((i,s)=>{i.steps.forEach((l,u)=>{if(!(l instanceof Ds))return;let c=(p,h)=>t.slice(s).reduce((g,x,m)=>(m===0?x.mapping.slice(u+1):x.mapping).map(g,h),p),f=c(l.from,-1),d=c(l.to,1);r.doc.nodesBetween(f,d,(p,h)=>{p.type!==a||p.attrs.isInline||p.marks.length&&(o??(o=r.tr),o.setNodeMarkup(h,a,p.attrs,[]))})})}),o}}));J(hH,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var LT=He(["table","code_block"],"hardbreakFilterNodes");J(LT,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var mH=rt(e=>{let t=e.get(LT.key);return new Be({key:new qe("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(n,r)=>{let a=n.getMeta("hardbreak"),[o]=n.steps;if(a&&o instanceof Rn){let i=r.doc.resolve(o.from),s=i.depth,l=!0;for(;s>0;)t.includes(i.node(s).type.name)&&(l=!1),s--;return l}return!0}})});J(mH,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var gH=rt(e=>{let t=new qe("MILKDOWN_HEADING_ID"),n=r=>{if(r.composing)return;let a=e.get(Ik.key),o=r.state.tr.setMeta("addToHistory",!1),i=!1,s={};r.state.doc.descendants((l,u)=>{if(l.type===ya.type(e)){if(l.textContent.trim().length===0)return;let c=l.attrs,f=a(l);s[f]?(s[f]+=1,f+=`-#${s[f]}`):s[f]=1,c.id!==f&&(i=!0,o.setMeta(t,!0).setNodeMarkup(u,void 0,{...c,id:f}))}}),i&&r.dispatch(o)};return new Be({key:t,view:r=>(n(r),{update:(a,o)=>{a.state.doc.eq(o.doc)||n(a)}})})});J(gH,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var xH=rt(e=>{let t=(n,r,a)=>{if(!a.selection||n.some(f=>f.getMeta("addToHistory")===!1||!f.isGeneric))return null;let o=vu.type(e),i=yu.type(e),s=va.type(e),l=(f,d,p=1)=>{let h=!1,g=`${d+p}.`;return f.label!==g&&(f.label=g,h=!0),h},u=a.tr,c=!1;return a.doc.descendants((f,d,p,h)=>{if(f.type===i){let g=f.maybeChild(0);g?.type===s&&g.attrs.listType==="ordered"&&(c=!0,u.setNodeMarkup(d,o,{spread:!0}),f.descendants((x,m,y,b)=>{if(x.type===s){let v={...x.attrs};l(v,b)&&(u=u.setNodeMarkup(m,void 0,v))}return!1}))}else if(f.type===s&&p?.type===o){let g={...f.attrs},x=!1;g.listType!=="ordered"&&(g.listType="ordered",x=!0),p?.maybeChild(0)&&(x=l(g,h,p?.attrs.order??1)),x&&(u=u.setNodeMarkup(d,void 0,g),c=!0)}}),c?u.setMeta("addToHistory",!1):null};return new Be({key:new qe("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:t})});J(xH,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var kie=[hH,LT,mH,pH,kk,vT,kT,wT,CT,ST,Lk,gH,xH].flat(),bH=[hie,mie,gie,xie,bie,kie].flat();var AT,ET;if(typeof WeakMap<"u"){let e=new WeakMap;AT=t=>e.get(t),ET=(t,n)=>(e.set(t,n),n)}else{let e=[],n=0;AT=r=>{for(let a=0;a<e.length;a+=2)if(e[a]==r)return e[a+1]},ET=(r,a)=>(n==10&&(n=0),e[n++]=r,e[n++]=a)}var It=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,a=t/this.width|0,o=r+1,i=a+1;for(let s=1;o<this.width&&this.map[t+s]==n;s++)o++;for(let s=1;i<this.height&&this.map[t+this.width*s]==n;s++)i++;return{left:r,top:a,right:o,bottom:i}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:a,top:o,bottom:i}=this.findCell(e);return t=="horiz"?(n<0?r==0:a==this.width)?null:this.map[o*this.width+(n<0?r-1:a)]:(n<0?o==0:i==this.height)?null:this.map[r+this.width*(n<0?o-1:i)]}rectBetween(e,t){let{left:n,right:r,top:a,bottom:o}=this.findCell(e),{left:i,right:s,top:l,bottom:u}=this.findCell(t);return{left:Math.min(n,i),top:Math.min(a,l),right:Math.max(r,s),bottom:Math.max(o,u)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let a=e.left;a<e.right;a++){let o=r*this.width+a,i=this.map[o];n[i]||(n[i]=!0,!(a==e.left&&a&&this.map[o-1]==i||r==e.top&&r&&this.map[o-this.width]==i)&&t.push(i))}return t}positionAt(e,t,n){for(let r=0,a=0;;r++){let o=a+n.child(r).nodeSize;if(r==e){let i=t+e*this.width,s=(e+1)*this.width;for(;i<s&&this.map[i]<a;)i++;return i==s?o-1:this.map[i]}a=o}}static get(e){return AT(e)||ET(e,Cie(e))}};function Cie(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);let t=Sie(e),n=e.childCount,r=[],a=0,o=null,i=[];for(let u=0,c=t*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){let f=e.child(u);c++;for(let h=0;;h++){for(;a<r.length&&r[a]!=0;)a++;if(h==f.childCount)break;let g=f.child(h),{colspan:x,rowspan:m,colwidth:y}=g.attrs;for(let b=0;b<m;b++){if(b+u>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:c,n:m-b});break}let v=a+b*t;for(let w=0;w<x;w++){r[v+w]==0?r[v+w]=c:(o||(o=[])).push({type:"collision",row:u,pos:c,n:x-w});let k=y&&y[w];if(k){let _=(v+w)%t*2,E=i[_];E==null||E!=k&&i[_+1]==1?(i[_]=k,i[_+1]=1):E==k&&i[_+1]++}}}a+=x,c+=g.nodeSize}let d=(u+1)*t,p=0;for(;a<d;)r[a++]==0&&p++;p&&(o||(o=[])).push({type:"missing",row:u,n:p}),c++}(t===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});let s=new It(t,n,r,o),l=!1;for(let u=0;!l&&u<i.length;u+=2)i[u]!=null&&i[u+1]<n&&(l=!0);return l&&Lie(s,i,e),s}function Sie(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let a=e.child(r),o=0;if(n)for(let i=0;i<r;i++){let s=e.child(i);for(let l=0;l<s.childCount;l++){let u=s.child(l);i+u.attrs.rowspan>r&&(o+=u.attrs.colspan)}}for(let i=0;i<a.childCount;i++){let s=a.child(i);o+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function Lie(e,t,n){e.problems||(e.problems=[]);let r={};for(let a=0;a<e.map.length;a++){let o=e.map[a];if(r[o])continue;r[o]=!0;let i=n.nodeAt(o);if(!i)throw new RangeError(`No cell with offset ${o} found`);let s=null,l=i.attrs;for(let u=0;u<l.colspan;u++){let c=t[(a+u)%e.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((s||(s=Iie(l)))[u]=c)}s&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function Iie(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function yH(e,t){if(typeof e=="string")return{};let n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(i=>Number(i)):null,a=Number(e.getAttribute("colspan")||1),o={colspan:a,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==a?r:null};for(let i in t){let s=t[i].getFromDOM,l=s&&s(e);l!=null&&(o[i]=l)}return o}function vH(e,t){let n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(let r in t){let a=t[r].setDOMAttr;a&&a(e.attrs[r],n)}return n}function Aie(e){if(e!==null){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(let t of e)if(typeof t!="number")throw new TypeError("colwidth must be null or an array of numbers")}}function RH(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:Aie}};for(let r in t)n[r]={default:t[r].default,validate:t[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>yH(r,t)}],toDOM(r){return["td",vH(r,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>yH(r,t)}],toDOM(r){return["th",vH(r,t),0]}}}}function ho(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],a=r.spec.tableRole;a&&(t[a]=r)}}return t}var wu=new qe("selectingCells");function kh(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function qa(e){let t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Rk(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;let n=kh(t.$head)||Eie(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Eie(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function _T(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function _ie(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function RT(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function MH(e,t,n){let r=e.node(-1),a=It.get(r),o=e.start(-1),i=a.nextCell(e.pos-o,t,n);return i==null?null:e.node(0).resolve(o+i)}function gf(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(a=>a>0)||(r.colwidth=null)),r}function Tie(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let a=0;a<n;a++)r.colwidth.splice(t,0,0)}return r}function Die(e,t,n){let r=ho(t.type.schema).header_cell;for(let a=0;a<e.height;a++)if(t.nodeAt(e.map[n+a*e.width]).type!=r)return!1;return!0}var Bt=class Zs extends Te{constructor(t,n=t){let r=t.node(-1),a=It.get(r),o=t.start(-1),i=a.rectBetween(t.pos-o,n.pos-o),s=t.node(0),l=a.cellsInRect(i).filter(c=>c!=n.pos-o);l.unshift(n.pos-o);let u=l.map(c=>{let f=r.nodeAt(c);if(!f)throw new RangeError(`No cell with offset ${c} found`);let d=o+c+1;return new Jl(s.resolve(d),s.resolve(d+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),a=t.resolve(n.map(this.$headCell.pos));if(_T(r)&&_T(a)&&RT(r,a)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Zs.rowSelection(r,a):o&&this.isColSelection()?Zs.colSelection(r,a):new Zs(r,a)}return ye.between(r,a)}content(){let t=this.$anchorCell.node(-1),n=It.get(t),r=this.$anchorCell.start(-1),a=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},i=[];for(let l=a.top;l<a.bottom;l++){let u=[];for(let c=l*n.width+a.left,f=a.left;f<a.right;f++,c++){let d=n.map[c];if(o[d])continue;o[d]=!0;let p=n.findCell(d),h=t.nodeAt(d);if(!h)throw new RangeError(`No cell with offset ${d} found`);let g=a.left-p.left,x=p.right-a.right;if(g>0||x>0){let m=h.attrs;if(g>0&&(m=gf(m,0,g)),x>0&&(m=gf(m,m.colspan-x,x)),p.left<a.left){if(h=h.type.createAndFill(m),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(m)}`)}else h=h.type.create(m,h.content)}if(p.top<a.top||p.bottom>a.bottom){let m={...h.attrs,rowspan:Math.min(p.bottom,a.bottom)-Math.max(p.top,a.top)};p.top<a.top?h=h.type.createAndFill(m):h=h.type.create(m,h.content)}u.push(h)}i.push(t.child(l).copy(re.from(u)))}let s=this.isColSelection()&&this.isRowSelection()?t:i;return new ue(re.from(s),1,1)}replace(t,n=ue.empty){let r=t.steps.length,a=this.ranges;for(let i=0;i<a.length;i++){let{$from:s,$to:l}=a[i],u=t.mapping.slice(r);t.replace(u.map(s.pos),u.map(l.pos),i?ue.empty:n)}let o=Te.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new ue(re.from(n),0,0))}forEachCell(t){let n=this.$anchorCell.node(-1),r=It.get(n),a=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a));for(let i=0;i<o.length;i++)t(n.nodeAt(o[i]),a+o[i])}isColSelection(){let t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;let r=t+this.$anchorCell.nodeAfter.attrs.rowspan,a=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,a)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),a=It.get(r),o=t.start(-1),i=a.findCell(t.pos-o),s=a.findCell(n.pos-o),l=t.node(0);return i.top<=s.top?(i.top>0&&(t=l.resolve(o+a.map[i.left])),s.bottom<a.height&&(n=l.resolve(o+a.map[a.width*(a.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(o+a.map[s.left])),i.bottom<a.height&&(t=l.resolve(o+a.map[a.width*(a.height-1)+i.right-1]))),new Zs(t,n)}isRowSelection(){let t=this.$anchorCell.node(-1),n=It.get(t),r=this.$anchorCell.start(-1),a=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(a,o)>0)return!1;let i=a+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==n.width}eq(t){return t instanceof Zs&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),a=It.get(r),o=t.start(-1),i=a.findCell(t.pos-o),s=a.findCell(n.pos-o),l=t.node(0);return i.left<=s.left?(i.left>0&&(t=l.resolve(o+a.map[i.top*a.width])),s.right<a.width&&(n=l.resolve(o+a.map[a.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(o+a.map[s.top*a.width])),i.right<a.width&&(t=l.resolve(o+a.map[a.width*(i.top+1)-1]))),new Zs(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Zs(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new Zs(t.resolve(n),t.resolve(r))}getBookmark(){return new Rie(this.$anchorCell.pos,this.$headCell.pos)}};Bt.prototype.visible=!1;Te.jsonID("cell",Bt);var Rie=class NH{constructor(t,n){this.anchor=t,this.head=n}map(t){return new NH(t.map(this.anchor),t.map(this.head))}resolve(t){let n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&RT(n,r)?new Bt(n,r):Te.near(r,1)}};function Mie(e){if(!(e.selection instanceof Bt))return null;let t=[];return e.selection.forEachCell((n,r)=>{t.push(Ht.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ct.create(e.doc,t)}function Nie({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,a=e.depth;for(;a>=0&&!(e.after(a+1)<e.end(a));a--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(a).type.spec.tableRole)}function Oie({$from:e,$to:t}){let n,r;for(let a=e.depth;a>0;a--){let o=e.node(a);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let a=t.depth;a>0;a--){let o=t.node(a);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function Pie(e,t,n){let r=(t||e).selection,a=(t||e).doc,o,i;if(r instanceof Ae&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")o=Bt.create(a,r.from);else if(i=="row"){let s=a.resolve(r.from+1);o=Bt.rowSelection(s,s)}else if(!n){let s=It.get(r.node),l=r.from+1,u=l+s.map[s.width*s.height-1];o=Bt.create(a,l+1,u)}}else r instanceof ye&&Nie(r)?o=ye.create(a,r.from):r instanceof ye&&Oie(r)&&(o=ye.create(a,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var Bie=new qe("fix-tables");function OH(e,t,n,r){let a=e.childCount,o=t.childCount;e:for(let i=0,s=0;i<o;i++){let l=t.child(i);for(let u=s,c=Math.min(a,i+3);u<c;u++)if(e.child(u)==l){s=u+1,n+=l.nodeSize;continue e}r(l,n),s<a&&e.child(s).sameMarkup(l)?OH(e.child(s),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function zie(e,t){let n,r=(a,o)=>{a.type.spec.tableRole=="table"&&(n=Fie(e,a,o,n))};return t?t.doc!=e.doc&&OH(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Fie(e,t,n,r){let a=It.get(t);if(!a.problems)return r;r||(r=e.tr);let o=[];for(let l=0;l<a.height;l++)o.push(0);for(let l=0;l<a.problems.length;l++){let u=a.problems[l];if(u.type=="collision"){let c=t.nodeAt(u.pos);if(!c)continue;let f=c.attrs;for(let d=0;d<f.rowspan;d++)o[u.row+d]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,gf(f,f.colspan-u.n,u.n))}else if(u.type=="missing")o[u.row]+=u.n;else if(u.type=="overlong_rowspan"){let c=t.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){let c=t.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){let c=r.mapping.map(n);r.delete(c,c+t.nodeSize)}}let i,s;for(let l=0;l<o.length;l++)o[l]&&(i==null&&(i=l),s=l);for(let l=0,u=n+1;l<a.height;l++){let c=t.child(l),f=u+c.nodeSize,d=o[l];if(d>0){let p="cell";c.firstChild&&(p=c.firstChild.type.spec.tableRole);let h=[];for(let x=0;x<d;x++){let m=ho(e.schema)[p].createAndFill();m&&h.push(m)}let g=(l==0||i==l-1)&&s==l?u+1:f-1;r.insert(r.mapping.map(g),h)}u=f}return r.setMeta(Bie,{fixTables:!0})}function PH(e){let t=It.get(e),n=[],r=t.height,a=t.width;for(let o=0;o<r;o++){let i=[];for(let s=0;s<a;s++){let l=o*a+s,u=t.map[l];if(o>0){let c=l-a;if(u===t.map[c]){i.push(null);continue}}if(s>0){let c=l-1;if(u===t.map[c]){i.push(null);continue}}i.push(e.nodeAt(u))}n.push(i)}return n}function BH(e,t){let n=[],r=It.get(e),a=r.height,o=r.width;for(let i=0;i<a;i++){let s=e.child(i),l=[];for(let c=0;c<o;c++){let f=t[i][c];if(!f)continue;let d=r.map[i*r.width+c],p=e.nodeAt(d);if(!p)continue;let h=p.type.createChecked(f.attrs,f.content,f.marks);l.push(h)}let u=s.type.createChecked(s.attrs,l,s.marks);n.push(u)}return e.type.createChecked(e.attrs,n,e.marks)}function zH(e,t,n,r){let a=t[0]>n[0]?-1:1,o=e.splice(t[0],t.length),i=o.length%2===0?1:0,s;return r===-1&&a===1?s=n[0]-1:r===1&&a===-1?s=n[n.length-1]-i+1:s=a===-1?n[0]:n[n.length-1]-i,e.splice(s,0,...o),e}function ku(e){return Hie(t=>t.type.spec.tableRole==="table",e)}function Hie(e,t){for(let n=t.depth;n>=0;n-=1){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function vh(e,t){let n=ku(t.$from);if(!n)return;let r=It.get(n.node);if(!(e<0||e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(a=>{let o=n.node.nodeAt(a),i=a+n.start;return{pos:i,start:i+1,node:o,depth:n.depth+2}})}function wh(e,t){let n=ku(t.$from);if(!n)return;let r=It.get(n.node);if(!(e<0||e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(a=>{let o=n.node.nodeAt(a),i=a+n.start;return{pos:i,start:i+1,node:o,depth:n.depth+2}})}function wH(e,t,n=t){let r=t,a=n;for(let c=t;c>=0;c--){let f=vh(c,e.selection);f&&f.forEach(d=>{let p=d.node.attrs.colspan+c-1;p>=r&&(r=c),p>a&&(a=p)})}for(let c=t;c<=a;c++){let f=vh(c,e.selection);f&&f.forEach(d=>{let p=d.node.attrs.colspan+c-1;d.node.attrs.colspan>1&&p>a&&(a=p)})}let o=[];for(let c=r;c<=a;c++){let f=vh(c,e.selection);f&&f.length>0&&o.push(c)}r=o[0],a=o[o.length-1];let i=vh(r,e.selection),s=wh(0,e.selection);if(!i||!s)return;let l=e.doc.resolve(i[i.length-1].pos),u;for(let c=a;c>=r;c--){let f=vh(c,e.selection);if(f&&f.length>0){for(let d=s.length-1;d>=0;d--)if(s[d].pos===f[0].pos){u=f[0];break}if(u)break}}if(u)return{$anchor:l,$head:e.doc.resolve(u.pos),indexes:o}}function kH(e,t,n=t){let r=t,a=n;for(let c=t;c>=0;c--){let f=wh(c,e.selection);f&&f.forEach(d=>{let p=d.node.attrs.rowspan+c-1;p>=r&&(r=c),p>a&&(a=p)})}for(let c=t;c<=a;c++){let f=wh(c,e.selection);f&&f.forEach(d=>{let p=d.node.attrs.rowspan+c-1;d.node.attrs.rowspan>1&&p>a&&(a=p)})}let o=[];for(let c=r;c<=a;c++){let f=wh(c,e.selection);f&&f.length>0&&o.push(c)}r=o[0],a=o[o.length-1];let i=wh(r,e.selection),s=vh(0,e.selection);if(!i||!s)return;let l=e.doc.resolve(i[i.length-1].pos),u;for(let c=a;c>=r;c--){let f=wh(c,e.selection);if(f&&f.length>0){for(let d=s.length-1;d>=0;d--)if(s[d].pos===f[0].pos){u=f[0];break}if(u)break}}if(u)return{$anchor:l,$head:e.doc.resolve(u.pos),indexes:o}}function CH(e){return e[0].map((t,n)=>e.map(r=>r[n]))}function Vie(e){var t,n;let{tr:r,originIndex:a,targetIndex:o,select:i,pos:s}=e,l=ku(r.doc.resolve(s));if(!l)return!1;let u=(t=wH(r,a))===null||t===void 0?void 0:t.indexes,c=(n=wH(r,o))===null||n===void 0?void 0:n.indexes;if(!u||!c||u.includes(o))return!1;let f=Uie(l.node,u,c,0);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!i)return!0;let d=It.get(f),p=l.start,h=o,g=d.positionAt(d.height-1,h,f),x=r.doc.resolve(p+g),m=d.positionAt(0,h,f),y=r.doc.resolve(p+m);return r.setSelection(Bt.colSelection(x,y)),!0}function Uie(e,t,n,r){let a=CH(PH(e));return a=zH(a,t,n,r),a=CH(a),BH(e,a)}function qie(e){var t,n;let{tr:r,originIndex:a,targetIndex:o,select:i,pos:s}=e,l=ku(r.doc.resolve(s));if(!l)return!1;let u=(t=kH(r,a))===null||t===void 0?void 0:t.indexes,c=(n=kH(r,o))===null||n===void 0?void 0:n.indexes;if(!u||!c||u.includes(o))return!1;let f=jie(l.node,u,c,0);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,f),!i)return!0;let d=It.get(f),p=l.start,h=o,g=d.positionAt(h,d.width-1,f),x=r.doc.resolve(p+g),m=d.positionAt(h,0,f),y=r.doc.resolve(p+m);return r.setSelection(Bt.rowSelection(x,y)),!0}function jie(e,t,n,r){let a=PH(e);return a=zH(a,t,n,r),BH(e,a)}function Js(e){let t=e.selection,n=Rk(e),r=n.node(-1),a=n.start(-1),o=It.get(r);return{...t instanceof Bt?o.rectBetween(t.$anchorCell.pos-a,t.$headCell.pos-a):o.findCell(n.pos-a),tableStart:a,map:o,table:r}}function FH(e,{map:t,tableStart:n,table:r},a){let o=a>0?-1:0;Die(t,r,a+o)&&(o=a==0||a==t.width?null:0);for(let i=0;i<t.height;i++){let s=i*t.width+a;if(a>0&&a<t.width&&t.map[s-1]==t.map[s]){let l=t.map[s],u=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,Tie(u.attrs,a-t.colCount(l))),i+=u.attrs.rowspan-1}else{let l=o==null?ho(r.type.schema).cell:r.nodeAt(t.map[s+o]).type,u=t.positionAt(i,a,r);e.insert(e.mapping.map(n+u),l.createAndFill())}}return e}function HH(e,t){if(!qa(e))return!1;if(t){let n=Js(e);t(FH(e.tr,n,n.left))}return!0}function VH(e,t){if(!qa(e))return!1;if(t){let n=Js(e);t(FH(e.tr,n,n.right))}return!0}function $ie(e,{map:t,table:n,tableStart:r},a){let o=e.mapping.maps.length;for(let i=0;i<t.height;){let s=i*t.width+a,l=t.map[s],u=n.nodeAt(l),c=u.attrs;if(a>0&&t.map[s-1]==l||a<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,gf(c,a-t.colCount(l)));else{let f=e.mapping.slice(o).map(r+l);e.delete(f,f+u.nodeSize)}i+=c.rowspan}}function UH(e,t){if(!qa(e))return!1;if(t){let n=Js(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let a=n.right-1;$ie(r,n,a),a!=n.left;a--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw new RangeError("No table found");n.table=o,n.map=It.get(o)}t(r)}return!0}function Gie(e,{map:t,table:n,tableStart:r},a){let o=0;for(let u=0;u<a;u++)o+=n.child(u).nodeSize;let i=o+n.child(a).nodeSize,s=e.mapping.maps.length;e.delete(o+r,i+r);let l=new Set;for(let u=0,c=a*t.width;u<t.width;u++,c++){let f=t.map[c];if(!l.has(f)){if(l.add(f),a>0&&f==t.map[c-t.width]){let d=n.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...d,rowspan:d.rowspan-1}),u+=d.colspan-1}else if(a<t.height&&f==t.map[c+t.width]){let d=n.nodeAt(f),p=d.attrs,h=d.type.create({...p,rowspan:d.attrs.rowspan-1},d.content),g=t.positionAt(a+1,u,n);e.insert(e.mapping.slice(s).map(r+g),h),u+=p.colspan-1}}}}function qH(e,t){if(!qa(e))return!1;if(t){let n=Js(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let a=n.bottom-1;Gie(r,n,a),a!=n.top;a--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw new RangeError("No table found");n.table=o,n.map=It.get(n.table)}t(r)}return!0}function jH(e,t){return function(n,r){if(!qa(n))return!1;let a=Rk(n);if(a.nodeAfter.attrs[e]===t)return!1;if(r){let o=n.tr;n.selection instanceof Bt?n.selection.forEachCell((i,s)=>{i.attrs[e]!==t&&o.setNodeMarkup(s,null,{...i.attrs,[e]:t})}):o.setNodeMarkup(a.pos,null,{...a.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function Wie(e){return function(t,n){if(!qa(t))return!1;if(n){let r=ho(t.schema),a=Js(t),o=t.tr,i=a.map.cellsInRect(e=="column"?{left:a.left,top:0,right:a.right,bottom:a.map.height}:e=="row"?{left:0,top:a.top,right:a.map.width,bottom:a.bottom}:a),s=i.map(l=>a.table.nodeAt(l));for(let l=0;l<i.length;l++)s[l].type==r.header_cell&&o.setNodeMarkup(a.tableStart+i[l],r.cell,s[l].attrs);if(o.steps.length===0)for(let l=0;l<i.length;l++)o.setNodeMarkup(a.tableStart+i[l],r.header_cell,s[l].attrs);n(o)}return!0}}function SH(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let a=0;a<r.length;a++){let o=t.table.nodeAt(r[a]);if(o&&o.type!==n.header_cell)return!1}return!0}function MT(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?Wie(e):function(n,r){if(!qa(n))return!1;if(r){let a=ho(n.schema),o=Js(n),i=n.tr,s=SH("row",o,a),l=SH("column",o,a),u=(e==="column"?s:e==="row"&&l)?1:0,c=e=="column"?{left:0,top:u,right:1,bottom:o.map.height}:e=="row"?{left:u,top:0,right:o.map.width,bottom:1}:o,f=e=="column"?l?a.cell:a.header_cell:e=="row"?s?a.cell:a.header_cell:a.cell;o.map.cellsInRect(c).forEach(d=>{let p=d+o.tableStart,h=i.doc.nodeAt(p);h&&i.setNodeMarkup(p,f,h.attrs)}),r(i)}return!0}}var cIe=MT("row",{useDeprecatedLogic:!0}),fIe=MT("column",{useDeprecatedLogic:!0}),dIe=MT("cell",{useDeprecatedLogic:!0});function Kie(e,t){if(t<0){let n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,a=e.before();r>=0;r--){let o=e.node(-1).child(r),i=o.lastChild;if(i)return a-1-i.nodeSize;a-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let n=e.node(-1);for(let r=e.indexAfter(-1),a=e.after();r<n.childCount;r++){let o=n.child(r);if(o.childCount)return a+1;a+=o.nodeSize}}return null}function NT(e){return function(t,n){if(!qa(t))return!1;let r=Kie(Rk(t),e);if(r==null)return!1;if(n){let a=t.doc.resolve(r);n(t.tr.setSelection(ye.between(a,_ie(a))).scrollIntoView())}return!0}}function $H(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Ak(e,t){let n=e.selection;if(!(n instanceof Bt))return!1;if(t){let r=e.tr,a=ho(e.schema).cell.createAndFill().content;n.forEachCell((o,i)=>{o.content.eq(a)||r.replace(r.mapping.map(i+1),r.mapping.map(i+o.nodeSize-1),new ue(a,0,0))}),r.docChanged&&t(r)}return!0}function GH(e){return(t,n)=>{let{from:r,to:a,select:o=!0,pos:i=t.selection.from}=e,s=t.tr;return qie({tr:s,originIndex:r,targetIndex:a,select:o,pos:i})?(n?.(s),!0):!1}}function WH(e){return(t,n)=>{let{from:r,to:a,select:o=!0,pos:i=t.selection.from}=e,s=t.tr;return Vie({tr:s,originIndex:r,targetIndex:a,select:o,pos:i})?(n?.(s),!0):!1}}function Xie(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;let a=t.child(0),o=a.type.spec.tableRole,i=a.type.schema,s=[];if(o=="row")for(let l=0;l<t.childCount;l++){let u=t.child(l).content,c=l?0:Math.max(0,n-1),f=l<t.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=TT(ho(i).row,new ue(u,c,f)).content),s.push(u)}else if(o=="cell"||o=="header_cell")s.push(n||r?TT(ho(i).row,new ue(t,n,r)).content:t);else return null;return Yie(i,s)}function Yie(e,t){let n=[];for(let a=0;a<t.length;a++){let o=t[a];for(let i=o.childCount-1;i>=0;i--){let{rowspan:s,colspan:l}=o.child(i).attrs;for(let u=a;u<a+s;u++)n[u]=(n[u]||0)+l}}let r=0;for(let a=0;a<n.length;a++)r=Math.max(r,n[a]);for(let a=0;a<n.length;a++)if(a>=t.length&&t.push(re.empty),n[a]<r){let o=ho(e).cell.createAndFill(),i=[];for(let s=n[a];s<r;s++)i.push(o);t[a]=t[a].append(re.from(i))}return{height:t.length,width:r,rows:t}}function TT(e,t){let n=e.createAndFill();return new dp(n).replace(0,n.content.size,t).doc}function Zie({width:e,height:t,rows:n},r,a){if(e!=r){let o=[],i=[];for(let s=0;s<n.length;s++){let l=n[s],u=[];for(let c=o[s]||0,f=0;c<r;f++){let d=l.child(f%l.childCount);c+d.attrs.colspan>r&&(d=d.type.createChecked(gf(d.attrs,d.attrs.colspan,c+d.attrs.colspan-r),d.content)),u.push(d),c+=d.attrs.colspan;for(let p=1;p<d.attrs.rowspan;p++)o[s+p]=(o[s+p]||0)+d.attrs.colspan}i.push(re.from(u))}n=i,e=r}if(t!=a){let o=[];for(let i=0,s=0;i<a;i++,s++){let l=[],u=n[s%t];for(let c=0;c<u.childCount;c++){let f=u.child(c);i+f.attrs.rowspan>a&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,a-f.attrs.rowspan)},f.content)),l.push(f)}o.push(re.from(l))}n=o,t=a}return{width:e,height:t,rows:n}}function Jie(e,t,n,r,a,o,i){let s=e.doc.type.schema,l=ho(s),u,c;if(a>t.width)for(let f=0,d=0;f<t.height;f++){let p=n.child(f);d+=p.nodeSize;let h=[],g;p.lastChild==null||p.lastChild.type==l.cell?g=u||(u=l.cell.createAndFill()):g=c||(c=l.header_cell.createAndFill());for(let x=t.width;x<a;x++)h.push(g);e.insert(e.mapping.slice(i).map(d-1+r),h)}if(o>t.height){let f=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,a);h++){let x=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==l.header_cell;f.push(x?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}let d=l.row.create(null,re.from(f)),p=[];for(let h=t.height;h<o;h++)p.push(d);e.insert(e.mapping.slice(i).map(r+n.nodeSize-2),p)}return!!(u||c)}function LH(e,t,n,r,a,o,i,s){if(i==0||i==t.height)return!1;let l=!1;for(let u=a;u<o;u++){let c=i*t.width+u,f=t.map[c];if(t.map[c-t.width]==f){l=!0;let d=n.nodeAt(f),{top:p,left:h}=t.findCell(f);e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...d.attrs,rowspan:i-p}),e.insert(e.mapping.slice(s).map(t.positionAt(i,h,n)),d.type.createAndFill({...d.attrs,rowspan:p+d.attrs.rowspan-i})),u+=d.attrs.colspan-1}}return l}function IH(e,t,n,r,a,o,i,s){if(i==0||i==t.width)return!1;let l=!1;for(let u=a;u<o;u++){let c=u*t.width+i,f=t.map[c];if(t.map[c-1]==f){l=!0;let d=n.nodeAt(f),p=t.colCount(f),h=e.mapping.slice(s).map(f+r);e.setNodeMarkup(h,null,gf(d.attrs,i-p,d.attrs.colspan-(i-p))),e.insert(h+d.nodeSize,d.type.createAndFill(gf(d.attrs,0,i-p))),u+=d.attrs.rowspan-1}}return l}function AH(e,t,n,r,a){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let i=It.get(o),{top:s,left:l}=r,u=l+a.width,c=s+a.height,f=e.tr,d=0;function p(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");i=It.get(o),d=f.mapping.maps.length}Jie(f,i,o,n,u,c,d)&&p(),LH(f,i,o,n,l,u,s,d)&&p(),LH(f,i,o,n,l,u,c,d)&&p(),IH(f,i,o,n,s,c,l,d)&&p(),IH(f,i,o,n,s,c,u,d)&&p();for(let h=s;h<c;h++){let g=i.positionAt(h,l,o),x=i.positionAt(h,u,o);f.replace(f.mapping.slice(d).map(g+n),f.mapping.slice(d).map(x+n),new ue(a.rows[h-s],0,0))}p(),f.setSelection(new Bt(f.doc.resolve(n+i.positionAt(s,l,o)),f.doc.resolve(n+i.positionAt(c-1,u-1,o)))),t(f)}var Qie=cx({ArrowLeft:Ek("horiz",-1),ArrowRight:Ek("horiz",1),ArrowUp:Ek("vert",-1),ArrowDown:Ek("vert",1),"Shift-ArrowLeft":_k("horiz",-1),"Shift-ArrowRight":_k("horiz",1),"Shift-ArrowUp":_k("vert",-1),"Shift-ArrowDown":_k("vert",1),Backspace:Ak,"Mod-Backspace":Ak,Delete:Ak,"Mod-Delete":Ak});function Tk(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Ek(e,t){return(n,r,a)=>{if(!a)return!1;let o=n.selection;if(o instanceof Bt)return Tk(n,r,Te.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;let i=KH(a,e,t);if(i==null)return!1;if(e=="horiz")return Tk(n,r,Te.near(n.doc.resolve(o.head+t),t));{let s=n.doc.resolve(i),l=MH(s,e,t),u;return l?u=Te.near(l,1):t<0?u=Te.near(n.doc.resolve(s.before(-1)),-1):u=Te.near(n.doc.resolve(s.after(-1)),1),Tk(n,r,u)}}}function _k(e,t){return(n,r,a)=>{if(!a)return!1;let o=n.selection,i;if(o instanceof Bt)i=o;else{let l=KH(a,e,t);if(l==null)return!1;i=new Bt(n.doc.resolve(l))}let s=MH(i.$headCell,e,t);return s?Tk(n,r,new Bt(i.$anchorCell,s)):!1}}function ese(e,t){let n=e.state.doc,r=kh(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Bt(r))),!0):!1}function tse(e,t,n){if(!qa(e.state))return!1;let r=Xie(n),a=e.state.selection;if(a instanceof Bt){r||(r={width:1,height:1,rows:[re.from(TT(ho(e.state.schema).cell,n))]});let o=a.$anchorCell.node(-1),i=a.$anchorCell.start(-1),s=It.get(o).rectBetween(a.$anchorCell.pos-i,a.$headCell.pos-i);return r=Zie(r,s.right-s.left,s.bottom-s.top),AH(e.state,e.dispatch,i,s,r),!0}else if(r){let o=Rk(e.state),i=o.start(-1);return AH(e.state,e.dispatch,i,It.get(o.node(-1)).findCell(o.pos-i),r),!0}else return!1}function nse(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;let r=EH(e,t.target),a;if(t.shiftKey&&e.state.selection instanceof Bt)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(a=kh(e.state.selection.$anchor))!=null&&((n=IT(e,t))===null||n===void 0?void 0:n.pos)!=a.pos)o(a,t),t.preventDefault();else if(!r)return;function o(l,u){let c=IT(e,u),f=wu.getState(e.state)==null;if(!c||!RT(l,c))if(f)c=l;else return;let d=new Bt(l,c);if(f||!e.state.selection.eq(d)){let p=e.state.tr.setSelection(d);f&&p.setMeta(wu,l.pos),e.dispatch(p)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),wu.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(wu,-1))}function s(l){let u=l,c=wu.getState(e.state),f;if(c!=null)f=e.state.doc.resolve(c);else if(EH(e,u.target)!=r&&(f=IT(e,t),!f))return i();f&&o(f,u)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function KH(e,t,n){if(!(e.state.selection instanceof ye))return null;let{$head:r}=e.state.selection;for(let a=r.depth-1;a>=0;a--){let o=r.node(a);if((n<0?r.index(a):r.indexAfter(a))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let i=r.before(a),s=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?i:null}}return null}function EH(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function IT(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:a}=n;return r>=0&&kh(e.state.doc.resolve(r))||kh(e.state.doc.resolve(a))}var rse=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")),DT(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,DT(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function DT(e,t,n,r,a,o){let i=0,s=!0,l=t.firstChild,u=e.firstChild;if(u){for(let f=0,d=0;f<u.childCount;f++){let{colspan:p,colwidth:h}=u.child(f).attrs;for(let g=0;g<p;g++,d++){let x=a==d?o:h&&h[g],m=x?x+"px":"";if(i+=x||r,x||(s=!1),l)l.style.width!=m&&(l.style.width=m),l=l.nextSibling;else{let y=document.createElement("col");y.style.width=m,t.appendChild(y)}}}for(;l;){var c;let f=l.nextSibling;(c=l.parentNode)===null||c===void 0||c.removeChild(l),l=f}s?(n.style.width=i+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=i+"px")}}var Ua=new qe("tableColumnResizing");function XH({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=rse,lastColumnResizable:a=!0}={}){let o=new Be({key:Ua,state:{init(i,s){var l;let u=(l=o.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,c=ho(s.schema).table.name;return r&&u&&(u[c]=(f,d)=>new r(f,n,d)),new ase(-1,!1)},apply(i,s){return s.apply(i)}},props:{attributes:i=>{let s=Ua.getState(i);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,s)=>{ose(i,s,e,a)},mouseleave:i=>{ise(i)},mousedown:(i,s)=>{sse(i,s,t,n)}},decorations:i=>{let s=Ua.getState(i);if(s&&s.activeHandle>-1)return dse(i,s.activeHandle)},nodeViews:{}}});return o}var ase=class Dk{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){let n=this,r=t.getMeta(Ua);if(r&&r.setHandle!=null)return new Dk(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Dk(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let a=t.mapping.map(n.activeHandle,-1);return _T(t.doc.resolve(a))||(a=-1),new Dk(a,n.dragging)}return n}};function ose(e,t,n,r){if(!e.editable)return;let a=Ua.getState(e.state);if(a&&!a.dragging){let o=use(t.target),i=-1;if(o){let{left:s,right:l}=o.getBoundingClientRect();t.clientX-s<=n?i=_H(e,t,"left",n):l-t.clientX<=n&&(i=_H(e,t,"right",n))}if(i!=a.activeHandle){if(!r&&i!==-1){let s=e.state.doc.resolve(i),l=s.node(-1),u=It.get(l),c=s.start(-1);if(u.colCount(s.pos-c)+s.nodeAfter.attrs.colspan-1==u.width-1)return}YH(e,i)}}}function ise(e){if(!e.editable)return;let t=Ua.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&YH(e,-1)}function sse(e,t,n,r){var a;if(!e.editable)return!1;let o=(a=e.dom.ownerDocument.defaultView)!==null&&a!==void 0?a:window,i=Ua.getState(e.state);if(!i||i.activeHandle==-1||i.dragging)return!1;let s=e.state.doc.nodeAt(i.activeHandle),l=lse(e,i.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(Ua,{setDragging:{startX:t.clientX,startWidth:l}}));function u(f){o.removeEventListener("mouseup",u),o.removeEventListener("mousemove",c);let d=Ua.getState(e.state);d?.dragging&&(cse(e,d.activeHandle,TH(d.dragging,f,n)),e.dispatch(e.state.tr.setMeta(Ua,{setDragging:null})))}function c(f){if(!f.which)return u(f);let d=Ua.getState(e.state);if(d&&d.dragging){let p=TH(d.dragging,f,n);DH(e,d.activeHandle,p,r)}}return DH(e,i.activeHandle,l,r),o.addEventListener("mouseup",u),o.addEventListener("mousemove",c),t.preventDefault(),!0}function lse(e,t,{colspan:n,colwidth:r}){let a=r&&r[r.length-1];if(a)return a;let o=e.domAtPos(t),i=o.node.childNodes[o.offset].offsetWidth,s=n;if(r)for(let l=0;l<n;l++)r[l]&&(i-=r[l],s--);return i/s}function use(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function _H(e,t,n,r){let a=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+a,top:t.clientY});if(!o)return-1;let{pos:i}=o,s=kh(e.state.doc.resolve(i));if(!s)return-1;if(n=="right")return s.pos;let l=It.get(s.node(-1)),u=s.start(-1),c=l.map.indexOf(s.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function TH(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function YH(e,t){e.dispatch(e.state.tr.setMeta(Ua,{setHandle:t}))}function cse(e,t,n){let r=e.state.doc.resolve(t),a=r.node(-1),o=It.get(a),i=r.start(-1),s=o.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let u=0;u<o.height;u++){let c=u*o.width+s;if(u&&o.map[c]==o.map[c-o.width])continue;let f=o.map[c],d=a.nodeAt(f).attrs,p=d.colspan==1?0:s-o.colCount(f);if(d.colwidth&&d.colwidth[p]==n)continue;let h=d.colwidth?d.colwidth.slice():fse(d.colspan);h[p]=n,l.setNodeMarkup(i+f,null,{...d,colwidth:h})}l.docChanged&&e.dispatch(l)}function DH(e,t,n,r){let a=e.state.doc.resolve(t),o=a.node(-1),i=a.start(-1),s=It.get(o).colCount(a.pos-i)+a.nodeAfter.attrs.colspan-1,l=e.domAtPos(a.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&DT(o,l.firstChild,l,r,s,n)}function fse(e){return Array(e).fill(0)}function dse(e,t){let n=[],r=e.doc.resolve(t),a=r.node(-1);if(!a)return Ct.empty;let o=It.get(a),i=r.start(-1),s=o.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1;for(let u=0;u<o.height;u++){let c=s+u*o.width;if((s==o.width-1||o.map[c]!=o.map[c+1])&&(u==0||o.map[c]!=o.map[c-o.width])){var l;let f=o.map[c],d=i+f+a.nodeAt(f).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((l=Ua.getState(e))===null||l===void 0)&&l.dragging&&n.push(Ht.node(i+f,i+f+a.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),n.push(Ht.widget(d,p))}}return Ct.create(e.doc,n)}function ZH({allowTableNodeSelection:e=!1}={}){return new Be({key:wu,state:{init(){return null},apply(t,n){let r=t.getMeta(wu);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;let{deleted:a,pos:o}=t.mapping.mapResult(n);return a?null:o}},props:{decorations:Mie,handleDOMEvents:{mousedown:nse},createSelectionBetween(t){return wu.getState(t.state)!=null?t.state.selection:null},handleTripleClick:ese,handleKeyDown:Qie,handlePaste:tse},appendTransaction(t,n,r){return Pie(r,zie(r,n),e)}})}var Mk=typeof navigator<"u"?navigator:null,PT=Mk&&Mk.userAgent||"",pse=/Edge\/(\d+)/.exec(PT),hse=/MSIE \d/.exec(PT),mse=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(PT),gse=!!(hse||mse||pse),xse=!gse&&!!Mk&&/Apple Computer/.test(Mk.vendor),JH=new qe("safari-ime-span"),OT=!1,bse={key:JH,props:{decorations:yse,handleDOMEvents:{compositionstart:()=>{OT=!0},compositionend:()=>{OT=!1}}}};function yse(e){let{$from:t,$to:n,to:r}=e.selection;if(OT&&t.sameParent(n)){let a=Ht.widget(r,vse,{ignoreSelection:!0,key:"safari-ime-span"});return Ct.create(e.doc,[a])}}function vse(e){let t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var QH=new Be(xse?bse:{key:JH});function BT(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function zT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FT(e,t,n){let a=Wl((n||{}).ignore||[]),o=wse(t),i=-1;for(;++i<o.length;)Kl(e,s);function s(u,c,f){if(u.type==="text"&&typeof f=="number")return l(u,c,f);if(a(u,f,c[c.length-1]))return oo}function l(u,c,f){let d=c[c.length-1],p=o[i][0],h=o[i][1],g=0,x=!1,m=[];p.lastIndex=0;let y=p.exec(u.value);for(;y;){let v=y.index,w={index:y.index,input:y.input,stack:[...c,u]},k=h(...y,w);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k!==!1){if(g!==v&&b({type:"text",value:u.value.slice(g,v)}),Array.isArray(k))for(let _ of k)b(_);else k&&b(k);g=v+y[0].length,x=!0}if(k===!1||y[0].length===0){let _=u.value.codePointAt(v)||0;p.lastIndex=v+(/[uv]/.test(p.flags)&&_>65535?2:1)}if(!p.global)break;y=p.exec(u.value)}return x?(g<u.value.length&&b({type:"text",value:u.value.slice(g)}),d.children.splice(f,1,...m)):m=[u],f+m.length;function b(v){let w=m[m.length-1];w&&w.type==="text"&&v.type==="text"?w.value+=v.value:m.push(v)}}}function wse(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let a=n[r];t.push([kse(a[0]),Cse(a[1])])}return t}function kse(e){return typeof e=="string"?new RegExp(zT(e),"g"):e}function Cse(e){return typeof e=="function"?e:function(){return e}}var HT="phrasing",VT=["autolink","link","image","label"];function qT(){return{transforms:[_se],enter:{literalAutolink:Sse,literalAutolinkEmail:UT,literalAutolinkHttp:UT,literalAutolinkWww:UT},exit:{literalAutolink:Ese,literalAutolinkEmail:Ase,literalAutolinkHttp:Lse,literalAutolinkWww:Ise}}}function jT(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:HT,notInConstruct:VT},{character:".",before:"[Ww]{3}",inConstruct:HT,notInConstruct:VT},{character:":",before:"[PSps]",after:"\\/",inConstruct:HT,notInConstruct:VT}]}}function Sse(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function UT(e){this.config.enter.autolinkProtocol.call(this,e)}function Lse(e){this.config.exit.autolinkProtocol.call(this,e)}function Ise(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Ase(e){this.config.exit.autolinkEmail.call(this,e)}function Ese(e){this.exit(e)}function _se(e){FT(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,Tse],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,Mse],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Rse],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Dse]],{ignore:["link","linkReference"]})}function Tse(e,t,n,r,a){if(!Pse(a))return!1;let o="";if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),Ul(n.charCodeAt(0))||!Nse(n))return!1;let i=Ose(n+r),s={type:"link",title:null,url:o+t+i[0],children:[{type:"text",value:t+i[0],position:void 0}],position:void 0};return i[1]?[s,{type:"text",value:i[1],position:void 0}]:s}function Dse(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function Rse(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function Mse(e,t,n,r,a){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||a.input.charAt(a.index+e.length)==="@"))return!1;let o="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:o,children:[{type:"text",value:o,position:void 0}],position:void 0}}function Nse(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function Ose(e){let t=e.length;for(;t>0;){let i=e.charCodeAt(t-1);if(i===33||i===34||i===38||i===39||i===41||i===44||i===46||i===58||i===59||i===60||i===62||i===63||i===93||i===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")"),a=BT(e,"("),o=BT(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Pse(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||bi(t)||Ul(t)}eV.peek=$se;function Bse(){this.buffer()}function zse(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fse(){this.buffer()}function Hse(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vse(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Use(e){this.exit(e)}function qse(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=wr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jse(e){this.exit(e)}function $se(){return"["}function eV(e,t,n,r){let a=n.createTracker(r),o=a.move("[^"),i=n.enter("footnoteReference"),s=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),i(),o+=a.move("]"),o}function $T(){return{enter:{gfmFootnoteCallString:Bse,gfmFootnoteCall:zse,gfmFootnoteDefinitionLabelString:Fse,gfmFootnoteDefinition:Hse},exit:{gfmFootnoteCallString:Vse,gfmFootnoteCall:Use,gfmFootnoteDefinitionLabelString:qse,gfmFootnoteDefinition:jse}}}function GT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:eV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,i){let s=o.createTracker(i),l=s.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),c(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
|
|
64
|
+
`:" ")+o.indentLines(o.containerFlow(r,s.current()),t?tV:Gse))),u(),l}}function Gse(e,t,n){return t===0?e:tV(e,t,n)}function tV(e,t,n){return(n?"":" ")+e}var Wse=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];XT.attention=Yse;XT.peek=Zse;function WT(){return{canContainEols:["delete"],enter:{strikethrough:Kse},exit:{strikethrough:Xse}}}function KT(){return{handlers:{delete:XT},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Wse}]}}function Kse(e){this.enter({type:"delete",children:[],position:void 0},e)}function Xse(e){this.exit(e)}function XT(e,t,n,r){let a=n.createTracker(r),o=n.stack.includes("strikethrough")?"~":"~~",i=n.enter("strikethrough"),s=a.move(o);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move(o),i(),s}function Yse(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Zse(){return"~"}function Jse(e){return e.length}function rV(e,t){let n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Jse,o=[],i=[],s=[],l=[],u=0,c=-1;for(;++c<e.length;){let g=[],x=[],m=-1;for(e[c].length>u&&(u=e[c].length);++m<e[c].length;){let y=Qse(e[c][m]);if(n.alignDelimiters!==!1){let b=a(y);x[m]=b,(l[m]===void 0||b>l[m])&&(l[m]=b)}g.push(y)}i[c]=g,s[c]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)o[f]=nV(r[f]);else{let g=nV(r);for(;++f<u;)o[f]=g}f=-1;let d=[],p=[];for(;++f<u;){let g=o[f],x="",m="";g===99?(x=":",m=":"):g===108?x=":":g===114&&(m=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[f]-x.length-m.length),b=x+"-".repeat(y)+m;n.alignDelimiters!==!1&&(y=x.length+y+m.length,y>l[f]&&(l[f]=y),p[f]=y),d[f]=b}i.splice(1,0,d),s.splice(1,0,p),c=-1;let h=[];for(;++c<i.length;){let g=i[c],x=s[c],m=n.fillRows===!1?Math.max(1,i[c===1?0:c].length):u;f=-1;let y=[];for(;++f<m;){let b=g[f]||"",v="",w="";if(n.alignDelimiters!==!1){let k=l[f]-(x[f]||0),_=o[f];if(_===114)v=" ".repeat(k);else if(_===99){let E=k/2;k%2?(v=" ".repeat(E+.5),w=" ".repeat(E-.5)):(v=" ".repeat(E),w=v)}else w=" ".repeat(k)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(v),y.push(b),n.alignDelimiters!==!1&&y.push(w),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==m-1)&&y.push("|")}h.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return h.join(`
|
|
65
|
+
`)}function Qse(e){return e==null?"":String(e)}function nV(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ZT(){return{enter:{table:ele,tableData:aV,tableHeader:aV,tableRow:nle},exit:{codeText:rle,table:tle,tableData:YT,tableHeader:YT,tableRow:YT}}}function ele(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function tle(e){this.exit(e),this.data.inTable=void 0}function nle(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function YT(e){this.exit(e)}function aV(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function rle(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ale));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ale(e,t){return t==="|"?t:e}function JT(e){let t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:a}=t,o=n?" ":"|";return{handlers:{inlineCode:d,table:i,tableCell:l,tableRow:s},join:[ole],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
66
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function i(p,h,g,x){let m=c(p,g,x),y=m[0];if(y){let b=p.align?p.align.length:0,v=-1;if(!b)for(;++v<m.length;)m[v].length>b&&(b=m[v].length);for(;y.length<b;)y.push("")}return u(m,p.align)}function s(p,h,g,x){let m=f(p,g,x),y=u([m]);return y.slice(0,y.indexOf(`
|
|
67
|
+
`))}function l(p,h,g,x){let m=g.enter("tableCell"),y=g.enter("phrasing"),b=g.containerPhrasing(p,{...x,before:o,after:o});return y(),m(),b}function u(p,h){return rV(p,{align:h,alignDelimiters:r,fillRows:!1,padding:n,stringLength:a})}function c(p,h,g){let{children:x}=p,m=-1,y=[],b=h.enter("table");for(;++m<x.length;)y[m]=f(x[m],h,g);return b(),y}function f(p,h,g){let{children:x}=p,m=-1,y=[],b=h.enter("tableRow");for(;++m<x.length;)y[m]=l(x[m],p,h,g);return b(),y}function d(p,h,g){let x=Xl.inlineCode(p,h,g);if(!g.stack.includes("tableCell"))return x;let m=[],y=0,b=x.indexOf("|");for(;b!==-1;){let v=b;for(;v>y&&x.charCodeAt(v-1)===92;)v--;m.push(x.slice(y,b)),(b-v)%2===0&&m.push("\\"),y=b,b=x.indexOf("|",b+1)}return m.push(x.slice(y)),m.join("")}}function ole(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&ile(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function ile(e,t){let n=!1;return jr(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,vi}),!!((!e.depth||e.depth<3)&&Es(e)&&(t.options.setext||n))}function QT(){return{exit:{taskListCheckValueChecked:oV,taskListCheckValueUnchecked:oV,paragraph:sle}}}function eD(){return{handlers:{paragraph:lle},join:[ule]}}function oV(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function sle(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let a=t.children,o=-1,i;for(;++o<a.length;){let s=a[o];if(s.type==="paragraph"){i=s;break}}i===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function lle(e,t,n,r){if(!t||t.type!=="listItem"||iV(t)!==e)return Xl.paragraph(e,t,n,r);let a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(r);o.move(a);let i=Xl.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...o.current()});return a+i}function ule(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;let r=iV(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function iV(e){if(typeof e.checked=="boolean")for(let t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function tD(){return[qT(),$T(),WT(),ZT(),QT()]}function nD(e){return{extensions:[jT(),GT(e),KT(),JT(e),eD()]}}var cle={tokenize:mle,partial:!0},sV={tokenize:gle,partial:!0},lV={tokenize:xle,partial:!0},uV={tokenize:ble,partial:!0},fle={tokenize:yle,partial:!0},cV={name:"wwwAutolink",tokenize:ple,previous:dV},fV={name:"protocolAutolink",tokenize:hle,previous:pV},Qs={name:"emailAutolink",tokenize:dle,previous:hV},zi={};function aD(){return{text:zi}}var xf=48;for(;xf<123;)zi[xf]=Qs,xf++,xf===58?xf=65:xf===91&&(xf=97);zi[43]=Qs;zi[45]=Qs;zi[46]=Qs;zi[95]=Qs;zi[72]=[Qs,fV];zi[104]=[Qs,fV];zi[87]=[Qs,cV];zi[119]=[Qs,cV];function dle(e,t,n){let r=this,a,o;return i;function i(f){return!rD(f)||!hV.call(r,r.previous)||oD(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(f))}function s(f){return rD(f)?(e.consume(f),s):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(fle,c,u)(f):f===45||f===95||Cn(f)?(o=!0,e.consume(f),l):c(f)}function u(f){return e.consume(f),a=!0,l}function c(f){return o&&a&&xn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function ple(e,t,n){let r=this;return a;function a(i){return i!==87&&i!==119||!dV.call(r,r.previous)||oD(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(cle,e.attempt(sV,e.attempt(lV,o),n),n)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function hle(e,t,n){let r=this,a="",o=!1;return i;function i(f){return(f===72||f===104)&&pV.call(r,r.previous)&&!oD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(f),e.consume(f),s):n(f)}function s(f){if(xn(f)&&a.length<5)return a+=String.fromCodePoint(f),e.consume(f),s;if(f===58){let d=a.toLowerCase();if(d==="http"||d==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),o?u:(o=!0,l)):n(f)}function u(f){return f===null||vc(f)||ot(f)||bi(f)||Ul(f)?n(f):e.attempt(sV,e.attempt(lV,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function mle(e,t,n){let r=0;return a;function a(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),a):i===46&&r===3?(e.consume(i),o):n(i)}function o(i){return i===null?n(i):t(i)}}function gle(e,t,n){let r,a,o;return i;function i(u){return u===46||u===95?e.check(uV,l,s)(u):u===null||ot(u)||bi(u)||u!==45&&Ul(u)?l(u):(o=!0,e.consume(u),i)}function s(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),i}function l(u){return a||r||!o?n(u):t(u)}}function xle(e,t){let n=0,r=0;return a;function a(i){return i===40?(n++,e.consume(i),a):i===41&&r<n?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(uV,t,o)(i):i===null||ot(i)||bi(i)?t(i):(e.consume(i),a)}function o(i){return i===41&&r++,e.consume(i),a}}function ble(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),a):s===60||s===null||ot(s)||bi(s)?t(s):n(s)}function a(s){return s===null||s===40||s===91||ot(s)||bi(s)?t(s):r(s)}function o(s){return xn(s)?i(s):n(s)}function i(s){return s===59?(e.consume(s),r):xn(s)?(e.consume(s),i):n(s)}}function yle(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return Cn(o)?n(o):t(o)}}function dV(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ot(e)}function pV(e){return!xn(e)}function hV(e){return!(e===47||rD(e))}function rD(e){return e===43||e===45||e===46||e===95||Cn(e)}function oD(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var vle={tokenize:Ale,partial:!0};function iD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Sle,continuation:{tokenize:Lle},exit:Ile}},text:{91:{name:"gfmFootnoteCall",tokenize:Cle},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wle,resolveTo:kle}}}}function wle(e,t,n){let r=this,a=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i;for(;a--;){let l=r.events[a][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return n(l);let u=wr(r.sliceSerialize({start:i.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function kle(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...l),e}function Cle(e,t,n){let r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,i;return s;function s(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(o>999||f===93&&!i||f===null||f===91||ot(f))return n(f);if(f===93){e.exit("chunkString");let d=e.exit("gfmFootnoteCallString");return a.includes(wr(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return ot(f)||(i=!0),o++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),o++,u):u(f)}}function Sle(e,t,n){let r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,i=0,s;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(h)}function c(h){if(i>999||h===93&&!s||h===null||h===91||ot(h))return n(h);if(h===93){e.exit("chunkString");let g=e.exit("gfmFootnoteDefinitionLabelString");return o=wr(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return ot(h)||(s=!0),i++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),i++,c):c(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a.includes(o)||a.push(o),Ve(e,p,"gfmFootnoteDefinitionWhitespace")):n(h)}function p(h){return t(h)}}function Lle(e,t,n){return e.check(yi,t,e.attempt(vle,t,n))}function Ile(e){e.exit("gfmFootnoteDefinition")}function Ale(e,t,n){let r=this;return Ve(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){let i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(o):n(o)}}function sD(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(i,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let u=l;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[l][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[l][1].end)},f={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[l][1].start)},d=[["enter",c,s],["enter",i[u][1],s],["exit",i[u][1],s],["enter",f,s]],p=s.parser.constructs.insideSpan.null;p&&Gn(d,d.length,0,jl(p,i.slice(u+1,l),s)),Gn(d,d.length,0,[["exit",f,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",c,s]]),Gn(i,u-1,l-u+3,d),l=u+d.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function o(i,s,l){let u=this.previous,c=this.events,f=0;return d;function d(h){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),p(h))}function p(h){let g=qr(u);if(h===126)return f>1?l(h):(i.consume(h),f++,p);if(f<2&&!n)return l(h);let x=i.exit("strikethroughSequenceTemporary"),m=qr(h);return x._open=!m||m===2&&!!g,x._close=!g||g===2&&!!m,s(h)}}}var Nk=class{constructor(){this.map=[],this.index=new Map}add(t,n,r){Ele(this,t,n,r)}consume(t){if(this.map.sort(function(o,i){return o[0]-i[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(let o of a)t.push(o);a=r.pop()}this.map.length=0,this.index.clear()}};function Ele(e,t,n,r){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}function mV(e,t){let n=!1,r=[];for(;t<e.length;){let a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function lD(){return{flow:{null:{name:"table",tokenize:_le,resolveAll:Tle}}}}function _le(e,t,n){let r=this,a=0,o=0,i;return s;function s(S){let U=r.events.length-1;for(;U>-1;){let{type:ie}=r.events[U][1];if(ie==="lineEnding"||ie==="linePrefix")U--;else break}let N=U>-1?r.events[U][1].type:null,q=N==="tableHead"||N==="tableRow"?k:l;return q===k&&r.parser.lazy[r.now().line]?n(S):q(S)}function l(S){return e.enter("tableHead"),e.enter("tableRow"),u(S)}function u(S){return S===124||(i=!0,o+=1),c(S)}function c(S){return S===null?n(S):we(S)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),p):n(S):Pe(S)?Ve(e,c,"whitespace")(S):(o+=1,i&&(i=!1,a+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),i=!0,c):(e.enter("data"),f(S)))}function f(S){return S===null||S===124||ot(S)?(e.exit("data"),c(S)):(e.consume(S),S===92?d:f)}function d(S){return S===92||S===124?(e.consume(S),f):f(S)}function p(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),i=!1,Pe(S)?Ve(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):h(S))}function h(S){return S===45||S===58?x(S):S===124?(i=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),g):w(S)}function g(S){return Pe(S)?Ve(e,x,"whitespace")(S):x(S)}function x(S){return S===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),m):S===45?(o+=1,m(S)):S===null||we(S)?v(S):w(S)}function m(S){return S===45?(e.enter("tableDelimiterFiller"),y(S)):w(S)}function y(S){return S===45?(e.consume(S),y):S===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(S))}function b(S){return Pe(S)?Ve(e,v,"whitespace")(S):v(S)}function v(S){return S===124?h(S):S===null||we(S)?!i||a!==o?w(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):w(S)}function w(S){return n(S)}function k(S){return e.enter("tableRow"),_(S)}function _(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),_):S===null||we(S)?(e.exit("tableRow"),t(S)):Pe(S)?Ve(e,_,"whitespace")(S):(e.enter("data"),E(S))}function E(S){return S===null||S===124||ot(S)?(e.exit("data"),_(S)):(e.consume(S),S===92?M:E)}function M(S){return S===92||S===124?(e.consume(S),E):E(S)}}function Tle(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,u,c,f,d=new Nk;for(;++n<e.length;){let p=e[n],h=p[1];p[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(gV(d,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},d.add(n,0,[["enter",u,t]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],i=[0,n+1,0,0],s&&(s=!1,c={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},d.add(n,0,[["enter",c,t]])),a=h.type==="tableDelimiterRow"?2:c?3:1):a&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],f=Ok(d,t,o,a,void 0,f),o=[0,0,0,0]),i[2]=n)):h.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(i[0]=i[1],f=Ok(d,t,o,a,void 0,f)),o=i,i=[o[1],n,0,0])):h.type==="tableHead"?(s=!0,l=n):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=n,o[1]!==0?(i[0]=i[1],f=Ok(d,t,o,a,n,f)):i[1]!==0&&(f=Ok(d,t,i,a,n,f)),a=0):a&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=n)}for(l!==0&&gV(d,t,l,u,c),d.consume(t.events),n=-1;++n<t.events.length;){let p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=mV(t.events,n))}return e}function Ok(e,t,n,r,a,o){let i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},Ch(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let l=Ch(t.events,n[1]);if(o={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let u=Ch(t.events,n[2]),c=Ch(t.events,n[3]),f={type:s,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){let d=t.events[n[2]],p=t.events[n[3]];if(d[1].end=Object.assign({},p[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){let h=n[2]+1,g=n[3]-n[2]-1;e.add(h,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return a!==void 0&&(o.end=Object.assign({},Ch(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function gV(e,t,n,r,a){let o=[],i=Ch(t.events,n);a&&(a.end=Object.assign({},i),o.push(["exit",a,t])),r.end=Object.assign({},i),o.push(["exit",r,t]),e.add(n+1,0,o)}function Ch(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var Dle={name:"tasklistCheck",tokenize:Rle};function uD(){return{text:{91:Dle}}}function Rle(e,t,n){let r=this;return a;function a(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return ot(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):n(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return we(l)?t(l):Pe(l)?e.check({tokenize:Mle},t,n)(l):n(l)}}function Mle(e,t,n){return Ve(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function xV(e){return wv([aD(),iD(),sD(e),lD(),uD()])}var Nle={};function Pk(e){let t=this,n=e||Nle,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(xV(n)),o.push(tD()),i.push(nD(n))}function je(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var dD=tf("strike_through");je(dD,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var bf=lu("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:t=>t==="line-through"}],toDOM:t=>["del",e.get(dD.key)(t)],parseMarkdown:{match:t=>t.type==="delete",runner:(t,n,r)=>{t.openMark(r),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="strike_through",runner:(t,n)=>{t.withMark(n,"delete")}}}));je(bf.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});je(bf.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var q1=Se("ToggleStrikeThrough",e=>()=>xp(bf.type(e)));je(q1,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var yV=Er(e=>Pc(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)$/,bf.type(e)));je(yV,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var j1=ur("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{let t=e.get(ge);return()=>t.call(q1.key)}}});je(j1.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});je(j1.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});function vV(e,t){let n=t.content.firstChild;if(t.childCount!==1||n?.type.name!=="paragraph"){e.next(t.content);return}let r=n.lastChild,a=r?.type.name==="hardbreak"?n.content.cut(0,n.content.size-r.nodeSize):n.content;e.next(a)}var $1=RH({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),$o=pn("table",()=>({...$1.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="table",runner:(e,t,n)=>{let r=t.align,a=t.children.map((o,i)=>({...o,align:r,isHeader:i===0}));e.openNode(n),e.next(a),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table",runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let r=[];n.forEach(a=>{r.push(a.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));je($o.node,{displayName:"NodeSchema<table>",group:"Table"});je($o.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var G1=pn("table_header_row",()=>({...$1.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&e.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type==="tableRow"&&e.isHeader),runner:(e,t,n)=>{let r=t.align,a=t.children.map((o,i)=>({...o,align:r[i],isHeader:t.isHeader}));e.openNode(n),e.next(a),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));je(G1.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});je(G1.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var Lh=pn("table_row",()=>({...$1.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>e.type==="tableRow",runner:(e,t,n)=>{let r=t.align,a=t.children.map((o,i)=>({...o,align:r[i]}));e.openNode(n),e.next(a),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_row",runner:(e,t)=>{t.content.size!==0&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));je(Lh.node,{displayName:"NodeSchema<tableRow>",group:"Table"});je(Lh.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var W1=pn("table_cell",()=>({...$1.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name==="table_cell",runner:(e,t)=>{e.openNode("tableCell"),vV(e,t),e.closeNode()}}}));je(W1.node,{displayName:"NodeSchema<tableCell>",group:"Table"});je(W1.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Sh=pn("table_header",()=>({...$1.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type==="tableCell"&&!!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name==="table_header",runner:(e,t)=>{e.openNode("tableCell"),vV(e,t),e.closeNode()}}}));je(Sh.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});je(Sh.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function Bk(e,t=3,n=3){let r=Array(n).fill(0).map(()=>W1.type(e).createAndFill()),a=Array(n).fill(0).map(()=>Sh.type(e).createAndFill()),o=Array(t).fill(0).map((i,s)=>s===0?G1.type(e).create(null,a):Lh.type(e).create(null,r));return $o.type(e).create(null,o)}function wV(e){return(t,n)=>r=>{n=n??r.selection.from;let a=r.doc.resolve(n),o=MA(l=>l.type.name==="table")(a),i=o?{node:o.node,from:o.start}:void 0,s=e==="row";if(i){let l=It.get(i.node);if(t>=0&&t<(s?l.height:l.width)){let u=l.positionAt(s?t:l.height-1,s?l.width-1:t,i.node),c=r.doc.resolve(i.from+u),f=s?Bt.rowSelection:Bt.colSelection,d=l.positionAt(s?t:0,s?0:t,i.node),p=r.doc.resolve(i.from+d);return RA(r.setSelection(f(c,p)))}}return r}}var Ole=wV("row"),Ple=wV("col");function kV(e,t,{map:n,tableStart:r,table:a},o){let i=Array(o).fill(0).reduce((l,u,c)=>l+a.child(c).nodeSize,r),s=Array(n.width).fill(0).map((l,u)=>{let c=a.nodeAt(n.map[u]);return W1.type(e).createAndFill({alignment:c?.attrs.alignment})});return t.insert(i,Lh.type(e).create(null,s)),t}function Ble(e){let t=ku(e.$from);if(!t)return;let n=It.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(r=>{let a=t.node.nodeAt(r),o=r+t.start;return{pos:o,start:o+1,node:a}})}function zle(e){let t=Ble(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){let a=e.doc.resolve(r.pos);return RA(e.setSelection(new Bt(a,n)))}}return e}var pD=Se("GoToPrevTableCell",()=>()=>NT(-1));je(pD,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var hD=Se("GoToNextTableCell",()=>()=>NT(1));je(hD,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var mD=Se("ExitTable",e=>()=>(t,n)=>{if(!qa(t))return!1;let{$head:r}=t.selection,a=f9(r,$o.type(e));if(!a)return!1;let{to:o}=a,i=t.tr.replaceWith(o,o,ba.type(e).createAndFill());return i.setSelection(Te.near(i.doc.resolve(o),1)).scrollIntoView(),n?.(i),!0});je(mD,{displayName:"Command<breakTableCommand>",group:"Table"});var CV=Se("InsertTable",e=>({row:t,col:n}={})=>(r,a)=>{let{selection:o,tr:i}=r,{from:s}=o,l=Bk(e,t,n),u=i.replaceSelectionWith(l),c=Te.findFrom(u.doc.resolve(s),1,!0);return c&&u.setSelection(c),a?.(u),!0});je(CV,{displayName:"Command<insertTableCommand>",group:"Table"});var zk=Se("MoveRow",()=>({from:e,to:t,pos:n}={})=>GH({from:e??0,to:t??0,pos:n}));je(zk,{displayName:"Command<moveRowCommand>",group:"Table"});var Fk=Se("MoveCol",()=>({from:e,to:t,pos:n}={})=>WH({from:e??0,to:t??0,pos:n}));je(Fk,{displayName:"Command<moveColCommand>",group:"Table"});var Cu=Se("SelectRow",()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(Ole(e.index,e.pos)(r))});je(Cu,{displayName:"Command<selectRowCommand>",group:"Table"});var Su=Se("SelectCol",()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(Ple(e.index,e.pos)(r))});je(Su,{displayName:"Command<selectColCommand>",group:"Table"});var SV=Se("SelectTable",()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(zle(n))});je(SV,{displayName:"Command<selectTableCommand>",group:"Table"});var Hk=Se("DeleteSelectedCells",()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof Bt))return!1;let r=n.isRowSelection(),a=n.isColSelection();return r&&a?$H(e,t):a?UH(e,t):qH(e,t)});je(Hk,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var Vk=Se("AddColBefore",()=>()=>HH);je(Vk,{displayName:"Command<addColBeforeCommand>",group:"Table"});var Uk=Se("AddColAfter",()=>()=>VH);je(Uk,{displayName:"Command<addColAfterCommand>",group:"Table"});var qk=Se("AddRowBefore",e=>()=>(t,n)=>{if(!qa(t))return!1;if(n){let r=Js(t);n(kV(e,t.tr,r,r.top))}return!0});je(qk,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var jk=Se("AddRowAfter",e=>()=>(t,n)=>{if(!qa(t))return!1;if(n){let r=Js(t);n(kV(e,t.tr,r,r.bottom))}return!0});je(jk,{displayName:"Command<addRowAfterCommand>",group:"Table"});var $k=Se("SetAlign",()=>(e="left")=>jH("alignment",e));je($k,{displayName:"Command<setAlignCommand>",group:"Table"});var LV=Er(e=>new Kn(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,a)=>{let o=t.doc.resolve(r);if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),$o.type(e)))return null;let i=Bk(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,a,i);return s.setSelection(ye.create(s.doc,r+3)).scrollIntoView()}));je(LV,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var IV=nz(e=>({run:(t,n,r)=>{if(r)return t;function a(u){let c=u.childCount,f=u.lastChild?.childCount??0;if(c===0||f===0)return ba.type(e).create();let d=u.firstChild;if(!(f>0&&d&&d.childCount===0))return u;if(c>=3){let x=u.child(1),m=[];for(let v=0;v<x.childCount;v++){let w=x.child(v);m.push(Sh.type(e).create(w.attrs,w.content,w.marks))}let y=d.type.create(d.attrs,m),b=[];for(let v=2;v<c;v++)b.push(u.child(v));return u.type.create(u.attrs,[y,...b])}let p=Array(f).fill(0).map(()=>Sh.type(e).createAndFill()),h=new ue(re.from(p),0,0),g=d.replace(0,0,h);return u.replace(0,d.nodeSize,new ue(re.from(g),0,0))}function o(u){let c=Lh.type(e),f=[],d=[],p=!1;function h(){if(d.length===0)return;let g=G1.type(e).createAndFill(),x=$o.type(e).create(null,[g,...d]);f.push(a(x)),d=[]}return u.forEach(g=>{g.type===c?(p=!0,d.push(g)):(h(),f.push(g))}),h(),p?re.from(f):u}function i(u){let c=o(u),f=c!==u,d=[];return c.forEach(p=>{if(p.type===$o.type(e)){let h=a(p);h!==p&&(f=!0),d.push(h)}else if(p.childCount>0){let h=i(p.content);h!==p.content?(f=!0,d.push(p.copy(h))):d.push(p)}else d.push(p)}),f?re.from(d):u}function s(u){let c=[],f=[];u.forEach(d=>f.push(d));for(let d=0;d<f.length;d++){let p=f[d],h=f[d+1];p.type===ba.type(e)&&p.content.size===0&&h&&h.type===$o.type(e)||c.push(p)}return c.length<f.length?re.from(c):u}let l=i(t.content);return l=s(l),new ue(re.from(l),t.openStart,t.openEnd)}}));je(IV,{displayName:"PasteRule<table>",group:"Table"});var gD=ur("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{let t=e.get(ge);return()=>t.call(hD.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{let t=e.get(ge);return()=>t.call(pD.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{let t=e.get(ge);return()=>t.call(mD.key)}}});je(gD.ctx,{displayName:"KeymapCtx<table>",group:"Table"});je(gD.shortcuts,{displayName:"Keymap<table>",group:"Table"});var cD="footnote_definition",bV="footnoteDefinition",xD=pn("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${cD}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Vr(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{let t=e.attrs.label;return["dl",{"data-label":t,"data-type":cD},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===bV,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===cD,runner:(e,t)=>{e.openNode(bV,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));je(xD.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});je(xD.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var fD="footnote_reference",bD=pn("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${fD}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw Vr(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return["sup",{"data-label":t,"data-type":fD},t]},parseMarkdown:{match:({type:e})=>e==="footnoteReference",runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===fD,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));je(bD.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});je(bD.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var yD=va.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:r=>{if(!(r instanceof HTMLElement))throw Vr(r);return{label:r.dataset.label,listType:r.dataset.listType,spread:r.dataset.spread==="true",checked:r.dataset.checked?r.dataset.checked==="true":null}}},...n?.parseDOM||[]],toDOM:r=>n.toDOM&&r.attrs.checked==null?n.toDOM(r):["li",{"data-item-type":"task","data-label":r.attrs.label,"data-list-type":r.attrs.listType,"data-spread":r.attrs.spread,"data-checked":r.attrs.checked},0],parseMarkdown:{match:({type:r})=>r==="listItem",runner:(r,a,o)=>{if(a.checked==null){n.parseMarkdown.runner(r,a,o);return}let i=a.label!=null?`${a.label}.`:"\u2022",s=a.checked!=null?!!a.checked:null,l=a.label!=null?"ordered":"bullet",u=a.spread??!0;r.openNode(o,{label:i,listType:l,spread:u,checked:s}),r.next(a.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="list_item",runner:(r,a)=>{if(a.attrs.checked==null){n.toMarkdown.runner(r,a);return}let o=a.attrs.label,i=a.attrs.listType,s=a.attrs.spread,l=a.attrs.checked;r.openNode("listItem",void 0,{label:o,listType:i,spread:s,checked:l}),r.next(a.content),r.closeNode()}}}});je(yD.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});je(yD.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var AV=Er(()=>new Kn(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{let a=e.doc.resolve(n),o=0,i=a.node(o);for(;i&&i.type.name!=="list_item";)o--,i=a.node(o);if(!i||i.attrs.checked!=null)return null;let s=t.groups?.checked==="x",l=a.before(o),u=e.tr;return u.deleteRange(n,r).setNodeMarkup(l,void 0,{...i.attrs,checked:s}),u}));je(AV,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var Fle=[j1,gD].flat(),Hle=[LV,AV],Vle=[yV],Ule=[IV],EV=rt(()=>QH);je(EV,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var qle=rt(()=>XH({}));je(qle,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var _V=rt(()=>ZH({allowTableNodeSelection:!0}));je(_V,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var vD=No("remarkGFM",()=>Pk);je(vD.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});je(vD.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var jle=new qe("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function $le(e,t){let n=0;return t.forEach((r,a,o)=>{r===e&&(n=o)}),n}function Gle(e,t){let n=e.content.findDiffStart(t.content);if(n==null)return null;let r=e.content.findDiffEnd(t.content);return r?{from:n,to:Math.max(r.b,n)}:null}var TV=rt(()=>new Be({key:jle,appendTransaction:(e,t,n)=>{if(t.doc===n.doc)return;let r=Gle(t.doc,n.doc);if(!r)return;let a,o=(i,s)=>{if(i.type.name!=="table_cell")return;let l=n.doc.resolve(s),u=l.node(l.depth),c=l.node(l.depth-1).firstChild;if(!c)return;let f=$le(i,u),d=c.maybeChild(f);if(!d)return;let p=d.attrs.alignment;p!==i.attrs.alignment&&(a||(a=n.tr),a.setNodeMarkup(s,void 0,{...i.attrs,alignment:p}))};return n.doc.nodesBetween(r.from,r.to,(i,s)=>i.type.name!=="table"?!0:(n.doc.nodesBetween(s,s+i.nodeSize,o),!1)),a}}));je(TV,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Wle=[TV,EV,vD,_V].flat(),Kle=[yD,$o,G1,Lh,Sh,W1,xD,bD,dD,bf].flat(),Xle=[hD,pD,mD,CV,zk,Fk,Cu,Su,SV,Hk,qk,jk,Vk,Uk,$k,q1],DV=[Kle,Hle,Ule,Vle,Fle,Xle,Wle].flat();var RV=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(RV||{}),Yle=Ie([],"FeaturesCtx"),Zle=Ie({},"CrepeCtx");function Jle(e){return e.use("FeaturesCtx")}var MV=e=>{throw TypeError(e)},NV=(e,t,n)=>t.has(e)||MV("Cannot "+n),ja=(e,t,n)=>(NV(e,t,"read from private field"),n?n.call(e):t.get(e)),wD=(e,t,n)=>t.has(e)?MV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kD=(e,t,n,r)=>(NV(e,t,"write to private field"),t.set(e,n),n),$a,Gk,K1,Wk=class{constructor({root:t,defaultValue:n=""}={}){wD(this,$a),wD(this,Gk),wD(this,K1,!0),this.addFeature=(a,o)=>(a(ja(this,$a),o),this),this.create=()=>ja(this,$a).create(),this.destroy=()=>ja(this,$a).destroy(),this.setReadonly=a=>(kD(this,K1,!a),ja(this,$a).action(o=>{ja(this,$a).status===Ux.Created&&o.get(it).setProps({editable:()=>!a})}),this),this.getMarkdown=()=>ja(this,$a).action(rz()),this.on=a=>ja(this,$a).status!==Ux.Created?(ja(this,$a).config(o=>{let i=o.get(O1);a(i)}),this):(ja(this,$a).action(o=>{let i=o.get(O1);a(i)}),this);var r;kD(this,Gk,(r=typeof t=="string"?document.querySelector(t):t)!=null?r:document.body),kD(this,$a,ez.make().config(a=>{a.inject(Zle,this),a.inject(Yle,[])}).config(a=>{a.set(Px,ja(this,Gk)),a.set(Nx,n),a.set(ef,{editable:()=>ja(this,K1)}),a.update(M1.key,o=>({...o,size:4})),a.update(ff.key,o=>({...o,uploader:async(i,s,l)=>{let c=Jle(l).get().includes(RV.ImageBlock),f=c?s.nodes["image-block"]:s.nodes.image;if(!f)return[];let d=c?l.get(D1.key).onUpload:void 0,p=[];for(let g=0;g<i.length;g++){let x=i.item(g);x&&x.type.includes("image")&&p.push(x)}return await Promise.all(p.map(async g=>{let x=d?await d(g):URL.createObjectURL(g);return f.createAndFill({src:x})}))}}))}).use(bH).use(O_).use(CF).use(LF).use(FF).use(S_).use(VF).use(DV))}get editor(){return ja(this,$a)}get readonly(){return!ja(this,K1)}};$a=new WeakMap;Gk=new WeakMap;K1=new WeakMap;function t0(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-block",...t}}),e}var Qle=e=>!pa(t=>t.type.name==="table")(e),n0=He({filterNodes:Qle},"blockConfig");t0(n0,{displayName:"Ctx<blockConfig>"});function eue(e,t,n){if(!e.dom.parentElement)return null;try{let r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(r==null||r<0)return null;let a=e.state.doc.resolve(r),o=e.state.doc.nodeAt(r),i=e.nodeDOM(r),s=l=>{let u=a.depth>=1&&a.index(a.depth)===0;if(!(l||u))return;let c=a.before(a.depth);o=e.state.doc.nodeAt(c),i=e.nodeDOM(c),a=e.state.doc.resolve(c),n(a,o)||s(!0)};return s(!n(a,o)),!i||!o?null:{node:o,$pos:a,el:i}}catch{return null}}var OV=Oc.ie&&Oc.ie_version<15||Oc.ios&&Oc.webkit_version<604,PV=20,Ah,X1,Lu,Go,Eh,Wo,Fi,FV,Ih,yf,vf,Y1,_h,Th,Dh,Rh,Z1,Iu,BV,tue=(BV=class{constructor(){X(this,Fi);X(this,Ah);X(this,X1);X(this,Lu);X(this,Go);X(this,Eh);X(this,Wo);X(this,yf);X(this,vf);X(this,Y1);X(this,_h);X(this,Th);X(this,Dh);X(this,Rh);X(this,Z1);X(this,Iu);B(this,X1,()=>{if(!L(this,Go))return null;let e=L(this,Go),t=L(this,Fi,Ih);if(B(this,Lu,null),t&&Ae.isSelectable(e.node)){let n=Ae.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),B(this,Lu,n),n}return null}),B(this,Lu,null),B(this,Go,null),B(this,Eh,void 0),B(this,Wo,!1),B(this,vf,()=>{var e;(e=L(this,yf))==null||e.call(this,{type:"hide"}),B(this,Go,null)}),B(this,Y1,e=>{var t;B(this,Go,e),(t=L(this,yf))==null||t.call(this,{type:"show",active:e})}),this.bind=(e,t)=>{B(this,Ah,e),B(this,yf,t)},this.addEvent=e=>{e.addEventListener("mousedown",L(this,_h)),e.addEventListener("mouseup",L(this,Th)),e.addEventListener("dragstart",L(this,Dh)),e.addEventListener("dragend",L(this,Rh))},this.removeEvent=e=>{e.removeEventListener("mousedown",L(this,_h)),e.removeEventListener("mouseup",L(this,Th)),e.removeEventListener("dragstart",L(this,Dh)),e.removeEventListener("dragend",L(this,Rh))},this.unBind=()=>{B(this,yf,void 0)},B(this,_h,()=>{B(this,Eh,L(this,Go)?.el.getBoundingClientRect()),L(this,X1).call(this)}),B(this,Th,()=>{if(!L(this,Wo)){requestAnimationFrame(()=>{L(this,Eh)&&L(this,Fi,Ih)?.focus()});return}B(this,Wo,!1),B(this,Lu,null)}),B(this,Dh,e=>{B(this,Wo,!0);let t=L(this,Fi,Ih);if(!t)return;t.dom.dataset.dragging="true";let n=L(this,Lu);if(e.dataTransfer&&n){let r=n.content();e.dataTransfer.effectAllowed="copyMove";let{dom:a,text:o}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData(OV?"Text":"text/html",a.innerHTML),OV||e.dataTransfer.setData("text/plain",o);let i=L(this,Go)?.el;i&&e.dataTransfer.setDragImage(i,0,0),t.dragging={slice:r,move:!0,node:n}}}),B(this,Rh,()=>{let e=L(this,Fi,Ih);if(!e)return;L(this,Iu).call(this,e);let t=e.dragging;window.setTimeout(()=>{e.dragging===t&&(e.dragging=null)},50)}),this.keydownCallback=e=>(L(this,vf).call(this),B(this,Wo,!1),e.dom.dataset.dragging="false",!1),B(this,Z1,mu((e,t)=>{if(!e.editable)return;let n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element)){L(this,vf).call(this);return}let a=L(this,Fi,FV);if(!a)return;let o=eue(e,{x:r,y:t.clientY},a);if(!o){L(this,vf).call(this);return}L(this,Y1).call(this,o)},200)),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||L(this,Z1).call(this,e,t),!1),this.dragoverCallback=(e,t)=>{if(L(this,Wo)){let n=L(this,Fi,Ih)?.dom.parentElement;if(!n)return!1;let r=n.scrollHeight>n.clientHeight,a=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&Math.abs(t.y-a.y)<PV)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;let o=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+a.height)<o&&Math.abs(t.y-(a.height+a.y))<PV)return n.scrollTop=n.scrollTop+10,!1}}return!1},this.dragenterCallback=e=>{e.dragging&&(B(this,Wo,!0),e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{let n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(B(this,Go,null),L(this,Iu).call(this,e))},this.dropCallback=e=>(L(this,Iu).call(this,e),!1),this.dragendCallback=e=>{L(this,Iu).call(this,e)},B(this,Iu,e=>{B(this,Wo,!1),e.dom.dataset.dragging="false"})}},Ah=new WeakMap,X1=new WeakMap,Lu=new WeakMap,Go=new WeakMap,Eh=new WeakMap,Wo=new WeakMap,Fi=new WeakSet,FV=function(){try{return L(this,Ah)?.get(n0.key).filterNodes}catch{return}},Ih=function(){return L(this,Ah)?.get(it)},yf=new WeakMap,vf=new WeakMap,Y1=new WeakMap,_h=new WeakMap,Th=new WeakMap,Dh=new WeakMap,Rh=new WeakMap,Z1=new WeakMap,Iu=new WeakMap,BV),CD=He(()=>new tue,"blockService"),Xk=He({},"blockServiceInstance");t0(CD,{displayName:"Ctx<blockService>"});t0(Xk,{displayName:"Ctx<blockServiceInstance>"});var Yk=He({},"blockSpec");t0(Yk,{displayName:"Ctx<blockSpec>"});var SD=rt(e=>{let t=new qe("MILKDOWN_BLOCK"),n=e.get(CD.key)();e.set(Xk.key,n);let r=e.get(Yk.key);return new Be({key:t,...r,props:{...r.props,handleDOMEvents:{drop:a=>n.dropCallback(a),pointermove:(a,o)=>n.mousemoveCallback(a,o),keydown:a=>n.keydownCallback(a),dragover:(a,o)=>n.dragoverCallback(a,o),dragleave:(a,o)=>n.dragleaveCallback(a,o),dragenter:a=>n.dragenterCallback(a),dragend:a=>n.dragendCallback(a)}}})});t0(SD,{displayName:"Prose<block>"});var wa,el,wf,kf,J1,Mh,Q1,e0,Nh,Oh,Ph,Kk,VV,zV,HV=(zV=class{constructor(e){X(this,Kk);X(this,wa);X(this,el);X(this,wf);X(this,kf);X(this,J1);X(this,Mh);X(this,Q1);X(this,e0);X(this,Nh);X(this,Oh);X(this,Ph);B(this,kf,null),B(this,Mh,!1),this.update=()=>{requestAnimationFrame(()=>{if(!L(this,Mh))try{zR(this,Kk,VV).call(this),B(this,Mh,!0)}catch{}})},this.destroy=()=>{L(this,wf)?.unBind(),L(this,wf)?.removeEvent(L(this,wa)),L(this,wa).remove()},this.show=t=>{let n=t.el,r=L(this,el).get(it).dom,a={ctx:L(this,el),active:t,editorDom:r,blockDom:L(this,wa)},o={contextElement:n,getBoundingClientRect:()=>L(this,Oh)?L(this,Oh).call(this,a):n.getBoundingClientRect()},i=[zl()];if(L(this,Nh)){let s=L(this,Nh).call(this,a),l=Pa(s);i.push(l)}zr(o,L(this,wa),{placement:L(this,Ph)?L(this,Ph).call(this,a):"left",middleware:[...i,...L(this,Q1)],...L(this,e0)}).then(({x:s,y:l})=>{Object.assign(L(this,wa).style,{left:`${s}px`,top:`${l}px`}),L(this,wa).dataset.show="true"}).catch(console.error)},this.hide=()=>{L(this,wa).dataset.show="false"},B(this,el,e.ctx),B(this,wa,e.content),B(this,Nh,e.getOffset),B(this,Oh,e.getPosition),B(this,Ph,e.getPlacement),B(this,Q1,e.middleware??[]),B(this,e0,e.floatingUIOptions??{}),B(this,J1,e.root),this.hide()}get active(){return L(this,kf)}},wa=new WeakMap,el=new WeakMap,wf=new WeakMap,kf=new WeakMap,J1=new WeakMap,Mh=new WeakMap,Q1=new WeakMap,e0=new WeakMap,Nh=new WeakMap,Oh=new WeakMap,Ph=new WeakMap,Kk=new WeakSet,VV=function(){let e=L(this,el).get(it);(L(this,J1)??e.dom.parentElement??document.body).appendChild(L(this,wa));let t=L(this,el).get(Xk.key);t.bind(L(this,el),n=>{n.type==="hide"?(this.hide(),B(this,kf,null)):n.type==="show"&&(this.show(n.active),B(this,kf,n.active))}),B(this,wf,t),L(this,wf).addEvent(L(this,wa)),L(this,wa).draggable=!0},zV),r0=[Yk,n0,CD,Xk,SD];r0.key=Yk.key;r0.pluginKey=SD.key;function qV(e){let t=He({},`${e}_SLASH_SPEC`),n=rt(a=>{let o=a.get(t.key);return new Be({key:new qe(`${e}_SLASH`),...o})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${e}`},n.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${e}`},r}var Bh,a0,o0,i0,s0,Cf,l0,zh,u0,c0,f0,UV,jV=(UV=class{constructor(e){X(this,Bh);X(this,a0);X(this,o0);X(this,i0);X(this,s0);X(this,Cf);X(this,l0);X(this,zh);X(this,u0);X(this,c0);X(this,f0);B(this,Bh,!1),this.onShow=()=>{},this.onHide=()=>{},B(this,c0,(t,n)=>{let{state:r,composing:a}=t,{selection:o,doc:i}=r,{ranges:s}=o,l=Math.min(...s.map(f=>f.$from.pos)),u=Math.max(...s.map(f=>f.$to.pos)),c=n&&n.doc.eq(i)&&n.selection.eq(o);if(L(this,Bh)||((L(this,i0)??t.dom.parentElement??document.body).appendChild(this.element),B(this,Bh,!0)),!(a||c)){if(!L(this,l0).call(this,t,n)){this.hide();return}zr({getBoundingClientRect:()=>Bc(t,l,u)},this.element,{placement:"bottom-start",middleware:[zl(),Pa(L(this,u0)),...L(this,a0)],...L(this,o0)}).then(({x:f,y:d})=>{Object.assign(this.element.style,{left:`${f}px`,top:`${d}px`})}).catch(console.error),this.show()}}),B(this,f0,t=>{let n=this.getContent(t);if(!n)return!1;let r=n.at(-1);return r?Array.isArray(L(this,Cf))?L(this,Cf).includes(r):L(this,Cf)===r:!1}),this.update=(t,n)=>{L(this,zh).call(this,t,n)},this.getContent=(t,n=r=>r.type.name==="paragraph")=>{let{selection:r}=t.state,{empty:a,$from:o}=r,i=t.state.selection instanceof ye;if(typeof document>"u")return;let s=this.element.contains(document.activeElement),l=!t.hasFocus()&&!s,u=!t.editable,c=!p9(n)(t.state.selection);if(!(l||u||!a||!i||c))return o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"\uFFFC")},this.destroy=()=>{L(this,zh).cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,B(this,s0,e.debounce??200),B(this,l0,e.shouldShow??L(this,f0)),B(this,Cf,e.trigger??"/"),B(this,u0,e.offset),B(this,a0,e.middleware??[]),B(this,o0,e.floatingUIOptions??{}),B(this,i0,e.root),B(this,zh,Ys(L(this,c0),L(this,s0)))}},Bh=new WeakMap,a0=new WeakMap,o0=new WeakMap,i0=new WeakMap,s0=new WeakMap,Cf=new WeakMap,l0=new WeakMap,zh=new WeakMap,u0=new WeakMap,c0=new WeakMap,f0=new WeakMap,UV);function nue(...e){}nue(H);function ka({icon:e,class:t,onClick:n}){return H("span",{class:Tr("milkdown-icon",t),onPointerdown:n,innerHTML:e?Po.sanitize(e.trim()):void 0})}ka.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function GV(e){return e.use("FeaturesCtx")}function rue(e){return t=>{GV(t).update(n=>n.includes(e)?n:[...n,e])}}var m0=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(m0||{}),aue=`
|
|
68
|
+
<svg
|
|
69
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
70
|
+
width="24"
|
|
71
|
+
height="24"
|
|
72
|
+
viewBox="0 0 24 24"
|
|
73
|
+
>
|
|
74
|
+
<g clip-path="url(#clip0_977_8070)">
|
|
75
|
+
<path
|
|
76
|
+
d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"
|
|
77
|
+
/>
|
|
78
|
+
</g>
|
|
79
|
+
<defs>
|
|
80
|
+
<clipPath id="clip0_977_8070">
|
|
81
|
+
<rect width="24" height="24" />
|
|
82
|
+
</clipPath>
|
|
83
|
+
</defs>
|
|
84
|
+
</svg>
|
|
85
|
+
`,oue=`
|
|
86
|
+
<svg
|
|
87
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
88
|
+
width="24"
|
|
89
|
+
height="24"
|
|
90
|
+
viewBox="0 0 24 24"
|
|
91
|
+
>
|
|
92
|
+
<g clip-path="url(#clip0_977_8081)">
|
|
93
|
+
<path
|
|
94
|
+
d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"
|
|
95
|
+
/>
|
|
96
|
+
</g>
|
|
97
|
+
<defs>
|
|
98
|
+
<clipPath id="clip0_977_8081">
|
|
99
|
+
<rect width="24" height="24" />
|
|
100
|
+
</clipPath>
|
|
101
|
+
</defs>
|
|
102
|
+
</svg>
|
|
103
|
+
`,iue=`
|
|
104
|
+
<svg
|
|
105
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
106
|
+
width="24"
|
|
107
|
+
height="24"
|
|
108
|
+
viewBox="0 0 24 24"
|
|
109
|
+
>
|
|
110
|
+
<g clip-path="url(#clip0_977_7900)">
|
|
111
|
+
<path
|
|
112
|
+
fill-rule="evenodd"
|
|
113
|
+
clip-rule="evenodd"
|
|
114
|
+
d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"
|
|
115
|
+
/>
|
|
116
|
+
</g>
|
|
117
|
+
<defs>
|
|
118
|
+
<clipPath id="clip0_977_7900">
|
|
119
|
+
<rect width="24" height="24" />
|
|
120
|
+
</clipPath>
|
|
121
|
+
</defs>
|
|
122
|
+
</svg>
|
|
123
|
+
`,sue=`
|
|
124
|
+
<svg
|
|
125
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
126
|
+
width="24"
|
|
127
|
+
height="24"
|
|
128
|
+
viewBox="0 0 24 24"
|
|
129
|
+
>
|
|
130
|
+
<g clip-path="url(#clip0_992_5553)">
|
|
131
|
+
<path
|
|
132
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"
|
|
133
|
+
/>
|
|
134
|
+
</g>
|
|
135
|
+
<defs>
|
|
136
|
+
<clipPath id="clip0_992_5553">
|
|
137
|
+
<rect width="24" height="24" />
|
|
138
|
+
</clipPath>
|
|
139
|
+
</defs>
|
|
140
|
+
</svg>
|
|
141
|
+
`,lue=`
|
|
142
|
+
<svg
|
|
143
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
144
|
+
width="24"
|
|
145
|
+
height="24"
|
|
146
|
+
viewBox="0 0 24 24"
|
|
147
|
+
>
|
|
148
|
+
<g clip-path="url(#clip0_992_5559)">
|
|
149
|
+
<path
|
|
150
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"
|
|
151
|
+
/>
|
|
152
|
+
</g>
|
|
153
|
+
<defs>
|
|
154
|
+
<clipPath id="clip0_992_5559">
|
|
155
|
+
<rect width="24" height="24" />
|
|
156
|
+
</clipPath>
|
|
157
|
+
</defs>
|
|
158
|
+
</svg>
|
|
159
|
+
`,uue=`
|
|
160
|
+
<svg
|
|
161
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
162
|
+
width="24"
|
|
163
|
+
height="24"
|
|
164
|
+
viewBox="0 0 24 24"
|
|
165
|
+
>
|
|
166
|
+
<g clip-path="url(#clip0_992_5565)">
|
|
167
|
+
<path
|
|
168
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
169
|
+
/>
|
|
170
|
+
</g>
|
|
171
|
+
<defs>
|
|
172
|
+
<clipPath id="clip0_992_5565">
|
|
173
|
+
<rect width="24" height="24" />
|
|
174
|
+
</clipPath>
|
|
175
|
+
</defs>
|
|
176
|
+
</svg>
|
|
177
|
+
`,cue=`
|
|
178
|
+
<svg
|
|
179
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
180
|
+
width="24"
|
|
181
|
+
height="24"
|
|
182
|
+
viewBox="0 0 24 24"
|
|
183
|
+
>
|
|
184
|
+
<g clip-path="url(#clip0_977_7757)">
|
|
185
|
+
<path
|
|
186
|
+
d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"
|
|
187
|
+
/>
|
|
188
|
+
</g>
|
|
189
|
+
<defs>
|
|
190
|
+
<clipPath id="clip0_977_7757">
|
|
191
|
+
<rect width="24" height="24" />
|
|
192
|
+
</clipPath>
|
|
193
|
+
</defs>
|
|
194
|
+
</svg>
|
|
195
|
+
`,fue=`
|
|
196
|
+
<svg
|
|
197
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
198
|
+
width="24"
|
|
199
|
+
height="24"
|
|
200
|
+
viewBox="0 0 24 24"
|
|
201
|
+
>
|
|
202
|
+
<g clip-path="url(#clip0_977_7760)">
|
|
203
|
+
<path
|
|
204
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
205
|
+
/>
|
|
206
|
+
</g>
|
|
207
|
+
<defs>
|
|
208
|
+
<clipPath id="clip0_977_7760">
|
|
209
|
+
<rect width="24" height="24" />
|
|
210
|
+
</clipPath>
|
|
211
|
+
</defs>
|
|
212
|
+
</svg>
|
|
213
|
+
`,due=`
|
|
214
|
+
<svg
|
|
215
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
216
|
+
width="24"
|
|
217
|
+
height="24"
|
|
218
|
+
viewBox="0 0 24 24"
|
|
219
|
+
>
|
|
220
|
+
<g clip-path="url(#clip0_977_7763)">
|
|
221
|
+
<path
|
|
222
|
+
d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"
|
|
223
|
+
/>
|
|
224
|
+
</g>
|
|
225
|
+
<defs>
|
|
226
|
+
<clipPath id="clip0_977_7763">
|
|
227
|
+
<rect width="24" height="24" />
|
|
228
|
+
</clipPath>
|
|
229
|
+
</defs>
|
|
230
|
+
</svg>
|
|
231
|
+
`,pue=`
|
|
232
|
+
<svg
|
|
233
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
234
|
+
width="24"
|
|
235
|
+
height="24"
|
|
236
|
+
viewBox="0 0 24 24"
|
|
237
|
+
>
|
|
238
|
+
<g clip-path="url(#clip0_977_8075)">
|
|
239
|
+
<path
|
|
240
|
+
d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"
|
|
241
|
+
/>
|
|
242
|
+
</g>
|
|
243
|
+
<defs>
|
|
244
|
+
<clipPath id="clip0_977_8075">
|
|
245
|
+
<rect width="24" height="24" />
|
|
246
|
+
</clipPath>
|
|
247
|
+
</defs>
|
|
248
|
+
</svg>
|
|
249
|
+
`,hue=`
|
|
250
|
+
<svg
|
|
251
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
252
|
+
width="24"
|
|
253
|
+
height="24"
|
|
254
|
+
viewBox="0 0 24 24"
|
|
255
|
+
>
|
|
256
|
+
<g clip-path="url(#clip0_971_7680)">
|
|
257
|
+
<path
|
|
258
|
+
d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"
|
|
259
|
+
/>
|
|
260
|
+
</g>
|
|
261
|
+
<defs>
|
|
262
|
+
<clipPath id="clip0_971_7680">
|
|
263
|
+
<rect width="24" height="24" />
|
|
264
|
+
</clipPath>
|
|
265
|
+
</defs>
|
|
266
|
+
</svg>
|
|
267
|
+
`,mue=`
|
|
268
|
+
<svg
|
|
269
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
270
|
+
width="24"
|
|
271
|
+
height="24"
|
|
272
|
+
viewBox="0 0 24 24"
|
|
273
|
+
>
|
|
274
|
+
<g clip-path="url(#clip0_977_8067)">
|
|
275
|
+
<path
|
|
276
|
+
d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"
|
|
277
|
+
/>
|
|
278
|
+
</g>
|
|
279
|
+
<defs>
|
|
280
|
+
<clipPath id="clip0_977_8067">
|
|
281
|
+
<rect width="24" height="24" />
|
|
282
|
+
</clipPath>
|
|
283
|
+
</defs>
|
|
284
|
+
</svg>
|
|
285
|
+
`,gue=`
|
|
286
|
+
<svg
|
|
287
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
288
|
+
width="24"
|
|
289
|
+
height="24"
|
|
290
|
+
viewBox="0 0 24 24"
|
|
291
|
+
>
|
|
292
|
+
<g clip-path="url(#clip0_971_7676)">
|
|
293
|
+
<path
|
|
294
|
+
d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"
|
|
295
|
+
/>
|
|
296
|
+
</g>
|
|
297
|
+
<defs>
|
|
298
|
+
<clipPath id="clip0_971_7676">
|
|
299
|
+
<rect width="24" height="24" />
|
|
300
|
+
</clipPath>
|
|
301
|
+
</defs>
|
|
302
|
+
</svg>
|
|
303
|
+
`,xue=`
|
|
304
|
+
<svg
|
|
305
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
306
|
+
width="24"
|
|
307
|
+
height="24"
|
|
308
|
+
viewBox="0 0 24 24"
|
|
309
|
+
>
|
|
310
|
+
<g clip-path="url(#clip0_977_7897)">
|
|
311
|
+
<path
|
|
312
|
+
d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"
|
|
313
|
+
/>
|
|
314
|
+
</g>
|
|
315
|
+
<defs>
|
|
316
|
+
<clipPath id="clip0_977_7897">
|
|
317
|
+
<rect width="24" height="24" />
|
|
318
|
+
</clipPath>
|
|
319
|
+
</defs>
|
|
320
|
+
</svg>
|
|
321
|
+
`,bue=`
|
|
322
|
+
<svg
|
|
323
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
324
|
+
width="24"
|
|
325
|
+
height="24"
|
|
326
|
+
viewBox="0 0 24 24"
|
|
327
|
+
>
|
|
328
|
+
<g clip-path="url(#clip0_977_8078)">
|
|
329
|
+
<path
|
|
330
|
+
d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"
|
|
331
|
+
/>
|
|
332
|
+
</g>
|
|
333
|
+
<defs>
|
|
334
|
+
<clipPath id="clip0_977_8078">
|
|
335
|
+
<rect width="24" height="24" />
|
|
336
|
+
</clipPath>
|
|
337
|
+
</defs>
|
|
338
|
+
</svg>
|
|
339
|
+
`,yue=`
|
|
340
|
+
<svg
|
|
341
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
342
|
+
width="24"
|
|
343
|
+
height="24"
|
|
344
|
+
viewBox="0 0 24 24"
|
|
345
|
+
>
|
|
346
|
+
<g clip-path="url(#clip0_992_5547)">
|
|
347
|
+
<path
|
|
348
|
+
d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"
|
|
349
|
+
/>
|
|
350
|
+
</g>
|
|
351
|
+
<defs>
|
|
352
|
+
<clipPath id="clip0_992_5547">
|
|
353
|
+
<rect width="24" height="24" />
|
|
354
|
+
</clipPath>
|
|
355
|
+
</defs>
|
|
356
|
+
</svg>
|
|
357
|
+
`,vue=`
|
|
358
|
+
<svg
|
|
359
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
360
|
+
width="24"
|
|
361
|
+
height="24"
|
|
362
|
+
viewBox="0 0 24 24"
|
|
363
|
+
>
|
|
364
|
+
<path
|
|
365
|
+
d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"
|
|
366
|
+
/>
|
|
367
|
+
</svg>
|
|
368
|
+
`,wue=`
|
|
369
|
+
<svg
|
|
370
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
371
|
+
width="32"
|
|
372
|
+
height="32"
|
|
373
|
+
viewBox="0 0 24 24"
|
|
374
|
+
>
|
|
375
|
+
<path
|
|
376
|
+
fill="currentColor"
|
|
377
|
+
d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"
|
|
378
|
+
/>
|
|
379
|
+
</svg>
|
|
380
|
+
`;function kue(e){return e.$from.parent.type.name==="code_block"}function Cue(e){var t;let n=(t=e.$from.node(e.$from.depth-1))==null?void 0:t.type;return n?.name==="list_item"}var WV=e=>{throw TypeError(e)},KV=(e,t,n)=>t.has(e)||WV("Cannot "+n),d0=(e,t,n)=>(KV(e,t,"read from private field"),n?n.call(e):t.get(e)),$V=(e,t,n)=>t.has(e)?WV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Sue=(e,t,n,r)=>(KV(e,t,"write to private field"),t.set(e,n),n),Fh,Qk,LD=class{constructor(){$V(this,Fh,[]),this.clear=()=>(Sue(this,Fh,[]),this),$V(this,Qk,t=>{let n={group:t,addItem:(r,a)=>{let o={...a,key:r};return t.items.push(o),n},clear:()=>(t.items=[],n)};return n}),this.addGroup=(t,n)=>{let a={key:t,label:n,items:[]};return d0(this,Fh).push(a),d0(this,Qk).call(this,a)},this.getGroup=t=>{let n=d0(this,Fh).find(r=>r.key===t);if(!n)throw new Error(`Group with key ${t} not found`);return d0(this,Qk).call(this,n)},this.build=()=>d0(this,Fh)}};Fh=new WeakMap;Qk=new WeakMap;function XV(...e){}function Lue(e,t,n){var r,a,o,i,s,l,u,c,f,d,p,h,g,x,m,y,b,v,w,k,_,E,M,S,U,N,q,ie,fe,he,xe,Ce,Fe,D,st,Ke,T,at,yt,Ut,ln,mt,be,Tt,Dt,vt,I,R,z,ne,j,W,Y,se,K,Z,$,te,le,me,P,G,de,ve,oe,ce,Ee,tt,un,Et,Qt,V,Le,Oe,et,lt,An,cn,wt,Je,zt,Qn,mr,Bu,Xi,Yi,go,rl,$e,En,fn,yn,Vn,Zi,xo,en,Zo,al,Of,cb,fb,Ji,db,pb,rn,ol,zu,hb,rm,Fu,am,om,mb,gb,xb,bb,bo,im,yb;let Sa=n&&GV(n).get(),sm=Sa?.includes(m0.Latex),lm=Sa?.includes(m0.ImageBlock),um=Sa?.includes(m0.Table),Qi=new LD;if(t?.textGroup!==null){let ht=Qi.addGroup("text",(a=(r=t?.textGroup)==null?void 0:r.label)!=null?a:"Text");((o=t?.textGroup)==null?void 0:o.text)!==null&&ht.addItem("text",{label:(l=(s=(i=t?.textGroup)==null?void 0:i.text)==null?void 0:s.label)!=null?l:"Text",icon:(f=(c=(u=t?.textGroup)==null?void 0:u.text)==null?void 0:c.icon)!=null?f:yue,onRun:De=>{let Re=De.get(ge),gt=ba.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt})}}),((d=t?.textGroup)==null?void 0:d.h1)!==null&&ht.addItem("h1",{label:(g=(h=(p=t?.textGroup)==null?void 0:p.h1)==null?void 0:h.label)!=null?g:"Heading 1",icon:(y=(m=(x=t?.textGroup)==null?void 0:x.h1)==null?void 0:m.icon)!=null?y:sue,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:1}})}}),((b=t?.textGroup)==null?void 0:b.h2)!==null&&ht.addItem("h2",{label:(k=(w=(v=t?.textGroup)==null?void 0:v.h2)==null?void 0:w.label)!=null?k:"Heading 2",icon:(M=(E=(_=t?.textGroup)==null?void 0:_.h2)==null?void 0:E.icon)!=null?M:lue,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:2}})}}),((S=t?.textGroup)==null?void 0:S.h3)!==null&&ht.addItem("h3",{label:(q=(N=(U=t?.textGroup)==null?void 0:U.h3)==null?void 0:N.label)!=null?q:"Heading 3",icon:(he=(fe=(ie=t?.textGroup)==null?void 0:ie.h3)==null?void 0:fe.icon)!=null?he:uue,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:3}})}}),((xe=t?.textGroup)==null?void 0:xe.h4)!==null&&ht.addItem("h4",{label:(D=(Fe=(Ce=t?.textGroup)==null?void 0:Ce.h4)==null?void 0:Fe.label)!=null?D:"Heading 4",icon:(T=(Ke=(st=t?.textGroup)==null?void 0:st.h4)==null?void 0:Ke.icon)!=null?T:cue,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:4}})}}),((at=t?.textGroup)==null?void 0:at.h5)!==null&&ht.addItem("h5",{label:(ln=(Ut=(yt=t?.textGroup)==null?void 0:yt.h5)==null?void 0:Ut.label)!=null?ln:"Heading 5",icon:(Tt=(be=(mt=t?.textGroup)==null?void 0:mt.h5)==null?void 0:be.icon)!=null?Tt:fue,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:5}})}}),((Dt=t?.textGroup)==null?void 0:Dt.h6)!==null&&ht.addItem("h6",{label:(R=(I=(vt=t?.textGroup)==null?void 0:vt.h6)==null?void 0:I.label)!=null?R:"Heading 6",icon:(j=(ne=(z=t?.textGroup)==null?void 0:z.h6)==null?void 0:ne.icon)!=null?j:due,onRun:De=>{let Re=De.get(ge),gt=ya.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt,attrs:{level:6}})}}),((W=t?.textGroup)==null?void 0:W.quote)!==null&&ht.addItem("quote",{label:(K=(se=(Y=t?.textGroup)==null?void 0:Y.quote)==null?void 0:se.label)!=null?K:"Quote",icon:(te=($=(Z=t?.textGroup)==null?void 0:Z.quote)==null?void 0:$.icon)!=null?te:xue,onRun:De=>{let Re=De.get(ge),gt=pf.type(De);Re.call(Zn.key),Re.call(bh.key,{nodeType:gt})}}),((le=t?.textGroup)==null?void 0:le.divider)!==null&&ht.addItem("divider",{label:(G=(P=(me=t?.textGroup)==null?void 0:me.divider)==null?void 0:P.label)!=null?G:"Divider",icon:(oe=(ve=(de=t?.textGroup)==null?void 0:de.divider)==null?void 0:ve.icon)!=null?oe:iue,onRun:De=>{let Re=De.get(ge),gt=hf.type(De);Re.call(Zn.key),Re.call(yh.key,{nodeType:gt})}})}if(t?.listGroup!==null){let ht=Qi.addGroup("list",(Ee=(ce=t?.listGroup)==null?void 0:ce.label)!=null?Ee:"List");((tt=t?.listGroup)==null?void 0:tt.bulletList)!==null&&ht.addItem("bullet-list",{label:(Qt=(Et=(un=t?.listGroup)==null?void 0:un.bulletList)==null?void 0:Et.label)!=null?Qt:"Bullet List",icon:(Oe=(Le=(V=t?.listGroup)==null?void 0:V.bulletList)==null?void 0:Le.icon)!=null?Oe:aue,onRun:De=>{let Re=De.get(ge),gt=yu.type(De);Re.call(Zn.key),Re.call(bh.key,{nodeType:gt})}}),((et=t?.listGroup)==null?void 0:et.orderedList)!==null&&ht.addItem("ordered-list",{label:(cn=(An=(lt=t?.listGroup)==null?void 0:lt.orderedList)==null?void 0:An.label)!=null?cn:"Ordered List",icon:(zt=(Je=(wt=t?.listGroup)==null?void 0:wt.orderedList)==null?void 0:Je.icon)!=null?zt:mue,onRun:De=>{let Re=De.get(ge),gt=vu.type(De);Re.call(Zn.key),Re.call(bh.key,{nodeType:gt})}}),((Qn=t?.listGroup)==null?void 0:Qn.taskList)!==null&&ht.addItem("task-list",{label:(Xi=(Bu=(mr=t?.listGroup)==null?void 0:mr.taskList)==null?void 0:Bu.label)!=null?Xi:"Task List",icon:(rl=(go=(Yi=t?.listGroup)==null?void 0:Yi.taskList)==null?void 0:go.icon)!=null?rl:vue,onRun:De=>{let Re=De.get(ge),gt=va.type(De);Re.call(Zn.key),Re.call(bh.key,{nodeType:gt,attrs:{checked:!1}})}})}if(t?.advancedGroup!==null){let ht=Qi.addGroup("advanced",(En=($e=t?.advancedGroup)==null?void 0:$e.label)!=null?En:"Advanced");((fn=t?.advancedGroup)==null?void 0:fn.image)!==null&&lm&&ht.addItem("image",{label:(Zi=(Vn=(yn=t?.advancedGroup)==null?void 0:yn.image)==null?void 0:Vn.label)!=null?Zi:"Image",icon:(Zo=(en=(xo=t?.advancedGroup)==null?void 0:xo.image)==null?void 0:en.icon)!=null?Zo:pue,onRun:De=>{let Re=De.get(ge),gt=R1.type(De);Re.call(Zn.key),Re.call(yh.key,{nodeType:gt})}}),((al=t?.advancedGroup)==null?void 0:al.codeBlock)!==null&&ht.addItem("code",{label:(fb=(cb=(Of=t?.advancedGroup)==null?void 0:Of.codeBlock)==null?void 0:cb.label)!=null?fb:"Code",icon:(pb=(db=(Ji=t?.advancedGroup)==null?void 0:Ji.codeBlock)==null?void 0:db.icon)!=null?pb:oue,onRun:De=>{let Re=De.get(ge),gt=bu.type(De);Re.call(Zn.key),Re.call(Bi.key,{nodeType:gt})}}),((rn=t?.advancedGroup)==null?void 0:rn.table)!==null&&um&&ht.addItem("table",{label:(hb=(zu=(ol=t?.advancedGroup)==null?void 0:ol.table)==null?void 0:zu.label)!=null?hb:"Table",icon:(am=(Fu=(rm=t?.advancedGroup)==null?void 0:rm.table)==null?void 0:Fu.icon)!=null?am:bue,onRun:De=>{let Re=De.get(ge),gt=De.get(it);Re.call(Zn.key);let{from:JC}=gt.state.selection;Re.call(yh.key,{nodeType:Bk(De,3,3)}),Re.call(yT.key,{pos:JC})}}),((om=t?.advancedGroup)==null?void 0:om.math)!==null&&sm&&ht.addItem("math",{label:(xb=(gb=(mb=t?.advancedGroup)==null?void 0:mb.math)==null?void 0:gb.label)!=null?xb:"Math",icon:(im=(bo=(bb=t?.advancedGroup)==null?void 0:bb.math)==null?void 0:bo.icon)!=null?im:wue,onRun:De=>{let Re=De.get(ge),gt=bu.type(De);Re.call(Zn.key),Re.call(yh.key,{nodeType:gt,attrs:{language:"LaTeX"}})}})}(yb=t?.buildMenu)==null||yb.call(t,Qi);let Hu=Qi.build();e&&(Hu=Hu.map(ht=>{let De=ht.items.filter(Re=>Re.label.toLowerCase().includes(e.toLowerCase()));return{...ht,items:De}}).filter(ht=>ht.items.length>0));let cm=Hu.flatMap(ht=>ht.items);return cm.forEach((ht,De)=>{Object.assign(ht,{index:De})}),Hu.reduce((ht,De)=>{let Re=ht+De.items.length;return Object.assign(De,{range:[ht,Re]}),Re},0),{groups:Hu,size:cm.length}}XV(H);var Iue=Yn({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:a}){let o=Ne(),i=aa(()=>Lue(n.value,a,e)),s=Ne(0),l=Ne({x:-999,y:-999}),u=g=>{let{x,y:m}=g;l.value={x,y:m}};jo([i,t],()=>{let{size:g}=i.value;g===0&&t.value?r():s.value>=g&&(s.value=0)});let c=(g,x)=>{let m=s.value,y=typeof g=="function"?g(m):g;x?.(y),s.value=y},f=g=>{var x,m;let y=(x=o.value)==null?void 0:x.querySelector(`[data-index="${g}"]`),b=(m=o.value)==null?void 0:m.querySelector(".menu-groups");!y||!b||(b.scrollTop=y.offsetTop-b.offsetTop)},d=g=>{let x=i.value.groups.flatMap(m=>m.items).at(g);x?.onRun&&e&&x.onRun(e),r()},p=g=>{let{size:x,groups:m}=i.value;if(g.key==="Escape"){g.preventDefault(),r?.();return}if(g.key==="ArrowDown")return g.preventDefault(),c(y=>y<x-1?y+1:y,f);if(g.key==="ArrowUp")return g.preventDefault(),c(y=>y<=0?y:y-1,f);if(g.key==="ArrowLeft")return g.preventDefault(),c(y=>{let b=m.find(w=>w.range[0]<=y&&w.range[1]>y);if(!b)return y;let v=m[m.indexOf(b)-1];return v?v.range[1]-1:y},f);if(g.key==="ArrowRight")return g.preventDefault(),c(y=>{let b=m.find(w=>w.range[0]<=y&&w.range[1]>y);if(!b)return y;let v=m[m.indexOf(b)+1];return v?v.range[0]:y},f);g.key==="Enter"&&(g.preventDefault(),d(s.value))},h=g=>x=>{let m=l.value;if(!m)return;let{x:y,y:b}=x;y===m.x&&b===m.y||c(g)};return dh(()=>{t.value?window.addEventListener("keydown",p,{capture:!0}):window.removeEventListener("keydown",p,{capture:!0})}),ph(()=>{window.removeEventListener("keydown",p,{capture:!0})}),()=>H("div",{ref:o,onPointerdown:g=>g.preventDefault()},H("nav",{class:"tab-group"},H("ul",null,i.value.groups.map(g=>H("li",{key:g.key,onPointerdown:()=>c(g.range[0],f),class:s.value>=g.range[0]&&s.value<g.range[1]?"selected":""},g.label)))),H("div",{class:"menu-groups",onPointermove:u},i.value.groups.map(g=>H("div",{key:g.key,class:"menu-group"},H("h6",null,g.label),H("ul",null,g.items.map(x=>H("li",{key:x.key,"data-index":x.index,class:s.value===x.index?"hover":"",onPointerenter:h(x.index),onPointerdown:()=>{var m,y;(y=(m=o.value)==null?void 0:m.querySelector(`[data-index="${x.index}"]`))==null||y.classList.add("active")},onPointerup:()=>{var m,y;(y=(m=o.value)==null?void 0:m.querySelector(`[data-index="${x.index}"]`))==null||y.classList.remove("active"),d(x.index)}},H(ka,{icon:x.icon}),H("span",null,x.label))))))))}}),YV=e=>{throw TypeError(e)},ZV=(e,t,n)=>t.has(e)||YV("Cannot "+n),Ko=(e,t,n)=>(ZV(e,t,"read from private field"),n?n.call(e):t.get(e)),p0=(e,t,n)=>t.has(e)?YV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Sf=(e,t,n,r)=>(ZV(e,t,"write to private field"),t.set(e,n),n),h0,eC,tC,tl,Hh,JV=qV("CREPE_MENU"),ED=He({show:()=>{},hide:()=>{}},"menuAPICtx");function Aue(e,t){e.set(JV.key,{view:n=>new ID(e,n,t)})}var ID=class{constructor(t,n,r){p0(this,h0),p0(this,eC),p0(this,tC),p0(this,tl),p0(this,Hh,null),this.update=p=>{Ko(this,tl).update(p)},this.show=p=>{Sf(this,Hh,p),Ko(this,tC).value="",Ko(this,tl).show()},this.hide=()=>{Sf(this,Hh,null),Ko(this,tl).hide()},this.destroy=()=>{Ko(this,tl).destroy(),Ko(this,eC).unmount(),Ko(this,h0).remove()};var a,o;let i=document.createElement("div");i.classList.add("milkdown-slash-menu");let s=Ne(!1),l=Ne("");Sf(this,tC,l);let u=this.hide,c=xa(Iue,{ctx:t,config:r,show:s,filter:l,hide:u});Sf(this,eC,c),c.mount(i),Sf(this,h0,i);let f=this,d=(a=r?.slashMenu)!=null?a:{};Sf(this,tl,new jV({content:Ko(this,h0),debounce:20,shouldShow(p){if(kue(p.state.selection)||Cue(p.state.selection))return!1;let h=this.getContent(p,x=>["paragraph","heading"].includes(x.type.name));if(h==null||!Eue(p.state.selection))return!1;let g=Ko(f,Hh);if(l.value=h.startsWith("/")?h.slice(1):h,typeof g=="number"){let x=p.state.doc.nodeSize-2,m=Math.min(g,x);return p.state.doc.resolve(m).node()!==p.state.doc.resolve(p.state.selection.from).node()?(Sf(f,Hh,null),!1):!0}return!!h.startsWith("/")},offset:(o=d.offset)!=null?o:10,middleware:d.middleware,floatingUIOptions:d.floatingUIOptions,root:d.root})),Ko(this,tl).onShow=()=>{s.value=!0},Ko(this,tl).onHide=()=>{s.value=!1},this.update(n),t.set(ED.key,{show:p=>this.show(p),hide:()=>this.hide()})}};h0=new WeakMap;eC=new WeakMap;tC=new WeakMap;tl=new WeakMap;Hh=new WeakMap;function Eue(e){if(!(e instanceof ye))return!1;let{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}XV(H,nn);var _ue=Yn({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){let t=Ne();return()=>H(nn,null,H("div",{ref:t,class:"operation-item",onPointerdown:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.value)==null||r.classList.add("active")},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.value)==null||r.classList.remove("active"),e.onAdd()}},H(ka,{icon:e.addIcon})),H("div",{class:"operation-item"},H(ka,{icon:e.handleIcon})))}}),QV=e=>{throw TypeError(e)},eU=(e,t,n)=>t.has(e)||QV("Cannot "+n),Lf=(e,t,n)=>(eU(e,t,"read from private field"),n?n.call(e):t.get(e)),Zk=(e,t,n)=>t.has(e)?QV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Jk=(e,t,n,r)=>(eU(e,t,"write to private field"),t.set(e,n),n),nC,If,rC,aC,AD=class{constructor(t,n){Zk(this,nC),Zk(this,If),Zk(this,rC),Zk(this,aC),this.update=()=>{Lf(this,If).update()},this.destroy=()=>{Lf(this,If).destroy(),Lf(this,nC).remove(),Lf(this,rC).unmount()},this.onAdd=()=>{let f=Lf(this,aC),d=f.get(it);d.hasFocus()||d.focus();let{state:p,dispatch:h}=d,g=Lf(this,If).active;if(!g)return;let m=g.$pos.pos+g.node.nodeSize,y=p.tr.insert(m,ba.type(f).create());y=y.setSelection(ye.near(y.doc.resolve(m))),h(y.scrollIntoView()),Lf(this,If).hide(),f.get(ED.key).show(y.selection.from)};var r,a,o,i,s;Jk(this,aC,t);let l=document.createElement("div");l.classList.add("milkdown-block-handle");let u=xa(_ue,{onAdd:this.onAdd,addIcon:(r=n?.handleAddIcon)!=null?r:gue,handleIcon:(a=n?.handleDragIcon)!=null?a:hue});u.mount(l),Jk(this,rC,u),Jk(this,nC,l);let c=(o=n?.blockHandle)!=null?o:{};Jk(this,If,new HV({ctx:t,content:l,getOffset:(i=c.getOffset)!=null?i:(()=>16),getPlacement:(s=c.getPlacement)!=null?s:(({active:f,blockDom:d})=>{if(f.node.type.name==="heading")return"left";let p=0;f.node.descendants(k=>{p+=k.childCount});let h=f.el,g=h.getBoundingClientRect(),x=d.getBoundingClientRect(),m=window.getComputedStyle(h),y=Number.parseInt(m.paddingTop,10)||0,b=Number.parseInt(m.paddingBottom,10)||0,v=g.height-y-b,w=x.height;return p>2||w<v?"left-start":"left"}),shouldShow:c.shouldShow,getPosition:c.getPosition,middleware:c.middleware,floatingUIOptions:c.floatingUIOptions,root:c.root})),this.update()}};nC=new WeakMap;If=new WeakMap;rC=new WeakMap;aC=new WeakMap;function Tue(e,t){e.set(n0.key,{filterNodes:n=>!pa(a=>["table","blockquote","math_inline"].includes(a.type.name))(n)}),e.set(r0.key,{view:()=>new AD(e,t)})}var tU=(e,t)=>{e.config(rue(m0.BlockEdit)).config(n=>Tue(n,t)).config(n=>Aue(n,t)).use(ED).use(r0).use(JV)};function Due(e){return e.nodeType===1}function nU(e){return Due(e)&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}var l_e=2**53-1;function Rue(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){let[r,a]=t.pop();if(r>=0){let o=e.nodeDOM(r);if(o&&nU(o)){let{top:i,bottom:s,left:l,right:u}=o.getBoundingClientRect();n.push([r,[l,i,u,i]],[r+a.nodeSize,[l,s,u,s]])}}if(a.isBlock&&!a.isTextblock){let o=r+1;for(let i of a.children)t.push([o,i]),o+=i.nodeSize}}return n}function Mue(e,t){let n=[],r,a,o=()=>{let c=e.dom.getBoundingClientRect(),f=e.state.doc;return n&&r&&a&&c.width===a.width&&c.height===a.height&&c.x===a.x&&c.y===a.y&&r.eq(f)||(a=c,r=f,n=Rue(e)),n},i=(c,f)=>{if(!e.editable||e.isDestroyed)return;let d=(g,x)=>{let[m,y]=g,[b,v]=x;return aU(c,y)-aU(c,v)||m-b},p=o();p.sort(d),p=p.slice(0,8);let h=p.find(g=>t?.({view:e,pos:g[0],event:f})!==!1);if(!(h&&Oue(e,h[0])))return h},s,l;return(c,f)=>(s&&Nue(s,c)||(s=c,l=i(c,f)),l)}function Nue(e,t){return e[0]===t[0]&&e[1]===t[1]}function rU(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function aU(e,t){return Math.min(rU(e,[t[0],t[1]]),rU(e,[t[2],t[3]]))}function Oue(e,t){let n=e.dragging;if(!n)return;let{move:r}=n;if(!r)return;let a=e.state.selection;if(!(a instanceof Ae))return;let{from:o,to:i}=a;return o<=t&&t<=i}function oU(e){let t;return new Be({key:new qe("prosemirror-drop-indicator"),view:n=>(t=Mue(n,e.onDrag),Bue(n,t,e)),props:{handleDrop(n,r,a,o){if(!t)return!1;let i=t([r.clientX,r.clientY],r);if(!i)return!1;r.preventDefault();let s=i[0],l=n.state.tr;if(o){let{node:p}=n.dragging||{};p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(s),c=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,a.content.firstChild):l.replaceRange(u,u,a),l.doc.eq(f))return!0;let d=l.doc.resolve(u);if(c&&Ae.isSelectable(a.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new Ae(d));else{let p=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,x,m)=>p=m),l.setSelection(Pue(n,d,l.doc.resolve(p)))}return n.focus(),n.dispatch(l.setMeta("uiEvent","drop")),!0}}})}function Pue(e,t,n,r){return e.someProp("createSelectionBetween",a=>a(e,t,n))||ye.between(t,n,r)}function Bue(e,t,n){let r=e.dom,a,o,i,s=!1,l=()=>{a&&clearTimeout(a),s=!1,a=setTimeout(()=>{s||n.onHide?.()},30)},u=f=>{s=!0;let{clientX:d,clientY:p}=f;if(o===d&&i===p)return;o=d,i=p;let h=t([d,p],f);if(h){let[g,[x,m,y,b]]=h,v={p1:{x,y:m},p2:{x:y,y:b}};n.onShow?.({view:e,pos:g,line:v})}else{l();return}};return r.addEventListener("dragover",u),r.addEventListener("dragend",l),r.addEventListener("drop",l),r.addEventListener("dragleave",l),{destroy:()=>{r.removeEventListener("dragover",u),r.removeEventListener("dragend",l),r.removeEventListener("drop",l),r.removeEventListener("dragleave",l)}}}var Dr=class e extends Te{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Te.near(r)}content(){return ue.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))}getBookmark(){return new _D(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!zue(t)||!Fue(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let a=n.contentMatchAt(t.index()).defaultType;return a&&a.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&e.valid(t))return t;let a=t.pos,o=null;for(let i=t.depth;;i--){let s=t.node(i);if(n>0?t.indexAfter(i)<s.childCount:t.index(i)>0){o=s.child(n>0?t.indexAfter(i):t.index(i)-1);break}else if(i==0)return null;a+=n;let l=t.doc.resolve(a);if(e.valid(l))return l}for(;;){let i=n>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Ae.isSelectable(o)){t=t.doc.resolve(a+o.nodeSize*n),r=!1;continue e}break}o=i,a+=n;let s=t.doc.resolve(a);if(e.valid(s))return s}return null}}};Dr.prototype.visible=!1;Dr.findFrom=Dr.findGapCursorFrom;Te.jsonID("gapcursor",Dr);var _D=class e{constructor(t){this.pos=t}map(t){return new e(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Dr.valid(n)?new Dr(n):Te.near(n)}};function iU(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function zue(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n-1);;a=a.lastChild){if(a.childCount==0&&!a.inlineContent||iU(a.type))return!0;if(a.inlineContent)return!1}}return!0}function Fue(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n);;a=a.firstChild){if(a.childCount==0&&!a.inlineContent||iU(a.type))return!0;if(a.inlineContent)return!1}}return!0}function sU(){return new Be({props:{decorations:que,createSelectionBetween(e,t,n){return t.pos==n.pos&&Dr.valid(n)?new Dr(n):null},handleClick:Vue,handleKeyDown:Hue,handleDOMEvents:{beforeinput:Uue}}})}var Hue=cx({ArrowLeft:oC("horiz",-1),ArrowRight:oC("horiz",1),ArrowUp:oC("vert",-1),ArrowDown:oC("vert",1)});function oC(e,t){let n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,a,o){let i=r.selection,s=t>0?i.$to:i.$from,l=i.empty;if(i instanceof ye){if(!o.endOfTextblock(n)||s.depth==0)return!1;l=!1,s=r.doc.resolve(t>0?s.after():s.before())}let u=Dr.findGapCursorFrom(s,t,l);return u?(a&&a(r.tr.setSelection(new Dr(u))),!0):!1}}function Vue(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Dr.valid(r))return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY});return a&&a.inside>-1&&Ae.isSelectable(e.state.doc.nodeAt(a.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Dr(r))),!0)}function Uue(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Dr))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let a=re.empty;for(let i=r.length-1;i>=0;i--)a=re.from(r[i].createAndFill(null,a));let o=e.state.tr.replace(n.pos,n.pos,new ue(a,0,0));return o.setSelection(ye.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function que(e){if(!(e.selection instanceof Dr))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ct.create(e.doc,[Ht.widget(e.selection.head,t,{key:"gapcursor"})])}function x0(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-cursor",...t}}),e}var g0=He(null,"dropIndicatorState");x0(g0,{displayName:"Ctx<dropIndicatorState>"});var b0=He({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");x0(b0,{displayName:"Ctx<dropIndicatorConfig>"});var jue=new qe("MILKDOWN_DROP_INDICATOR_DOM"),lU=rt(e=>new Be({key:jue,view:t=>{let n=e.get(b0.key),r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),r.classList.add(n.class),r.classList.add("milkdown-drop-indicator"),t.dom.parentNode?.appendChild(r);let a=e.use(g0.key),o=i=>{$ue(r,i,n)};return a.on(o),{destroy:()=>{a.off(o),r.remove()}}}}));x0(lU,{displayName:"Prose<dropIndicatorDOM>"});function $ue(e,t,n){if(!t){Object.assign(e.style,{display:"none"});return}let{line:r}=t,{width:a}=n,{p1:{x:o,y:i},p2:{x:s,y:l}}=r,u=i===l,c,f,d=i,p=o;u?(c=s-o,f=a,d-=a/2):(c=a,f=l-i,p-=a/2),d=Math.round(d),p=Math.round(p),Object.assign(e.style,{display:"block",width:`${c}px`,height:`${f}px`,transform:`translate(${p}px, ${d}px)`})}var uU=rt(e=>oU({onShow:r=>{e.set(g0.key,r)},onHide:()=>{e.set(g0.key,null)},onDrag:()=>!0}));x0(uU,{displayName:"Prose<dropIndicator>"});var cU=rt(()=>sU());x0(cU,{displayName:"Prose<gapCursor>"});var fU=[cU,b0,g0,lU,uU].flat();function dU(e){var t;let n=(t=e?.skipWarning)!=null?t:!1,r=typeof document>"u"?null:document.createElement("div");return new Be({key:Gue,view:a=>{n!==!0&&Yue(a.state.schema,n||[]);let o=a.dom.ownerDocument;r=r||document.createElement("div");let i=r,s=()=>{Kue(a,i)},l;return window.ResizeObserver&&(l=new window.ResizeObserver(()=>s()),l.observe(a.dom)),o.addEventListener("selectionchange",s),{update:()=>{s()},destroy:()=>{o.removeEventListener("selectionchange",s),l&&l.unobserve(a.dom)}}},props:{handleKeyDown:(a,o)=>{var i;let{selection:s}=a.state;if(o.altKey||o.ctrlKey||o.metaKey||o.shiftKey||o.isComposing||!["ArrowLeft","ArrowRight"].includes(o.key)||!TD(s)||!s.empty)return!1;let l=s.$head,[u,c]=pU(l),f=a.state.storedMarks||l.marks();if(u&&c&&!Ye.sameSet(u,c)){if(o.key==="ArrowLeft"&&!Ye.sameSet(u,f))return a.dispatch(a.state.tr.setStoredMarks(u)),!0;if(o.key==="ArrowRight"&&!Ye.sameSet(c,f))return a.dispatch(a.state.tr.setStoredMarks(c)),!0}return o.key==="ArrowLeft"&&l.textOffset===1?(a.dispatch(a.state.tr.setSelection(ye.create(a.state.doc,l.pos-1)).setStoredMarks(l.marks())),!0):o.key==="ArrowRight"&&l.textOffset+1===((i=l.parent.maybeChild(l.index()))==null?void 0:i.nodeSize)?(a.dispatch(a.state.tr.setSelection(ye.create(a.state.doc,l.pos+1)).setStoredMarks(l.marks())),!0):!1},decorations:a=>{if(!(!r||!TD(a.selection)||!a.selection.empty))return Ct.create(a.doc,[Ht.widget(0,r,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}var Gue=new qe("prosemirror-virtual-cursor");function Wue(e,t){var n;let r=window.getSelection();if(!r||!r.rangeCount)return null;let a=(n=r?.getRangeAt(0))==null?void 0:n.cloneRange();if(!a)return null;a.collapse(t);let o=a.getClientRects(),i=o?.length?o[o.length-1]:null;return i?.height?i:e.coordsAtPos(e.state.selection.head)}function pU(e){let t=e.index(),n=e.parent.maybeChild(t),r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[r?.marks,n?.marks]}function TD(e){return e&&typeof e=="object"&&"$cursor"in e}function Kue(e,t){if(!e||!e.dom||e.isDestroyed||!t)return;let{state:n,dom:r}=e,{selection:a}=n;if(!TD(a))return;let o=Wue(e,a.$head===a.$from);if(!o)return t;let i=r.getBoundingClientRect(),s="prosemirror-virtual-cursor",l=n.selection.$head,[u,c]=pU(l),f=n.storedMarks||l.marks();a.$cursor&&u&&c&&f&&!Ye.sameSet(u,c)&&(Ye.sameSet(u,f)?s+=" prosemirror-virtual-cursor-left":Ye.sameSet(c,f)&&(s+=" prosemirror-virtual-cursor-right")),t.className=s,Xue(t,"prosemirror-virtual-cursor-animation"),t.style.height=`${o.bottom-o.top}px`,t.style.left=`${o.left-i.left}px`,t.style.top=`${o.top-i.top}px`}function Xue(e,t){e.classList.remove(t),e.offsetWidth,e.classList.add(t)}function Yue(e,t){for(let[n,r]of Object.entries(e.marks))r.spec.inclusive===!1&&!t.includes(n)&&console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function Zue(e){return e.use("FeaturesCtx")}function Jue(e){return t=>{Zue(t).update(n=>n.includes(e)?n:[...n,e])}}var hU=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(hU||{}),mU=(e,t)=>{if(e.config(Jue(hU.Cursor)).config(r=>{r.update(b0.key,()=>{var a,o;return{class:"crepe-drop-cursor",width:(a=t?.width)!=null?a:4,color:(o=t?.color)!=null?o:!1}})}).use(fU),t?.virtual===!1)return;let n=dU({skipWarning:["inlineCode"]});e.use(rt(()=>n))};var y0,v0,w0,Vh,Uh,qh,Hi,k0,C0,S0,jh,Au,$h,L0,I0,gU,A0=(gU=class{constructor(e){X(this,y0);X(this,v0);X(this,w0);X(this,Vh);X(this,Uh);X(this,qh);X(this,Hi);X(this,k0);X(this,C0);X(this,S0);X(this,jh);X(this,Au);X(this,$h);X(this,L0);X(this,I0);B(this,qh,!1),this.onShow=()=>{},this.onHide=()=>{},B(this,Au,t=>{zr(t,this.element,{placement:L(this,Vh).placement??"top",middleware:[zl(),Pa(L(this,C0)),xv(L(this,S0)),...L(this,w0)],...L(this,Vh)}).then(({x:n,y:r})=>{Object.assign(this.element.style,{left:`${n}px`,top:`${r}px`})}).catch(console.error)}),B(this,$h,t=>L(this,Uh)!==t.dom.parentElement),B(this,L0,(t,n)=>{var p;let{state:r,composing:a}=t,{selection:o,doc:i}=r,{ranges:s}=o,l=Math.min(...s.map(h=>h.$from.pos)),u=Math.max(...s.map(h=>h.$to.pos)),c=h=>!!h&&h.doc.eq(i)&&h.selection.eq(o),f=c(n)&&c(L(this,k0));if(L(this,qh)||((L(this,Uh)??t.dom.parentElement??document.body).appendChild(this.element),B(this,qh,!0)),a||f)return;if(B(this,k0,r),(p=L(this,Hi))==null||p.call(this),B(this,Hi,void 0),!L(this,v0).call(this,t,n)){this.hide();return}let d={getBoundingClientRect:()=>Bc(t,l,u),contextElement:t.dom};L(this,$h).call(this,t)?B(this,Hi,Sg(d,this.element,()=>L(this,Au).call(this,d))):L(this,Au).call(this,d),this.show()}),this.update=(t,n)=>{L(this,jh).call(this,t,n)},B(this,I0,t=>{let{doc:n,selection:r}=t.state,{empty:a,from:o,to:i}=r,s=!n.textBetween(o,i).length&&t.state.selection instanceof ye,l=this.element.contains(document.activeElement),u=!t.hasFocus()&&!l,c=!t.editable;return!(u||a||s||c)}),this.destroy=()=>{var t;(t=L(this,Hi))==null||t.call(this),L(this,jh).cancel()},this.show=(t,n)=>{var r;if(this.element.dataset.show="true",t){(r=L(this,Hi))==null||r.call(this),B(this,Hi,void 0);let a={...t,contextElement:n?.dom};n&&L(this,$h).call(this,n)?B(this,Hi,Sg(a,this.element,()=>L(this,Au).call(this,a))):L(this,Au).call(this,a)}this.onShow()},this.hide=()=>{this.element.dataset.show!=="false"&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,B(this,y0,e.debounce??200),B(this,v0,e.shouldShow??L(this,I0)),B(this,C0,e.offset),B(this,S0,e.shift),B(this,w0,e.middleware??[]),B(this,Vh,e.floatingUIOptions??{}),B(this,Uh,e.root),this.element.dataset.show="false",B(this,jh,mu(L(this,L0),L(this,y0)))}},y0=new WeakMap,v0=new WeakMap,w0=new WeakMap,Vh=new WeakMap,Uh=new WeakMap,qh=new WeakMap,Hi=new WeakMap,k0=new WeakMap,C0=new WeakMap,S0=new WeakMap,jh=new WeakMap,Au=new WeakMap,$h=new WeakMap,L0=new WeakMap,I0=new WeakMap,gU);function Gh(e){let t=He({},`${e}_TOOLTIP_SPEC`),n=rt(a=>{let o=a.get(t.key);return new Be({key:new qe(`${e}_TOOLTIP`),...o})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}var Que=Object.defineProperty,xU=Object.getOwnPropertySymbols,ece=Object.prototype.hasOwnProperty,tce=Object.prototype.propertyIsEnumerable,bU=(e,t,n)=>t in e?Que(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nce=(e,t)=>{for(var n in t||(t={}))ece.call(t,n)&&bU(e,n,t[n]);if(xU)for(var n of xU(t))tce.call(t,n)&&bU(e,n,t[n]);return e};function Tf(e,t){return Object.assign(e,{meta:nce({package:"@milkdown/components"},t)}),e}var rce=Object.defineProperty,yU=Object.getOwnPropertySymbols,ace=Object.prototype.hasOwnProperty,oce=Object.prototype.propertyIsEnumerable,vU=(e,t,n)=>t in e?rce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OD=(e,t)=>{for(var n in t||(t={}))ace.call(t,n)&&vU(e,n,t[n]);if(yU)for(var n of yU(t))oce.call(t,n)&&vU(e,n,t[n]);return e},ice={mode:"preview"},Du=He(OD({},ice),"linkTooltipStateCtx");Tf(Du,{displayName:"State<link-tooltip>",group:"LinkTooltip"});var sce={addLink:()=>{},editLink:()=>{},removeLink:()=>{}},Kh=He(OD({},sce),"linkTooltipAPICtx");Tf(Du,{displayName:"API<link-tooltip>",group:"LinkTooltip"});var lce={linkIcon:"\u{1F517}",editButton:"\u270E",removeButton:"\u232B",confirmButton:"Confirm \u23CE",onCopyLink:()=>{},inputPlaceholder:"Paste link..."},_f=He(OD({},lce),"linkTooltipConfigCtx");Tf(Du,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});var PD=Se("ToggleLink",e=>()=>t=>{let{doc:n,selection:r}=t,a=Va.type(e);return n.rangeHasMark(r.from,r.to,a)?(e.get(Kh.key).removeLink(r.from,r.to),!0):(e.get(Kh.key).addLink(r.from,r.to),!0)}),O0=Gh("LINK_PREVIEW");Tf(O0[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"});Tf(O0[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});var yC=Gh("LINK_EDIT");Tf(yC[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"});Tf(yC[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"});function BD(...e){}BD(H);function N0({icon:e,class:t,onClick:n}){return H("span",{class:Tr("milkdown-icon",t),onPointerdown:n,innerHTML:e?Po.sanitize(e.trim()):void 0})}N0.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var uce=Kp("abcdefghijklmnopqrstuvwxyz0123456789",8);function cce(e){return`${e}-${uce()}`}BD(H);var fce=Yn({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){let a=Ne(t),o=cce("milkdown-link-edit");jo(t,l=>{a.value=l});let i=()=>{n(a.value)},s=l=>{l.stopPropagation(),l.key==="Enter"&&(l.preventDefault(),i()),l.key==="Escape"&&(l.preventDefault(),r())};return()=>H("div",{class:"link-edit"},H("input",{id:o,class:"input-area",placeholder:e.value.inputPlaceholder,onKeydown:s,onInput:l=>{a.value=l.target.value},value:a.value}),a.value?H(N0,{class:"button confirm",icon:e.value.confirmButton,onClick:i}):null)}}),dce=Object.defineProperty,pce=Object.defineProperties,hce=Object.getOwnPropertyDescriptors,wU=Object.getOwnPropertySymbols,mce=Object.prototype.hasOwnProperty,gce=Object.prototype.propertyIsEnumerable,AU=e=>{throw TypeError(e)},kU=(e,t,n)=>t in e?dce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iC=(e,t)=>{for(var n in t||(t={}))mce.call(t,n)&&kU(e,n,t[n]);if(wU)for(var n of wU(t))gce.call(t,n)&&kU(e,n,t[n]);return e},CU=(e,t)=>pce(e,hce(t)),EU=(e,t,n)=>t.has(e)||AU("Cannot "+n),At=(e,t,n)=>(EU(e,t,"read from private field"),n?n.call(e):t.get(e)),mo=(e,t,n)=>t.has(e)?AU("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Af=(e,t,n,r)=>(EU(e,t,"write to private field"),t.set(e,n),n),Wh,_u,Tu,sC,E0,lC,nl,uC,DD,cC,RD,fC,SU={from:-1,to:-1,mark:null},MD=class{constructor(t,n){this.ctx=t,mo(this,Wh),mo(this,_u),mo(this,Tu,iC({},SU)),mo(this,sC),mo(this,E0),mo(this,lC,Ne("")),mo(this,nl,()=>{At(this,cC).call(this),At(this,_u).hide(),this.ctx.update(Du.key,o=>CU(iC({},o),{mode:"preview"})),Af(this,Tu,iC({},SU))}),mo(this,uC,o=>{let i=o.target;i&&(At(this,Wh).contains(i)||At(this,nl).call(this))}),mo(this,DD,()=>{document.addEventListener("pointerdown",At(this,uC),!0)}),mo(this,cC,()=>{document.removeEventListener("pointerdown",At(this,uC),!0)}),mo(this,RD,o=>{let i=this.ctx.get(it),{from:s,to:l,mark:u}=At(this,Tu),c=Va.type(this.ctx),f=Sk(o);if(u&&u.attrs.href===f){At(this,nl).call(this);return}let d=i.state.tr;if(u&&d.removeMark(s,l,u),s===l){if(!f){At(this,nl).call(this);return}let p=c.create({href:f});d.insertText(f,s),d.addMark(s,s+f.length,p)}else d.addMark(s,l,c.create({href:f}));i.dispatch(d),At(this,nl).call(this)}),mo(this,fC,(o,i,s)=>{let l=this.ctx.get(_f.key);At(this,E0).value=l,At(this,lC).value=o,this.ctx.update(Du.key,c=>CU(iC({},c),{mode:"edit"}));let u=this.ctx.get(it);u.dispatch(u.state.tr.setSelection(ye.create(u.state.doc,i,s))),At(this,_u).show({getBoundingClientRect:()=>Bc(u,i,s)},u),At(this,DD).call(this),requestAnimationFrame(()=>{var c;(c=At(this,Wh).querySelector("input"))==null||c.focus()})}),this.update=o=>{let{state:i}=o,{selection:s}=i;if(!(s instanceof ye))return;let{from:l,to:u}=s;l===At(this,Tu).from&&u===At(this,Tu).to||At(this,nl).call(this)},this.destroy=()=>{At(this,cC).call(this),At(this,sC).unmount(),At(this,_u).destroy(),At(this,Wh).remove()},this.addLink=(o,i)=>{Af(this,Tu,{from:o,to:i,mark:null}),At(this,fC).call(this,"",o,i)},this.editLink=(o,i,s)=>{Af(this,Tu,{from:i,to:s,mark:o}),At(this,fC).call(this,o.attrs.href,i,s)},this.removeLink=(o,i)=>{let s=this.ctx.get(it),l=s.state.tr;l.removeMark(o,i,Va.type(this.ctx)),s.dispatch(l),At(this,nl).call(this)},Af(this,E0,Ne(this.ctx.get(_f.key)));let r=document.createElement("div");r.className="milkdown-link-edit";let a=xa(fce,{config:At(this,E0),src:At(this,lC),onConfirm:At(this,RD),onCancel:At(this,nl)});a.mount(r),Af(this,sC,a),Af(this,Wh,r),Af(this,_u,new A0({content:r,debounce:0,shouldShow:()=>!1})),At(this,_u).onHide=()=>{requestAnimationFrame(()=>{n.dom.focus({preventScroll:!0})})},At(this,_u).update(n)}};Wh=new WeakMap;_u=new WeakMap;Tu=new WeakMap;sC=new WeakMap;E0=new WeakMap;lC=new WeakMap;nl=new WeakMap;uC=new WeakMap;DD=new WeakMap;cC=new WeakMap;RD=new WeakMap;fC=new WeakMap;var xce=Object.defineProperty,bce=Object.defineProperties,yce=Object.getOwnPropertyDescriptors,LU=Object.getOwnPropertySymbols,vce=Object.prototype.hasOwnProperty,wce=Object.prototype.propertyIsEnumerable,IU=(e,t,n)=>t in e?xce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kce=(e,t)=>{for(var n in t||(t={}))vce.call(t,n)&&IU(e,n,t[n]);if(LU)for(var n of LU(t))wce.call(t,n)&&IU(e,n,t[n]);return e},Cce=(e,t)=>bce(e,yce(t));function Sce(e){let t;e.update(Kh.key,n=>Cce(kce({},n),{addLink:(r,a)=>{t?.addLink(r,a)},editLink:(r,a,o)=>{t?.editLink(r,a,o)},removeLink:(r,a)=>{t?.removeLink(r,a)}})),e.set(yC.key,{view:n=>(t=new MD(e,n),t)})}function Lce(e,t,n,r,a){let o={start:-1,end:-1};return n.nodesBetween(r,a,(i,s)=>{if(o.start>-1)return!1;o.start===-1&&e.isInSet(i.marks)&&t===i&&(o={start:s,end:s+Math.max(i.textContent.length,1)})}),o}function Ice(e,t,n){let r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;let{pos:a}=r,o=t.state.doc.nodeAt(a);if(!o)return;let i=o.marks.find(l=>l.type===Va.mark.type(e));if(!(!i||!O0.pluginKey()))return{show:!0,pos:a,node:o,mark:i}}BD(H);var Ace=Yn({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){let a=aa(()=>Sk(t.value)),o=l=>{l.preventDefault(),l.stopPropagation(),n.value()},i=l=>{l.preventDefault(),l.stopPropagation(),r.value()},s=l=>{l.preventDefault();let u=t.value;navigator.clipboard&&u&&navigator.clipboard.writeText(u).then(()=>{e.value.onCopyLink(u)}).catch(c=>console.error(c))};return()=>H("div",{class:"link-preview"},H(N0,{class:"button link-icon",icon:e.value.linkIcon,onClick:s}),H("a",{href:a.value,target:"_blank",rel:"noopener noreferrer",class:"link-display"},t.value),H(N0,{class:"button link-edit-button",icon:e.value.editButton,onClick:o}),H(N0,{class:"button link-remove-button",icon:e.value.removeButton,onClick:i}))}}),_U=e=>{throw TypeError(e)},TU=(e,t,n)=>t.has(e)||_U("Cannot "+n),pt=(e,t,n)=>(TU(e,t,"read from private field"),n?n.call(e):t.get(e)),Ca=(e,t,n)=>t.has(e)?_U("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Eu=(e,t,n,r)=>(TU(e,t,"write to private field"),t.set(e,n),n),Ef,Xo,_0,T0,dC,pC,hC,D0,mC,R0,gC,xC,bC,M0,ND=class{constructor(t,n){this.ctx=t,Ca(this,Ef),Ca(this,Xo),Ca(this,_0),Ca(this,T0),Ca(this,dC,Ne("")),Ca(this,pC,Ne(()=>{})),Ca(this,hC,Ne(()=>{})),Ca(this,D0),Ca(this,mC),Ca(this,R0,!1),Ca(this,gC,({mode:r})=>{r==="edit"&&pt(this,M0).call(this)}),Ca(this,xC,()=>{Eu(this,R0,!0)}),Ca(this,bC,()=>{Eu(this,R0,!1)}),Ca(this,M0,()=>{pt(this,Xo).hide(),pt(this,Xo).element.removeEventListener("mouseenter",pt(this,xC)),pt(this,Xo).element.removeEventListener("mouseleave",pt(this,bC))}),this.show=(r,a,o,i)=>{pt(this,T0).value=this.ctx.get(_f.key),pt(this,dC).value=r.attrs.href,pt(this,pC).value=()=>{this.ctx.get(Kh.key).editLink(r,a,o)},pt(this,hC).value=()=>{this.ctx.get(Kh.key).removeLink(a,o),pt(this,M0).call(this)},pt(this,Xo).show({getBoundingClientRect:()=>i},pt(this,mC)),pt(this,Xo).element.addEventListener("mouseenter",pt(this,xC)),pt(this,Xo).element.addEventListener("mouseleave",pt(this,bC))},this.hide=()=>{pt(this,R0)||pt(this,M0).call(this)},this.update=()=>{},this.destroy=()=>{pt(this,D0).unmount(),pt(this,_0).off(pt(this,gC)),pt(this,Xo).destroy(),pt(this,Ef).remove()},Eu(this,mC,n),Eu(this,T0,Ne(this.ctx.get(_f.key))),Eu(this,D0,xa(Ace,{config:pt(this,T0),src:pt(this,dC),onEdit:pt(this,pC),onRemove:pt(this,hC)})),Eu(this,Ef,document.createElement("div")),pt(this,Ef).className="milkdown-link-preview",pt(this,D0).mount(pt(this,Ef)),Eu(this,Xo,new A0({debounce:0,content:pt(this,Ef),shouldShow:()=>!1})),pt(this,Xo).update(n),Eu(this,_0,t.use(Du.key)),pt(this,_0).on(pt(this,gC))}};Ef=new WeakMap;Xo=new WeakMap;_0=new WeakMap;T0=new WeakMap;dC=new WeakMap;pC=new WeakMap;hC=new WeakMap;D0=new WeakMap;mC=new WeakMap;R0=new WeakMap;gC=new WeakMap;xC=new WeakMap;bC=new WeakMap;M0=new WeakMap;function Ece(e){let t,r=Ys((o,i)=>{if(!t||!o.hasFocus()||e.get(Du.key).mode==="edit")return;let l=Ice(e,o,i);if(l){let u=o.state.doc.resolve(l.pos),c=Lce(l.mark,l.node,o.state.doc,u.before(),u.after()),f=c.start,d=c.end;t.show(l.mark,f,d,Bc(o,f,d));return}t.hide()},50),a=()=>{setTimeout(()=>{t?.hide()},50)};e.set(O0.key,{props:{handleDOMEvents:{mousemove:r,mouseleave:a}},view:o=>(t=new ND(e,o),t)})}function DU(e){Ece(e),Sce(e)}var RU=[Du,Kh,_f,O0,yC,PD].flat();Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function _ce(e){return e.use("FeaturesCtx")}function Tce(e){return t=>{_ce(t).update(n=>n.includes(e)?n:[...n,e])}}var Dce=`
|
|
381
|
+
<svg
|
|
382
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
383
|
+
width="24"
|
|
384
|
+
height="24"
|
|
385
|
+
viewBox="0 0 24 24"
|
|
386
|
+
fill="none"
|
|
387
|
+
>
|
|
388
|
+
<g clip-path="url(#clip0_1013_1606)">
|
|
389
|
+
<path
|
|
390
|
+
d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"
|
|
391
|
+
fill="#817567"
|
|
392
|
+
/>
|
|
393
|
+
</g>
|
|
394
|
+
<defs>
|
|
395
|
+
<clipPath id="clip0_1013_1606">
|
|
396
|
+
<rect width="24" height="24" />
|
|
397
|
+
</clipPath>
|
|
398
|
+
</defs>
|
|
399
|
+
</svg>
|
|
400
|
+
`,Rce=`
|
|
401
|
+
<svg
|
|
402
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
403
|
+
height="24px"
|
|
404
|
+
viewBox="0 -960 960 960"
|
|
405
|
+
width="24px"
|
|
406
|
+
fill="none"
|
|
407
|
+
>
|
|
408
|
+
<path
|
|
409
|
+
d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
|
|
410
|
+
/>
|
|
411
|
+
</svg>
|
|
412
|
+
`,Mce=`
|
|
413
|
+
<svg
|
|
414
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
415
|
+
width="24"
|
|
416
|
+
height="24"
|
|
417
|
+
viewBox="0 0 24 24"
|
|
418
|
+
>
|
|
419
|
+
<g clip-path="url(#clip0_1013_1585)">
|
|
420
|
+
<path
|
|
421
|
+
d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"
|
|
422
|
+
/>
|
|
423
|
+
</g>
|
|
424
|
+
<defs>
|
|
425
|
+
<clipPath id="clip0_1013_1585">
|
|
426
|
+
<rect width="24" height="24" />
|
|
427
|
+
</clipPath>
|
|
428
|
+
</defs>
|
|
429
|
+
</svg>
|
|
430
|
+
`,Nce=`
|
|
431
|
+
<svg
|
|
432
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
433
|
+
width="24"
|
|
434
|
+
height="24"
|
|
435
|
+
viewBox="0 0 24 24"
|
|
436
|
+
>
|
|
437
|
+
<path
|
|
438
|
+
d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"
|
|
439
|
+
/>
|
|
440
|
+
</svg>
|
|
441
|
+
`,MU=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(MU||{}),NU=(e,t)=>{e.config(Tce(MU.LinkTooltip)).config(DU).config(n=>{n.update(_f.key,r=>{var a,o,i,s,l,u;return{...r,linkIcon:(a=t?.linkIcon)!=null?a:Rce,editButton:(o=t?.editButton)!=null?o:Mce,removeButton:(i=t?.removeButton)!=null?i:Nce,confirmButton:(s=t?.confirmButton)!=null?s:Dce,inputPlaceholder:(l=t?.inputPlaceholder)!=null?l:"Paste link...",onCopyLink:(u=t?.onCopyLink)!=null?u:(()=>{})}})}).use(RU)};var Oce=Object.defineProperty,OU=Object.getOwnPropertySymbols,Pce=Object.prototype.hasOwnProperty,Bce=Object.prototype.propertyIsEnumerable,PU=(e,t,n)=>t in e?Oce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zce=(e,t)=>{for(var n in t||(t={}))Pce.call(t,n)&&PU(e,n,t[n]);if(OU)for(var n of OU(t))Bce.call(t,n)&&PU(e,n,t[n]);return e};function BU(e,t){return Object.assign(e,{meta:zce({package:"@milkdown/components"},t)}),e}var Fce={renderLabel:({label:e,listType:t,checked:n})=>n==null?t==="bullet"?"\u29BF":e:n?"\u2611":"\u25A1"},P0=He(Fce,"listItemBlockConfigCtx");BU(P0,{displayName:"Config<list-item-block>",group:"ListItemBlock"});function zU(...e){}zU(H);function FU({icon:e,class:t,onClick:n}){return H("span",{class:Tr("milkdown-icon",t),onPointerdown:n,innerHTML:e?Po.sanitize(e.trim()):void 0})}FU.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};zU(H);var Hce=Yn({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:r,readonly:a,setAttr:o,onMount:i,selected:s}){let l=d=>{d!=null&&d instanceof Element&&i(d)},u=d=>{t.value!=null&&(d.stopPropagation(),d.preventDefault(),o("checked",!t.value))},c=aa(()=>r.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:a.value})),f=aa(()=>t.value==null?n.value==="bullet"?"bullet":"ordered":t.value?"checked":"unchecked");return()=>H("li",{class:Tr("list-item",s.value&&"ProseMirror-selectednode")},H("div",{class:"label-wrapper",onPointerdown:u,contenteditable:!1},H(FU,{class:Tr("label",a.value&&"readonly",f.value),icon:c.value})),H("div",{class:"children",ref:l}))}}),vC=new WeakMap;function Vce(e,t,n){let r=vC.get(e);if(!r){let a=new Map;r=a,vC.set(e,a),requestAnimationFrame(()=>{if(vC.delete(e),e.isDestroyed)return;let{state:o}=e,i=o.doc.content.size,s;for(let f of a.values())f.anchor<=i&&f.head<=i&&(s=f);if(!s)return;let l=o.doc.resolve(s.anchor),u=o.doc.resolve(s.head),c=ye.between(l,u);e.dispatch(o.tr.setSelection(c))})}r.delete(t),r.set(t,n)}var HU=Xp(va.node,e=>(t,n,r)=>{let a=document.createElement("div");a.className="milkdown-list-item-block";let o=document.createElement("div");o.setAttribute("data-content-dom","true"),o.classList.add("content-dom");let i=Ne(t.attrs.label),s=Ne(t.attrs.checked),l=Ne(t.attrs.listType),u=Ne(!n.editable),c=e.get(P0.key),f=Ne(!1),d=(b,v)=>{if(!n.editable)return;let w=r();w!=null&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(w,b,v)))},p=dh(()=>{f.value?a.classList.add("selected"):a.classList.remove("selected")}),h=null,x=xa(Hce,{label:i,checked:s,listType:l,readonly:u,config:c,selected:f,setAttr:d,onMount:b=>{if(b===h)return;h=b;let{anchor:v,head:w}=n.state.selection;b.appendChild(o),Vce(n,a,{anchor:v,head:w})}});x.mount(a);let m=b=>{l.value=b.attrs.listType,i.value=b.attrs.label,s.value=b.attrs.checked,u.value=!n.editable};m(t);let y=t;return{dom:a,contentDOM:o,update:b=>b.type!==t.type?!1:(b.sameMarkup(y)&&b.content.eq(y.content)||(y=b,m(b)),!0),ignoreMutation:b=>!a||!o?!0:b.type==="selection"?!1:o===b.target&&b.type==="attributes"?!0:!o.contains(b.target),selectNode:()=>{f.value=!0},deselectNode:()=>{f.value=!1},destroy:()=>{var b;(b=vC.get(n))==null||b.delete(a),p(),x.unmount(),a.remove(),o.remove()}}});BU(HU,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});var VU=[P0,HU];Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function Uce(e){return e.use("FeaturesCtx")}function qce(e){return t=>{Uce(t).update(n=>n.includes(e)?n:[...n,e])}}var jce=`
|
|
442
|
+
<svg
|
|
443
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
444
|
+
width="24"
|
|
445
|
+
height="24"
|
|
446
|
+
viewBox="0 0 24 24"
|
|
447
|
+
>
|
|
448
|
+
<g clip-path="url(#clip0_952_6527)">
|
|
449
|
+
<circle cx="12" cy="12" r="3" />
|
|
450
|
+
</g>
|
|
451
|
+
<defs>
|
|
452
|
+
<clipPath id="clip0_952_6527">
|
|
453
|
+
<rect width="24" height="24" />
|
|
454
|
+
</clipPath>
|
|
455
|
+
</defs>
|
|
456
|
+
</svg>
|
|
457
|
+
`,$ce=`
|
|
458
|
+
<svg
|
|
459
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
460
|
+
width="24"
|
|
461
|
+
height="24"
|
|
462
|
+
viewBox="0 0 24 24"
|
|
463
|
+
>
|
|
464
|
+
<g clip-path="url(#clip0_1803_1151)">
|
|
465
|
+
<path
|
|
466
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"
|
|
467
|
+
/>
|
|
468
|
+
</g>
|
|
469
|
+
<defs>
|
|
470
|
+
<clipPath id="clip0_1803_1151">
|
|
471
|
+
<rect width="24" height="24" />
|
|
472
|
+
</clipPath>
|
|
473
|
+
</defs>
|
|
474
|
+
</svg>
|
|
475
|
+
`,Gce=`
|
|
476
|
+
<svg
|
|
477
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
478
|
+
width="24"
|
|
479
|
+
height="24"
|
|
480
|
+
viewBox="0 0 24 24"
|
|
481
|
+
>
|
|
482
|
+
<g clip-path="url(#clip0_1803_535)">
|
|
483
|
+
<path
|
|
484
|
+
d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"
|
|
485
|
+
/>
|
|
486
|
+
</g>
|
|
487
|
+
<defs>
|
|
488
|
+
<clipPath id="clip0_1803_535">
|
|
489
|
+
<rect width="24" height="24" />
|
|
490
|
+
</clipPath>
|
|
491
|
+
</defs>
|
|
492
|
+
</svg>
|
|
493
|
+
`,UU=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(UU||{});function Wce(e,t){e.set(P0.key,{renderLabel:({label:n,listType:r,checked:a})=>{var o,i,s;return a==null?r==="bullet"?(o=t?.bulletIcon)!=null?o:jce:n:a?(i=t?.checkBoxCheckedIcon)!=null?i:$ce:(s=t?.checkBoxUncheckedIcon)!=null?s:Gce}})}var qU=(e,t)=>{e.config(qce(UU.ListItem)).config(n=>Wce(n,t)).use(VU)};Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function Kce(e){return e.get("CrepeCtx")}function Xce(e){return e.use("FeaturesCtx")}function Yce(e){return t=>{Xce(t).update(n=>n.includes(e)?n:[...n,e])}}function Zce(e){return e.$from.parent.type.name==="code_block"}function Jce(e){var t;let n=(t=e.$from.node(e.$from.depth-1))==null?void 0:t.type;return n?.name==="list_item"}var jU=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(jU||{});function Qce(e){var t;return e.childCount<=1&&!((t=e.firstChild)!=null&&t.content.size)}function efe(e,t){let{selection:n}=e;if(!n.empty)return null;let r=n.$anchor,a=r.parent;if(a.content.size>0||pa(s=>s.type.name==="table")(r))return null;let i=r.before();return Ht.node(i,i+a.nodeSize,{class:"crepe-placeholder","data-placeholder":t})}var zD=He({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),tfe=rt(e=>new Be({key:new qe("CREPE_PLACEHOLDER"),props:{decorations:t=>{var n;if(Kce(e).readonly)return null;let a=e.get(zD.key);if(a.mode==="doc"&&!Qce(t.doc)||Zce(t.selection)||Jce(t.selection))return null;let o=(n=a.text)!=null?n:"Please enter...",i=efe(t,o);return i?Ct.create(t.doc,[i]):null}}})),$U=(e,t)=>{e.config(Yce(jU.Placeholder)).config(n=>{t&&n.update(zD.key,r=>({...r,...t}))}).use(tfe).use(zD)};var nfe=Object.defineProperty,GU=Object.getOwnPropertySymbols,rfe=Object.prototype.hasOwnProperty,afe=Object.prototype.propertyIsEnumerable,WU=(e,t,n)=>t in e?nfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ofe=(e,t)=>{for(var n in t||(t={}))rfe.call(t,n)&&WU(e,n,t[n]);if(GU)for(var n of GU(t))afe.call(t,n)&&WU(e,n,t[n]);return e};function ZU(e,t){return Object.assign(e,{meta:ofe({package:"@milkdown/components"},t)}),e}var ife=Object.defineProperty,KU=Object.getOwnPropertySymbols,sfe=Object.prototype.hasOwnProperty,lfe=Object.prototype.propertyIsEnumerable,XU=(e,t,n)=>t in e?ife(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ufe=(e,t)=>{for(var n in t||(t={}))sfe.call(t,n)&&XU(e,n,t[n]);if(KU)for(var n of KU(t))lfe.call(t,n)&&XU(e,n,t[n]);return e},cfe={renderButton:e=>{switch(e){case"add_row":return"+";case"add_col":return"+";case"delete_row":return"-";case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":return"=";case"row_drag_handle":return"="}}},B0=He(ufe({},cfe),"tableBlockConfigCtx");ZU(B0,{displayName:"Config<table-block>",group:"TableBlock"});function JU(...e){}JU(H);function Vi({icon:e,class:t,onClick:n}){return H("span",{class:Tr("milkdown-icon",t),onPointerdown:n,innerHTML:e?Po.sanitize(e.trim()):void 0})}Vi.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};function QU(e){let{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:a,xLineHandleRef:o,colHandleRef:i,rowHandleRef:s}=e,l=t.value;if(!l)return;let u=n.value;if(!u)return;let c=r.value;if(!c)return;let f=c.querySelector("tbody");if(!f)return;let d=l.querySelector("tbody");if(!d)return;let p=a.value;if(!p)return;let h=o.value;if(!h)return;let g=i.value;if(!g)return;let x=s.value;return x?{preview:l,wrapper:u,content:c,contentRoot:f,previewRoot:d,yHandle:p,xHandle:h,colHandle:g,rowHandle:x}:void 0}function eq(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function tq(e,t,n,r,a){let{width:o,height:i}=r.querySelector("tbody").getBoundingClientRect();if(e==="y"){let l=r.querySelectorAll("tr")[a];if(!l)return;n.appendChild(l.cloneNode(!0));let u=l.getBoundingClientRect().height;Object.assign(t.style,{width:`${o}px`,height:`${u}px`}),t.dataset.show="true";return}if(e==="x"){let s=r.querySelectorAll("tr"),l;Array.from(s).forEach(u=>{let c=u.children[a];if(!c)return;l===void 0&&(l=c.getBoundingClientRect().width);let f=c.parentElement.cloneNode(!1),d=c.cloneNode(!0);f.appendChild(d),n.appendChild(f)}),Object.assign(t.style,{width:`${l}px`,height:`${i}px`}),t.dataset.show="true";return}}function ffe(e,t){return n=>{rq(e,n,t,r=>{nq("y",n,r,e);let{preview:a,content:o,previewRoot:i}=r;eq(i);let{hoverIndex:s}=e,[l]=s.value;tq("y",a,i,o,l)})}}function dfe(e,t){return n=>{rq(e,n,t,r=>{nq("x",n,r,e);let{preview:a,content:o,previewRoot:i}=r,{hoverIndex:s}=e,[l,u]=s.value;eq(i),tq("x",a,i,o,u)})}}function nq(e,t,n,r){let{xHandle:a,yHandle:o,colHandle:i,rowHandle:s,preview:l}=n;a.dataset.displayType=e==="y"?"indicator":"none",o.dataset.displayType=e==="x"?"indicator":"none",e==="y"?(i.dataset.show="false",YU(s)):(s.dataset.show="false",YU(i));let{hoverIndex:u,dragInfo:c}=r,[f,d]=u.value;c.value={startCoords:[t.clientX,t.clientY],startIndex:e==="y"?f:d,endIndex:e==="y"?f:d,type:e==="y"?"row":"col"},l.dataset.direction=e==="y"?"vertical":"horizontal"}function rq(e,t,n,r){let a=n?.get(it);if(!a?.editable)return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move");let o=QU(e);o&&requestAnimationFrame(()=>{r(o)})}function YU(e){var t;(t=e.querySelector(".button-group"))==null||t.setAttribute("data-show","false")}function FD(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return-1}function pfe(e,t){var n,r,a;if(t)try{let o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return;let i=o?.inside;if(i==null||i<0)return;let s=t.state.doc.resolve(i),l=t.state.doc.nodeAt(i);if(!l)return;let u=["table_cell","table_header"],c=["table_row","table_header_row"],f=u.includes(l.type.name)?l:(n=pa(x=>u.includes(x.type.name))(s))==null?void 0:n.node,d=(r=pa(x=>c.includes(x.type.name))(s))==null?void 0:r.node,p=(a=pa(x=>x.type.name==="table")(s))==null?void 0:a.node;if(!f||!d||!p)return;let h=FD(d,f);return[FD(p,d),h]}catch{return}}function wC(e,[t,n]){let r=e.value;if(!r)return;let a=r.querySelectorAll("tr"),o=a[t];if(!o)return;let i=a[0];if(!i)return;let s=i.children[n];if(!s)return;let l=o.children[n];if(l)return{row:o,col:l,headerCol:s}}function hfe(e,t,n){if(!n||!t)return;let{selection:r}=t.state;if(!(r instanceof Bt))return;let{$from:a}=r,o=ku(a);if(!(!o||o.node!==n)){if(r.isColSelection()){let{$head:i}=r,s=i.index(i.depth-1);UD({refs:e,index:[0,s],before:l=>{var u;(u=l.querySelector(".button-group"))==null||u.setAttribute("data-show","true")}});return}if(r.isRowSelection()){let{$head:i}=r,s=pa(u=>u.type.name==="table_row"||u.type.name==="table_header_row")(i);if(!s)return;let l=FD(o.node,s.node);qD({refs:e,index:[l,0],before:u=>{var c;l>0&&((c=u.querySelector(".button-group"))==null||c.setAttribute("data-show","true"))}})}}}function UD({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:a,colHandleRef:o,hoverIndex:i}=e,s=o.value;if(!s)return;i.value=t;let l=wC(a,t);if(!l)return;let{headerCol:u}=l;s.dataset.show="true",n&&n(s),zr(u,s,{placement:"top"}).then(({x:c,y:f})=>{Object.assign(s.style,{left:`${c}px`,top:`${f}px`}),r&&r(s)}).catch(console.error)}function qD({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:a,rowHandleRef:o,hoverIndex:i}=e,s=o.value;if(!s)return;i.value=t;let l=wC(a,t);if(!l)return;let{row:u}=l;s.dataset.show="true",n&&n(s),zr(u,s,{placement:"left"}).then(({x:c,y:f})=>{Object.assign(s.style,{left:`${c}px`,top:`${f}px`}),r&&r(s)}).catch(console.error)}function aq(e,t,n){let r=n==="x"?"left":"top",a=n==="x"?"right":"bottom",o=e.length-1,i=e.findIndex((l,u)=>{let c=l.getBoundingClientRect(),f=c[r],d=c[a];return f<=t&&t<=d||u===o&&t>d||u===0&&t<f}),s=e[i];return s?[s,i]:void 0}function mfe(e,t){let n=e.querySelector("tr");if(!n)return;let r=Array.from(n.children);return aq(r,t,"x")}function gfe(e,t){let n=Array.from(e.querySelectorAll("tr"));return aq(n,t,"y")}function xfe(e){return mu(t=>{let n=QU(e);if(!n)return;let{preview:r,content:a,contentRoot:o,xHandle:i,yHandle:s}=n,{dragInfo:l,hoverIndex:u}=e;if(r.dataset.show==="false")return;let c=wC(e.contentWrapperRef,u.value);if(!c||!o.querySelector("tr"))return;let d=l.value;if(!d||!o.offsetParent)return;let p=o.offsetParent.offsetTop,h=o.offsetParent.offsetLeft;if(d.type==="col"){let g=c.col.getBoundingClientRect().width,{left:x,width:m}=o.getBoundingClientRect(),y=h-x,b=t.clientX+y-g/2,[v]=d.startCoords,w=v<t.clientX?"right":"left";r.style.top=`${p}px`;let k=b<x+y-20?x+y-20:b>x+m+y-g+20?x+m+y-g+20:b;r.style.left=`${k}px`;let _=mfe(o,t.clientX);if(_){let[E,M]=_,S=s.getBoundingClientRect().width,U=a.getBoundingClientRect();d.endIndex=M,zr(E,s,{placement:w==="left"?"left":"right",middleware:[Pa(w==="left"?-1*S:0)]}).then(({x:N})=>{s.dataset.show="true",Object.assign(s.style,{height:`${U.height}px`,left:`${N}px`,top:`${p}px`})}).catch(console.error)}}else if(d.type==="row"){let g=c.row.getBoundingClientRect().height,{top:x,height:m}=o.getBoundingClientRect(),y=p-x,b=t.clientY+y-g/2,[v,w]=d.startCoords,k=w<t.clientY?"down":"up",_=b<x+y-20?x+y-20:b>x+m+y-g+20?x+m+y-g+20:b;r.style.top=`${_}px`,r.style.left=`${h}px`;let E=gfe(o,t.clientY);if(E){let[M,S]=E,U=i.getBoundingClientRect().height,N=a.getBoundingClientRect();d.endIndex=S,zr(M,i,{placement:k==="up"?"top":"bottom",middleware:[Pa(k==="up"?-1*U:0)]}).then(({y:q})=>{i.dataset.show="true",Object.assign(i.style,{width:`${N.width}px`,top:`${q}px`})}).catch(console.error)}}},20)}function bfe(e,t,n){let{dragPreviewRef:r,yLineHandleRef:a,xLineHandleRef:o,dragInfo:i}=e,s=ffe(e,t),l=dfe(e,t),u=()=>{let d=r.value;if(!d||d.dataset.show==="false")return;let p=d?.querySelector("tbody");for(;p?.firstChild;)p?.removeChild(p.firstChild);d&&(d.dataset.show="false")},c=()=>{var d;let p=r.value;if(!p)return;let h=a.value;if(!h)return;let g=o.value;if(!g)return;let x=i.value;if(!x||!t||p.dataset.show==="false"||!e.colHandleRef.value||!e.rowHandleRef.value||(h.dataset.show="false",g.dataset.show="false",x.startIndex===x.endIndex))return;let b=t.get(ge),v={from:x.startIndex,to:x.endIndex,pos:((d=n?.())!=null?d:0)+1};if(x.type==="col"){b.call(Su.key,{pos:v.pos,index:x.startIndex}),b.call(Fk.key,v);let w=[0,x.endIndex];UD({refs:e,index:w})}else{b.call(Cu.key,{pos:v.pos,index:x.startIndex}),b.call(zk.key,v);let w=[x.endIndex,0];qD({refs:e,index:w})}requestAnimationFrame(()=>{t.get(it).focus()})},f=xfe(e);return L1(()=>{window.addEventListener("dragover",f),window.addEventListener("dragend",u),window.addEventListener("drop",c)}),ph(()=>{window.removeEventListener("dragover",f),window.removeEventListener("dragend",u),window.removeEventListener("drop",c)}),{dragRow:s,dragCol:l}}function yfe(e,t,n){let{xLineHandleRef:r,contentWrapperRef:a,colHandleRef:o,rowHandleRef:i,hoverIndex:s,lineHoverIndex:l}=e;return{onAddRow:()=>{var g,x,m;if(!t)return;let y=r.value;if(!y)return;let[b]=l.value;if(b<0||!t.get(it).editable)return;let v=Array.from((x=(g=a.value)==null?void 0:g.querySelectorAll("tr"))!=null?x:[]),w=t.get(ge),k=((m=n?.())!=null?m:0)+1;v.length===b?(w.call(Cu.key,{pos:k,index:b-1}),w.call(jk.key)):(w.call(Cu.key,{pos:k,index:b}),w.call(qk.key)),w.call(Cu.key,{pos:k,index:b}),y.dataset.show="false"},onAddCol:()=>{var g,x,m,y;if(!t||!r.value)return;let[v,w]=l.value;if(w<0||!t.get(it).editable)return;let k=Array.from((m=(x=(g=a.value)==null?void 0:g.querySelector("tr"))==null?void 0:x.children)!=null?m:[]),_=t.get(ge),E=((y=n?.())!=null?y:0)+1;k.length===w?(_.call(Su.key,{pos:E,index:w-1}),_.call(Uk.key)):(_.call(Su.key,{pos:E,index:w}),_.call(Vk.key)),_.call(Su.key,{pos:E,index:w})},selectCol:()=>{var g,x;if(!t)return;let[m,y]=s.value,b=t.get(ge),v=((g=n?.())!=null?g:0)+1;b.call(Su.key,{pos:v,index:y});let w=(x=o.value)==null?void 0:x.querySelector(".button-group");w&&(w.dataset.show=w.dataset.show==="true"?"false":"true")},selectRow:()=>{var g,x;if(!t)return;let[m,y]=s.value,b=t.get(ge),v=((g=n?.())!=null?g:0)+1;b.call(Cu.key,{pos:v,index:m});let w=(x=i.value)==null?void 0:x.querySelector(".button-group");w&&m>0&&(w.dataset.show=w.dataset.show==="true"?"false":"true")},deleteSelected:g=>{if(!t||!t.get(it).editable)return;g.preventDefault(),g.stopPropagation(),t.get(ge).call(Hk.key),requestAnimationFrame(()=>{t.get(it).focus()})},onAlign:g=>x=>{if(!t||!t.get(it).editable)return;x.preventDefault(),x.stopPropagation(),t.get(ge).call($k.key,g),requestAnimationFrame(()=>{t.get(it).focus()})}}}function vfe(e,t){return mu(n=>{if(!t?.editable)return;let{contentWrapperRef:r,yLineHandleRef:a,xLineHandleRef:o,colHandleRef:i,rowHandleRef:s,hoverIndex:l,lineHoverIndex:u}=e,c=a.value;if(!c)return;let f=o.value;if(!f)return;let d=r.value;if(!d)return;let p=s.value;if(!p)return;let h=i.value;if(!h)return;let g=pfe(n,t);if(!g)return;let x=wC(r,g);if(!x)return;let[m,y]=g,b=x.col.getBoundingClientRect(),v=Math.abs(n.clientX-b.left)<8,w=Math.abs(b.right-n.clientX)<8,k=Math.abs(n.clientY-b.top)<8,_=Math.abs(b.bottom-n.clientY)<8,E=v||w||k||_,M=p.querySelector(".button-group"),S=h.querySelector(".button-group");if(M&&(M.dataset.show="false"),S&&(S.dataset.show="false"),E){let U=d.getBoundingClientRect();p.dataset.show="false",h.dataset.show="false",f.dataset.displayType="tool",c.dataset.displayType="tool";let N=c.getBoundingClientRect().width,q=f.getBoundingClientRect().height;v||w?(u.value[1]=v?y:y+1,zr(x.col,c,{placement:v?"left":"right",middleware:[Pa(v?-1*N:0)]}).then(({x:ie})=>{c.dataset.show="true",Object.assign(c.style,{height:`${U.height}px`,left:`${ie}px`})}).catch(console.error)):c.dataset.show="false",g[0]!==0&&(k||_)?(u.value[0]=k?m:m+1,zr(x.row,f,{placement:k?"top":"bottom",middleware:[Pa(k?-1*q:0)]}).then(({y:ie})=>{f.dataset.show="true",Object.assign(f.style,{width:`${U.width}px`,top:`${ie}px`})}).catch(console.error)):f.dataset.show="false";return}u.value=[-1,-1],c.dataset.show="false",f.dataset.show="false",p.dataset.show="true",h.dataset.show="true",qD({refs:e,index:g}),UD({refs:e,index:g}),l.value=g},20)}function wfe(e){return()=>{let{rowHandleRef:t,colHandleRef:n,yLineHandleRef:r,xLineHandleRef:a}=e;setTimeout(()=>{let o=t.value;if(!o)return;let i=n.value;if(!i)return;let s=r.value;if(!s)return;let l=a.value;l&&(o.dataset.show="false",i.dataset.show="false",s.dataset.show="false",l.dataset.show="false")},200)}}function kfe(e,t){let n=vfe(e,t),r=wfe(e);return{pointerMove:n,pointerLeave:r}}JU(H);var Cfe=Yn({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:a,onMount:o}){let i=Ne(),s=N=>{N!=null&&(N instanceof HTMLElement?(i.value=N,o(N)):i.value=void 0)},l=Ne(),u=Ne(),c=Ne(),f=Ne(),d=Ne(),p=Ne(),h=Ne([0,0]),g=Ne([-1,-1]),x=Ne(),m={dragPreviewRef:p,tableWrapperRef:d,contentWrapperRef:i,yLineHandleRef:f,xLineHandleRef:c,colHandleRef:l,rowHandleRef:u,hoverIndex:h,lineHoverIndex:g,dragInfo:x},{pointerLeave:y,pointerMove:b}=kfe(m,e),{dragRow:v,dragCol:w}=bfe(m,n,r),{onAddRow:k,onAddCol:_,selectCol:E,selectRow:M,deleteSelected:S,onAlign:U}=yfe(m,n,r);return L1(()=>{requestAnimationFrame(()=>{e.editable&&hfe(m,e,t.value)})}),()=>H("div",{onDragstart:N=>N.preventDefault(),onDragover:N=>N.preventDefault(),onDragleave:N=>N.preventDefault(),onPointermove:b,onPointerleave:y},H("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:w,onClick:E,onPointerdown:N=>N.stopPropagation(),onPointermove:N=>N.stopPropagation(),ref:l},H(Vi,{icon:a.renderButton("col_drag_handle")}),H("div",{"data-show":"false",class:"button-group",onPointermove:N=>N.stopPropagation()},H("button",{type:"button",onPointerdown:U("left")},H(Vi,{icon:a.renderButton("align_col_left")})),H("button",{type:"button",onPointerdown:U("center")},H(Vi,{icon:a.renderButton("align_col_center")})),H("button",{type:"button",onPointerdown:U("right")},H(Vi,{icon:a.renderButton("align_col_right")})),H("button",{type:"button",onPointerdown:S},H(Vi,{icon:a.renderButton("delete_col")})))),H("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:v,onClick:M,onPointerdown:N=>N.stopPropagation(),onPointermove:N=>N.stopPropagation(),ref:u},H(Vi,{icon:a.renderButton("row_drag_handle")}),H("div",{"data-show":"false",class:"button-group",onPointermove:N=>N.stopPropagation()},H("button",{type:"button",onPointerdown:S},H(Vi,{icon:a.renderButton("delete_row")})))),H("div",{class:"table-wrapper",ref:d},H("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:p},H("table",null,H("tbody",null))),H("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:N=>N.stopPropagation(),ref:c},H("button",{type:"button",onClick:k,class:"add-button"},H(Vi,{icon:a.renderButton("add_row")}))),H("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:N=>N.stopPropagation(),ref:f},H("button",{type:"button",onClick:_,class:"add-button"},H(Vi,{icon:a.renderButton("add_col")}))),H("table",{ref:s,class:"children"})))}}),oq=e=>{throw TypeError(e)},Sfe=(e,t,n)=>t.has(e)||oq("Cannot "+n),Lfe=(e,t,n)=>t.has(e)?oq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ife=(e,t,n)=>(Sfe(e,t,"access private method"),n),HD,iq,VD=class{constructor(t,n,r,a){this.ctx=t,this.node=n,this.view=r,this.getPos=a,Lfe(this,HD);let o=document.createElement("div");o.className="milkdown-table-block";let i=document.createElement("tbody");this.contentDOM=i,i.setAttribute("data-content-dom","true"),i.classList.add("content-dom"),this.nodeRef=ih(n);let s=xa(Cfe,{view:r,ctx:t,getPos:a,config:t.get(B0.key),onMount:l=>{l.appendChild(i)},node:this.nodeRef});s.mount(o),this.app=s,this.dom=o}update(t){return t.type!==this.node.type||t.sameMarkup(this.node)&&t.content.eq(this.node.content)?!1:(this.node=t,this.nodeRef.value=t,!0)}stopEvent(t){if(t.type==="drop"||t.type.startsWith("drag"))return!0;if(t.type==="mousedown"||t.type==="pointerdown"){if(t.target instanceof Element&&t.target.closest("button"))return!0;let n=t.target;if(n instanceof HTMLElement&&(n.closest("th")||n.closest("td"))){let r=t;return Ife(this,HD,iq).call(this,r)}}return!1}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:t.type==="selection"?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}};HD=new WeakSet;iq=function(e){let t=this.view;if(!t.editable)return!1;let{state:n,dispatch:r}=t,a=t.posAtCoords({left:e.clientX,top:e.clientY});if(!a)return!1;let o=n.doc.resolve(a.inside),i=pa(u=>u.type.name==="table_cell"||u.type.name==="table_header")(o);if(!i)return!1;if(n.selection instanceof ye){let u=pa(c=>c.type.name==="table_cell"||c.type.name==="table_header")(n.selection.$from);if(u?.node===i.node)return!1}let{from:s}=i,l=Ae.create(n.doc,s+1);return n.selection.eq(l)?!1:(n.selection instanceof Bt?setTimeout(()=>{r(n.tr.setSelection(l).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(l).scrollIntoView())}),!0)};var sq=Xp($o.node,e=>(t,n,r)=>new VD(e,t,n,r));ZU(sq,{displayName:"NodeView<table-block>",group:"TableBlock"});var lq=[B0,sq];Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function Afe(e){return e.use("FeaturesCtx")}function Efe(e){return t=>{Afe(t).update(n=>n.includes(e)?n:[...n,e])}}var _fe=`
|
|
494
|
+
<svg
|
|
495
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
496
|
+
width="24"
|
|
497
|
+
height="24"
|
|
498
|
+
viewBox="0 0 24 24"
|
|
499
|
+
>
|
|
500
|
+
<path
|
|
501
|
+
d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
|
|
502
|
+
/>
|
|
503
|
+
</svg>
|
|
504
|
+
`,Tfe=`
|
|
505
|
+
<svg
|
|
506
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
507
|
+
width="24"
|
|
508
|
+
height="24"
|
|
509
|
+
viewBox="0 0 24 24"
|
|
510
|
+
>
|
|
511
|
+
<path
|
|
512
|
+
d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
|
|
513
|
+
/>
|
|
514
|
+
</svg>
|
|
515
|
+
`,Dfe=`
|
|
516
|
+
<svg
|
|
517
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
518
|
+
width="24"
|
|
519
|
+
height="24"
|
|
520
|
+
viewBox="0 0 24 24"
|
|
521
|
+
>
|
|
522
|
+
<path
|
|
523
|
+
d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"
|
|
524
|
+
/>
|
|
525
|
+
</svg>
|
|
526
|
+
`,uq=`
|
|
527
|
+
<svg
|
|
528
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
529
|
+
width="16"
|
|
530
|
+
height="16"
|
|
531
|
+
viewBox="0 0 16 16"
|
|
532
|
+
>
|
|
533
|
+
<path
|
|
534
|
+
d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"
|
|
535
|
+
/>
|
|
536
|
+
</svg>
|
|
537
|
+
`,cq=`
|
|
538
|
+
<svg
|
|
539
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
540
|
+
width="24"
|
|
541
|
+
height="24"
|
|
542
|
+
viewBox="0 0 24 24"
|
|
543
|
+
>
|
|
544
|
+
<g clip-path="url(#clip0_971_7676)">
|
|
545
|
+
<path
|
|
546
|
+
d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"
|
|
547
|
+
/>
|
|
548
|
+
</g>
|
|
549
|
+
<defs>
|
|
550
|
+
<clipPath id="clip0_971_7676">
|
|
551
|
+
<rect width="24" height="24" />
|
|
552
|
+
</clipPath>
|
|
553
|
+
</defs>
|
|
554
|
+
</svg>
|
|
555
|
+
`,fq=`
|
|
556
|
+
<svg
|
|
557
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
558
|
+
width="24"
|
|
559
|
+
height="24"
|
|
560
|
+
viewBox="0 0 24 24"
|
|
561
|
+
>
|
|
562
|
+
<path
|
|
563
|
+
d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"
|
|
564
|
+
/>
|
|
565
|
+
</svg>
|
|
566
|
+
`,dq=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(dq||{}),pq=(e,t)=>{e.config(Efe(dq.Table)).config(n=>{n.update(B0.key,r=>({...r,renderButton:a=>{var o,i,s,l,u,c,f,d,p;switch(a){case"add_row":return(o=t?.addRowIcon)!=null?o:cq;case"add_col":return(i=t?.addColIcon)!=null?i:cq;case"delete_row":return(s=t?.deleteRowIcon)!=null?s:fq;case"delete_col":return(l=t?.deleteColIcon)!=null?l:fq;case"align_col_left":return(u=t?.alignLeftIcon)!=null?u:Tfe;case"align_col_center":return(c=t?.alignCenterIcon)!=null?c:_fe;case"align_col_right":return(f=t?.alignRightIcon)!=null?f:Dfe;case"col_drag_handle":return(d=t?.colDragHandleIcon)!=null?d:uq;case"row_drag_handle":return(p=t?.rowDragHandleIcon)!=null?p:uq}}}))}).use(lq)};function Rfe(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return n==null&&(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}var bq={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-Rfe(e.type),compareTokens:(e,t)=>e===t};function jD(e,t,n,r,a){for(let o=0,i=0;o<e.childCount;o++){let s=e.child(o),l=i+s.nodeSize,u=Math.max(i,n),c=Math.min(l,r);if(u<c)if(s.isText)for(let f=u;f<c;f++)a.push(t.encodeCharacter(s.text.charCodeAt(f-i),s.marks));else s.isLeaf?a.push(t.encodeNodeStart(s)):(u==i&&a.push(t.encodeNodeStart(s)),jD(s.content,t,Math.max(i+1,u)-i-1,Math.min(l-1,c)-i-1,a),c==l&&a.push(t.encodeNodeEnd(s)));i=l}return a}var hq=2500,mq=1e4;function Mfe(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function yq(e,t,n,r=bq){if(Math.max(n.toA-n.fromA,n.toB-n.fromB)>mq){let i=e.cut(n.fromA,n.toA),s=t.cut(n.fromB,n.toB),l=i.findDiffStart(s);if(l==null)return[];let u=i.findDiffEnd(s);if(n=n.slice(l,u.a,l,u.b),Math.max(n.toA-n.fromA,n.toB-n.fromB)>mq)return[n]}let a=jD(e,r,n.fromA,n.toA,[]),o=jD(t,r,n.fromB,n.toB,[]);return Nfe(a,o,n,r.compareTokens)}function Nfe(e,t,n,r){let a=0,o=e.length,i=t.length;for(;a<e.length&&a<t.length&&r(e[a],t[a]);)a++;if(a==e.length&&a==t.length)return[];for(;o>a&&i>a&&r(e[o-1],t[i-1]);)o--,i--;if(o==a&&i==a)return[];if(o==a||i==a||o==i&&o==a+1||Math.max(o,i)-a>hq)return[n.slice(a,o,a,i)];let s=o-a,l=i-a,u=Math.min(hq,s+l),c=[],f=new Int16Array((u+1)*2).fill(-1);for(let d=0;d<=u;d++){for(let p=-d;p<=d;p+=2){let h=f[p+1+u],g=f[p-1+u],x=h<g?g:h+1,m=x+p;for(;x<s&&m<l&&r(e[a+x],t[a+m]);)x++,m++;if(f[p+u]=x,x>=s&&m>=l){let y=[],b=Mfe(o-a,i-a),v=-1,w=-1,k=-1,_=-1,E=(M,S,U,N)=>{v>-1&&v<S+b?(v=M,k=U):(v>-1&&y.push(n.slice(v,w,k,_)),v=M,w=S,k=U,_=N)};for(let M=d-1;M>=0;M--){let S=f[p+1+u],U=f[p-1+u];S<U?(p--,x=U+a,m=x+p,E(x,x,m,m+1)):(p++,x=S+a,m=x+p,E(x,x+1,m,m)),f=c[M>>1]}return v>-1&&y.push(n.slice(v,w,k,_)),y.reverse()}}d%2==0&&c.push(f.slice())}return[n.slice(a,o,a,i)]}var On=class e{constructor(t,n){this.length=t,this.data=n}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(n==0&&r==e.len(t))return t;let a=[];for(let o=0,i=0;i<r;o++){let s=t[o],l=i+s.length,u=Math.min(r,l)-Math.max(n,i);u>0&&a.push(s.cut(u)),i=l}return a}static join(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let a=r(t[t.length-1].data,n[0].data);if(a==null)return t.concat(n);let o=t.slice(0,t.length-1);o.push(new e(t[t.length-1].length+n[0].length,a));for(let i=1;i<n.length;i++)o.push(n[i]);return o}static len(t){let n=0;for(let r=0;r<t.length;r++)n+=t[r].length;return n}};On.none=[];var Ui=class e{constructor(t,n,r,a,o,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=a,this.deleted=o,this.inserted=i}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(t,n,r,a){return t==0&&r==0&&n==this.toA-this.fromA&&a==this.toB-this.fromB?this:new e(this.fromA+t,this.fromA+n,this.fromB+r,this.fromB+a,On.slice(this.deleted,t,n),On.slice(this.inserted,r,a))}static merge(t,n,r){if(t.length==0)return n;if(n.length==0)return t;let a=[];for(let o=0,i=0,s=t[0],l=n[0];;){if(!s&&!l)return a;if(s&&(!l||s.toB<l.fromA)){let u=i?n[i-1].toB-n[i-1].toA:0;a.push(u==0?s:new e(s.fromA,s.toA,s.fromB+u,s.toB+u,s.deleted,s.inserted)),s=o++==t.length?null:t[o]}else if(l&&(!s||l.toA<s.fromB)){let u=o?t[o-1].toB-t[o-1].toA:0;a.push(u==0?l:new e(l.fromA-u,l.toA-u,l.fromB,l.toB,l.deleted,l.inserted)),l=i++==n.length?null:n[i]}else{let u=Math.min(s.fromB,l.fromA),c=Math.min(s.fromA,l.fromA-(o?t[o-1].toB-t[o-1].toA:0)),f=c,d=Math.min(l.fromB,s.fromB+(i?n[i-1].toB-n[i-1].toA:0)),p=d,h=On.none,g=On.none,x=!1,m=!1;for(;;){let y=s?u>=s.fromB?s.toB:s.fromB:2e8,b=l?u>=l.fromA?l.toA:l.fromA:2e8,v=Math.min(y,b),w=s&&u>=s.fromB,k=l&&u>=l.fromA;if(!w&&!k)break;w&&u==s.fromB&&!x&&(h=On.join(h,s.deleted,r),f+=s.lenA,x=!0),w&&!k&&(g=On.join(g,On.slice(s.inserted,u-s.fromB,v-s.fromB),r),p+=v-u),k&&u==l.fromA&&!m&&(g=On.join(g,l.inserted,r),p+=l.lenB,m=!0),k&&!w&&(h=On.join(h,On.slice(l.deleted,u-l.fromA,v-l.fromA),r),f+=v-u),w&&v==s.toB&&(s=o++==t.length?null:t[o],x=!1),k&&v==l.toA&&(l=i++==n.length?null:n[i],m=!1),u=v}(c<f||d<p)&&a.push(new e(c,f,d,p,h,g))}}}static fromJSON(t){return new e(t.fromA,t.toA,t.fromB,t.toB,t.deleted.map(n=>new On(n.length,n.data)),t.inserted.map(n=>new On(n.length,n.data)))}toJSON(){return this}},Ofe;try{Ofe=new RegExp("[\\p{Alphabetic}_]","u")}catch{}var Xh=class e{constructor(t,n){this.config=t,this.changes=n}addSteps(t,n,r){let a=[];for(let l=0;l<n.length;l++){let u=Array.isArray(r)?r[l]:r,c=0;n[l].forEach((f,d,p,h)=>{a.push(new Ui(f+c,d+c,p,h,f==d?On.none:[new On(d-f,u)],p==h?On.none:[new On(h-p,u)])),c=h-p-(d-f)})}if(a.length==0)return this;let o=$D(a,this.config.combine),i=Ui.merge(this.changes,o,this.config.combine),s=i;for(let l=0;l<s.length;l++){let u=s[l];if(u.fromA==u.toA||u.fromB==u.toB||!o.some(f=>f.toB>u.fromB&&f.fromB<u.toB))continue;let c=yq(this.config.doc.content,t.content,u,this.config.encoder);c.length==1&&c[0].fromB==0&&c[0].toB==u.toB-u.fromB||(s==i&&(s=i.slice()),c.length==1?s[l]=c[0]:(s.splice(l,1,...c),l+=c.length-1))}return new e(this.config,s)}get startDoc(){return this.config.doc}map(t){let n=r=>{let a=t(r);return a===r.data?r:new On(r.length,a)};return new e(this.config,this.changes.map(r=>new Ui(r.fromA,r.toA,r.fromB,r.toB,r.deleted.map(n),r.inserted.map(n))))}changedRange(t,n){if(t==this)return null;let r=n&&Pfe(n),a=r?r.toB-r.fromB-(r.toA-r.fromA):0;function o(f){return!r||f<=r.fromA?f:f+a}let i=r?r.fromB:2e8,s=r?r.toB:-2e8;function l(f,d=f){i=Math.min(f,i),s=Math.max(d,s)}let u=this.changes,c=t.changes;for(let f=0,d=0;f<u.length&&d<c.length;){let p=u[f],h=c[d];p&&h&&Bfe(p,h,o)?(f++,d++):h&&(!p||o(p.fromB)>=h.fromB)?(l(h.fromB,h.toB),d++):(l(o(p.fromB),o(p.toB)),f++)}return i<=s?{from:i,to:s}:null}static create(t,n=(o,i)=>o===i?o:null,r=bq,a=[]){return new e({combine:n,doc:t,encoder:r},a)}};Xh.computeDiff=yq;function $D(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let a=n+r>>1;return Ui.merge($D(e,t,n,a),$D(e,t,a,r),t)}function gq(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let a=e[r];t!=2e8&&(t=a.map(t,-1),n=a.map(n,1)),a.forEach((o,i,s,l)=>{t=Math.min(t,s),n=Math.max(n,l)})}return t==2e8?null:{from:t,to:n}}function Pfe(e){let t=gq(e);if(!t)return null;let n=gq(e.map(r=>r.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}function Bfe(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&xq(e.deleted,t.deleted)&&xq(e.inserted,t.inserted)}function xq(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function qi(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-diff",...t}}),e}var vq=500;function zfe(e={}){let t=new WeakMap,n=new WeakMap;function r(a){let o=t.get(a);if(o!=null)return o;let i=a.attrs,s=i?Object.keys(i).filter(l=>i[l]!=null).sort():[];if(s.length===0)o=a.type.name;else{let l={};for(let u of s)l[u]=i[u];o=`${a.type.name}:${JSON.stringify(l)}`}return t.set(a,o),o}return{encodeCharacter:(a,o)=>{if(o.length===0)return a;let i=n.get(o);return i==null&&(i=o.map(r).join(","),n.set(o,i)),`${a}:${i}`},encodeNodeStart:a=>{let o=a.attrs;if(o&&Object.keys(o).length>0){let i=e[a.type.name]??[],s=Object.keys(o).filter(l=>{if(i.includes(l))return!1;let u=a.type.spec.attrs?.[l]?.default;return o[l]!==u});if(s.length>0){let l={};for(let u of s.sort())l[u]=o[u];return`${a.type.name}:${JSON.stringify(l)}`}}return a.type.name},encodeNodeEnd:a=>{let o=a.type.schema,i=o.cached.changeSetIDs||(o.cached.changeSetIDs=Object.create(null)),s=i[a.type.name];return s==null&&(i[a.type.name]=s=Object.keys(o.nodes).indexOf(a.type.name)+1),-s},compareTokens:(a,o)=>a===o}}function Sq(e,t,n){let r=n.get(e);if(r!=null)return r;let a=[String(t.encodeNodeStart(e))];if(e.isText){let i=e.text;for(let s=0;s<i.length;s++)a.push(":"+String(t.encodeCharacter(i.charCodeAt(s),e.marks)))}else e.content.forEach(i=>{a.push("/"+Sq(i,t,n))});a.push("\\"+String(t.encodeNodeEnd(e)));let o=a.join("");return n.set(e,o),o}function wq(e,t,n){let r=[],a=0;return e.content.forEach(o=>{r.push({node:o,offset:a,size:o.nodeSize,signature:Sq(o,n.encoder,n.sigCache)}),a+=o.nodeSize}),{node:e,contentStart:t,content:r}}function Ffe(e,t){let n=e.length,r=t.length,a=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let l=n-1;l>=0;l--)for(let u=r-1;u>=0;u--)e[l].signature===t[u].signature?a[l][u]=a[l+1][u+1]+1:a[l][u]=Math.max(a[l+1][u],a[l][u+1]);let o=[],i=0,s=0;for(;i<n&&s<r;)e[i].signature===t[s].signature?(o.push([i,s]),i++,s++):a[i+1][s]>=a[i][s+1]?i++:s++;return o}function Hfe(e,t){if(e.type!==t.type)return!1;let n=e.type;return!(n.isTextblock||n.isAtom||n.spec.code===!0||!n.isBlock)}function Lq(e,t,n){return Ui.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(r=>({length:r.length,data:r.data})),inserted:e.inserted.map(r=>({length:r.length,data:r.data}))})}function Vfe(e,t,n){let r=e.parent.copy(re.from(e.node)),a=t.parent.copy(re.from(t.node)),o=new Rn(0,r.content.size,new ue(a.content,0,0));return Xh.create(r,void 0,n.encoder).addSteps(a,[o.getMap()],null).changes.map(i=>Lq(i,e.abs,t.abs))}function kq(e,t){let n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){let r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function Ufe(e,t,n){return Ui.fromJSON({fromA:t,toA:t+e.size,fromB:n,toB:n,deleted:[{length:e.size,data:null}],inserted:[]})}function qfe(e,t,n){return Ui.fromJSON({fromA:t,toA:t,fromB:n,toB:n+e.size,deleted:[],inserted:[{length:e.size,data:null}]})}function jfe(e,t,n,r,a){let o=new Rn(0,e.content.size,new ue(t.content,0,0));return Xh.create(e,void 0,a.encoder).addSteps(t,[o.getMap()],null).changes.map(i=>Lq(i,n,r))}function kC(e,t,n,r,a){if(e.childCount>vq||t.childCount>vq)return jfe(e,t,n,r,a);let o=wq(e,n,a),i=wq(t,r,a),s=Ffe(o.content,i.content),l=[],u=0,c=0;for(let[f,d]of s)Cq(o,i,{oldStart:u,oldEnd:f,newStart:c,newEnd:d},a,l),u=f+1,c=d+1;return Cq(o,i,{oldStart:u,oldEnd:o.content.length,newStart:c,newEnd:i.content.length},a,l),l}function Cq(e,t,n,r,a){let o=e.content,i=t.content,s=n.oldStart,l=n.newStart;for(;s<n.oldEnd||l<n.newEnd;){let u=s<n.oldEnd?o[s]:null,c=l<n.newEnd?i[l]:null,f=u&&c&&u.node.type===c.node.type;if(u&&c&&f){a.push(...$fe(e,t,u,c,r)),s++,l++;continue}if(u&&(!c||!f)){let d=e.contentStart+u.offset;a.push(Ufe(u,d,kq(t,l))),s++;continue}if(c){let d=t.contentStart+c.offset;a.push(qfe(c,kq(e,s),d)),l++}}}function $fe(e,t,n,r,a){let o=e.contentStart+n.offset,i=t.contentStart+r.offset;return Hfe(n.node,r.node)&&Gfe(n.node,r.node,a.encoder)?kC(n.node,r.node,o+1,i+1,a):Vfe({node:n.node,parent:e.node,abs:o},{node:r.node,parent:t.node,abs:i},a)}function Gfe(e,t,n){return n.encodeNodeStart(e)===n.encodeNodeStart(t)}function Wfe(e,t,n,r,a){let o=e.resolve(n),i=e.resolve(r),s=t.resolve(n),l=t.resolve(r),u=o.sharedDepth(r);if(s.sharedDepth(r)!==u)throw new RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let g=0;g<=u;g++){if(a.encodeNodeStart(o.node(g))!==a.encodeNodeStart(s.node(g)))throw new RangeError(`computeDocDiff: ancestor at depth ${g} differs in type or non-ignored attrs along the path to the shared ancestor`);if(o.start(g)!==s.start(g))throw new RangeError(`computeDocDiff: ancestor at depth ${g} starts at different absolute positions in old and new docs (content before the range differs in size)`)}let c=o.node(u);if(c.isTextblock)throw new RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(o.depth!==u||i.depth!==u||s.depth!==u||l.depth!==u)throw new RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);let f=s.node(u),d=o.start(u),p=n-d,h=r-d;return{oldCut:c.copy(c.content.cut(p,h)),newCut:f.copy(f.content.cut(p,h)),cutAbsStart:n}}function z0(e,t,n){let r=zfe(n?.ignoreAttrs),a={encoder:r,sigCache:new WeakMap},o=e.content.size,i=t.content.size,s=n?.range;if(s==null)return kC(e,t,0,0,a);let l=Math.min(o,i),u=Math.max(0,Math.min(s.from??0,l)),c=Math.max(u,Math.min(s.to??l,l));if(u===c)return[];if(u===0&&c===l&&o===i)return kC(e,t,0,0,a);let f=Wfe(e,t,u,c,r);return kC(f.oldCut,f.newCut,f.cutAbsStart,f.cutAbsStart,a)}var Iq=He({ignoreAttrs:{heading:["id"]}},"diffConfig");qi(Iq,{displayName:"Ctx<diffConfig>",group:"Diff"});var Pn=new qe("MILKDOWN_DIFF");function Kfe(e,t,n){let r=z0(e,t.newDoc,n);return{...t,changes:r}}function Xfe(e,t){return t.some(n=>e.fromB<n.toB&&e.toB>n.fromB)}function CC(e){return e.changes.filter(t=>!Xfe(t,e.rejectedRanges))}var Yfe=rt(e=>{let t=e.get(Iq.key);return new Be({key:Pn,state:{init:()=>null,apply(n,r,a,o){let i=n.getMeta(Pn);if(!r){if(i?.type==="start"){let u=z0(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:u,rejectedRanges:[],active:!0}}return null}let s=r;if(n.docChanged&&s.active&&(s=Kfe(o.doc,s,{ignoreAttrs:t.ignoreAttrs})),!i)return s;let l;switch(i.type){case"start":{let u=z0(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:u,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":l=s;break;case"reject":l={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.fromB,toB:i.toB}]};break;case"rejectRange":l={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.range.fromB,toB:i.range.toB}]};break;case"acceptAll":case"clear":return null;default:return s}return l.active&&CC(l).length===0?null:l}},filterTransaction(n,r){return!Pn.getState(r)?.active||n.getMeta(Pn)?!0:!n.docChanged}})});qi(Yfe,{displayName:"Prose<diff>",group:"Diff"});function Zfe(e,t){let n=CC(t);for(let r=n.length-1;r>=0;r--){let a=n[r],o=t.newDoc.slice(a.fromB,a.toB);e=e.replace(a.fromA,a.toA,o)}return e}var Jfe=Se("StartDiffReview",e=>t=>(n,r)=>{if(t==null)return!1;let a=e.get(ga)(t);return a?(r&&r(n.tr.setMeta(Pn,{type:"start",newDoc:a})),!0):!1});qi(Jfe,{displayName:"Command<startDiffReview>",group:"Diff"});var GD=Se("StartDiffReviewFromDoc",()=>e=>(t,n)=>!e||e.type!==t.doc.type?!1:(n&&n(t.tr.setMeta(Pn,{type:"start",newDoc:e})),!0));qi(GD,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var Qfe=Se("AcceptDiffChunk",()=>e=>(t,n)=>{if(e==null)return!1;let r=Pn.getState(t);if(!r)return!1;let a=CC(r)[e];if(!a)return!1;if(n){let o=r.newDoc.slice(a.fromB,a.toB),i=t.tr.replace(a.fromA,a.toA,o);i=i.setMeta(Pn,{type:"accept",changeIndex:e}),n(i)}return!0});qi(Qfe,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var ede=Se("RejectDiffChunk",()=>e=>(t,n)=>{if(e==null)return!1;let r=Pn.getState(t);if(!r)return!1;let a=CC(r)[e];return a?(n&&n(t.tr.setMeta(Pn,{type:"reject",fromB:a.fromB,toB:a.toB})),!0):!1});qi(ede,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var tde=Se("AcceptDiffRange",()=>e=>(t,n)=>{if(!e)return!1;let r=Pn.getState(t);if(!r)return!1;if(n){let a=r.newDoc.slice(e.fromB,e.toB),o=t.tr.replace(e.fromA,e.toA,a);o=o.setMeta(Pn,{type:"acceptRange",range:e}),n(o)}return!0});qi(tde,{displayName:"Command<acceptDiffRange>",group:"Diff"});var nde=Se("RejectDiffRange",()=>e=>(t,n)=>!e||!Pn.getState(t)?!1:(n&&n(t.tr.setMeta(Pn,{type:"rejectRange",range:e})),!0));qi(nde,{displayName:"Command<rejectDiffRange>",group:"Diff"});var rde=Se("AcceptAllDiffs",()=>()=>(e,t)=>{let n=Pn.getState(e);return n?(t&&t((n.rejectedRanges.length===0?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):Zfe(e.tr,n)).setMeta(Pn,{type:"acceptAll"})),!0):!1});qi(rde,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var ade=Se("ClearDiffReview",()=>()=>(e,t)=>Pn.getState(e)?(t&&t(e.tr.setMeta(Pn,{type:"clear"})),!0):!1);qi(ade,{displayName:"Command<clearDiffReview>",group:"Diff"});function Yh(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-streaming",...t}}),e}var F0=He({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");Yh(F0,{displayName:"Ctx<streamingConfig>",group:"Streaming"});function ode(e,t,n){let r=SC(e.get(ga),n);if(!r)return{tr:t,newDoc:null};let a=e.get(F0.key).ignoreAttrs,o=z0(t.doc,r,a?{ignoreAttrs:a}:void 0);for(let i=o.length-1;i>=0;i--){let s=o[i],l=r.slice(s.fromB,s.toB);t=t.replace(s.fromA,s.toA,l)}return{tr:t,newDoc:r}}function ide(e){if(e.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let t=e.depth;t>0;t--)if(e.node(t).type.name==="table")return{type:"plain-text",preserveNewlines:!1};return e.depth>=1?{type:"split-block"}:{type:"block"}}function Aq(e){if(e.childCount===0)return e;let t=e.lastChild;return t.type.name==="paragraph"&&t.content.size===0?e.cut(0,e.size-t.nodeSize):e}function sde(e,t,n){let{insertPos:r,currentEndPos:a}=n,o=n.buffer.replace(/\r\n?/g,`
|
|
567
|
+
`);if(!o)return{tr:t,applied:!1,insertEndPos:a};let i=t.doc.content.size,s=Math.max(0,Math.min(r,i)),l=Math.max(s,Math.min(a,i)),u=t.doc.resolve(s),c=(e.get(F0.key).insertStrategy??ide)(u),f={ctx:e,tr:t,buffer:o,from:s,to:l,resolved:u};switch(c.type){case"plain-text":return lde(f,c.preserveNewlines??!1);case"split-block":return pde(f);case"block":return hde(f)}}function lde({tr:e,buffer:t,from:n,to:r},a){let o=a?t:t.replace(/\n/g," "),i=e.doc.type.schema.text(o);return e=e.replaceWith(n,r,i),{tr:e,applied:!0,insertEndPos:n+o.length}}var ude=/[*_~`[\\<]|https?:\/\/|www\.|[\w.+-]@\w|&[a-zA-Z#]/,cde=/\$(?!\s)(?:[^$\n]*[^\s$])?\$(?!\d)/,fde=/:[\w+-]+:/;function dde(e,t){return!!(ude.test(t)||e.nodes.math_inline&&cde.test(t)||e.nodes.emoji&&fde.test(t))}function SC(e,t){try{return e(t)??null}catch{return null}}function WD(e,t,n){if(!n)return re.empty;if(!dde(t,n))return re.from(t.text(n));let r=SC(e.get(ga),n)?.firstChild;if(r?.type.name!=="paragraph"||r.content.size===0)return re.from(t.text(n));let a=r.content,o=/^[ \t]+/.exec(n)?.[0];o&&(a=re.from(t.text(o)).append(a));let i=/[ \t]+$/.exec(n)?.[0];return i&&(a=a.append(re.from(t.text(i)))),a}function pde({ctx:e,tr:t,buffer:n,from:r,to:a,resolved:o}){let i=t.doc.type.schema,s=n.indexOf(`
|
|
568
|
+
`);if(s<0){let w=WD(e,i,n);return t=t.replaceWith(r,a,w),{tr:t,applied:!0,insertEndPos:r+w.size}}let l=n.substring(0,s),u=n.substring(s+1),c=e.get(ga),f=u.trim()?SC(c,u):null,d=f?Aq(f.content):re.empty;if(d.childCount===0){let w=WD(e,i,n.replace(/\n/g," "));return t=t.replaceWith(r,a,w),{tr:t,applied:!0,insertEndPos:r+w.size}}let p=o.depth,h=WD(e,i,l);for(let w=p;w>0;w--)h=re.from(o.node(w).copy(h));let g=h.append(d),x=new ue(g,p,0),m=t.doc.content.size,y=t.doc.resolve(Math.min(a,m)),b=a;p>0&&y.depth===p&&y.parentOffset===y.parent.content.size&&(b=y.after(p)),t=t.replace(r,b,x);let v=g.size-p;return{tr:t,applied:!0,insertEndPos:r+v}}function hde({ctx:e,tr:t,buffer:n,from:r,to:a}){let o=SC(e.get(ga),n);if(!o)return{tr:t,applied:!1,insertEndPos:a};let i=Aq(o.content);return i.size===0?{tr:t,applied:!1,insertEndPos:a}:(t=t.replace(r,a,new ue(i,0,0)),{tr:t,applied:!0,insertEndPos:r+i.size})}function KD(e,t,n){if(n.insertPos!=null){let r=n.insertPos,a=sde(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:a.tr,newDoc:a.applied?a.tr.doc:null,insertEndPos:a.insertEndPos}}return ode(e,t,n.buffer)}var Jn=new qe("MILKDOWN_STREAMING");function mde(e,t){if(!e&&t?.type!=="start")return null;if(!t)return e;switch(t.type){case"start":return{buffer:"",originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case"push":return e?{...e,buffer:e.buffer+t.token}:null;case"apply":return e?{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos}:null;case"end":case"abort":return null;default:return e}}var gde=rt(e=>{let t=e.get(F0.key);return new Be({key:Jn,state:{init:()=>null,apply(n,r){return mde(r,n.getMeta(Jn))}},filterTransaction(n,r){return!Jn.getState(r)?.active||n.getMeta(Jn)?!0:!n.docChanged},view(){return xde(e,t)}})});Yh(gde,{displayName:"Prose<streaming>",group:"Streaming"});function xde(e,t){let n=null,r=-1,a=null;function o(){if(!a)return;let s=Jn.getState(a.state);if(!s?.active||s.buffer.length===r)return;r=s.buffer.length;let l=KD(e,a.state.tr,s);if(!l.newDoc)return;let u=l.tr;!u.docChanged&&l.insertEndPos==null||(u=u.setMeta(Jn,{type:"apply",lastApplyTime:Date.now(),insertEndPos:l.insertEndPos}),t.scrollFollow&&(u=u.scrollIntoView()),a.dispatch(u))}function i(){n!=null&&clearTimeout(n),n=setTimeout(o,t.throttleMs)}return{update(s){a=s;let l=Jn.getState(s.state);if(!l?.active){n!=null&&(clearTimeout(n),n=null),r=-1;return}l.buffer.length!==r&&(Date.now()-l.lastApplyTime>=t.throttleMs?o():i())},destroy(){n!=null&&(clearTimeout(n),n=null),a=null}}}var XD=Se("StartStreaming",()=>e=>(t,n)=>{if(Jn.getState(t)?.active)return!1;if(n){let r,a;if(e?.insertAt!=null)if(e.insertAt==="selection"){if(r=t.selection.from,a=t.selection.to,t.selection.empty){let o=t.doc.resolve(r);o.parent.isTextblock&&!o.parent.type.spec.code&&o.parent.content.size===0&&o.depth===1&&(r=o.before(o.depth),a=o.after(o.depth))}}else{let o=e.insertAt==="cursor"?t.selection.head:e.insertAt;if(!Number.isFinite(o))return!1;r=Math.max(0,Math.min(Math.round(o),t.doc.content.size));let i=t.doc.resolve(r);i.parent.isTextblock&&!i.parent.type.spec.code&&i.parent.content.size===0&&i.depth===1&&(r=i.before(i.depth),a=i.after(i.depth))}n(t.tr.setMeta(Jn,{type:"start",originalDoc:t.doc,insertPos:r,insertEndPos:a,lastApplyTime:Date.now()}))}return!0});Yh(XD,{displayName:"Command<startStreaming>",group:"Streaming"});var YD=Se("PushChunk",()=>e=>(t,n)=>e==null||!Jn.getState(t)?.active?!1:(n&&n(t.tr.setMeta(Jn,{type:"push",token:e})),!0));Yh(YD,{displayName:"Command<pushChunk>",group:"Streaming"});var ZD=Se("EndStreaming",e=>t=>(n,r)=>{let a=Jn.getState(n);if(!a?.active)return!1;if(r){let o=e.get(F0.key),i=t?.diffReview??o.diffReviewOnEnd,s=KD(e,n.tr,a),l=s.tr;if(l=l.setMeta(Jn,{type:"end"}),i&&s.newDoc){let u=l.doc;l=l.replace(0,l.doc.content.size,new ue(a.originalDoc.content,0,0)),r(l);try{e.get(ge).call(GD.key,u)}catch(c){console.warn("[milkdown/streaming] diff review handoff skipped:",c)}return!0}r(l)}return!0});Yh(ZD,{displayName:"Command<endStreaming>",group:"Streaming"});var H0=Se("AbortStreaming",e=>t=>(n,r)=>{let a=Jn.getState(n);if(!a?.active)return!1;if(r){let o=t?.keep??!1,i=n.tr;o?i=KD(e,i,a).tr:i=i.replace(0,n.doc.content.size,new ue(a.originalDoc.content,0,0)),i=i.setMeta(Jn,{type:"abort"}),r(i)}return!0});Yh(H0,{displayName:"Command<abortStreaming>",group:"Streaming"});Ie([],"FeaturesCtx");Ie({},"CrepeCtx");function Tq(e){return e.use("FeaturesCtx")}function bde(e){return t=>{Tq(t).update(n=>n.includes(e)?n:[...n,e])}}var _C=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(_C||{});function eR(...e){}var yde=`
|
|
569
|
+
<svg
|
|
570
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
571
|
+
width="24"
|
|
572
|
+
height="24"
|
|
573
|
+
viewBox="0 0 24 24"
|
|
574
|
+
>
|
|
575
|
+
<path
|
|
576
|
+
fill="currentColor"
|
|
577
|
+
d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"
|
|
578
|
+
transform="translate(3 3) scale(0.75)"
|
|
579
|
+
/>
|
|
580
|
+
</svg>
|
|
581
|
+
`,vde=`
|
|
582
|
+
<svg
|
|
583
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
584
|
+
width="24"
|
|
585
|
+
height="24"
|
|
586
|
+
viewBox="0 0 24 24"
|
|
587
|
+
>
|
|
588
|
+
<path
|
|
589
|
+
d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"
|
|
590
|
+
/>
|
|
591
|
+
</svg>
|
|
592
|
+
`,wde=`
|
|
593
|
+
<svg
|
|
594
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
595
|
+
width="24"
|
|
596
|
+
height="24"
|
|
597
|
+
viewBox="0 0 24 24"
|
|
598
|
+
>
|
|
599
|
+
<g clip-path="url(#clip0_977_8081)">
|
|
600
|
+
<path
|
|
601
|
+
d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"
|
|
602
|
+
/>
|
|
603
|
+
</g>
|
|
604
|
+
<defs>
|
|
605
|
+
<clipPath id="clip0_977_8081">
|
|
606
|
+
<rect width="24" height="24" />
|
|
607
|
+
</clipPath>
|
|
608
|
+
</defs>
|
|
609
|
+
</svg>
|
|
610
|
+
`,kde=`
|
|
611
|
+
<svg
|
|
612
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
613
|
+
width="24"
|
|
614
|
+
height="24"
|
|
615
|
+
viewBox="0 0 24 24"
|
|
616
|
+
>
|
|
617
|
+
<path
|
|
618
|
+
d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"
|
|
619
|
+
/>
|
|
620
|
+
</svg>
|
|
621
|
+
`,Cde=`
|
|
622
|
+
<svg
|
|
623
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
624
|
+
width="24"
|
|
625
|
+
height="24"
|
|
626
|
+
viewBox="0 0 24 24"
|
|
627
|
+
>
|
|
628
|
+
<path
|
|
629
|
+
d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"
|
|
630
|
+
/>
|
|
631
|
+
</svg>
|
|
632
|
+
`,Sde=`
|
|
633
|
+
<svg
|
|
634
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
635
|
+
width="24"
|
|
636
|
+
height="24"
|
|
637
|
+
viewBox="0 0 24 24"
|
|
638
|
+
>
|
|
639
|
+
<path
|
|
640
|
+
d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"
|
|
641
|
+
/>
|
|
642
|
+
</svg>
|
|
643
|
+
`,Lde=`
|
|
644
|
+
<svg
|
|
645
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
646
|
+
width="32"
|
|
647
|
+
height="32"
|
|
648
|
+
viewBox="0 0 24 24"
|
|
649
|
+
>
|
|
650
|
+
<path
|
|
651
|
+
fill="currentColor"
|
|
652
|
+
d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"
|
|
653
|
+
/>
|
|
654
|
+
</svg>
|
|
655
|
+
`,Dq=e=>{throw TypeError(e)},Rq=(e,t,n)=>t.has(e)||Dq("Cannot "+n),V0=(e,t,n)=>(Rq(e,t,"read from private field"),n?n.call(e):t.get(e)),Eq=(e,t,n)=>t.has(e)?Dq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ide=(e,t,n,r)=>(Rq(e,t,"write to private field"),t.set(e,n),n),Zh,AC,JD=class{constructor(){Eq(this,Zh,[]),this.clear=()=>(Ide(this,Zh,[]),this),Eq(this,AC,t=>{let n={group:t,addItem:(r,a)=>{let o={...a,key:r};return t.items.push(o),n},clear:()=>(t.items=[],n)};return n}),this.addGroup=(t,n)=>{let a={key:t,label:n,items:[]};return V0(this,Zh).push(a),V0(this,AC).call(this,a)},this.getGroup=t=>{let n=V0(this,Zh).find(r=>r.key===t);if(!n)throw new Error(`Group with key ${t} not found`);return V0(this,AC).call(this,n)},this.build=()=>V0(this,Zh)}};Zh=new WeakMap;AC=new WeakMap;function LC(e,t){return{slice:e,entry:t}}function Ade(e){if(e===" "||e.toLowerCase()==="space")return{display:"Space",aria:" "};if(e.length===1){let t=e.toUpperCase();return{display:t,aria:t}}return{display:e,aria:e}}function Ede(e,t){var n;let r=e.split(/-(?!$)/),a=(n=r[r.length-1])!=null?n:"",o=r.slice(0,-1),i=!1,s=!1,l=!1,u=!1;for(let p of o)switch(p.toLowerCase()){case"mod":t?i=!0:s=!0;break;case"meta":case"cmd":case"m":i=!0;break;case"ctrl":case"control":case"c":s=!0;break;case"alt":case"option":case"a":l=!0;break;case"shift":case"s":u=!0;break}let c=Ade(a),f=t?[s&&"\u2303",l&&"\u2325",u&&"\u21E7",i&&"\u2318",c.display].filter(Boolean).join(""):[s&&"Ctrl",l&&"Alt",u&&"Shift",i&&"Meta",c.display].filter(Boolean).join("+"),d=[i&&"Meta",s&&"Control",l&&"Alt",u&&"Shift",c.aria].filter(Boolean).join("+");return{display:f,aria:d}}function _de(e,t){if(!e.isInjected(t.slice))return;let n=e.get(t.slice)[t.entry],r=n?[n.shortcuts].flat()[0]:void 0;if(r)return Ede(r,Oc.mac)}function Tde(e,t){var n;let r=e.get(it),a=e.get(Mo),{state:o}=r,i=a(o.doc),s="";if(!o.selection.empty){let{from:l,to:u}=o.selection,c=o.doc.slice(l,u),{schema:f}=o.doc.type,d=f.topNodeType.createAndFill(null,c.content);if(!d){let p=(n=f.nodes.paragraph)==null?void 0:n.createAndFill(null,c.content);p&&(d=f.topNodeType.createAndFill(null,p))}s=d?a(d):o.doc.textBetween(l,u)}return{document:i,selection:s,instruction:t}}var DC=He({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},"aiProviderConfig"),ji=He({abortController:null,label:"",lastInstruction:"",lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},"aiSession");function Mq(e,t){let n=e.get(DC.key);try{n.onError(t)}catch(r){console.error("[milkdown/ai] onError handler failed:",r)}}function TC(e){let t=e.get(ji.key);e.set(ji.key,{...t,abortController:null,label:""})}async function Dde(e,t,n,r){try{let a=t(n,r.signal),o=e.get(ge);for await(let l of a){if(r.signal.aborted)break;o.call(YD.key,l)}if(r.signal.aborted)return;let i=e.get(DC.key);if(i.diffReviewOnEnd){let l=e.get(ji.key);e.set(ji.key,{...l,diffOwnedByAI:!0})}let s=o.call(ZD.key,{diffReview:i.diffReviewOnEnd});if(i.diffReviewOnEnd&&!s){let l=e.get(ji.key);e.set(ji.key,{...l,diffOwnedByAI:!1})}}catch(a){if(r.signal.aborted)return;let o=lP(a);Mq(e,o),e.get(ge).call(H0.key,{keep:!1})}finally{e.get(ji.key).abortController===r&&TC(e)}}Se("RunAI",e=>t=>(n,r)=>{var a,o,i,s;if(!t?.instruction)return!1;let l=e.get(DC.key);if(!l.provider||e.get(ji.key).abortController||(a=Jn.getState(n))!=null&&a.active||(o=Pn.getState(n))!=null&&o.active)return!1;if(!r)return!0;let c=new AbortController,{from:f,to:d}=n.selection;e.set(ji.key,{abortController:c,label:(i=t.label)!=null?i:"",lastInstruction:t.instruction,lastLabel:t.label,lastFrom:f,lastTo:d,diffOwnedByAI:!1});let p=e.get(ge),h=n.selection.empty?"cursor":"selection";if(!p.call(XD.key,{insertAt:h}))return TC(e),!1;let g;try{g=((s=l.buildContext)!=null?s:Tde)(e,t.instruction)}catch(x){let m=uP(x);return Mq(e,m),p.call(H0.key,{keep:!1}),TC(e),!1}return Dde(e,l.provider,g,c),!0});Se("AbortAI",e=>t=>(n,r)=>{var a;let o=e.get(ji.key);return r?o.abortController?(o.abortController.abort(),TC(e),(a=Jn.getState(n))!=null&&a.active&&e.get(ge).call(H0.key,t),!0):!1:!!o.abortController});eR(H);function Rde(e,t){let n=t.trim();if(!n)return[e];let r=e.toLowerCase(),a=n.toLowerCase(),o=r.indexOf(a);return o===-1?[e]:[e.slice(0,o),H("mark",null,e.slice(o,o+n.length)),e.slice(o+n.length)]}Yn({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:a,onCancel:o}){let i=Ne(""),s=Ne({kind:"main"}),l=Ne(0),u=Ne(null),c=Ne(null),f=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,d=N=>`${f}-opt-${N}`,p=`ai-instruction-input-${Math.random().toString(36).slice(2,9)}`;jo(t,()=>{i.value="",s.value={kind:"main"},l.value=0});let h=aa(()=>{if(s.value.kind==="submenu"){let N=n.submenus[s.value.id];return N?N.items.map(({id:q,item:ie})=>({id:q,icon:ie.icon,label:ie.label,hasSubmenu:!1,prompt:{text:ie.prompt,streamingLabel:ie.streamingLabel}})):[]}return n.main.map(N=>N.kind==="item"?{id:N.id,icon:N.item.icon,label:N.item.label,hasSubmenu:!1,prompt:{text:N.item.prompt,streamingLabel:N.item.streamingLabel}}:{id:N.id,icon:N.def.icon,label:N.def.label,hasSubmenu:!0})}),g=aa(()=>{var N,q;return s.value.kind!=="submenu"?null:(q=(N=n.submenus[s.value.id])==null?void 0:N.def)!=null?q:null}),x=aa(()=>{let N=i.value.trim().toLowerCase();return N?h.value.filter(q=>q.label.toLowerCase().includes(N)):h.value}),m=aa(()=>i.value.trim().length>0),y=aa(()=>x.value.length+(m.value?1:0));jo([x,s,m],()=>{l.value=m.value?x.value.length:0});let b=()=>{S1(()=>{var N;return(N=u.value)==null?void 0:N.focus()})},v=N=>{s.value={kind:"submenu",id:N},i.value="",l.value=0,b()},w=()=>{s.value={kind:"main"},i.value="",l.value=0,b()},k=N=>{N.hasSubmenu?v(N.id):N.prompt&&(a(N.prompt.text,N.prompt.streamingLabel),i.value="")},_=()=>{let N=i.value.trim();N&&(a(N),i.value="")},E=()=>{let N=l.value,q=x.value;N<q.length?k(q[N]):m.value&&_()},M=()=>{S1(()=>{let N=c.value;if(!N)return;let q=N.querySelector(`[data-index="${l.value}"]`);q?.scrollIntoView({block:"nearest"})})},S=N=>{if(N.stopPropagation(),N.key==="ArrowDown"){if(N.preventDefault(),y.value===0)return;l.value=(l.value+1)%y.value,M();return}if(N.key==="ArrowUp"){if(N.preventDefault(),y.value===0)return;l.value=(l.value-1+y.value)%y.value,M();return}if(N.key==="Enter"){N.preventDefault(),E();return}if(N.key==="Escape"){N.preventDefault(),s.value.kind==="submenu"?w():o();return}N.key==="Backspace"&&i.value===""&&s.value.kind==="submenu"&&(N.preventDefault(),w())},U=N=>{N.preventDefault()};return()=>{let N=x.value,q=m.value,ie=g.value;return H("div",{class:"ai-instruction"},H("div",{class:"ai-instruction-input"},H("span",{class:"ai-instruction-input-prefix"},H(ka,{icon:r.aiIcon})),H("input",{ref:u,id:p,class:"ai-instruction-input-field",role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":f,"aria-activedescendant":y.value>0?d(l.value):void 0,placeholder:ie?ie.searchPlaceholder:e.value,value:i.value,onInput:fe=>{i.value=fe.target.value},onKeydown:S}),H("button",{type:"button",class:"ai-instruction-submit","aria-label":r.submitButtonLabel,disabled:!q,onMousedown:U,onClick:_},H(ka,{icon:r.sendIcon}))),H("div",{class:"ai-instruction-list",ref:c,id:f,role:"listbox","aria-label":r.listboxLabel},ie&&H("button",{type:"button",class:"ai-instruction-back",onMousedown:U,onClick:w},H("span",{class:"ai-instruction-back-icon","aria-hidden":"true"},H(ka,{icon:r.chevronLeftIcon})),H("span",null,ie.title)),N.length>0&&H("div",{class:"ai-instruction-section"},H("div",{class:"ai-instruction-section-header"},r.suggestionsHeaderLabel),N.map((fe,he)=>H("div",{key:fe.id,id:d(he),"data-index":he,role:"option","aria-selected":he===l.value,class:["ai-instruction-item",he===l.value?"active":""],onMousedown:U,onClick:()=>k(fe),onPointerenter:()=>{l.value=he}},H("span",{class:"ai-instruction-item-icon"},H(ka,{icon:fe.icon})),H("span",{class:"ai-instruction-item-label"},Rde(fe.label,i.value)),fe.hasSubmenu&&H("span",{class:"ai-instruction-item-arrow"},H(ka,{icon:r.chevronRightIcon}))))),q&&H("div",{class:"ai-instruction-section"},H("div",{class:"ai-instruction-section-header"},r.sendAsPromptHeaderLabel),H("div",{id:d(N.length),"data-index":N.length,role:"option","aria-selected":l.value===N.length,class:["ai-instruction-item","ai-instruction-item-prompt",l.value===N.length?"active":""],onMousedown:U,onClick:_,onPointerenter:()=>{l.value=N.length}},H("span",{class:"ai-instruction-item-icon"},H(ka,{icon:r.sendPromptIcon})),H("span",{class:"ai-instruction-item-label"},r.sendAsPromptLabel," ",H("span",{class:"ai-instruction-item-quote"},'"',i.value,'"')),H("span",{class:"ai-instruction-item-shortcut"},H(ka,{icon:r.enterKeyIcon}))))))}}});var Mde={show:()=>{}},Nde=He({...Mde},"aiInstructionTooltipAPI");Gh("CREPE_AI_INSTRUCTION");var Ode="math_inline",Pde="ToggleLatex";function Bde(e,t){var n,r,a,o,i,s,l,u,c,f,d,p,h,g,x,m,y,b;let v=new JD;v.addGroup("formatting","Formatting").addItem("bold",{icon:(n=e?.boldIcon)!=null?n:vde,label:(r=e?.boldLabel)!=null?r:"Bold",keymap:LC(F1.key,"ToggleBold"),active:M=>M.get(ge).call(mf.key,df.type(M)),onRun:M=>{M.get(ge).call(z1.key)}}).addItem("italic",{icon:(a=e?.italicIcon)!=null?a:kde,label:(o=e?.italicLabel)!=null?o:"Italic",keymap:LC(B1.key,"ToggleEmphasis"),active:M=>M.get(ge).call(mf.key,xu.type(M)),onRun:M=>{M.get(ge).call(P1.key)}}).addItem("strikethrough",{icon:(i=e?.strikethroughIcon)!=null?i:Sde,label:(s=e?.strikethroughLabel)!=null?s:"Strikethrough",keymap:LC(j1.key,"ToggleStrikethrough"),active:M=>M.get(ge).call(mf.key,bf.type(M)),onRun:M=>{M.get(ge).call(q1.key)}});let w=v.addGroup("function","Function");w.addItem("code",{icon:(l=e?.codeIcon)!=null?l:wde,label:(u=e?.codeLabel)!=null?u:"Inline code",keymap:LC(V1.key,"ToggleInlineCode"),active:M=>M.get(ge).call(mf.key,Pi.type(M)),onRun:M=>{M.get(ge).call(H1.key)}});let k=t&&Tq(t).get();if(k?.includes(_C.Latex)&&w.addItem("latex",{icon:(c=e?.latexIcon)!=null?c:Lde,label:(f=e?.latexLabel)!=null?f:"Inline math",active:M=>{let S=M.get(ge),U=M.get(Ar).nodes[Ode];return S.call(bT.key,U)},onRun:M=>{M.get(ge).call(Pde)}}),w.addItem("link",{icon:(d=e?.linkIcon)!=null?d:Cde,label:(p=e?.linkLabel)!=null?p:"Link",active:M=>M.get(ge).call(mf.key,Va.type(M)),onRun:M=>{M.get(ge).call(PD.key)}}),t&&k?.includes(_C.AI)){let M=t.get(DC.key);M.provider&&w.addItem("ai",{icon:(g=(h=e?.aiIcon)!=null?h:M.aiIcon)!=null?g:yde,label:(x=e?.aiLabel)!=null?x:"Ask AI",active:()=>!1,onRun:S=>{let U=S.get(Nde.key),N=S.get(it),{from:q,to:ie}=N.state.selection;U.show(q,ie)}})}(m=e?.buildToolbar)==null||m.call(e,v);let E=v.build();if(t)for(let M of E)for(let S of M.items){if(!S.keymap)continue;let U=_de(t,S.keymap);U&&((y=S.shortcut)!=null||(S.shortcut=U.display),(b=S.ariaKeyshortcuts)!=null||(S.ariaKeyshortcuts=U.aria))}return E}eR(H,nn);var zde=Yn({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){let{ctx:t,config:n}=e,r=s=>l=>{l.preventDefault(),t&&s?.(t)};function a(s){return eR(e.selection.value),t.get(Bw).status!==Ux.Created?!1:s(t)}let o=aa(()=>Bde(n,t));function i(s){if(s.label)return s.shortcut?`${s.label} (${s.shortcut})`:s.label}return()=>H(nn,null,o.value.map(s=>s.items.map(l=>H("button",{type:"button",class:Tr("toolbar-item",t&&a(l.active)&&"active"),"data-toolbar-item":l.key,title:i(l),"aria-label":l.label,"aria-keyshortcuts":l.ariaKeyshortcuts,onPointerdown:r(l.onRun)},H(ka,{icon:l.icon})))).reduce((s,l,u)=>(u===0?s.push(...l):s.push(H("div",{class:"divider"}),...l),s),[]))}}),Nq=e=>{throw TypeError(e)},Oq=(e,t,n)=>t.has(e)||Nq("Cannot "+n),Ga=(e,t,n)=>(Oq(e,t,"read from private field"),n?n.call(e):t.get(e)),U0=(e,t,n)=>t.has(e)?Nq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),IC=(e,t,n,r)=>(Oq(e,t,"write to private field"),t.set(e,n),n),Ru,q0,EC,j0,$0,_q=Gh("CREPE_TOOLBAR"),QD=class{constructor(t,n,r){U0(this,Ru),U0(this,q0),U0(this,EC),U0(this,j0),U0(this,$0,Ne(!1)),this.update=(i,s)=>{Ga(this,Ru).update(i,s),Ga(this,j0).value=i.state.selection},this.destroy=()=>{Ga(this,Ru).destroy(),Ga(this,EC).unmount(),Ga(this,q0).remove()},this.hide=()=>{Ga(this,Ru).hide()};let a=document.createElement("div");a.className="milkdown-toolbar",IC(this,j0,ih(n.state.selection));let o=xa(zde,{ctx:t,hide:this.hide,config:r,selection:Ga(this,j0),show:Ga(this,$0)});o.mount(a),IC(this,q0,a),IC(this,EC,o),IC(this,Ru,new A0({content:Ga(this,q0),debounce:20,offset:10,shouldShow(i){let{doc:s,selection:l}=i.state,{empty:u,from:c,to:f}=l,d=!s.textBetween(c,f).length&&l instanceof ye,p=!(l instanceof ye),h=i.dom.getRootNode().activeElement,g=a.contains(h),x=!i.hasFocus()&&!g,m=!i.editable;return!(x||p||u||d||m)}})),Ga(this,Ru).onShow=()=>{Ga(this,$0).value=!0},Ga(this,Ru).onHide=()=>{Ga(this,$0).value=!1},this.update(n)}};Ru=new WeakMap;q0=new WeakMap;EC=new WeakMap;j0=new WeakMap;$0=new WeakMap;var Pq=(e,t)=>{e.config(bde(_C.Toolbar)).config(n=>{n.set(_q.key,{view:r=>new QD(n,r,t)})}).use(_q)};var tR={};aS(tR,{decode:()=>G0,encode:()=>Mu,format:()=>Jh,parse:()=>W0});var Bq={};function Fde(e){let t=Bq[e];if(t)return t;t=Bq[e]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function RC(e,t){typeof t!="string"&&(t=RC.defaultChars);let n=Fde(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let a="";for(let o=0,i=r.length;o<i;o+=3){let s=parseInt(r.slice(o+1,o+3),16);if(s<128){a+=n[s];continue}if((s&224)===192&&o+3<i){let l=parseInt(r.slice(o+4,o+6),16);if((l&192)===128){let u=s<<6&1984|l&63;u<128?a+="\uFFFD\uFFFD":a+=String.fromCharCode(u),o+=3;continue}}if((s&240)===224&&o+6<i){let l=parseInt(r.slice(o+4,o+6),16),u=parseInt(r.slice(o+7,o+9),16);if((l&192)===128&&(u&192)===128){let c=s<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?a+="\uFFFD\uFFFD\uFFFD":a+=String.fromCharCode(c),o+=6;continue}}if((s&248)===240&&o+9<i){let l=parseInt(r.slice(o+4,o+6),16),u=parseInt(r.slice(o+7,o+9),16),c=parseInt(r.slice(o+10,o+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let f=s<<18&1835008|l<<12&258048|u<<6&4032|c&63;f<65536||f>1114111?a+="\uFFFD\uFFFD\uFFFD\uFFFD":(f-=65536,a+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}a+="\uFFFD"}return a})}RC.defaultChars=";/?:@&=+$,#";RC.componentChars="";var G0=RC;var zq={};function Hde(e){let t=zq[e];if(t)return t;t=zq[e]=[];for(let n=0;n<128;n++){let r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function MC(e,t,n){typeof t!="string"&&(n=t,t=MC.defaultChars),typeof n>"u"&&(n=!0);let r=Hde(t),a="";for(let o=0,i=e.length;o<i;o++){let s=e.charCodeAt(o);if(n&&s===37&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){a+=e.slice(o,o+3),o+=2;continue}if(s<128){a+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<i){let l=e.charCodeAt(o+1);if(l>=56320&&l<=57343){a+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(e[o])}return a}MC.defaultChars=";/?:@&=+$,-_.!~*'()#";MC.componentChars="-_.!~*'()";var Mu=MC;function Jh(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function NC(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Vde=/^([a-z0-9.+-]+:)/i,Ude=/:[0-9]*$/,qde=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,jde=["<",">",'"',"`"," ","\r",`
|
|
656
|
+
`," "],$de=["{","}","|","\\","^","`"].concat(jde),Gde=["'"].concat($de),Fq=["%","/","?",";","#"].concat(Gde),Hq=["/","?","#"],Wde=255,Vq=/^[+a-z0-9A-Z_-]{0,63}$/,Kde=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Uq={javascript:!0,"javascript:":!0},qq={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Xde(e,t){if(e&&e instanceof NC)return e;let n=new NC;return n.parse(e,t),n}NC.prototype.parse=function(e,t){let n,r,a,o=e;if(o=o.trim(),!t&&e.split("#").length===1){let u=qde.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let i=Vde.exec(o);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(t||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(a=o.substr(0,2)==="//",a&&!(i&&Uq[i])&&(o=o.substr(2),this.slashes=!0)),!Uq[i]&&(a||i&&!qq[i])){let u=-1;for(let h=0;h<Hq.length;h++)r=o.indexOf(Hq[h]),r!==-1&&(u===-1||r<u)&&(u=r);let c,f;u===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",u),f!==-1&&(c=o.slice(0,f),o=o.slice(f+1),this.auth=c),u=-1;for(let h=0;h<Fq.length;h++)r=o.indexOf(Fq[h]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=o.length),o[u-1]===":"&&u--;let d=o.slice(0,u);o=o.slice(u),this.parseHost(d),this.hostname=this.hostname||"";let p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){let h=this.hostname.split(/\./);for(let g=0,x=h.length;g<x;g++){let m=h[g];if(m&&!m.match(Vq)){let y="";for(let b=0,v=m.length;b<v;b++)m.charCodeAt(b)>127?y+="x":y+=m[b];if(!y.match(Vq)){let b=h.slice(0,g),v=h.slice(g+1),w=m.match(Kde);w&&(b.push(w[1]),v.unshift(w[2])),v.length&&(o=v.join(".")+o),this.hostname=b.join(".");break}}}}this.hostname.length>Wde&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));let l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),qq[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};NC.prototype.parseHost=function(e){let t=Ude.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var W0=Xde;var iR={};aS(iR,{Any:()=>nR,Cc:()=>rR,Cf:()=>Yde,P:()=>K0,S:()=>aR,Z:()=>oR});var nR=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,rR=/[\0-\x1F\x7F-\x9F]/,Yde=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,K0=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,aR=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,oR=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Zde=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function Jde(e){return e===0||e>=55296&&e<=57343||e>1114111}function jq(e){return Jde(e)?65533:e>=128&&e<=159&&Zde[e-128]||e}function $q(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(jq(e))}var Yo=(()=>{let e=new Uint8Array(127),t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function Gq(e,t,n,r,a,o){let s=e.length,l=o*90,u=0,c=()=>{let M=Yo[e.charCodeAt(u++)];return M<o?M:M*91-l+Yo[e.charCodeAt(u++)]},f=n-r,d=n+a,p=new Int32Array(d);p.fill(-1,r,o),p.fill(-1,o+f,d);let h=new Int32Array(d),g=new Int32Array(d);function x(M,S){let U=0,N=S,q=S+M;for(;N<q;){let ie=Yo[e.charCodeAt(u++)];if(ie<89)U+=ie,p[N++]=U;else if(ie===89){let fe=Yo[e.charCodeAt(u++)]+2;for(;fe--;)p[N++]=++U}else{let fe=Yo[e.charCodeAt(u++)];U+=89+(fe<90?fe*91+Yo[e.charCodeAt(u++)]:Yo[e.charCodeAt(u++)]*8281+Yo[e.charCodeAt(u++)]*91+Yo[e.charCodeAt(u++)]),p[N++]=U}}}x(r,0),x(f,o);let m=new Int32Array(a*2),y=0,b=0;function v(M,S){for(let U=0;U<M;U++){let N=S+U,q=c(),ie=c();m[b*2]=q,m[b*2+1]=ie,b+=1,h[N]=y;let fe=(p[q]<0?g[q]:1)+(p[ie]<0?g[ie]:1);g[N]=fe,y+=fe}}v(a-o+r,o+f),v(o-r,r);let w=new Uint16Array(y),k=0;for(let M=0;M<b;M++)for(let S=0;S<2;S++){let U=m[M*2+S],N=p[U];if(N<0){let q=h[U],ie=q+g[U];for(;q<ie;)w[k++]=w[q++]}else w[k++]=N}let _=new Uint16Array(t),E=0;for(;u<s;){let M=Yo[e.charCodeAt(u++)];M>=o&&(M=M*91-l+Yo[e.charCodeAt(u++)]);let S=p[M];if(S<0){let U=h[M],N=U+g[M];for(;U<N;)_[E++]=w[U++]}else _[E++]=S}return _}var Wq=Gq("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61);var In;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.FLAG13=8192]="FLAG13",e[e.BRANCH_LENGTH=8064]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE",e[e.VALUE_MASK=8191]="VALUE_MASK"})(In||(In={}));var pr;(function(e){e[e.AMP=38]="AMP",e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_X=120]="LOWER_X"})(pr||(pr={}));var OC=32,Yq=21,Qde=2097151,sR=2047,Zq=0;function epe(e){let t=e>>>Yq;return t===sR?Zq:t}function Jq(e){return e-pr.ZERO>>>0<=9}function tpe(e){return(e|OC)-pr.LOWER_A>>>0<=5}function Qq(e){return(e|OC)-pr.LOWER_A>>>0<=25}function npe(e){return e===pr.EQUALS||Qq(e)||Jq(e)}var Kq;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Kq||(Kq={}));var lR;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(lR||(lR={}));function rpe(e,t,n,r){let a=(t&In.BRANCH_LENGTH)>>7,o=t&In.JUMP_TABLE;if(o){if(a===0)return r===o?n:-1;let l=r-o;if(l>>>0>=a)return-1;let u=e[n+l];return u===0?-1:n+a+u-1&65535}if(a===0)return-1;let i=a+1>>1,s=n+i+a;for(let l=0;l<a;l++){let c=e[n+(l>>1)]>>((l&1)<<3)&255;if(c===r){let f=n+i+l;return s+e[f]&65535}if(c>r)return-1}return-1}function Xq(e,t,n){return n===1?String.fromCharCode(e[t]&In.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function ape(e,t,n){let r=t+1,a=0,o=r;if(r<n&&(e.charCodeAt(r)|OC)===pr.LOWER_X)for(r+=1,o=r;r<n;){let s=e.charCodeAt(r);if(Jq(s))a=a*16+(s-pr.ZERO);else if(tpe(s))a=a*16+((s|OC)-pr.LOWER_A+10);else break;r+=1}else for(;r<n;){let s=e.charCodeAt(r)-pr.ZERO;if(s>>>0>9)break;a=a*10+s,r+=1}if(r===o)return 0;r<n&&e.charCodeAt(r)===pr.SEMI&&(r+=1),a>1114111&&(a=1114112);let i=r-t;return i>=sR&&(Zq=i,i=sR),i<<Yq|a}function ope(e,t,n){let r=Wq,a=e.indexOf("&");if(a<0)return e;let o=e.length,i=0,s="",l=r[0],u=l&In.JUMP_TABLE,c=(l&In.BRANCH_LENGTH)>>7;do{let f=a+1,d=e.charCodeAt(f),p,h;if(d===pr.NUM){let g=ape(e,f,o);p=epe(g),t&&p>0&&e.charCodeAt(f+p-1)!==pr.SEMI&&(p=0),h=p===0?"":$q(g&Qde)}else if(Qq(d)){p=0,h="";let g=d-u,x;if(g>>>0<c){let w=r[1+g];x=w===0?-1:c+w&65535}else x=-1;let m=0,y=0,b=x<0?0:r[x],v=f+1;e:for(;v<o;){for(;(b&(In.VALUE_LENGTH|In.FLAG13))===0&&(b&In.JUMP_TABLE)!==0;){let E=b&In.JUMP_TABLE,M=(b&In.BRANCH_LENGTH)>>7;if(M===0){if(e.charCodeAt(v)!==E)break e;x+=1}else{let S=e.charCodeAt(v)-E;if(S>>>0>=M)break e;let U=r[x+1+S];if(U===0)break e;x=x+M+U&65535}if(b=r[x],v+=1,v>=o)break e}if((b&(In.VALUE_LENGTH|In.FLAG13))===In.FLAG13){let E=(b&In.BRANCH_LENGTH)>>7;if(e.charCodeAt(v)!==(b&In.JUMP_TABLE))break;v+=1;let M=E-1,S=x+1,U=0;for(;U+1<M;U+=2){let N=r[S];if(e.charCodeAt(v)!==(N&255)||(v+=1,e.charCodeAt(v)!==(N>>8&255)))break e;v+=1,S+=1}if(U<M){if(e.charCodeAt(v)!==(r[S]&255))break;v+=1}x+=1+(E>>1),b=r[x];continue}let w=b>>>14,k=e.charCodeAt(v);if(w!==0){if(k===pr.SEMI){p=v-f+1,h=w===1?String.fromCharCode(b&In.VALUE_MASK):Xq(r,x,w);break}if(!t&&(b&In.FLAG13)===0&&(p=v-f,m=x,y=w),w===1)break}let _=rpe(r,b,x+(w||1),k);if(_<0)break;x=_,b=r[x],v+=1}if(h===""){let w=b>>>14;w!==0&&!t&&(b&In.FLAG13)===0&&(p=v-f,m=x,y=w),p>0&&(h=Xq(r,m,y))}}else p=0,h="";p===0||n&&d!==pr.NUM&&e.charCodeAt(f+p-1)!==pr.SEMI&&f+p<o&&npe(e.charCodeAt(f+p))?a=f:(i<a&&(s+=e.slice(i,a)),s+=h,a=i=f+p),e.charCodeAt(a)!==pr.AMP&&(a=e.indexOf("&",a))}while(a>=0);return s+e.slice(i)}function PC(e){return ope(e,!0,!1)}var ej;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(ej||(ej={}));var tj;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(tj||(tj={}));var spe=class{constructor(e={}){Bn(this,"src_Any",nR.source);Bn(this,"src_Cc",rR.source);Bn(this,"src_Z",oR.source);Bn(this,"src_P",K0.source);Bn(this,"src_ZPCc",[this.src_Z,this.src_P,this.src_Cc].join("|"));Bn(this,"src_ZCc",[this.src_Z,this.src_Cc].join("|"));Bn(this,"cache",{});Bn(this,"opts",{maxLength:1e4,urlAuth:!1,schema_names:[]});this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){let r=this.escapeRE(e),a=this.escapeRE(t),o=`(?:(?!${this.src_ZCc}|${r}|${a}).)`,i=`${r}${o}{0,1000}${a}`;for(let s=2;s<=n;s++)i=`${r}(?:${o}|${i}){0,1000}${a}`;return i}get_text_separators(){var e;return(e=this.cache).text_separators??(e.text_separators=/[><\uff5c]/)}get_pseudo_letter(){var e;return(e=this.cache).src_pseudo_letter??(e.src_pseudo_letter=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`))}get_ipv4_addr(){var e;return(e=this.cache).src_ip4??(e.src_ip4=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"))}get_ipv6_addr(){var n;let e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return(n=this.cache).src_ip6_addr??(n.src_ip6_addr=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`))}get_ipv6_url_host(){var e;return(e=this.cache).src_ip6_host??(e.src_ip6_host=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`))}get_ipv6_mail_host(){var e;return(e=this.cache).src_ipv6_mail_host??(e.src_ipv6_mail_host=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`))}get_auth(){var e;return(e=this.cache).src_auth??(e.src_auth=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`))}get_port(){var e;return(e=this.cache).src_port??(e.src_port=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"))}get_host_terminator(){var e;return(e=this.cache).src_host_terminator??(e.src_host_terminator=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`))}get_path_terminator(){var e;return(e=this.cache).src_path_terminator??(e.src_path_terminator=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`))}get_path(){var e;return(e=this.cache).src_path??(e.src_path=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`))}get_mail_name(){var e;return(e=this.cache).src_mail_name??(e.src_mail_name=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"))}get_xn(){var e;return(e=this.cache).src_xn??(e.src_xn=new RegExp("xn--[a-z0-9\\-]{1,59}"))}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){var e;return(e=this.cache).src_domain_root??(e.src_domain_root=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`))}get_domain(){var e;return(e=this.cache).src_domain??(e.src_domain=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`))}get_url_host_port(){var e;return(e=this.cache).url_host_port??(e.url_host_port=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source))}get_fuzzy_url_host_port(){var e;return(e=this.cache).fuzzy_url_host_port??(e.fuzzy_url_host_port=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source))}get_mail_host(){var e;return(e=this.cache).src_mail_host??(e.src_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source))}get_fuzzy_mail_host(){var e;return(e=this.cache).src_fuzzy_mail_host??(e.src_fuzzy_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source))}get_path_extra(){var e;return(e=this.cache).src_path_extra??(e.src_path_extra=new RegExp(""))}get_fuzzy_mail_host_search(){var e;return(e=this.cache).mail_fuzzy_host_search??(e.mail_fuzzy_host_search=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig"))}get_fuzzy_link_search(){var e;return(e=this.cache).link_fuzzy_search??(e.link_fuzzy_search=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uFF5C])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig"))}get_http_validator(){var e;return(e=this.cache).http_validator??(e.http_validator=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy"))}get_relative_proto_validator(){var e;return(e=this.cache).relative_proto_validator??(e.relative_proto_validator=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy"))}get_mail_name_validator(){var e;return(e=this.cache).mail_name_validator??(e.mail_name_validator=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`))}get_mailto_validator(){var e;return(e=this.cache).mailto_validator??(e.mailto_validator=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy"))}get_schema_names(){var e;return(e=this.cache).schema_names??(e.schema_names=new RegExp((this.opts.schema_names||[]).map(t=>this.escapeRE(t)).join("|")))}get_schema_search(){var e;return(e=this.cache).schema_search??(e.schema_search=new RegExp(`(^|(?!_)(?:[><\uFF5C]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig"))}get_schema_at_start(){var e;return(e=this.cache).schema_at_start??(e.schema_at_start=new RegExp(`^${this.get_schema_search().source}`,"i"))}},uR={validate:(e,t,n)=>{let r=n.re.get_http_validator();r.lastIndex=t;let a=r.exec(e);return a?a[0].length:0},normalize:(e,t)=>t.normalize(e)},lpe={"http:":uR,"https:":uR,"ftp:":uR,"//":{validate:function(e,t,n){let r=n.re.get_relative_proto_validator();r.lastIndex=t;let a=r.exec(e);return a?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:a[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){let r=n.re.get_mailto_validator();r.lastIndex=t;let a=r.exec(e);return a?a[0].length:0},normalize:(e,t)=>t.normalize(e)}},upe="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",cpe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444";function fpe(){let e=cpe.split("|");return upe.split("|").forEach(t=>{let n=t.indexOf(":"),r=t.slice(0,n);for(let a of t.slice(n+1))e.push(r+a)}),e}var dpe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:fpe(),urlAuth:!1,maxLength:1e4},nj=class{constructor(e,t,n,r){Bn(this,"schema");Bn(this,"index");Bn(this,"lastIndex");Bn(this,"raw");Bn(this,"text");Bn(this,"url");let a=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=a,this.text=a,this.url=a}},rj=class{constructor(e={}){Bn(this,"__opts__");Bn(this,"__schemas__");Bn(this,"re");let{rebuilder:t,...n}=e;this.__opts__={...dpe,...n},this.__schemas__={...lpe},this.re=t||new spe,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{let n={normalize:(r,a)=>a.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){let r=this.re.get_fuzzy_mail_host_search(),a=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){let o=e.slice(Math.max(0,t.index-65),t.index);if(a.test(o))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){let t=[],n=this.re.get_schema_search(),r,a,o,i,s,l,u=!1,c=!1,f=!1,d=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(a=this.re.get_fuzzy_mail_host_search(),a.lastIndex=0,o=this.re.get_mail_name_validator());;){let p=Math.max(d-1,0);if(a&&o&&!f&&(!s||s.index<d))for(a.lastIndex<p&&(a.lastIndex=p);;){let y=a.exec(e);if(!y){f=!0,s=void 0;break}let b=o.exec(e.slice(Math.max(0,y.index-65),y.index));if(b){if(s={schema:"mailto:",index:y.index-b[1].length,lastIndex:y.index+y[0].length},s.index>=d)break;a.lastIndex<p&&(a.lastIndex=p)}}if(r&&!c&&(!i||i.index<d))for(r.lastIndex<p&&(r.lastIndex=p);;){let y=r.exec(e);if(!y){c=!0,i=void 0;break}if(i={schema:"",index:y.index+y[1].length,lastIndex:y.index+y[0].length},i.index>=d)break;r.lastIndex<p&&(r.lastIndex=p)}let h=s;(!h||i&&(i.index<h.index||i.index===h.index&&i.lastIndex>h.lastIndex))&&(h=i);let g;if(!u)for(;;){if(!l){n.lastIndex<p&&(n.lastIndex=p);let v=n.exec(e);if(!v){u=!0;break}l={schema:v[2],index:v.index+v[1].length,lastIndex:v.index+v[0].length}}if(l.index<d){l=void 0;continue}if(h&&l.index>h.index)break;let y=l;l=void 0;let b=this.testSchemaAt(e,y.schema,y.lastIndex);if(b){g={schema:y.schema,index:y.index,lastIndex:y.lastIndex+b};break}}let x=g;if((!x||s&&(s.index<x.index||s.index===x.index&&s.lastIndex>x.lastIndex))&&(x=s),(!x||i&&(i.index<x.index||i.index===x.index&&i.lastIndex>x.lastIndex))&&(x=i),!x)break;x===s?s=void 0:x===i&&(i=void 0);let m=new nj(e,x.schema,x.index,x.lastIndex);m.schema?this.__schemas__[m.schema].normalize(m,this):this.normalize(m),t.push(m),d=x.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;let t=this.re.get_schema_at_start().exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new nj(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};var ppe=/^xn--/,hpe=/[^\0-\x7F]/,mpe=/[\x2E\u3002\uFF0E\uFF61]/g,gpe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},cR=35,$i=Math.floor,fR=String.fromCharCode;function Nu(e){throw new RangeError(gpe[e])}function xpe(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function oj(e,t){let n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(mpe,".");let a=e.split("."),o=xpe(a,t).join(".");return r+o}function ij(e){let t=[],n=0,r=e.length;for(;n<r;){let a=e.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){let o=e.charCodeAt(n++);(o&64512)==56320?t.push(((a&1023)<<10)+(o&1023)+65536):(t.push(a),n--)}else t.push(a)}return t}var bpe=e=>String.fromCodePoint(...e),ype=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},aj=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},sj=function(e,t,n){let r=0;for(e=n?$i(e/700):e>>1,e+=$i(e/t);e>cR*26>>1;r+=36)e=$i(e/cR);return $i(r+(cR+1)*e/(e+38))},lj=function(e){let t=[],n=e.length,r=0,a=128,o=72,i=e.lastIndexOf("-");i<0&&(i=0);for(let s=0;s<i;++s)e.charCodeAt(s)>=128&&Nu("not-basic"),t.push(e.charCodeAt(s));for(let s=i>0?i+1:0;s<n;){let l=r;for(let c=1,f=36;;f+=36){s>=n&&Nu("invalid-input");let d=ype(e.charCodeAt(s++));d>=36&&Nu("invalid-input"),d>$i((2147483647-r)/c)&&Nu("overflow"),r+=d*c;let p=f<=o?1:f>=o+26?26:f-o;if(d<p)break;let h=36-p;c>$i(2147483647/h)&&Nu("overflow"),c*=h}let u=t.length+1;o=sj(r-l,u,l==0),$i(r/u)>2147483647-a&&Nu("overflow"),a+=$i(r/u),r%=u,t.splice(r++,0,a)}return String.fromCodePoint(...t)},uj=function(e){let t=[];e=ij(e);let n=e.length,r=128,a=0,o=72;for(let l of e)l<128&&t.push(fR(l));let i=t.length,s=i;for(i&&t.push("-");s<n;){let l=2147483647;for(let c of e)c>=r&&c<l&&(l=c);let u=s+1;l-r>$i((2147483647-a)/u)&&Nu("overflow"),a+=(l-r)*u,r=l;for(let c of e)if(c<r&&++a>2147483647&&Nu("overflow"),c===r){let f=a;for(let d=36;;d+=36){let p=d<=o?1:d>=o+26?26:d-o;if(f<p)break;let h=f-p,g=36-p;t.push(fR(aj(p+h%g,0))),f=$i(h/g)}t.push(fR(aj(f,0))),o=sj(a,u,s===i),a=0,++s}++a,++r}return t.join("")},vpe=function(e){return oj(e,function(t){return ppe.test(t)?lj(t.slice(4).toLowerCase()):t})},wpe=function(e){return oj(e,function(t){return hpe.test(t)?"xn--"+uj(t):t})},kpe={version:"2.3.1",ucs2:{decode:ij,encode:bpe},decode:lj,encode:uj,toASCII:wpe,toUnicode:vpe};var dR=kpe;var cj=Object.defineProperty,kj=(e,t)=>{let n={};for(var r in e)cj(n,r,{get:e[r],enumerable:!0});return t||cj(n,Symbol.toStringTag,{value:"Module"}),n},Cpe=kj({arrayReplaceAt:()=>Spe,asciiTrim:()=>VC,callable:()=>Cj,escapeHtml:()=>Ou,escapeRE:()=>Npe,fromCodePoint:()=>Y0,isMdAsciiPunct:()=>Q0,isPunctChar:()=>Lj,isPunctCharCode:()=>J0,isSpace:()=>Jt,isValidEntityCode:()=>bR,isWhiteSpace:()=>Z0,lib:()=>Ope,normalizeReference:()=>HC,unescapeAll:()=>Qh,unescapeMd:()=>Epe});function Cj(e){let t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Spe(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function bR(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Y0(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Sj=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Lpe=new RegExp(`${Sj.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ipe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ape(e,t){if(t.charCodeAt(0)===35&&Ipe.test(t)){let r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return bR(r)?Y0(r):e}let n=PC(e);return n!==e?n:e}function Epe(e){return e.indexOf("\\")<0?e:e.replace(Sj,"$1")}function Qh(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Lpe,function(t,n,r){return n||Ape(t,r)})}var _pe=/[&<>"]/,Tpe=/[&<>"]/g,Dpe={"&":"&","<":"<",">":">",'"':"""};function Rpe(e){return Dpe[e]}function Ou(e){return _pe.test(e)?e.replace(Tpe,Rpe):e}var Mpe=/[.?*+^$[\]\\(){}|-]/g;function Npe(e){return e.replace(Mpe,"\\$&")}function Jt(e){switch(e){case 9:case 32:return!0}return!1}function Z0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Lj(e){return K0.test(e)||aR.test(e)}function J0(e){return Lj(Y0(e))}function Q0(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function HC(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function fj(e){return e===32||e===9||e===10||e===13}function VC(e){let t=0;for(;t<e.length&&fj(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&fj(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Ope={mdurl:tR,ucmicro:iR};function Ppe(e,t,n){let r,a,o,i,s=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(o=e.src.charCodeAt(e.pos),o===93&&(r--,r===0)){a=!0;break}if(i=e.pos,e.md.inline.skipToken(e),o===91){if(i===e.pos-1)r++;else if(n)return e.pos=l,-1}}let u=-1;return a&&(u=e.pos),e.pos=l,u}function Bpe(e,t,n){let r,a=t,o={ok:!1,pos:0,str:""};if(e.charCodeAt(a)===60){for(a++;a<n;){if(r=e.charCodeAt(a),r===10||r===60)return o;if(r===62)return o.pos=a+1,o.str=Qh(e.slice(t+1,a)),o.ok=!0,o;if(r===92&&a+1<n){a+=2;continue}a++}return o}let i=0;for(;a<n&&(r=e.charCodeAt(a),!(r===32||r<32||r===127));){if(r===92&&a+1<n){if(e.charCodeAt(a+1)===32){a++;continue}a+=2;continue}if(r===40&&(i++,i>32))return o;if(r===41){if(i===0)break;i--}a++}return t===a||i!==0||(o.str=Qh(e.slice(t,a)),o.pos=a,o.ok=!0),o}function zpe(e,t,n,r){let a,o=t,i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(o>=n)return i;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return i;t++,o++,s===40&&(s=41),i.marker=s}for(;o<n;){if(a=e.charCodeAt(o),a===i.marker)return i.pos=o+1,i.str+=Qh(e.slice(t,o)),i.ok=!0,i;if(a===40&&i.marker===41)return i;a===92&&o+1<n&&o++,o++}return i.can_continue=!0,i.str+=Qh(e.slice(t,o)),i}var Fpe=kj({parseLinkDestination:()=>Bpe,parseLinkLabel:()=>Ppe,parseLinkTitle:()=>zpe});function eb(e){"@babel/helpers - typeof";return eb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eb(e)}function Hpe(e,t){if(eb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(eb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vpe(e){var t=Hpe(e,"string");return eb(t)=="symbol"?t:t+""}function _e(e,t,n){return(t=Vpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rf=class{constructor(e,t,n){_e(this,"map",null),_e(this,"level",0),_e(this,"children",null),_e(this,"content",""),_e(this,"markup",""),_e(this,"info",""),_e(this,"block",!1),_e(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},tb=class{constructor(){_e(this,"__rules__",[]),_e(this,"__cache__",null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){let e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){let r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){let a=this.__find__(e);if(a===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(a,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){let a=this.__find__(e);if(a===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(a+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(r=>{let a=this.__find__(r);if(a<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[a].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(r=>{let a=this.__find__(r);if(a<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[a].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Gi={};Gi.code_inline=function(e,t,n,r,a){let o=e[t];return`<code${a.renderAttrs(o)}>${Ou(o.content)}</code>`};Gi.code_block=function(e,t,n,r,a){let o=e[t];return`<pre${a.renderAttrs(o)}><code>${Ou(e[t].content)}</code></pre>
|
|
657
|
+
`};Gi.fence=function(e,t,n,r,a){let o=e[t],i=o.info?Qh(o.info).trim():"",s="",l="";if(i){let c=i.split(/(\s+)/g);s=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(o.content,s,l)||Ou(o.content):u=Ou(o.content),u.indexOf("<pre")===0)return u+`
|
|
658
|
+
`;if(i){let c=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];c<0?f.push(["class",`${n.langPrefix}${s}`]):(f[c]=[f[c][0],f[c][1]],f[c][1]+=` ${n.langPrefix}${s}`);let d={attrs:f};return`<pre><code${a.renderAttrs(d)}>${u}</code></pre>
|
|
659
|
+
`}return`<pre><code${a.renderAttrs(o)}>${u}</code></pre>
|
|
660
|
+
`};Gi.image=function(e,t,n,r,a){let o=e[t];return o.attrs[o.attrIndex("alt")][1]=a.renderInlineAsText(o.children,n,r),a.renderToken(e,t,n)};Gi.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
661
|
+
`:`<br>
|
|
662
|
+
`};Gi.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
663
|
+
`:`<br>
|
|
664
|
+
`:`
|
|
665
|
+
`};Gi.text=function(e,t){return Ou(e[t].content)};Gi.html_block=function(e,t){return e[t].content};Gi.html_inline=function(e,t){return e[t].content};var Ij=class{constructor(){_e(this,"rules",Object.assign({},Gi))}renderAttrs(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=` ${Ou(e.attrs[t][0])}="${Ou(String(e.attrs[t][1]))}"`;return r}renderToken(e,t,n){let r=e[t],a="";if(r.hidden)return"";let o=t-1;for(;o>=0&&e[o].hidden&&e[o].nesting===0;)o--;r.block&&r.nesting!==-1&&o>=0&&e[o].hidden&&e[o].nesting===-1&&(a+=`
|
|
666
|
+
`),a+=(r.nesting===-1?"</":"<")+r.tag,a+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(a+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1)){let s=t+1;for(;s<e.length&&e[s].hidden&&e[s].nesting===0;)s++;if(s<e.length){let l=e[s];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===r.tag)&&(i=!1)}}return a+=i?`>
|
|
667
|
+
`:">",a}renderInline(e,t,n){let r="",a=this.rules;for(let o=0,i=e.length;o<i;o++){let s=e[o].type;typeof a[s]<"u"?r+=a[s](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r}renderInlineAsText(e,t,n){let r="";for(let a=0,o=e.length;a<o;a++)switch(e[a].type){case"text":case"code_inline":r+=e[a].content;break;case"image":r+=this.renderInlineAsText(e[a].children,t,n);break;case"html_inline":case"html_block":r+=e[a].content;break;case"softbreak":case"hardbreak":r+=`
|
|
668
|
+
`}return r}render(e,t,n){let r="",a=this.rules;for(let o=0,i=e.length;o<i;o++){let s=e[o].type;s==="inline"?r+=this.renderInline(e[o].children,t,n):typeof a[s]<"u"?r+=a[s](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r}},Aj=class{constructor(e,t,n){_e(this,"tokens",[]),_e(this,"inlineMode",!1),_e(this,"Token",Rf),this.src=e,this.env=n,this.md=t}},Upe=/\r\n?/g,qpe=/\0/g;function jpe(e){let t;t=e.src.replace(Upe,`
|
|
669
|
+
`),t=t.replace(qpe,"\uFFFD"),e.src=t}function $pe(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Gpe(e){let t=e.tokens,n=0;for(let r=0;r<t.length;r++)t[r].type!=="reference_definition"&&(r!==n&&(t[n]=t[r]),n++);t.length!==n&&(t.length=n)}function Wpe(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let a=t[n];a.type==="inline"&&e.md.inline.parse(a.content,e.md,e.env,a.children)}}function Kpe(e){return/^<a[>\s]/i.test(e)}function Xpe(e){return/^<\/a\s*>/i.test(e)}function Ype(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.test(t[n].content))continue;let a=t[n].children,o=[],i=0;for(let s=a.length-1;s>=0;s--){let l=a[s];if(l.type==="link_close"){for(s--;a[s].level!==l.level&&a[s].type!=="link_open";)s--;continue}if(l.type==="html_inline"&&(Kpe(l.content)&&i>0&&i--,Xpe(l.content)&&i++),!(i>0)&&l.type==="text"&&e.md.linkify.test(l.content)){let u=l.content,c=e.md.linkify.match(u),f=[],d=l.level,p=0;c.length>0&&c[0].index===0&&s>0&&a[s-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){let g=c[h].url,x=e.md.normalizeLink(g);if(!e.md.validateLink(x))continue;let m=c[h].text;c[h].schema?c[h].schema==="mailto:"&&!/^mailto:/i.test(m)?m=e.md.normalizeLinkText(`mailto:${m}`).replace(/^mailto:/,""):m=e.md.normalizeLinkText(m):m=e.md.normalizeLinkText(`http://${m}`).replace(/^http:\/\//,"");let y=c[h].index;if(y>p){let k=new e.Token("text","",0);k.content=u.slice(p,y),k.level=d,f.push(k)}let b=new e.Token("link_open","a",1);b.attrs=[["href",x]],b.level=d++,b.markup="linkify",b.info="auto",f.push(b);let v=new e.Token("text","",0);v.content=m,v.level=d,f.push(v);let w=new e.Token("link_close","a",-1);w.level=--d,w.markup="linkify",w.info="auto",f.push(w),p=c[h].lastIndex}if(p<u.length){let h=new e.Token("text","",0);h.content=u.slice(p),h.level=d,f.push(h)}o.push({index:s,nodes:f})}}if(o.length>0){let s=a.length;for(let f of o)s+=f.nodes.length-1;let l=new Array(s),u=0,c=0;o.reverse();for(let f=0;f<a.length;f++){let d=o[u];if(d?.index===f){for(let p of d.nodes)l[c++]=p;u++}else l[c++]=a[f]}t[n].children=l}}}var Ej=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Zpe=/\((c|tm|r)\)/i,Jpe=/\((c|tm|r)\)/gi,Qpe={c:"\xA9",r:"\xAE",tm:"\u2122"};function ehe(e,t){return Qpe[t.toLowerCase()]}function the(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(Jpe,ehe)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function nhe(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type==="text"&&!t&&Ej.test(r.content)&&(r.content=r.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1\u2014").replace(/(^|\s)--(?=\s|$)/gm,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function rhe(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Zpe.test(e.tokens[t].content)&&the(e.tokens[t].children),Ej.test(e.tokens[t].content)&&nhe(e.tokens[t].children))}var ahe=/['"]/,dj=/['"]/g,pj="\u2019",ohe=1e3;function hj(e,t,n){for(;e.length>n;){let r=e.pop();r.isSingleQuote?t.single=r.prevSameQuoteIdx:t.double=r.prevSameQuoteIdx}}function BC(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function ihe(e,t){let n="",r=0;t.sort((a,o)=>a.pos-o.pos);for(let a=0;a<t.length;a++){let o=t[a];n+=e.slice(r,o.pos)+o.ch,r=o.pos+1}return n+e.slice(r)}function she(e,t){let n,r=[],a={single:-1,double:-1},o={};for(let i=0;i<e.length;i++){let s=e[i],l=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(hj(r,a,n+1),s.type!=="text")continue;let u=s.content,c=0,f=u.length;e:for(;c<f;){dj.lastIndex=c;let d=dj.exec(u);if(!d)break;let p=!0,h=!0;c=d.index+1;let g=d[0]==="'",x=32;if(d.index-1>=0)x=u.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(c<f)m=u.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}let y=Q0(x)||J0(x),b=Q0(m)||J0(m),v=Z0(x),w=Z0(m);if(w?p=!1:b&&(v||y||(p=!1)),v?h=!1:y&&(w||b||(h=!1)),m===34&&d[0]==='"'&&x>=48&&x<=57&&(h=p=!1),p&&h&&(p=y,h=b),!p&&!h){g&&BC(o,i,d.index,pj);continue}if(h&&(n=g?a.single:a.double,n>=0&&r[n].level===l)){let k=r[n],_,E;g?(_=t.md.options.quotes[2],E=t.md.options.quotes[3]):(_=t.md.options.quotes[0],E=t.md.options.quotes[1]),BC(o,i,d.index,E),BC(o,k.tokenIdx,k.contentPos,_),hj(r,a,n);continue e}if(p){if(r.length>=ohe)return;r.push({tokenIdx:i,contentPos:d.index,isSingleQuote:g,level:l,prevSameQuoteIdx:g?a.single:a.double}),g?a.single=r.length-1:a.double=r.length-1}else h&&g&&BC(o,i,d.index,pj)}}Object.keys(o).forEach(function(i){let s=Number(i);e[s].content=ihe(e[s].content,o[i])})}function lhe(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!ahe.test(e.tokens[t].content)||she(e.tokens[t].children,e)}function uhe(e){let t,n,r=e.length;for(t=0;t<r;t++)e[t].type==="text_special"&&(e[t].type="text");for(t=n=0;t<r;t++)e[t].type==="text"&&t+1<r&&e[t+1].type==="text"?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}function che(e){let t,n,r=e.tokens,a=r.length;for(let o=0;o<a;o++){if(r[o].type!=="inline")continue;let i=r[o].children,s=i.length;for(t=0;t<s;t++)i[t].type==="text_special"&&(i[t].type="text"),i[t].children&&uhe(i[t].children);for(t=n=0;t<s;t++)i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var pR=[["normalize",jpe],["block",$pe],["strip_references",Gpe],["inline",Wpe],["linkify",Ype],["replacements",rhe],["smartquotes",lhe],["text_join",che]],_j=class{constructor(){_e(this,"ruler",new tb),_e(this,"State",Aj);for(let e=0;e<pR.length;e++)this.ruler.push(pR[e][0],pR[e][1])}process(e){let t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)}},Tj=class{constructor(e,t,n,r){_e(this,"bMarks",[]),_e(this,"eMarks",[]),_e(this,"tShift",[]),_e(this,"sCount",[]),_e(this,"bsCount",[]),_e(this,"blkIndent",0),_e(this,"line",0),_e(this,"lineMax",0),_e(this,"tight",!1),_e(this,"listIndent",-1),_e(this,"parentType","root"),_e(this,"level",0),_e(this,"Token",Rf),this.src=e,this.md=t,this.env=n,this.tokens=r;let a=this.src;for(let o=0,i=0,s=0,l=0,u=a.length,c=!1;i<u;i++){let f=a.charCodeAt(i);if(!c)if(Jt(f)){s++,f===9?l+=4-l%4:l++;continue}else c=!0;(f===10||i===u-1)&&(f!==10&&i++,this.bMarks.push(o),this.eMarks.push(i),this.tShift.push(s),this.sCount.push(l),this.bsCount.push(0),c=!1,s=0,l=0,o=i+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new Rf(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){for(let t=this.src.length;e<t&&Jt(this.src.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;for(;e>t;)if(!Jt(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";let a=new Array(t-e);for(let o=0,i=e;i<t;i++,o++){let s=0,l=this.bMarks[i],u=l,c;for(i+1<t||r?c=this.eMarks[i]+1:c=this.eMarks[i];u<c&&s<n;){let f=this.src.charCodeAt(u);if(Jt(f))f===9?s+=4-(s+this.bsCount[i])%4:s++;else if(u-l<this.tShift[i])s++;else break;u++}s>n?a[o]=new Array(s-n+1).join(" ")+this.src.slice(u,c):a[o]=this.src.slice(u,c)}return a.join("")}},fhe=65536;function hR(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function mj(e){let t=[],n=e.length,r=0,a=e.charCodeAt(r),o=!1,i=0,s="";for(;r<n;)a===124&&(o?(s+=e.substring(i,r-1),i=r):(t.push(s+e.substring(i,r)),s="",i=r+1)),o=a===92,r++,a=e.charCodeAt(r);return t.push(s+e.substring(i)),t}function dhe(e,t,n,r){if(t+2>n)return!1;let a=t+1;if(e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)return!1;let o=e.bMarks[a]+e.tShift[a];if(o>=e.eMarks[a])return!1;let i=e.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=e.eMarks[a])return!1;let s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!Jt(s)||i===45&&Jt(s))return!1;for(;o<e.eMarks[a];){let v=e.src.charCodeAt(o);if(v!==124&&v!==45&&v!==58&&!Jt(v))return!1;o++}let l=hR(e,t+1),u=l.split("|"),c=[];for(let v=0;v<u.length;v++){let w=u[v].trim();if(!w){if(v===0||v===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?c.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=hR(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=mj(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();let f=u.length;if(f===0||f!==c.length)return!1;if(r)return!0;let d=e.parentType;e.parentType="table";let p=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),g=[t,0];h.map=g;let x=e.push("thead_open","thead",1);x.map=[t,t+1];let m=e.push("tr_open","tr",1);m.map=[t,t+1];for(let v=0;v<u.length;v++){let w=e.push("th_open","th",1);c[v]&&(w.attrs=[["style",`text-align:${c[v]}`]]);let k=e.push("inline","",0);k.content=u[v].trim(),k.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,b=0;for(a=t+2;a<n&&!(e.sCount[a]<e.blkIndent);a++){let v=!1;for(let k=0,_=p.length;k<_;k++)if(p[k](e,a,n,!0)){v=!0;break}if(v||(l=hR(e,a).trim(),!l)||e.sCount[a]-e.blkIndent>=4||(u=mj(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),b+=f-u.length,b>fhe))break;if(a===t+2){let k=e.push("tbody_open","tbody",1);k.map=y=[t+2,0]}let w=e.push("tr_open","tr",1);w.map=[a,a+1];for(let k=0;k<f;k++){let _=e.push("td_open","td",1);c[k]&&(_.attrs=[["style",`text-align:${c[k]}`]]);let E=e.push("inline","",0);E.content=u[k]?u[k].trim():"",E.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=a),e.push("table_close","table",-1),g[1]=a,e.parentType=d,e.line=a,!0}function phe(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,a=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,a=r;continue}break}e.line=a;let o=e.push("code_block","code",0);return o.content=e.getLines(t,a,4+e.blkIndent,!1)+`
|
|
670
|
+
`,o.map=[t,e.line],!0}function hhe(e,t,n,r){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||a+3>o)return!1;let i=e.src.charCodeAt(a);if(i!==126&&i!==96)return!1;let s=a;a=e.skipChars(a,i);let l=a-s;if(l<3)return!1;let u=e.src.slice(s,a),c=e.src.slice(a,o);if(i===96&&c.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let f=t,d=!1;for(;f++,!(f>=n||(a=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],a<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(a)===i&&!(e.sCount[f]-e.blkIndent>=4)&&(a=e.skipChars(a,i),!(a-s<l)&&(a=e.skipSpaces(a),!(a<o)))){d=!0;break}l=e.sCount[t],e.line=f+(d?1:0);let p=e.push("fence","code",0);return p.info=c,p.content=e.getLines(t+1,f,l,!0),p.markup=u,p.map=[t,e.line],!0}function mhe(e,t,n,r){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(a)!==62)return!1;if(r)return!0;let s=[],l=[],u=[],c=[],f=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let p=!1,h;for(h=t;h<n;h++){let b=e.sCount[h]<e.blkIndent;if(a=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],a>=o)break;if(e.src.charCodeAt(a++)===62&&!b){let w=e.sCount[h]+1,k,_;e.src.charCodeAt(a)===32?(a++,w++,_=!1,k=!0):e.src.charCodeAt(a)===9?(k=!0,(e.bsCount[h]+w)%4===3?(a++,w++,_=!1):_=!0):k=!1;let E=w;for(s.push(e.bMarks[h]),e.bMarks[h]=a;a<o;){let M=e.src.charCodeAt(a);if(Jt(M))M===9?E+=4-(E+e.bsCount[h]+(_?1:0))%4:E++;else break;a++}p=a>=o,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(k?1:0),u.push(e.sCount[h]),e.sCount[h]=E-w,c.push(e.tShift[h]),e.tShift[h]=a-e.bMarks[h];continue}if(p)break;let v=!1;for(let w=0,k=f.length;w<k;w++)if(f[w](e,h,n,!0)){v=!0;break}if(v){e.lineMax=h,e.blkIndent!==0&&(s.push(e.bMarks[h]),l.push(e.bsCount[h]),c.push(e.tShift[h]),u.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}s.push(e.bMarks[h]),l.push(e.bsCount[h]),c.push(e.tShift[h]),u.push(e.sCount[h]),e.sCount[h]=-1}let g=e.blkIndent;e.blkIndent=0;let x=e.push("blockquote_open","blockquote",1);x.markup=">";let m=[t,0];x.map=m,e.md.block.tokenize(e,t,h);let y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=i,e.parentType=d,m[1]=e.line;for(let b=0;b<c.length;b++)e.bMarks[b+t]=s[b],e.tShift[b+t]=c[b],e.sCount[b+t]=u[b],e.bsCount[b+t]=l[b];return e.blkIndent=g,!0}function ghe(e,t,n,r){let a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let s=1;for(;o<a;){let u=e.src.charCodeAt(o++);if(u!==i&&!Jt(u))return!1;u===i&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(s+1).join(String.fromCharCode(i)),!0}function gj(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],a=e.src.charCodeAt(r++);return a!==42&&a!==45&&a!==43||r<n&&!Jt(e.src.charCodeAt(r))?-1:r}function xj(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],a=n;if(a+1>=r)return-1;let o=e.src.charCodeAt(a++);if(o<48||o>57)return-1;for(;;){if(a>=r)return-1;if(o=e.src.charCodeAt(a++),o>=48&&o<=57){if(a-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return a<r&&(o=e.src.charCodeAt(a),!Jt(o))?-1:a}function xhe(e,t){let n=e.level+2;for(let r=t+2,a=e.tokens.length-2;r<a;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function bhe(e,t,n,r){let a,o,i,s,l=t,u=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;r&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let f,d,p;if((p=xj(e,l))>=0){if(f=!0,i=e.bMarks[l]+e.tShift[l],d=Number(e.src.slice(i,p-1)),c&&d!==1)return!1}else if((p=gj(e,l))>=0)f=!1;else return!1;if(c&&e.skipSpaces(p)>=e.eMarks[l])return!1;if(r)return!0;let h=e.src.charCodeAt(p-1),g=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),d!==1&&(s.attrs=[["start",d]])):s=e.push("bullet_list_open","ul",1);let x=[l,0];s.map=x,s.markup=String.fromCharCode(h);let m=!1,y=e.md.block.ruler.getRules("list"),b=e.parentType;for(e.parentType="list";l<n;){o=p,a=e.eMarks[l];let v=e.sCount[l]+p-(e.bMarks[l]+e.tShift[l]),w=v;for(;o<a;){let fe=e.src.charCodeAt(o);if(fe===9)w+=4-(w+e.bsCount[l])%4;else if(fe===32)w++;else break;o++}let k=o,_;k>=a?_=1:_=w-v,_>4&&(_=1);let E=v+_;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(h);let M=[l,0];s.map=M,f&&(s.info=e.src.slice(i,p-1));let S=e.tight,U=e.tShift[l],N=e.sCount[l],q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=E,e.tight=!0,e.tShift[l]=k-e.bMarks[l],e.sCount[l]=w,k>=a&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n),(!e.tight||m)&&(u=!1),m=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=q,e.tShift[l]=U,e.sCount[l]=N,e.tight=S,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(h),l=e.line,M[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let ie=!1;for(let fe=0,he=y.length;fe<he;fe++)if(y[fe](e,l,n,!0)){ie=!0;break}if(ie)break;if(f){if(p=xj(e,l),p<0)break;i=e.bMarks[l]+e.tShift[l]}else if(p=gj(e,l),p<0)break;if(h!==e.src.charCodeAt(p-1))break}return f?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(h),x[1]=l,e.line=l,e.parentType=b,u&&xhe(e,g),!0}var mR=999;function yhe(e){let t=e.length;for(let n=0;n<e.length-1;n++){let r=e.charCodeAt(n);if(r<55296||r>56319)continue;let a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(t--,n++)}return t}function X0(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function zC(e,t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let a=e.md.block.ruler.getRules("reference"),o=e.parentType;e.parentType="reference";let i=!1;for(let s=0,l=a.length;s<l;s++)if(a[s](e,t,n,!0)){i=!0;break}if(e.parentType=o,i)return-1}return e.bMarks[t]+e.tShift[t]}function vhe(e,t,n,r){let a=e.src,o=e.bMarks[t]+e.tShift[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||a.charCodeAt(o)!==91)return!1;let s=X0(e,t),l="",u=-1,c=++o;for(;o<s;){if(l.length+o-c>mR*2)return!1;let k=a.charCodeAt(o);if(k===91)return!1;if(k===93){u=o;break}if(k===92&&(k=a.charCodeAt(++o)),k===10&&o<s){let _=zC(e,i);if(_<0)return!1;l+=a.slice(c,s),o=c=_,s=X0(e,i++);continue}o++}if(u<0||a.charCodeAt(u+1)!==58||(l+=a.slice(c,u),l.length>mR&&yhe(l)>mR))return!1;for(o=u+2;o<s;){let k=a.charCodeAt(o);if(k===10){let _=zC(e,i);if(_<0)break;o=_,s=X0(e,i++)}else if(Jt(k))o++;else break}let f=e.md.helpers.parseLinkDestination(a,o,s);if(!f.ok)return!1;let d=e.md.normalizeLink(f.str);if(!e.md.validateLink(d))return!1;o=f.pos;let p=o,h=s,g=i;for(;o<s;){let k=a.charCodeAt(o);if(k===10){let _=zC(e,i);if(_<0)break;o=_,s=X0(e,i++)}else if(Jt(k))o++;else break}let x=o,m=e.md.helpers.parseLinkTitle(a,o,s);for(;m.can_continue;){let k=zC(e,i);if(k<0)break;o=k,s=X0(e,i++),m=e.md.helpers.parseLinkTitle(a,o,s,m)}let y;for(x!==p&&m.ok?(y=m.str,o=m.pos):(y="",o=p,s=h,i=g);o<s&&Jt(a.charCodeAt(o));)o++;if(o<s&&a.charCodeAt(o)!==10&&y)for(y="",o=p,s=h,i=g;o<s&&Jt(a.charCodeAt(o));)o++;if(o<s&&a.charCodeAt(o)!==10)return!1;let b=HC(l);if(!b)return!1;if(r)return!0;typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:y,href:d});let v=e.push("reference_definition","",0);v.map=[t,i],v.hidden=!0;let w=Object.create(null);return w.label=b,v.meta=w,e.line=i,!0}var whe=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Dj=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Rj="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";new RegExp(`^(?:${Dj}|${Rj}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);var Mj=new RegExp(`^(?:${Dj}|${Rj})`),Df=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${whe.join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${Mj.source}\\s*$`),/^$/,!1]];function khe(e,t,n,r){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(a)!==60)return!1;let i=e.src.slice(a,o),s=0;for(;s<Df.length&&!Df[s][0].test(i);s++);if(s===Df.length)return!1;if(r)return Df[s][2];let l=t+1,u=Df[s][1].test("");if(!Df[s][1].test(i)){for(;l<n&&!(e.sCount[l]<e.blkIndent&&(u||!e.isEmpty(l)));l++)if(a=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],i=e.src.slice(a,o),Df[s][1].test(i)){i.length!==0&&l++;break}}e.line=l;let c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0}function Che(e,t,n,r){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(a);if(i!==35||a>=o)return!1;let s=1;for(i=e.src.charCodeAt(++a);i===35&&a<o&&s<=6;)s++,i=e.src.charCodeAt(++a);if(s>6||a<o&&!Jt(i))return!1;if(r)return!0;o=e.skipSpacesBack(o,a);let l=e.skipCharsBack(o,35,a);l>a&&Jt(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;let u=e.push("heading_open",`h${s}`,1);u.markup="########".slice(0,s),u.map=[t,e.line];let c=e.push("inline","",0);c.content=VC(e.src.slice(a,o)),c.map=[t,e.line],c.children=[];let f=e.push("heading_close",`h${s}`,-1);return f.markup="########".slice(0,s),!0}function She(e,t,n){let r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.parentType;e.parentType="paragraph";let o=0,i,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let p=e.bMarks[s]+e.tShift[s],h=e.eMarks[s];if(p<h&&(i=e.src.charCodeAt(p),(i===45||i===61)&&(p=e.skipChars(p,i),p=e.skipSpaces(p),p>=h))){o=i===61?1:2;break}}if(e.sCount[s]<0)continue;let d=!1;for(let p=0,h=r.length;p<h;p++)if(r[p](e,s,n,!0)){d=!0;break}if(d)break}if(!o)return e.parentType=a,!1;let l=VC(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let u=e.push("heading_open",`h${o}`,1);u.markup=String.fromCharCode(i),u.map=[t,e.line];let c=e.push("inline","",0);c.content=l,c.map=[t,e.line-1],c.children=[];let f=e.push("heading_close",`h${o}`,-1);return f.markup=String.fromCharCode(i),e.parentType=a,!0}function Lhe(e,t,n){let r=e.md.block.ruler.getRules("paragraph"),a=e.parentType,o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let u=!1;for(let c=0,f=r.length;c<f;c++)if(r[c](e,o,n,!0)){u=!0;break}if(u)break}let i=VC(e.getLines(t,o,e.blkIndent,!1));e.line=o;let s=e.push("paragraph_open","p",1);s.map=[t,e.line];let l=e.push("inline","",0);return l.content=i,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=a,!0}var FC=[["table",dhe,["paragraph","reference"]],["code",phe],["fence",hhe,["paragraph","reference","blockquote","list"]],["blockquote",mhe,["paragraph","reference","blockquote","list"]],["hr",ghe,["paragraph","reference","blockquote","list"]],["list",bhe,["paragraph","reference","blockquote"]],["reference",vhe],["html_block",khe,["paragraph","reference","blockquote"]],["heading",Che,["paragraph","reference","blockquote"]],["lheading",She],["paragraph",Lhe]],Nj=class{constructor(){_e(this,"ruler",new tb),_e(this,"State",Tj);for(let e=0;e<FC.length;e++)this.ruler.push(FC[e][0],FC[e][1],{alt:(FC[e][2]||[]).slice()})}tokenize(e,t,n){let r=this.ruler.getRules(""),a=r.length,o=e.md.options.maxNesting,i=t,s=!1;for(;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n||e.sCount[i]<e.blkIndent));){if(e.level>=o){e.line=n;break}let l=e.line,u=!1;for(let c=0;c<a;c++)if(u=r[c](e,i,n,!1),u){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),i=e.line,i<n&&e.isEmpty(i)&&(s=!0,i++,e.line=i)}}parse(e,t,n,r){if(!e)return;let a=new this.State(e,t,n,r);this.tokenize(a,a.line,a.lineMax)}},Oj=class{constructor(e,t,n,r){_e(this,"pos",0),_e(this,"level",0),_e(this,"pending",""),_e(this,"pendingLevel",0),_e(this,"cache",{}),_e(this,"backticks",{}),_e(this,"backticksScanned",!1),_e(this,"skipHtmlSpecial",!1),_e(this,"linkLevel",0),_e(this,"delimiters",[]),_e(this,"_prev_delimiters",[]),_e(this,"Token",Rf),this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new Rf("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,t,n){this.pending&&this.pushPending();let r=new Rf(e,t,n),a;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],a={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(a),r}scanDelims(e,t){let n=this.posMax,r=this.src.charCodeAt(e),a;if(e===0)a=32;else if(e===1)a=this.src.charCodeAt(0),(a&63488)===55296&&(a=65533);else if(a=this.src.charCodeAt(e-1),(a&64512)===56320){let h=this.src.charCodeAt(e-2);a=(h&64512)===55296?65536+(h-55296<<10)+(a-56320):65533}else(a&64512)===55296&&(a=65533);let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;let i=o-e,s=o<n?this.src.charCodeAt(o):32;if((s&64512)===55296){let h=this.src.charCodeAt(o+1);s=(h&64512)===56320?65536+(s-55296<<10)+(h-56320):65533}else(s&64512)===56320&&(s=65533);let l=Q0(a)||J0(a),u=Q0(s)||J0(s),c=Z0(a),f=Z0(s),d=!f&&(!u||c||l),p=!c&&(!l||f||u);return{can_open:d&&(t||!p||l),can_close:p&&(t||!d||u),length:i}}};function Ihe(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Ahe(e,t){let n=e.pos;for(;n<e.posMax&&!Ihe(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function Ehe(e){return e>=65&&e<=90||e>=97&&e<=122}function _he(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function The(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let a=n-Math.min(10,e.pending.length,n),o=n;for(;o>a&&_he(e.src.charCodeAt(o-1));)o--;if(o===n||!Ehe(e.src.charCodeAt(o)))return!1;let i=n-o,s=e.md.linkify.matchAtStart(e.src.slice(o));if(!s)return!1;let l=s.url;if(l.length<=i)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-i);let f=e.push("link_open","a",1);f.attrs=[["href",c]],f.markup="linkify",f.info="auto";let d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);let p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-i,!0}function Dhe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,a=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<a&&Jt(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var yR=[];for(let e=0;e<256;e++)yR.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){yR[e.charCodeAt(0)]=1});function Rhe(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let a=e.src.charCodeAt(n);if(a===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(a=e.src.charCodeAt(n),!!Jt(a));)n++;return e.pos=n,!0}if(a===32){if(!t){let s=e.push("text_special","",0);s.content="\\",s.markup="\\",s.info="escape"}return e.pos=n,!0}let o=e.src[n];if(a>=55296&&a<=56319&&n+1<r){let s=e.src.charCodeAt(n+1);s>=56320&&s<=57343&&(o+=e.src[n+1],n++)}let i="\\"+o;if(!t){let s=e.push("text_special","",0);a<256&&yR[a]!==0?s.content=o:s.content=i,s.markup=i,s.info="escape"}return e.pos=n+1,!0}function Mhe(e){let t={},n=0;for(;(n=e.indexOf("`",n))!==-1;){let r=n;for(;e.charCodeAt(++n)===96;);t[n-r]=r}return t}function Nhe(e,t){var n;let r=e.pos;if(e.src.charCodeAt(r)!==96)return!1;let a=e.posMax,o=r+1;for(;o<a&&e.src.charCodeAt(o)===96;)o++;let i=e.src.slice(r,o),s=i.length;if(e.backticksScanned||(e.backticks=Mhe(e.src),e.backticksScanned=!0),((n=e.backticks[s])!==null&&n!==void 0?n:-1)>=o){let l=o,u;for(;(u=e.src.indexOf("`",l))!==-1&&u<a;){for(l=u+1;e.src.charCodeAt(l)===96;)l++;if(l>a)break;if(l-u===s){if(!t){let c=e.push("code_inline","code",0);c.markup=i;let f=e.src.slice(o,u).replace(/\n/g," ");f.startsWith(" ")&&f.endsWith(" ")&&/[^ ]/.test(f)&&(f=f.slice(1,-1)),c.content=f}return e.pos=l,!0}}}return t||(e.pending+=i),e.pos=o,!0}function Ohe(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let a=e.scanDelims(e.pos,!0),o=a.length,i=String.fromCharCode(r);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=i,o--);for(let l=0;l<o;l+=2)s=e.push("text","",0),s.content=i+i,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:a.can_open,close:a.can_close});return e.pos+=a.length,!0}function bj(e,t){let n,r=[],a=t.length;for(let o=0;o<a;o++){let i=t[o];if(i.marker!==126||i.end===-1)continue;let s=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&r.push(s.token-1)}for(;r.length;){let o=r.pop(),i=o+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,o!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[o],e.tokens[o]=n)}}function Phe(e){let t=e.tokens_meta,n=e.tokens_meta.length;bj(e,e.delimiters);for(let a=0;a<n;a++){var r;let o=(r=t[a])===null||r===void 0?void 0:r.delimiters;o&&bj(e,o)}}var Pj={tokenize:Ohe,postProcess:Phe};function Bhe(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let a=e.scanDelims(e.pos,r===42);for(let o=0;o<a.length;o++){let i=e.push("text","",0);i.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:a.length,token:e.tokens.length-1,end:-1,open:a.can_open,close:a.can_close})}return e.pos+=a.length,!0}function yj(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let a=t[r];if(a.marker!==95&&a.marker!==42||a.end===-1)continue;let o=t[a.end],i=r>0&&t[r-1].end===a.end+1&&t[r-1].marker===a.marker&&t[r-1].token===a.token-1&&t[a.end+1].token===o.token+1,s=String.fromCharCode(a.marker),l=e.tokens[a.token];l.type=i?"strong_open":"em_open",l.tag=i?"strong":"em",l.nesting=1,l.markup=i?s+s:s,l.content="";let u=e.tokens[o.token];u.type=i?"strong_close":"em_close",u.tag=i?"strong":"em",u.nesting=-1,u.markup=i?s+s:s,u.content="",i&&(e.tokens[t[r-1].token].content="",e.tokens[t[a.end+1].token].content="",r--)}}function zhe(e){let t=e.tokens_meta,n=e.tokens_meta.length;yj(e,e.delimiters);for(let a=0;a<n;a++){var r;let o=(r=t[a])===null||r===void 0?void 0:r.delimiters;o&&yj(e,o)}}var Bj={tokenize:Bhe,postProcess:zhe};function Fhe(e,t){let n,r,a,o,i="",s="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let c=e.pos,f=e.posMax,d=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let h=p+1;if(h<f&&e.src.charCodeAt(h)===40){for(u=!1,h++;h<f&&(n=e.src.charCodeAt(h),!(!Jt(n)&&n!==10));h++);if(h>=f)return!1;if(l=h,a=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),a.ok){for(i=e.md.normalizeLink(a.str),e.md.validateLink(i)?h=a.pos:i="",l=h;h<f&&(n=e.src.charCodeAt(h),!(!Jt(n)&&n!==10));h++);if(a=e.md.helpers.parseLinkTitle(e.src,h,e.posMax),h<f&&l!==h&&a.ok)for(s=a.str,h=a.pos;h<f&&(n=e.src.charCodeAt(h),!(!Jt(n)&&n!==10));h++);}(h>=f||e.src.charCodeAt(h)!==41)&&(u=!0),h++}if(u){if(typeof e.env.references>"u")return!1;if(h<f&&e.src.charCodeAt(h)===91?(l=h+1,h=e.md.helpers.parseLinkLabel(e,h),h>=0?r=e.src.slice(l,h++):h=p+1):h=p+1,r||(r=e.src.slice(d,p)),r=HC(r),o=e.env.references[r],!o)return e.pos=c,!1;i=o.href,s=o.title}if(!t){e.pos=d,e.posMax=p;let g=e.push("link_open","a",1),x=[["href",i]];if(g.attrs=x,s&&x.push(["title",s]),r){let m=Object.create(null);m.label=r,g.meta=m}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=f,!0}function Hhe(e,t){let n,r,a,o,i,s,l,u,c="",f=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(o=h+1,o<d&&e.src.charCodeAt(o)===40){for(o++;o<d&&(n=e.src.charCodeAt(o),!(!Jt(n)&&n!==10));o++);if(o>=d)return!1;for(u=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),u=o;o<d&&(n=e.src.charCodeAt(o),!(!Jt(n)&&n!==10));o++);if(s=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<d&&u!==o&&s.ok)for(l=s.str,o=s.pos;o<d&&(n=e.src.charCodeAt(o),!(!Jt(n)&&n!==10));o++);else l="";if(o>=d||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<d&&e.src.charCodeAt(o)===91?(u=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?a=e.src.slice(u,o++):o=h+1):o=h+1,a||(a=e.src.slice(p,h)),a=HC(a),i=e.env.references[a],!i)return e.pos=f,!1;c=i.href,l=i.title}if(!t){r=e.src.slice(p,h);let g=[];e.md.inline.parse(r,e.md,e.env,g);let x=e.push("image","img",0),m=[["src",c],["alt",""]];if(x.attrs=m,x.children=g,x.content=r,l&&m.push(["title",l]),a){let y=Object.create(null);y.label=a,x.meta=y}}return e.pos=o,e.posMax=d,!0}var Vhe=/^([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])?)*)$/,Uhe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function qhe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,a=e.posMax;for(;;){if(++n>=a)return!1;let i=e.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}let o=e.src.slice(r+1,n);if(Uhe.test(o)){let i=e.md.normalizeLink(o);if(!e.md.validateLink(i))return!1;if(!t){let s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=o.length+2,!0}if(Vhe.test(o)){let i=e.md.normalizeLink(`mailto:${o}`);if(!e.md.validateLink(i))return!1;if(!t){let s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=o.length+2,!0}return!1}function jhe(e){return/^<a[>\s]/i.test(e)}function $he(e){return/^<\/a\s*>/i.test(e)}function zj(e){let t=e|32;return t>=97&&t<=122}function Ghe(e,t){let n=e.src,r,a;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;r=t+4,a="-->"}else if(n.startsWith("<![CDATA[",t))r=t+9,a="]]>";else if(n.charCodeAt(t+1)===63)r=t+2,a="?>";else if(zj(n.charCodeAt(t+2)))r=t+3,a=">";else return-1;if(e.skipHtmlSpecial)return-1;let o=n.indexOf(a,r);return o<0?(e.skipHtmlSpecial=!0,-1):o+a.length}function Whe(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let a,o=e.src.charCodeAt(r+1);if(o===33||o===63)a=Ghe(e,r);else if(o===47||zj(o)){let i=e.src.slice(r).match(Mj);a=i?r+i[0].length:-1}else return!1;if(a<0)return!1;if(!t){let i=e.push("html_inline","",0);i.content=e.src.slice(r,a),jhe(i.content)&&e.linkLevel++,$he(i.content)&&e.linkLevel--}return e.pos=a,!0}var Khe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Xhe=/^&([a-z][a-z0-9]{1,31});/i;function Yhe(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let a=e.src.slice(n).match(Khe);if(a){if(!t){let o=a[1][0].toLowerCase()==="x"?parseInt(a[1].slice(1),16):parseInt(a[1],10),i=e.push("text_special","",0);i.content=bR(o)?Y0(o):Y0(65533),i.markup=a[0],i.info="entity"}return e.pos+=a[0].length,!0}}else{let a=e.src.slice(n).match(Xhe);if(a){let o=PC(a[0]);if(o!==a[0]){if(!t){let i=e.push("text_special","",0);i.content=o,i.markup=a[0],i.info="entity"}return e.pos+=a[0].length,!0}}}return!1}function vj(e){let t={},n=e.length;if(!n)return;let r=0,a=-2,o=[];for(let i=0;i<n;i++){let s=e[i];if(o.push(0),(e[r].marker!==s.marker||a!==s.token-1)&&(r=i),a=s.token,s.length=s.length||0,!s.close)continue;t.hasOwnProperty(s.marker)||(t[s.marker]=[-1,-1,-1,-1,-1,-1]);let l=t[s.marker][(s.open?3:0)+s.length%3],u=r-o[r]-1,c=u;for(;u>l;u-=o[u]+1){let f=e[u];if(f.marker===s.marker&&f.open&&f.end<0){let d=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(d=!0),!d){let p=u>0&&!e[u-1].open?o[u-1]+1:0;o[i]=i-u+p,o[u]=p,s.open=!1,f.end=i,f.close=!1,c=-1,a=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function Zhe(e){let t=e.tokens_meta,n=e.tokens_meta.length;vj(e.delimiters);for(let a=0;a<n;a++){var r;let o=(r=t[a])===null||r===void 0?void 0:r.delimiters;o&&vj(o)}}function Jhe(e){let t,n,r=0,a=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)a[t].nesting<0&&r--,a[t].level=r,a[t].nesting>0&&r++,a[t].type==="text"&&t+1<o&&a[t+1].type==="text"?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}var gR=[["text",Ahe],["linkify",The],["newline",Dhe],["escape",Rhe],["backticks",Nhe],["strikethrough",Pj.tokenize],["emphasis",Bj.tokenize],["link",Fhe],["image",Hhe],["autolink",qhe],["html_inline",Whe],["entity",Yhe]],xR=[["balance_pairs",Zhe],["strikethrough",Pj.postProcess],["emphasis",Bj.postProcess],["fragments_join",Jhe]],Fj=class{constructor(){_e(this,"ruler",new tb),_e(this,"ruler2",new tb),_e(this,"State",Oj);for(let e=0;e<gR.length;e++)this.ruler.push(gR[e][0],gR[e][1]);for(let e=0;e<xR.length;e++)this.ruler2.push(xR[e][0],xR[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(""),r=n.length,a=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let i=!1;if(e.level<a){for(let s=0;s<r;s++)if(e.level++,i=n[s](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,o[t]=e.pos}tokenize(e){let t=this.ruler.getRules(""),n=t.length,r=e.posMax,a=e.md.options.maxNesting;for(;e.pos<r;){let o=e.pos,i=!1;if(e.level<a){for(let s=0;s<n;s++)if(i=t[s](e,!1),i){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){let a=new this.State(e,t,n,r);this.tokenize(a);let o=this.ruler2.getRules(""),i=o.length;for(let s=0;s<i;s++)o[s](a)}},Qhe={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","strip_references","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},eme=/^(vbscript|javascript|file|data):/,tme=/^data:image\/(gif|png|jpeg|webp);/,wj=["http:","https:","mailto:"],Wi=class{validateLink(e){let t=e.trim().toLowerCase();return eme.test(t)?tme.test(t):!0}normalizeLink(e){let t=W0(e,!0);if(t.hostname&&(!t.protocol||wj.indexOf(t.protocol)>=0))try{t.hostname=dR.toASCII(t.hostname)}catch{}return t.auth&&(t.auth=Mu(t.auth)),t.hostname&&(t.hostname=Mu(t.hostname)),t.pathname&&(t.pathname=Mu(t.pathname)),t.search&&(t.search=Mu(t.search)),t.hash&&(t.hash=Mu(t.hash)),Jh(t)}normalizeLinkText(e){let t=W0(e,!0);if(t.hostname&&(!t.protocol||wj.indexOf(t.protocol)>=0))try{t.hostname=dR.toUnicode(t.hostname)}catch{}return G0(Jh(t),G0.defaultChars+"%")}constructor(...e){_e(this,"inline",new Fj),_e(this,"block",new Nj),_e(this,"core",new _j),_e(this,"renderer",new Ij),_e(this,"linkify",new rj),_e(this,"utils",Cpe),_e(this,"helpers",Object.assign({},Fpe));let[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){let a=e;if(t=Qhe[a],!t)throw new Error(`Wrong 'markdown-it' preset "${a}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});let n=t.components;if(n){var r;["core","block","inline"].forEach(o=>{var i;let s=(i=n[o])===null||i===void 0?void 0:i.rules;s&&this[o].ruler.enableOnly(s)});let a=(r=n.inline)===null||r===void 0?void 0:r.rules2;a&&this.inline.ruler2.enableOnly(a)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(a=>{n=n.concat(this[a].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(a=>n.indexOf(a)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(a=>{n=n.concat(this[a].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(a=>n.indexOf(a)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};_e(Wi,"Token",Rf);_e(Wi,"Ruler",tb);_e(Wi,"Renderer",Ij);_e(Wi,"ParserCore",_j);_e(Wi,"StateCore",Aj);_e(Wi,"ParserBlock",Nj);_e(Wi,"StateBlock",Tj);_e(Wi,"ParserInline",Fj);_e(Wi,"StateInline",Oj);var nb=Cj(Wi);var Vt=new nb({html:!1,linkify:!1,breaks:!1}),GC=new nb({html:!1,linkify:!1,breaks:!1});GC.renderer.rules.link_open=()=>"";GC.renderer.rules.link_close=()=>"";GC.renderer.rules.image=(e,t)=>hr(e[t].content);var $C=(e,t,n)=>Math.max(t,Math.min(n,e)),hr=e=>String(e).replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t]),rb=e=>Vt.renderInline(String(e)).replace(/\n/g,"<br>"),vR=(e,t="markdown")=>`<ins class="space-suggestion-insert" data-suggestion-id="${hr(e.id)}">${t==="code"?hr(e.replacement):rb(e.replacement)}</ins>`;function Hj(e,t,n){if(!n)return{runs:[],end:t};let r=t,a=0,o=null,i=[],s=(l,u,c)=>{o&&o.to===u?(o.text+=l,o.to=c):(o={text:l,from:u,to:c},i.push(o))};for(;a<n.length;){let l=n[a];if(e[r]==="&"){let u=e.indexOf(";",r+1);if(u>r&&u-r<=32){let c=Vt.utils.unescapeAll(e.slice(r,u+1));if(c&&c!==e.slice(r,u+1)&&n.startsWith(c,a)){i.push({text:c,from:r,to:u+1}),o=null,r=u+1,a+=c.length;continue}}}if(e[r]==="\\"&&r+1<e.length&&e[r+1]===l){i.push({text:l,from:r,to:r+2}),o=null,r+=2,a+=1;continue}if(e[r]===l){s(l,r,r+1),r+=1,a+=1;continue}return null}return{runs:i,end:r}}function nme(e,t,n){let r=Hj(e,t,n);if(r)return r;for(let a=t+1;a<e.length;a+=1){if(e[a]!==n[0]&&e[a]!=="&"&&e[a]!=="\\")continue;let o=Hj(e,a,n);if(o)return o}return null}function UC(e,t){let n=0,r=0;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]==="`"){let o=a;for(;e[o+1]==="`";)o+=1;let i=o-a+1;r?r===i&&(r=0):r=i,a=o;continue}if(!r&&(e[a]==="["&&(n+=1),e[a]==="]"&&--n===0))return a}return-1}function Vj(e,t){let n=0,r=0;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]==="`"){let o=a;for(;e[o+1]==="`";)o+=1;let i=o-a+1;r?r===i&&(r=0):r=i,a=o;continue}if(!r&&(e[a]==="("&&(n+=1),e[a]===")"&&--n===0))return a}return-1}function rme(e){let t=[0];for(let n=0;n<e.length;n+=1)e[n]===`
|
|
671
|
+
`&&t.push(n+1);return t}function ame(e,t,n){if(!e.map)return null;let r=n[e.map[0]];if(!Number.isInteger(r))return null;let a=t.indexOf(`
|
|
672
|
+
`,r);if(a<0)return null;let o=a+1;if(t.slice(o,o+e.content.length)===e.content)return{from:o,to:o+e.content.length};let i=t.indexOf(e.content,r);return i<0?null:{from:i,to:i+e.content.length}}function ome(e,t,n){if(!e.map)return null;let r=e.content.match(/[^\n]*\n|[^\n]+$/g);if(!r)return null;let a=[];for(let o=0;o<r.length;o+=1){let i=n[e.map[0]+o];if(!Number.isInteger(i))return null;let s=t.indexOf(`
|
|
673
|
+
`,i),l=t.slice(i,s<0?t.length:s),u=r[o],c=u.endsWith(`
|
|
674
|
+
`)?u.slice(0,-1):u;if(!c){if(s<0)return null;a.push({from:i,to:i+1,text:`
|
|
675
|
+
`});continue}let f=l.indexOf(c);if(f<0)return null;let d=i+f,p=d+u.length;if(t.slice(d,p)!==u)return null;a.push({from:d,to:p,text:u})}return a}function ime(e,t,n){let r=n,a=e.children||[],o=[];for(let i of a)switch(i.type){case"text":{let s=nme(t,r,i.content);s&&(s.runs.length&&(i.meta={...i.meta||{},spaceRuns:s.runs}),r=s.end);break}case"code_inline":{let s=i.markup||"`",l=t.indexOf(s,r);if(l<0)break;let u=l+s.length,c=u+i.content.length;if(t.slice(u,c)===i.content)i.meta={...i.meta||{},spaceSrc:{from:u,to:c}},r=c,t.slice(r,r+s.length)===s&&(r+=s.length);else{let f=t.indexOf(i.content,l+s.length);f>=0&&(i.meta={...i.meta||{},spaceSrc:{from:f,to:f+i.content.length}},r=f+i.content.length)}break}case"image":{let s=t.indexOf("![",r);if(s<0)break;let l=UC(t,s+1),u=l>=0&&t[l+1]==="("?l+1:-1,c=l>=0&&t[l+1]==="["?l+1:-1,f=c>=0?UC(t,c):-1,d=u>=0?Vj(t,u):f>=0?f:l;d>=0&&(r=d+1);break}case"link_open":{let s=i.markup==="autolink",l=t.indexOf(s?"<":"[",r);i.meta={...i.meta||{},spaceAutolink:s,spaceLinkOpen:l},o.push(i);break}case"link_close":{let s=o.pop();if(s?.meta?.spaceAutolink){t[r]===">"&&(r+=1);break}let u=s?.meta?.spaceLinkOpen??-1,c=u>=0?UC(t,u):-1;if(c<0)break;if(t[c+1]==="("){let f=Vj(t,c+1);r=f>=0?f+1:c+1}else if(t[c+1]==="["){let f=UC(t,c+1);r=f>=0?f+1:c+1}else r=c+1;break}case"softbreak":case"hardbreak":{let s=t.indexOf(`
|
|
676
|
+
`,r);s>=0&&(r=s+1);break}case"html_inline":r+=i.content.length;break;default:break}return r}function qC(e,t){let n=rme(t),r=0;for(let a of e)if(a.map&&(a.meta={...a.meta||{},spaceBlockRange:{from:n[a.map[0]],to:n[a.map[1]]??t.length}}),a.type==="inline")a.map&&Number.isInteger(n[a.map[0]])&&(r=Math.max(r,n[a.map[0]])),r=ime(a,t,r);else if(a.type==="fence"){let o=ame(a,t,n);if(o){a.meta={...a.meta||{},spaceSrc:o},r=Math.max(r,o.to);let i=t.indexOf(`
|
|
677
|
+
`,o.to);i>=0&&(r=Math.max(r,i+1))}}else if(a.type==="code_block"){let o=ome(a,t,n);o?.length&&(a.meta={...a.meta||{},spaceLines:o},r=Math.max(r,o[o.length-1].to))}}Vt.renderer.rules.text=(e,t,n,r)=>{let a=e[t];if(r.projection)return(a.meta?.spaceBeforeHtml||"")+fme(a.meta?.spaceRuns||[],a.content,r)+(a.meta?.spaceAfterHtml||"");let o=a.meta?.spaceRuns,i=a.meta?.spaceBeforeHtml||"",s=o?.length?o.map(l=>ume(l,r.suggestions,r.sourceOffset||0)).join(""):hr(a.content);return i+s+(a.meta?.spaceAfterHtml||"")};var sme=["blockquote_open","bullet_list_open","ordered_list_open","list_item_open","heading_open","paragraph_open","table_open","thead_open","tbody_open","tr_open","th_open","td_open"],lme=["blockquote_close","bullet_list_close","ordered_list_close","list_item_close","heading_close","paragraph_close","table_close","thead_close","tbody_close","tr_close","th_close","td_close"];for(let e of sme)Vt.renderer.rules[e]=(t,n,r)=>Vt.renderer.renderToken(t,n,r)+(t[n].meta?.spaceAfterHtml||"");for(let e of lme)Vt.renderer.rules[e]=(t,n,r)=>(t[n].meta?.spaceAfterHtml||"")+Vt.renderer.renderToken(t,n,r);function ume(e,t,n=0){return jj(e.text,e.from,t,{sourceEnd:e.to,mode:"markdown",showDeletedWhitespace:!0,sourceOffset:n})}function cme(e,t){let n=t.filter(l=>l.status==="pending"&&Number.isInteger(l.from)&&Number.isInteger(l.to)&&l.from>=0&&l.from<=l.to&&l.to<=e.length&&e.slice(l.from,l.to)===l.expected).toSorted((l,u)=>l.from-u.from||l.to-u.to||(l.order||0)-(u.order||0)),r=[],a=[],o=0,i=0,s="";for(let l of n){if(l.from<o)continue;if(l.from>o){let c=e.slice(o,l.from);r.push({kind:"source",projectedFrom:i,projectedTo:i+c.length,sourceFrom:o}),s+=c,i+=c.length}let u=i;s+=l.replacement,i+=l.replacement.length,a.push({...l,previewFrom:u,previewTo:i}),o=l.to}if(o<e.length){let l=e.slice(o);r.push({kind:"source",projectedFrom:i,projectedTo:i+l.length,sourceFrom:o}),s+=l}return{source:s,edits:a,sourceRange(l,u){let c=r.find(f=>l>=f.projectedFrom&&u<=f.projectedTo);return c?{from:c.sourceFrom+l-c.projectedFrom,to:c.sourceFrom+u-c.projectedFrom}:null}}}function wR(e,t){let n=t==="code"?hr(e.expected):GC.renderInline(e.expected);return`<del class="space-src space-suggestion-delete" data-src-from="${e.from}" data-src-to="${e.to}" data-suggestion-id="${Pu(e)}">${n}</del>`}function fme(e,t,n){return e.length?e.map(r=>ab(r.text,r.from,n,"markdown",r.to)).join(""):hr(t)}function dme(e,t){let n=Wj(e);for(let r of t.edits){if(!r.replacement||n.some(g=>r.previewFrom<g.to&&r.previewTo>g.from))continue;let a=r.expected?`<del class="space-src space-suggestion-delete" data-src-from="${r.from}" data-src-to="${r.to}" data-suggestion-id="${Pu(r)}">${ob(r.expected)}</del>`:"",o=`<ins class="space-suggestion-insert space-suggestion-source-insert" data-suggestion-id="${Pu(r)}">${ob(r.replacement)}</ins>`,i=a+o,s=e.findIndex(g=>g.type==="inline"&&jC(g,{from:r.previewFrom,to:r.previewTo})),l=s>=0?s:e.findIndex(g=>g.type==="inline");if(l<0)continue;let c=(e[l].children||[]).flatMap((g,x)=>{let m=g.meta?.spaceRuns||(g.meta?.spaceSrc?[g.meta.spaceSrc]:[]);return g.type==="text"&&m.length?[{child:g,index:x,ranges:m}]:[]}),f=c.find(g=>g.ranges.some(x=>x.from>=r.previewFrom)),d=c.filter(g=>g.ranges.some(x=>x.to<=r.previewFrom)).at(-1),p=f?.child||d?.child;if(p){let g=f?"spaceBeforeHtml":"spaceAfterHtml";p.meta={...p.meta||{},[g]:`${p.meta?.[g]||""}${i}`};continue}let h=e[l+1]?.type?.endsWith("_close")?e[l+1]:e[l-1]?.type?.endsWith("_open")?e[l-1]:null;h&&(h.meta={...h.meta||{},spaceAfterHtml:`${h.meta?.spaceAfterHtml||""}${i}`})}}function pme(e){let t=Vt.parse(e.expected,{});qC(t,e.expected);let n={...e,from:0,to:e.expected.length,replacement:""};return Vt.renderer.render(t,Vt.options,{suggestions:[n],sourceOffset:e.from})}function qj(e){let t=Vt.parse(e,{});return t.some(n=>n.level===0&&n.nesting===1&&["heading_open","blockquote_open","bullet_list_open","ordered_list_open","table_open"].includes(n.type))||t.some(n=>n.level===0&&["fence","code_block","hr"].includes(n.type))}function hme(e,t){for(let n of t){if(!n.expected||n.replacement||!qj(n.expected))continue;let r=e.findIndex(o=>o.level===0&&o.nesting===1&&Number.isInteger(o.meta?.spaceBlockRange?.from)&&o.meta.spaceBlockRange.from>=n.previewFrom),a=r>=0?r:e.length;e.splice(a,0,{type:"html_block",tag:"",attrs:null,map:null,nesting:0,level:0,children:null,content:`${pme(n)}
|
|
678
|
+
`,markup:"",info:"",meta:null,block:!0,hidden:!1})}}function ab(e,t,n,r="code",a=t+e.length){let o=n.projection,i=d=>t+Math.round(d/(e.length||1)*(a-t)),s=d=>Math.round((d-t)/(a-t||1)*e.length),l=o.edits.filter(d=>d.previewFrom===d.previewTo?d.previewFrom>=t&&d.previewFrom<=a:d.previewFrom<a&&d.previewTo>t),u=new Set([0,e.length]);for(let d of l)u.add($C(s(Math.max(t,Math.min(a,d.previewFrom))),0,e.length)),u.add($C(s(Math.max(t,Math.min(a,d.previewTo))),0,e.length));let c=[...u].sort((d,p)=>d-p),f="";for(let d=0;d<c.length-1;d+=1){let p=c[d],h=c[d+1],g=i(p),x=i(h);for(let b of l)!n.deletedEdits.has(b.id)&&b.expected&&b.previewFrom<x&&b.previewTo>g&&(f+=wR(b,r),n.deletedEdits.add(b.id)),b.previewFrom===b.previewTo&&b.expected&&b.previewFrom===g&&!n.deletedEdits.has(b.id)&&(f+=wR(b,r),n.deletedEdits.add(b.id));let m=e.slice(p,h),y=l.find(b=>b.previewFrom<b.previewTo&&b.previewFrom<x&&b.previewTo>g);if(y)f+=`<ins class="space-suggestion-insert" data-suggestion-id="${Pu(y)}">${hr(m)}</ins>`,n.insertedEdits.add(y.id);else{let b=o.sourceRange(g,x);f+=b?`<span class="space-src" data-src-from="${b.from}" data-src-to="${b.to}">${hr(m)}</span>`:hr(m)}}for(let d of l)d.previewFrom===d.previewTo&&d.expected&&d.previewFrom===a&&!n.deletedEdits.has(d.id)&&(f+=wR(d,r),n.deletedEdits.add(d.id));return f}function jj(e,t,n,{sourceEnd:r=t+e.length,mode:a="code",showDeletedWhitespace:o=!1,sourceOffset:i=0}={}){let s=r-t,l=h=>t+Math.round(h/(e.length||1)*s),u=h=>s===e.length?h-t:Math.round((h-t)/(s||1)*e.length),c=n.filter(h=>h.from===h.to?h.from>=t&&h.from<=r:h.from<r&&h.to>t),f=new Set([0,e.length]);for(let h of c)f.add($C(u(Math.max(t,Math.min(r,h.from))),0,e.length)),f.add($C(u(Math.max(t,Math.min(r,h.to))),0,e.length));let d=[...f].sort((h,g)=>h-g),p="";for(let h=0;h<d.length-1;h+=1){let g=d[h],x=d[h+1],m=l(g),y=l(x);for(let k of c.filter(_=>_.from===_.to&&u(_.from)===g))p+=vR(k,a);let b=c.find(k=>k.from<k.to&&k.from<y&&k.to>m),v=e.slice(g,x),w=b&&o&&!v.trim()?ob(v):hr(v);p+=b?`<del class="space-src space-suggestion-delete" data-src-from="${i+m}" data-src-to="${i+y}" data-suggestion-id="${Pu(b)}">${w}</del>`:`<span class="space-src" data-src-from="${i+m}" data-src-to="${i+y}">${w}</span>`;for(let k of c.filter(_=>_.from<_.to&&_.replacement&&_.to>m&&_.to<=y))p+=vR(k,a)}for(let h of c.filter(g=>g.from===g.to&&u(g.from)===e.length))p+=vR(h,a);return p}Vt.renderer.rules.code_inline=(e,t,n,r)=>{let a=e[t],o=a.meta?.spaceSrc;return r.projection&&o?`<code class="space-inline-code">${ab(a.content,o.from,r,"code",o.to)}</code>`:!o||!CR(o.from,o.to,r.suggestions)?`<code class="space-src space-inline-code"${o?` data-src-from="${o.from}" data-src-to="${o.to}"`:""}>${hr(a.content)}</code>`:`<code class="space-inline-code">${kR(a.content,o.from,r.suggestions,"code",r.sourceOffset||0)}</code>`};Vt.renderer.rules.fence=(e,t,n,r)=>{let a=e[t],i=(a.info?Vt.utils.unescapeAll(a.info).trim():"").split(/\s+/g)[0],s=a.meta?.spaceSrc,l=i?` class="language-${hr(i)} space-src"`:' class="space-src"';if(r.projection&&s)return`<pre class="space-code-block"><code${l}>${ab(a.content,s.from,r,"code",s.to)}</code></pre>
|
|
679
|
+
`;if(r.projection&&s)return`<pre class="space-code-block"><code${l}>${ab(a.content,s.from,r,"code")}</code></pre>
|
|
680
|
+
`;if(!s||!CR(s.from,s.to,r.suggestions)){let u=s?` data-src-from="${s.from}" data-src-to="${s.to}"`:"";return`<pre class="space-code-block"><code${l}${u}>${hr(a.content)}${a.meta?.spaceAfterCodeHtml||""}</code></pre>
|
|
681
|
+
`}return`<pre class="space-code-block"><code${l}>${kR(a.content,s.from,r.suggestions,"code",r.sourceOffset||0)}${a.meta?.spaceAfterCodeHtml||""}</code></pre>
|
|
682
|
+
`};Vt.renderer.rules.code_block=(e,t,n,r)=>{let a=e[t],o=a.meta?.spaceLines;return r.projection&&o?.length?`<pre class="space-code-block"><code class="space-src">${o.map(s=>ab(s.text,s.from,r,"code",s.to)).join("")}</code></pre>
|
|
683
|
+
`:o?.length?o.some(s=>CR(s.from,s.to,r.suggestions))?`<pre class="space-code-block"><code class="space-src">${o.map(s=>kR(s.text,s.from,r.suggestions,"code",r.sourceOffset||0)).join("")}${a.meta?.spaceAfterCodeHtml||""}</code></pre>
|
|
684
|
+
`:`<pre class="space-code-block"><code class="space-src">${o.map(l=>`<span class="space-src" data-src-from="${l.from}" data-src-to="${l.to}">${hr(l.text)}</span>`).join("")}${a.meta?.spaceAfterCodeHtml||""}</code></pre>
|
|
685
|
+
`:`<pre class="space-code-block"><code class="space-src">${hr(a.content)}${a.meta?.spaceAfterCodeHtml||""}</code></pre>
|
|
686
|
+
`};function kR(e,t,n,r="code",a=0){return jj(e,t,n,{mode:r,sourceOffset:a})}function CR(e,t,n){return n.some(r=>r.from===r.to?r.from>=e&&r.from<=t:r.from<t&&r.to>e)}Vt.renderer.rules.table_open=(e,t)=>`<div class="space-table-wrap"><table>
|
|
687
|
+
${e[t].meta?.spaceAfterHtml||""}`;Vt.renderer.rules.table_close=(e,t)=>(e[t].meta?.spaceAfterHtml||"")+`</table></div>
|
|
688
|
+
`;function $j(e,t=[]){let n=t.filter(l=>l.status==="pending"||l.status==="conflicted");if(n.some(l=>l.status==="conflicted")){let l=Vt.parse(e,{});return qC(l,e),Uj(l,e,n),Vt.renderer.render(l,Vt.options,{suggestions:n})}let r=cme(e,n);if(r.edits.length!==n.length){let l=Vt.parse(e,{});return qC(l,e),Uj(l,e,n),Vt.renderer.render(l,Vt.options,{suggestions:n})}let a=Vt.parse(r.source,{});qC(a,r.source),dme(a,r);let o={projection:r,deletedEdits:new Set,insertedEdits:new Set},i=Vt.renderer.render(a,Vt.options,o),s=r.edits.filter(l=>l.expected&&!l.replacement&&!o.deletedEdits.has(l.id)&&qj(l.expected));return s.length?(hme(a,s),Vt.renderer.render(a,Vt.options,o)):i}var Pu=e=>hr(e.id);function mme(e){let t=e.split(/\r?\n/).map(a=>a.replace(/^(?:\s*>\s*)+/,"")),n=[],r=[];for(let a of t){if(!a.trim())continue;let o=a.match(/^(\s*)([-+*]|\d+[.)])\s+(.+)$/);if(o){let i={text:o[3],level:o[1].replace(/\t/g," ").length,ordered:/^\d/.test(o[2]),children:[]};for(;r.length&&r.at(-1).level>=i.level;)r.pop();r.length?r.at(-1).children.push(i):n.push(i),r.push(i)}else if(r.length)r.at(-1).text+=`
|
|
689
|
+
${a.trim()}`;else return null}return n.length?n:null}function gme(e,t,n=null){let r=!0,a=o=>{let i=n&&r?n:`data-suggestion-id="${t}"`;r=!1;let s=o.children.length?`<${o.children[0].ordered?"ol":"ul"}>${o.children.map(a).join("")}</${o.children[0].ordered?"ol":"ul"}>`:"";return`<li class="space-suggestion-insert-block"><ins class="space-suggestion-insert" ${i}>${rb(o.text)}</ins>${s}</li>`};return e.map(a).join("")}function xme(e){let t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[],r="",a=!1,o=0;for(let i=0;i<t.length;i+=1){let s=t[i];if(s==="`"&&!a){let l=i;for(;t[l+1]==="`";)l+=1;let u=l-i+1;o=o===0?u:o===u?0:o,r+=t.slice(i,l+1),i=l;continue}if(s==="|"&&!a&&o===0){n.push(r.trim()),r="";continue}r+=s,s==="\\"&&!a?a=!0:a=!1}return n.push(r.trim()),n.length>1?n:null}function bme(e){let t=e.split(/\r?\n/).filter(r=>r.trim());if(!t.length||t.some(r=>!r.trim().startsWith("|")))return null;let n=t.map(xme);return n.every(r=>r?.length>1)?n:null}function Gj(e){let t=mme(e);if(t?.length)return{kind:"list",items:t};let n=bme(e);return n?.length?{kind:"table",rows:n}:null}function ob(e){if(!e)return"";let t=!e.trim();return hr(e).replace(/\t/g,t?"\u21E5":" ").replace(/ /g,t?"\xB7":" ").replace(/\r?\n/g,"\u21B5<br>")}function Wj(e){return e.flatMap(t=>t.type==="inline"?(t.children||[]).flatMap(n=>[...n.meta?.spaceRuns||[],...n.meta?.spaceSrc?[n.meta.spaceSrc]:[]]):t.meta?.spaceSrc?[t.meta.spaceSrc]:t.meta?.spaceLines||[])}function yme(e,t){return e.from===e.to?t.some(n=>e.from>=n.from&&e.from<=n.to):t.some(n=>e.from<n.to&&e.to<=n.to&&e.to>n.from)}function vme(e){let t=[],n=new Map;for(let r=0;r<e.length;r+=1)if(e[r].nesting===1&&t.push(r),e[r].nesting===-1){let a=t.pop();a!==void 0&&n.set(a,r)}return n}function jC(e,t){let n=e.meta?.spaceBlockRange;return n?t.from===t.to?t.from>=n.from&&t.from<=n.to:t.from<n.to&&t.to>n.from:!1}function wme(e,t){let n=Pu(t),r=`data-src-from="${t.from}" data-src-to="${t.to}" data-suggestion-id="${n}"`;return e.map((a,o)=>`<tr class="space-suggestion-insert-row">${a.map((i,s)=>`<td><ins class="space-suggestion-insert" ${o===0&&s===0?r:`data-suggestion-id="${n}"`}>${rb(i)}</ins></td>`).join("")}</tr>`).join("")}function kme(e,t,n){let r=Pu(e),a=Gj(e.replacement||"");if(a?.kind==="list"){let i=e.from===e.to?`data-src-from="${e.from}" data-src-to="${e.to}" data-suggestion-id="${r}"`:null;return gme(a.items,r,i)}if(a?.kind==="table")return wme(a.rows,e);if(e.from===e.to)return`<ins class="space-suggestion-insert" ${`data-src-from="${e.from}" data-src-to="${e.to}" data-suggestion-id="${r}"`}>${rb(e.replacement)}</ins>`;let o=`<ins class="space-suggestion-insert" data-suggestion-id="${r}">${rb(e.replacement)}</ins>`;return n?o:`<span class="space-suggestion-source-diff" data-suggestion-id="${r}"><del class="space-src space-suggestion-delete" data-src-from="${e.from}" data-src-to="${e.to}" data-suggestion-id="${r}">${ob(t.slice(e.from,e.to))}</del>${o}</span>`}function Uj(e,t,n){let r=Wj(e),a=vme(e);for(let o of n){if(yme(o,r))continue;let i=Gj(o.replacement||""),s=i?.kind==="table"?"tr_open":i?.kind==="list"?"list_item_open":null,l=s?e.findIndex(v=>v.type===s&&jC(v,o)):-1,u=l>=0?a.get(l):void 0,c=e.findIndex(v=>v.type==="inline"&&jC(v,o)),f=c>=0?c:e.findIndex(v=>v.type==="inline"),d=e.findIndex(v=>["fence","code_block"].includes(v.type)&&jC(v,o)),p=o.from<o.to&&r.some(v=>o.from<v.to&&o.to>v.from),h=kme(o,t,p),g=u??(d>=0?d:f);if(g<0)continue;let x=e[g];if(x.type==="inline"){let w=(x.children||[]).flatMap((S,U)=>{let N=S.meta?.spaceRuns||(S.meta?.spaceSrc?[S.meta.spaceSrc]:[]);return S.type==="text"&&N.length?[{child:S,index:U,ranges:N}]:[]}),k,_;if(p){let S=w.filter(U=>U.ranges.some(N=>o.from<N.to&&o.to>N.from)).at(-1);S&&(k=S.child,_="spaceAfterHtml")}else if(w.length){let S=w.filter(U=>U.ranges.some(N=>N.to<=o.from)).at(-1);S?(k=S.child,_="spaceAfterHtml"):(k=w[0].child,_="spaceBeforeHtml")}if(k){k.meta={...k.meta||{},[_]:`${k.meta?.[_]||""}${h}`};continue}let E=p?g+1:g-1,M=e[E];M&&M.type.endsWith(p?"_close":"_open")&&(g=E,x=M)}let m=["fence","code_block"].includes(x.type),y=m?`<span class="space-suggestion-insert" data-suggestion-id="${Pu(o)}">${ob(o.replacement)}</span>`:h,b=m?"spaceAfterCodeHtml":"spaceAfterHtml";x.meta={...x.meta||{},[b]:`${x.meta?.[b]||""}${y}`}}}var Yj=(e,t,n)=>Math.max(t,Math.min(n,e));function Ki(e,t=""){if(!e?.querySelectorAll)return[];let n=[...e.querySelectorAll("[data-src-from][data-src-to]")].map((p,h)=>{let g=Number(p.dataset.srcFrom),x=Number(p.dataset.srcTo),m=p.firstChild?.nodeType===3?p.firstChild:null;return{element:p,textNode:m,from:g,to:x,order:h,textLength:m?.nodeValue.length||0}}).filter(p=>Number.isInteger(p.from)&&Number.isInteger(p.to)&&p.to>=p.from&&p.textNode).sort((p,h)=>p.from-h.from||p.to-h.to||p.order-h.order);if(n.length||!t||typeof document>"u")return n;let r=e.querySelector(".ProseMirror");if(!r)return[];let a=e.__spaceSourceSpans;if(a?.source===t&&a.root===r)return a.spans;let o=document.createElement("div");o.innerHTML=$j(t);let i=[...o.querySelectorAll("[data-src-from][data-src-to]")].map((p,h)=>({from:Number(p.dataset.srcFrom),to:Number(p.dataset.srcTo),text:p.textContent||"",order:h})).filter(p=>Number.isInteger(p.from)&&Number.isInteger(p.to)&&p.to>=p.from&&p.text).sort((p,h)=>p.from-h.from||p.to-h.to||p.order-h.order);if(!i.length)return[];let s=[],l=document.createTreeWalker(r,4,{acceptNode(p){return p.parentElement?.closest(".space-suggestion-insert,.label-wrapper,.milkdown-toolbar,.milkdown-block-handle,.milkdown-slash-menu,.milkdown-table-block .handle,.milkdown-table-block .line-handle,.milkdown-table-block .cell-handle,.milkdown-table-block .add-button,.milkdown-table-block .button-group,.milkdown-code-block .language-picker,.milkdown-code-block .tools")?2:1}}),u="",c;for(;c=l.nextNode();)for(let p=0;p<c.nodeValue.length;p+=1){let h=c.nodeValue[p];if(/\s/.test(h)){if(u.endsWith(" "))continue;u+=" "}else u+=h;s.push({node:c,offset:p})}let f=[],d=0;for(let p of i){let h=p.text.replace(/\s+/g," ").trim();if(!h)continue;let g=u.indexOf(h,d);if(g<0)continue;let x=g+h.length,m=null;for(let v=g;v<x;v+=1){let w=s[v];w&&(m&&m.node===w.node&&m.end===w.offset?m.end+=1:(m&&f.push(m),m={node:w.node,start:w.offset,end:w.offset+1,indexStart:v,indexEnd:v+1}),m&&(m.indexEnd=v+1))}m&&f.push(m);let y=f.splice(f.findIndex(v=>v.indexStart>=g)),b=x-g;for(let v of y){let w=(v.indexStart-g)/b,k=(v.indexEnd-g)/b;f.push({element:v.node.parentElement,textNode:v.node,from:Math.round(p.from+(p.to-p.from)*w),to:Math.round(p.from+(p.to-p.from)*k),order:f.length,textLength:v.end-v.start})}d=x}return f.sort((p,h)=>p.from-h.from||p.to-h.to||p.order-h.order),e.__spaceSourceSpans={source:t,root:r,spans:f},f}function Kj(e,t){let n=e.to-e.from;return n<=0?0:e.textLength===n?Yj(t-e.from,0,e.textLength):t<=e.from?0:t>=e.to?e.textLength:Math.round((t-e.from)/n*e.textLength)}function Cme(e,t){for(let r of e)if(r.from<=t&&t<r.to)return r;for(let r of e)if(r.from===t)return r;for(let r=e.length-1;r>=0;r-=1)if(e[r].to===t)return e[r];let n=e.find(r=>r.from>=t);return n||(t>=e[e.length-1].to?e[e.length-1]:e[0])}function Sme(e,t){for(let r of e)if(r.from<t&&t<=r.to)return r;for(let r=e.length-1;r>=0;r-=1)if(e[r].from<t)return e[r];let n=e.find(r=>r.from>=t);return n||(t>e[e.length-1].to?e[e.length-1]:e[0])}function Mf(e,t,n){if(!e.length||!Number.isInteger(t)||!Number.isInteger(n)||t<0||n<t)return null;let r=Cme(e,t),a=n>t?Sme(e,n):r;if(!r||!a)return null;let o=document.createRange();return o.setStart(r.textNode,Kj(r,t)),o.setEnd(a.textNode,Kj(a,n)),{range:o,startSpan:r,endSpan:a}}function WC(e,t){let n=[];try{n=[...e.getClientRects()]}catch{n=[]}if(!n.length)try{let r=e.getBoundingClientRect();r&&(r.width||r.height)&&(n=[r])}catch{n=[]}return n.filter(r=>r&&(r.width>0||r.height>0)).map(r=>({left:r.left-t.left,top:r.top-t.top,right:r.right-t.left,bottom:r.bottom-t.top,width:r.width,height:r.height}))}function IR(e,t){let n=Yj(t,0,e.textLength),r=e.to-e.from;return e.textLength===r?e.from+n:e.textLength?e.from+Math.round(n/e.textLength*r):e.from}function Zj(e,t,n,r=""){let a=Ki(e,r),o=t?.nodeType===3?t.parentElement?.closest("[data-src-from]"):t?.closest?.("[data-src-from]"),i=a.find(s=>s.textNode===t||s.element===o);return i?IR(i,t?.nodeType===3?n:n?i.textLength:0):null}function Xj(e,t,n,r){if(!e)return null;if(e.nodeType===3){let l=e.parentElement?.closest("[data-src-from]"),u=n.find(c=>c.element===l);return u?IR(u,t):null}let a=e.nodeType===1?e:e.parentElement,o=n.find(l=>l.element===a);if(o)return IR(o,t===0?0:o.textLength);let i=[...a?.childNodes||[]],s=r==="end"?i.slice(0,t).reverse():i.slice(t);for(let l of s){let u=l.nodeType===1?l.closest?.("[data-src-from]")||l.querySelector?.("[data-src-from]"):null;if(!u)continue;let c=n.find(f=>f.element===u);if(c)return r==="end"?c.to:c.from}return null}function SR(e,t,n,r){if(!e||!t||typeof n!="string"||!n)return null;let a=Ki(e,n),o=a.length?Xj(t.startContainer,t.startOffset,a,"start"):null,i=a.length?Xj(t.endContainer,t.endOffset,a,"end"):null;if(!Number.isInteger(o)||!Number.isInteger(i)){let h=t.toString().trim();if(!h)return null;let g=y=>{let b=[];for(let v=y.indexOf(h);v>=0;v=y.indexOf(h,v+h.length))b.push(v);return b},x=g(n),m=x[0];if(x.length>1){let y=e.querySelector(".ProseMirror");if(!y||!y.contains(t.startContainer))return null;let b=document.createRange();b.selectNodeContents(y),b.setEnd(t.startContainer,t.startOffset);let v=y.innerText||y.textContent||"",w=g(v),k=w.findIndex(_=>_>=b.toString().length);if(w.length!==x.length||k<0)return null;m=x[k]}if(m<0)return null;o=m,i=m+h.length}o>i&&([o,i]=[i,o]);let s=n.slice(o,i),l=s.length-s.trimStart().length,u=s.length-s.trimEnd().length;if(o+=l,i-=u,o>=i||o>0&&n.charCodeAt(o-1)>=55296&&n.charCodeAt(o-1)<=56319&&n.charCodeAt(o)>=56320&&n.charCodeAt(o)<=57343||i<n.length&&n.charCodeAt(i-1)>=55296&&n.charCodeAt(i-1)<=56319&&n.charCodeAt(i)>=56320&&n.charCodeAt(i)<=57343)return null;let c=e.closest(".space-paper-wrap");if(!c)return null;let f=c.getBoundingClientRect(),d=WC(t,f).map(h=>({...h,left:h.left+c.scrollLeft,top:h.top+c.scrollTop})),p=d[0]||{left:0,top:0,bottom:0,width:0,height:0};return{from:o,to:i,version:r,quote:n.slice(o,i),anchor:{x:p.left+p.width/2,top:p.top,bottom:Math.max(p.top+p.height,...d.map(h=>h.bottom)),wrapWidth:c.clientWidth},rects:d}}function Lme(e){let t=e?.parentElement;for(;t&&t!==document.body;){let n=getComputedStyle(t);if(/(auto|scroll)/.test(n.overflowY)&&t.scrollHeight>t.clientHeight+1)return t;t=t.parentElement}return e?.closest(".space-paper-wrap")||null}function LR(e,t,n,r=""){if(!e)return!1;let a=Mf(Ki(e,r),t,n);if(!a)return!1;let o=null;try{o=a.range.getBoundingClientRect()}catch{o=null}if((!o||!o.width&&!o.height)&&(o=a.startSpan.element.getBoundingClientRect()),!o)return!1;let i=Lme(e);if(!i)return!0;let s=i.getBoundingClientRect(),l=i.scrollTop;return o.top<s.top+64?l+=o.top-s.top-64:o.bottom>s.bottom-64&&(l+=o.bottom-s.bottom+64),i.scrollTo({top:Math.max(0,l),behavior:"auto"}),!0}var n$=gr(Nf(),1);function Eme(e,t,n,r){let a=Ct.empty,o=!1,i=s=>{let l=Ki(e,t),u=[];for(let c of n){if(!["pending","conflicted"].includes(c.status))continue;let f=Mf(l,c.from,c.to);if(!f)continue;let d,p;try{d=s.posAtDOM(f.range.startContainer,f.range.startOffset),p=s.posAtDOM(f.range.endContainer,f.range.endOffset)}catch{continue}if(c.expected&&p>d&&u.push(Ht.inline(d,p,{class:`space-suggestion-delete${c.status==="conflicted"?" is-conflicted":""}`,"data-suggestion-id":String(c.id)},{inclusiveStart:!1,inclusiveEnd:!1})),c.replacement){let h=document.createElement("span");h.className=`space-suggestion-insert${c.status==="conflicted"?" is-conflicted":""}`,h.dataset.suggestionId=String(c.id),h.textContent=c.replacement,h.setAttribute("aria-label",`\u5EFA\u8BAE\u65B0\u589E\uFF1A${c.replacement}`),u.push(Ht.widget(p,h,{key:`cospace-suggestion-${c.id}`,side:1}))}}a=Ct.create(s.state.doc,u),s.dispatch(s.state.tr.setMeta("cospace-suggestion-decorations",!0)),delete e.__spaceSourceSpans,Ki(e,t),r?.()};return new Be({props:{decorations:()=>a},view(s){return queueMicrotask(()=>{o||i(s)}),{destroy(){o=!0}}}})}function t$({markdown:e,editorRef:t,onChange:n,onDecorationsReady:r,t:a,readOnly:o=!1,suggestions:i=[],autoFocus:s=!1}){let l=(0,ib.useRef)(null),u=(0,ib.useRef)({onChange:n,onDecorationsReady:r,t:a});return u.current={onChange:n,onDecorationsReady:r,t:a},(0,ib.useEffect)(()=>{let c=!1,f=!1,d=!1,p;return(async()=>{if(p=new Wk({root:l.current,defaultValue:e}),p.setReadonly(o),o&&i.length&&p.editor.use(rt(()=>Eme(l.current,e,i,()=>u.current.onDecorationsReady?.()))),p.addFeature(mU).addFeature(qU).addFeature(NU).addFeature(tU).addFeature(Pq,{boldLabel:u.current.t("edit.bold"),italicLabel:u.current.t("edit.italic"),strikethroughLabel:u.current.t("edit.strike"),linkLabel:u.current.t("edit.link"),codeLabel:u.current.t("edit.code")}).addFeature(pq).addFeature($U,{text:u.current.t("edit.placeholder"),mode:"block"}),p.on(g=>g.markdownUpdated((x,m,y)=>{f&&m!==y&&u.current.onChange()})),await p.create(),d=!0,c){await p.destroy(),d=!1;return}s&&!o&&p.editor.action(g=>{let x=g.get(it),{doc:m,schema:y}=x.state;(m.lastChild?.type!==y.nodes.paragraph||m.lastChild.content.size>0)&&x.dispatch(x.state.tr.insert(m.content.size,y.nodes.paragraph.create()))}),f=!0,t.current=p,s&&!o&&p.editor.action(g=>{let x=g.get(it),m=x.state.doc.content.size-1;x.dispatch(x.state.tr.setSelection(Te.near(x.state.doc.resolve(m),1))),x.focus()})})().catch(g=>{c||console.error("Milkdown editor initialization failed",g)}),()=>{c=!0,f=!1,t.current===p&&(t.current=null),p&&d&&p.destroy()}},[o,e,i,s]),(0,n$.jsx)("div",{ref:l,className:`space-milkdown-root${o?" is-readonly":""}`,"aria-label":a("edit.contentLabel")})}var a$=gr(vo(),1),r$=new WeakMap,_me=o$(null);function o$(e){let t=new Map,n=new Set,r=null,a=()=>{for(let o of n)o()};return{titles:t,subscribe(o){return n.add(o),()=>n.delete(o)},documentTitle(o){return t.get(o)},remember(o,i){typeof o!="string"||typeof i!="string"||i===""||t.get(o)===i||(t.set(o,i),a())},load(){return r!==null?r:typeof e!="function"?Promise.resolve():(r=e("listDocuments").then(o=>{for(let i of o)typeof i?.id=="string"&&typeof i.title=="string"&&i.title!==""&&t.set(i.id,i.title)}).catch(()=>{}).finally(()=>{r=null,a()}),r)}}}function Tme(e){if(typeof e!="function")return _me;let t=r$.get(e);return t||(t=o$(e),r$.set(e,t)),t}function i$(e,t,n){Tme(n).remember(e,t)}var Dme=new nb({html:!1,linkify:!1}).enable("table"),XC=9026,s$=e=>String(e).replace(/[<>&"']/g,t=>({"<":"<",">":">","&":"&",'"':""","'":"'"})[t]);function l$(e,t){return`${String(e||"").replace(/[\\/:*?"<>|\u0000-\u001f]/g,"-").replace(/^[. -]+|[. -]+$/g,"").slice(0,100).replace(/^[. -]+|[. -]+$/g,"")||"\u672A\u547D\u540D\u6587\u6863"}.${t}`}function YC(e=[]){let t=[],n={strong_open:"strong",strong_close:"strong",em_open:"em",em_close:"em",s_open:"strike",s_close:"strike"};for(let r of e)n[r.type]?t.push({marker:n[r.type],close:r.type.endsWith("_close")}):r.type==="text"||r.type==="code_inline"||r.type==="html_inline"?t.push({text:r.content,code:r.type==="code_inline"}):r.type==="softbreak"||r.type==="hardbreak"?t.push({text:`
|
|
690
|
+
`}):r.type==="image"?t.push({text:r.content||r.attrGet("alt")||""}):r.type==="link_open"?t.push({marker:"link",href:r.attrGet("href")}):r.type==="link_close"&&t.push({marker:"link",close:!0});return t}function Rme(e,t,n=0){return{type:t,level:n,runs:YC(e.children)}}function Mme(e){let t=Dme.parse(String(e??""),{}),n=[];for(let r=0;r<t.length;r++){let a=t[r];if(a.type==="heading_open"||a.type==="paragraph_open"){let o=t[++r];n.push(Rme(o,a.type==="heading_open"?"heading":"paragraph",Number(a.tag.slice(1))||0))}else if(a.type==="fence"||a.type==="code_block")n.push({type:"code",text:a.content,language:a.info.trim().split(/\s+/)[0]||""});else if(a.type==="bullet_list_open"||a.type==="ordered_list_open"){let o=[],i=[{ordered:a.type==="ordered_list_open",start:Number(a.attrGet("start"))||1,index:0}],s=null;for(;r+1<t.length;){let l=t[++r];if(l.type==="bullet_list_open"||l.type==="ordered_list_open")s&&(o.push(s),s=null),i.push({ordered:l.type==="ordered_list_open",start:Number(l.attrGet("start"))||1,index:0});else if(l.type==="bullet_list_close"||l.type==="ordered_list_close"){if(i.pop(),!i.length)break}else if(l.type==="list_item_open"){let u=i[i.length-1]||{ordered:!1,start:1,index:0};s={runs:[],depth:Math.max(0,i.length-1),ordered:u.ordered,number:u.start+u.index++}}else l.type==="inline"&&s?s.runs.push(...YC(l.children)):l.type==="list_item_close"&&s&&(o.push(s),s=null)}n.push({type:"list",items:o})}else if(a.type==="blockquote_open"){let o=1,i=[];for(;++r<t.length&&o;){let s=t[r];s.type==="blockquote_open"?o++:s.type==="blockquote_close"?o--:s.type==="paragraph_open"&&t[r+1]?.type==="inline"&&i.push(YC(t[++r].children))}n.push({type:"quote",paragraphs:i})}else if(a.type==="table_open"){let o=[],i=null,s=!1,l=[];for(;++r<t.length&&t[r].type!=="table_close";){let u=t[r];if(u.type==="thead_open")s=!0;else if(u.type==="tbody_open")s=!1;else if(u.type==="tr_open")i=[];else if(u.type==="th_open"||u.type==="td_open"){let c=u.attrGet("style")?.match(/text-align:\s*(left|center|right)/)?.[1]||"left";s&&l.push(c),i&&i.push({runs:[],header:s,align:c})}else u.type==="inline"&&i?.length?i[i.length-1].runs=YC(u.children):u.type==="tr_close"&&i&&(o.push(i),i=null)}n.push({type:"table",rows:o,alignments:l})}}return n}function Nme(e=[],t=[]){let n=[],r=null;return e.map(a=>{if(a.marker==="link")return r=a.close?null:a.href,"";if(a.marker){if(a.close){let s=n.lastIndexOf(a.marker);s>=0&&n.splice(s,1)}else n.push(a.marker);return""}let o=[n.includes("strong")?"<w:b/>":"",n.includes("em")?"<w:i/>":"",n.includes("strike")?"<w:strike/>":"",a.code?'<w:rStyle w:val="InlineCode"/>':"",r?'<w:color w:val="0563C1"/><w:u w:val="single"/>':""].filter(Boolean).join(""),i=String(a.text||"").split(`
|
|
691
|
+
`).map((s,l)=>`${l?"<w:r><w:br/></w:r>":""}<w:r>${o?`<w:rPr>${o}</w:rPr>`:""}<w:t xml:space="preserve">${s$(s)}</w:t></w:r>`).join("");if(r&&/^(https?:|mailto:)/i.test(r)){let s=t.find(l=>l.target===r)?.id;return s||(s=`rId${t.length+1}`,t.push({id:s,target:r})),`<w:hyperlink r:id="${s}">${i}</w:hyperlink>`}return i}).join("")}function em(e,t="Normal",n=[],r={}){return`<w:p><w:pPr>${[`<w:pStyle w:val="${t}"/>`,r.left?`<w:ind w:left="${r.left}"/>`:"",r.hanging?`<w:ind w:left="${r.left||720}" w:hanging="${r.hanging}"/>`:"",r.align?`<w:jc w:val="${r.align}"/>`:"",r.shading?`<w:shd w:val="clear" w:color="auto" w:fill="${r.shading}"/>`:"",r.borderLeft?`<w:pBdr><w:left w:val="single" w:sz="16" w:space="8" w:color="${r.borderLeft}"/></w:pBdr>`:""].filter(Boolean).join("")}</w:pPr>${Nme(e,n)}</w:p>`}function Ome(e,t){let n=Array.from({length:t},(s,l)=>Math.max(1,...e.map(u=>Array.from(u[l]?.runs||[]).reduce((c,f)=>c+String(f.text||"").length,0)))),r=Math.min(1080,Math.floor(XC/t)),a=XC-r*t,o=n.reduce((s,l)=>s+l,0),i=n.map(s=>r+Math.floor(a*s/o));return i[i.length-1]+=XC-i.reduce((s,l)=>s+l,0),i}function Pme(e,t){let n=Math.max(1,...e.rows.map(s=>s.length)),r=Ome(e.rows,n),a=r.map(s=>`<w:gridCol w:w="${s}"/>`).join(""),o='<w:tblBorders><w:top w:val="single" w:sz="4" w:color="C8D2DC"/><w:left w:val="single" w:sz="4" w:color="C8D2DC"/><w:bottom w:val="single" w:sz="4" w:color="C8D2DC"/><w:right w:val="single" w:sz="4" w:color="C8D2DC"/><w:insideH w:val="single" w:sz="4" w:color="C8D2DC"/><w:insideV w:val="single" w:sz="4" w:color="C8D2DC"/></w:tblBorders>',i=e.rows.map((s,l)=>{let u=l===0,c=Array.from({length:n},(f,d)=>{let p=s[d]||{runs:[],header:u,align:"left"},h=`<w:tcW w:w="${r[d]}" w:type="dxa"/><w:vAlign w:val="center"/>${p.header?'<w:shd w:val="clear" w:color="auto" w:fill="EAF1F8"/>':""}`,g=p.header?[{marker:"strong"},...p.runs,{marker:"strong",close:!0}]:p.runs,x=em(g,p.header?"TableHeader":"TableCell",t,{align:p.align});return`<w:tc><w:tcPr>${h}</w:tcPr>${x}</w:tc>`}).join("");return`<w:tr>${u?"<w:trPr><w:tblHeader/></w:trPr>":""}${c}</w:tr>`}).join("");return`<w:tbl><w:tblPr><w:tblW w:w="${XC}" w:type="dxa"/><w:tblLayout w:type="fixed"/>${o}<w:tblCellMar><w:top w:w="90" w:type="dxa"/><w:left w:w="110" w:type="dxa"/><w:bottom w:w="90" w:type="dxa"/><w:right w:w="110" w:type="dxa"/></w:tblCellMar></w:tblPr><w:tblGrid>${a}</w:tblGrid>${i}</w:tbl>`}function Bme(){return`<?xml version="1.0" encoding="UTF-8"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Aptos" w:hAnsi="Aptos" w:eastAsia="Microsoft YaHei"/><w:sz w:val="22"/><w:lang w:val="en-US" w:eastAsia="zh-CN"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="140" w:line="300" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>${[1,2,3,4,5,6].map(t=>{let n=[36,30,26,24,22,22][t-1];return`<w:style w:type="paragraph" w:styleId="Heading${t}"><w:name w:val="heading ${t}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="${t===1?300:220}" w:after="120"/></w:pPr><w:rPr><w:b/><w:color w:val="${t<3?"1F2937":"374151"}"/><w:sz w:val="${n}"/></w:rPr></w:style>`}).join("")}<w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:pPr><w:ind w:left="360"/><w:spacing w:before="80" w:after="160"/></w:pPr><w:rPr><w:color w:val="5B6470"/><w:i/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Code"><w:name w:val="Code"/><w:basedOn w:val="Normal"/><w:pPr><w:ind w:left="180" w:right="180"/><w:spacing w:before="60" w:after="60"/><w:shd w:val="clear" w:color="auto" w:fill="F1F3F5"/></w:pPr><w:rPr><w:rFonts w:ascii="Menlo" w:hAnsi="Menlo" w:eastAsia="Microsoft YaHei"/><w:sz w:val="19"/><w:color w:val="24292F"/></w:rPr></w:style><w:style w:type="character" w:styleId="InlineCode"><w:name w:val="Inline Code"/><w:rPr><w:rFonts w:ascii="Menlo" w:hAnsi="Menlo"/><w:shd w:val="clear" w:color="auto" w:fill="F1F3F5"/><w:color w:val="24292F"/><w:sz w:val="19"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:pPr><w:spacing w:after="60"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="TableHeader"><w:name w:val="Table Header"/><w:basedOn w:val="Normal"/><w:pPr><w:spacing w:after="0" w:line="260" w:lineRule="auto"/></w:pPr><w:rPr><w:b/><w:color w:val="243447"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="TableCell"><w:name w:val="Table Cell"/><w:basedOn w:val="Normal"/><w:pPr><w:spacing w:after="0" w:line="260" w:lineRule="auto"/></w:pPr></w:style></w:styles>`}function zme(e){let t=[],n=Mme(e).map(r=>r.type==="heading"?em(r.runs,`Heading${r.level}`,t):r.type==="code"?r.text.replace(/\n$/,"").split(`
|
|
692
|
+
`).map(a=>em([{text:a}],"Code",t)).join(""):r.type==="quote"?r.paragraphs.map(a=>em(a,"Quote",t,{borderLeft:"C8D2DC"})).join(""):r.type==="list"?r.items.map(a=>{let o=720*(a.depth+1),i=a.ordered?`${a.number}. `:"\u2022 ";return em([{text:i},...a.runs],"ListParagraph",t,{left:o})}).join(""):r.type==="table"?Pme(r,t):em(r.runs,"Normal",t)).join("");return{"[Content_Types].xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>',"_rels/.rels":'<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/></Relationships>',"word/_rels/document.xml.rels":`<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rIdStyles" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>${t.map(r=>`<Relationship Id="${r.id}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="${s$(r.target)}" TargetMode="External"/>`).join("")}</Relationships>`,"word/styles.xml":Bme(),"word/document.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><w:body>${n}<w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440"/></w:sectPr></w:body></w:document>`}}var Fme=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function Hme(e){let t=4294967295;for(let n of e)t=Fme[(t^n)&255]^t>>>8;return(t^4294967295)>>>0}function Vme(e){let t=new TextEncoder,n=[],r=[],a=0;for(let[l,u]of Object.entries(e)){let c=t.encode(l),f=typeof u=="string"?t.encode(u):u,d=Hme(f),p=new Uint8Array(30+c.length),h=new DataView(p.buffer);h.setUint32(0,67324752,!0),h.setUint16(4,20,!0),h.setUint16(6,2048,!0),h.setUint32(14,d,!0),h.setUint32(18,f.length,!0),h.setUint32(22,f.length,!0),h.setUint16(26,c.length,!0),p.set(c,30),n.push(p,f);let g=new Uint8Array(46+c.length),x=new DataView(g.buffer);x.setUint32(0,33639248,!0),x.setUint16(4,20,!0),x.setUint16(6,20,!0),x.setUint16(8,2048,!0),x.setUint32(16,d,!0),x.setUint32(20,f.length,!0),x.setUint32(24,f.length,!0),x.setUint16(28,c.length,!0),x.setUint32(42,a,!0),g.set(c,46),r.push(g),a+=p.length+f.length}let o=r.reduce((l,u)=>l+u.length,0),i=new Uint8Array(22),s=new DataView(i.buffer);return s.setUint32(0,101010256,!0),s.setUint16(8,r.length,!0),s.setUint16(10,r.length,!0),s.setUint32(12,o,!0),s.setUint32(16,a,!0),new Blob([...n,...r,i],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}function u$(e){return Vme(zme(e))}var ZC=gr(vo(),1),c$=new WeakMap,Ume=async()=>null;function qme(e){let t=new Set,n={user:null,loaded:!1,loading:null,subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return n.user},load(){return n.loading!==null?n.loading:n.loaded?Promise.resolve(n.user):(n.loading=e().then(r=>{n.user=r&&r.signedIn?r:null,n.loaded=!0}).catch(()=>{n.user=null,n.loaded=!0}).finally(()=>{n.loading=null;for(let r of t)r()}),n.loading)}};return n}function jme(e){let t=c$.get(e);return t||(t=qme(e),c$.set(e,t)),t}function f$(e=Ume){let t=jme(e);return(0,ZC.useEffect)(()=>{t.loaded||t.load()},[t]),(0,ZC.useSyncExternalStore)(t.subscribe,t.getSnapshot,()=>null)}function d$(e,t,n,r,a){let o=e.right,i=e.bottom-1,s=t,l=n+Math.min(24,Math.max(12,r/2)),u=s-o;if(u<=36){let g=Math.max(0,u*.45);return{x1:o,y1:i,x2:s,y2:l,d:`M ${o} ${i} C ${o+g} ${i}, ${s-g} ${l}, ${s} ${l}`}}let c=o+14,f=i+8,d=Math.max(c,Math.min(a-8,s-18)),p=(s-d)*.5,h=`M ${o} ${i} C ${o+5} ${i}, ${o+6} ${f}, ${c} ${f} L ${d} ${f} C ${d+p} ${f}, ${s-p} ${l}, ${s} ${l}`;return{x1:o,y1:i,x2:s,y2:l,d:h}}var $me=Object.freeze(["conversation.current.read","conversation.create","conversation.open","conversation.send","conversation.references.insert","conversation.references.render","workspace.list","workspace.select","identity.current.read","navigation.document.open","navigation.deepLink.register","files.export.save","files.import.choose","clipboard.write","clipboard.read","notifications.show","application.lifecycle.observe","application.window.open","application.shortcuts.register","updates.subscribe","runtime.localService.manage","runtime.localStorage.choose"]),Gme=new Set($me);function p$(e,t){if(!Array.isArray(e))throw new TypeError(`${t} must be an array`);let n=new Set;for(let r of e){if(typeof r!="string"||!Gme.has(r))throw new TypeError(`Unknown ${t} entry: ${String(r)}`);n.add(r)}return n}function h$(e,t=[]){if(!e||typeof e!="object")throw new TypeError("Adapter declaration is required");if(typeof e.id!="string"||!/^[a-z][a-z0-9.-]*$/.test(e.id))throw new TypeError("Adapter id must be a lowercase identifier");if(typeof e.version!="string"||e.version.length===0)throw new TypeError("Adapter version is required");if(e.contractVersion!==1)throw new TypeError(`Unsupported adapter contract version: ${e.contractVersion}`);let n=p$(e.capabilities,"declared capability"),r=p$(t,"runtime capability");return Object.freeze({id:e.id,version:e.version,contractVersion:e.contractVersion,declared:Object.freeze([...n]),available:Object.freeze([...n].filter(a=>r.has(a)))})}function tm(e,t){return Array.isArray(e?.available)&&e.available.includes(t)}function m$(e){return`\u8BF7\u901A\u8FC7 CoSpace MCP \u8BFB\u53D6\u6587\u6863\u5F15\u7528 ${e}\uFF0C\u4EC5\u6839\u636E\u5DF2\u63A5\u53D7\u7684\u6B63\u6587\u81EA\u4E3B\u5BA1\u9605\u5E76\u63D0\u4EA4\u5177\u4F53\u4FEE\u6539\u5EFA\u8BAE\u3002\u6B64\u64CD\u4F5C\u4E0D\u662F\u6309\u8BC4\u8BBA\u4FEE\u6539\uFF1A\u4E0D\u8981\u628A\u8BC4\u8BBA\u5F53\u4F5C\u4FEE\u6539\u6307\u4EE4\uFF0C\u4E0D\u8981\u5904\u7406\u6216\u5B8C\u6210\u8BC4\u8BBA\uFF0C\u4E5F\u4E0D\u8981\u628A\u5BA1\u9605\u8303\u56F4\u6269\u5C55\u5230\u8BC4\u8BBA\u8981\u6C42\u4E4B\u5916\u3002\u4E0D\u8981\u76F4\u63A5\u8986\u76D6\u5DF2\u63A5\u53D7\u5185\u5BB9\uFF1B\u6240\u6709\u4FEE\u6539\u4EE5\u5EFA\u8BAE\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6211\u5728 CoSpace \u4E2D\u63A5\u53D7\u6216\u62D2\u7EDD\u3002\u4E0D\u8981\u66FF\u6211\u53D1\u9001\u8BC4\u8BBA\u3002`}function g$(e,t){let n=[...new Set(t)];return`${e}
|
|
693
|
+
\u8BF7\u901A\u8FC7 CoSpace MCP \u6309\u8BC4\u8BBA\u63D0\u51FA\u4FEE\u6539\u5EFA\u8BAE\uFF0C\u53EA\u5904\u7406\u4EE5\u4E0B\u8BC4\u8BBA ID\uFF1A${n.join("\u3001")}\u3002\u8C03\u7528 space_document_read \u8BFB\u53D6\u6B63\u6587\u548C\u8FD9\u4E9B\u8BC4\u8BBA\u7684\u5F15\u7528\u6587\u672C\u3001\u951A\u70B9\u53CA\u6B63\u6587\uFF1B\u9010\u6761\u7406\u89E3\u8BC4\u8BBA\uFF0C\u5E76\u5BF9\u6BCF\u6761\u660E\u786E\u4E14\u53EF\u5B9A\u4F4D\u7684\u4FEE\u6539\u8981\u6C42\u63D0\u4EA4\u5BF9\u5E94\u7684\u5177\u4F53\u5EFA\u8BAE\u3002\u4E0D\u8981\u53EA\u590D\u8FF0\u6216\u5206\u7C7B\u8BC4\u8BBA\uFF0C\u4E5F\u4E0D\u8981\u5728\u8BC4\u8BBA\u8981\u6C42\u4E4B\u5916\u81EA\u4E3B\u5BA1\u9605\u6216\u589E\u52A0\u5EFA\u8BAE\u3002\u8BC4\u8BBA\u542B\u7CCA\u6216\u65E0\u6CD5\u5B89\u5168\u5B9A\u4F4D\u65F6\uFF0C\u8BF4\u660E\u539F\u56E0\u5E76\u8BE2\u95EE\uFF0C\u4E0D\u8981\u731C\u6D4B\u3002\u5B8C\u6210\u540E\u8C03\u7528 space_comment_complete\uFF0C\u4E3A\u6BCF\u6761\u5DF2\u5904\u7406\u8BC4\u8BBA\u5173\u8054\u5BF9\u5E94\u5EFA\u8BAE ID\uFF1B\u672A\u5904\u7406\u7684\u8BC4\u8BBA\u4F20\u7A7A suggestionIds\uFF0C\u4F7F\u5176\u4FDD\u6301\u5F85\u5904\u7406\u3002\u4E0D\u8981\u76F4\u63A5\u8986\u76D6\u5DF2\u63A5\u53D7\u5185\u5BB9\uFF1B\u6240\u6709\u4FEE\u6539\u4EE5\u5EFA\u8BAE\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6211\u5728 CoSpace \u4E2D\u63A5\u53D7\u6216\u62D2\u7EDD\u3002\u4E0D\u8981\u66FF\u6211\u53D1\u9001\u8BC4\u8BBA\u3002`}var A=gr(Nf(),1);var lb=()=>globalThis.crypto.randomUUID();function x$({label:e,value:t,options:n,onChange:r}){let[a,o]=(0,ae.useState)(!1),i=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{if(!a)return;let l=u=>{i.current?.contains(u.target)||o(!1)};return document.addEventListener("pointerdown",l),()=>document.removeEventListener("pointerdown",l)},[a]);let s=n.findIndex(l=>l.value===t);return(0,A.jsxs)("div",{className:"space-home-select",ref:i,children:[(0,A.jsxs)("button",{type:"button",className:"space-home-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":a,onClick:()=>o(l=>!l),onKeyDown:l=>{if(l.key==="Escape"){o(!1);return}if(l.key==="ArrowDown"||l.key==="ArrowUp"){l.preventDefault();let u=l.key==="ArrowDown"?1:-1;r(n[(s+u+n.length)%n.length].value)}},children:[(0,A.jsx)("span",{children:n[s]?.label}),(0,A.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",children:(0,A.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),a&&(0,A.jsx)("div",{className:"space-home-select-menu",role:"listbox","aria-label":e,children:n.map(l=>(0,A.jsxs)("button",{type:"button",role:"option","aria-selected":t===l.value,onClick:()=>{r(l.value),o(!1)},children:[l.label,t===l.value&&(0,A.jsx)("span",{"aria-hidden":"true",children:"\u2713"})]},l.value))})]})}function w$(e,t,n){if(!e)return!1;if(LR(e,t,t,n))return!0;let r=e.closest(".space-paper-wrap");if(!r)return!1;let a=n.length?Math.max(0,Math.min(1,t/n.length)):0;return r.scrollTo({top:Math.max(0,e.offsetTop+e.offsetHeight*a-r.clientHeight*.3),behavior:"auto"}),!0}var b$={pending:"status.pending",sending:"status.sending",sent:"status.sent",failed:"status.failed",unknown:"status.unknown",processed:"status.processed"},y$={pending:"suggestion.pendingStatus",accepted:"suggestion.acceptedStatus",rejected:"suggestion.rejectedStatus",conflicted:"suggestion.conflictedStatus"};var Wme=(e,t)=>{let n=e.updatedAt||e.createdAt;if(!n||!Number.isFinite(Date.parse(n)))return t("home.timeUnknown");let r=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(n));return t(e.updatedAt?"home.updated":"home.created",{time:r})},ub=(e,t)=>J4(Z4,e,t),k$=typeof __COSPACE_BUILD_VERSION__>"u"?"development":__COSPACE_BUILD_VERSION__,Kme=k$.split("+",1)[0];function Xme({className:e=""}){return(0,A.jsx)("img",{className:e,src:Y4,alt:"","aria-hidden":"true"})}function Yme({size:e=14}){return(0,A.jsx)(ws,{size:e,strokeWidth:1.8,"aria-hidden":"true"})}function Zme({size:e=15}){return(0,A.jsx)(Hd,{size:e,strokeWidth:1.8,"aria-hidden":"true"})}function Jme({label:e,children:t,...n}){return(0,A.jsx)("button",{type:"button","aria-label":e,title:e,...n,children:t})}function Qme({exporting:e,onExport:t,onReview:n,onPreferences:r,canExport:a,t:o}){let[i,s]=(0,ae.useState)(!1),l=(0,ae.useRef)(null),u=(0,ae.useRef)(null),c=(0,ae.useId)();(0,ae.useEffect)(()=>{if(!i)return;let d=h=>{l.current?.contains(h.target)||s(!1)},p=h=>{h.key==="Escape"&&(s(!1),u.current?.focus())};return document.addEventListener("pointerdown",d),document.addEventListener("keydown",p),()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",p)}},[i]);let f=d=>{s(!1),d?.()};return(0,A.jsxs)("div",{className:"space-tools-menu",ref:l,children:[(0,A.jsx)("button",{ref:u,type:"button",className:"space-tools-menu-trigger","aria-label":o("toolbar.more"),title:o("toolbar.more"),"aria-haspopup":"true","aria-expanded":i,"aria-controls":c,onClick:()=>s(d=>!d),children:(0,A.jsx)(Fl,{size:19,"aria-hidden":"true"})}),i&&(0,A.jsxs)("div",{id:c,className:"space-tools-menu-panel",children:[n&&(0,A.jsx)("button",{type:"button",onClick:()=>f(n),children:"\u8BA9 Agent \u5BA1\u9605"}),r&&(0,A.jsx)("button",{type:"button",onClick:()=>f(r),children:o("collab.open")}),a&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"space-tools-menu-divider",role:"separator"}),(0,A.jsx)("p",{children:o("export.button")}),(0,A.jsxs)("button",{type:"button",disabled:e,onClick:()=>f(()=>t("md")),children:["Markdown ",(0,A.jsx)("span",{children:".md"})]}),(0,A.jsxs)("button",{type:"button",disabled:e,onClick:()=>f(()=>t("docx")),children:["Word ",(0,A.jsx)("span",{children:".docx"})]})]})]})]})}function nm({open:e,onClose:t,labelledBy:n,title:r,closeLabel:a,className:o="",closeOnBackdrop:i=!1,actions:s,children:l}){let u=(0,ae.useRef)(null),c=(0,ae.useRef)(t);return c.current=t,(0,ae.useEffect)(()=>{if(!e||typeof document>"u")return;let f=u.current,d=document.activeElement,p=document.body.style.overflow;document.body.style.overflow="hidden";let h=()=>[...f.querySelectorAll('button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href],[tabindex]:not([tabindex="-1"])')];(f.querySelector("[autofocus]")||h()[0]||f).focus();let x=m=>{if(m.key==="Escape"){m.preventDefault(),c.current?.();return}if(m.key!=="Tab")return;let y=h();if(!y.length){m.preventDefault(),f.focus();return}let b=y[0],v=y.at(-1);m.shiftKey&&(document.activeElement===b||document.activeElement===f)?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),b.focus())};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),document.body.style.overflow=p,d instanceof HTMLElement&&d.isConnected&&d.focus()}},[e]),!e||typeof document>"u"?null:(0,A.jsx)("div",{className:"space-dialog-backdrop",onMouseDown:f=>{i&&f.target===f.currentTarget&&t()},children:(0,A.jsxs)("section",{ref:u,className:`space-dialog ${o}`,role:"dialog","aria-modal":"true","aria-labelledby":n,tabIndex:-1,onMouseDown:f=>f.stopPropagation(),children:[(0,A.jsxs)("header",{className:"space-dialog-header",children:[(0,A.jsx)("h2",{id:n,children:r}),(0,A.jsx)("button",{type:"button",className:"space-dialog-close","aria-label":a,onClick:()=>c.current?.(),children:(0,A.jsx)(Ud,{size:17,"aria-hidden":"true"})})]}),(0,A.jsx)("div",{className:"space-dialog-content",children:l}),s&&(0,A.jsx)("footer",{className:"space-dialog-actions",children:s})]})})}function ege(e,t,n,r=ub,a=null,o=null){let i=a?.conversation||null,[s,l]=(0,ae.useState)(null),[u,c]=(0,ae.useState)([]),[f,d]=(0,ae.useState)(null),[p,h]=(0,ae.useState)(null),[g,x]=(0,ae.useState)(""),[m,y]=(0,ae.useState)(null),[b,v]=(0,ae.useState)(1),[w,k]=(0,ae.useState)(!1),[_,E]=(0,ae.useState)(""),[M,S]=(0,ae.useState)(!1),[U,N]=(0,ae.useState)(""),[q,ie]=(0,ae.useState)(null),[fe,he]=(0,ae.useState)(!1),xe=(0,ae.useRef)(null),Ce=(0,ae.useRef)(new Map),Fe=(0,ae.useRef)(new Map),D=(0,ae.useRef)(0),st=(0,ae.useRef)(null),Ke=(0,ae.useRef)(null),T=(0,ae.useRef)(!1),at=(0,ae.useRef)(r);at.current=r;let yt=(0,ae.useCallback)(($,te={})=>e($,te),[e]);(0,ae.useEffect)(()=>{v(1)},[t]);let Ut=(0,ae.useCallback)(async $=>{let te=++D.current,le=await yt("readDocument",{docId:$});if(te!==D.current)return;$===o&&(S(!0),ie(le?.version??null),he(!1));let me=le?.comments||[],P=JSON.stringify(le),G=!Ke.current||Ke.current.content!==le?.content||Ke.current.version!==le?.version;Ke.current?.signature!==P&&(l(le),c(me)),Ke.current={signature:P,content:le?.content,version:le?.version},G&&y(null),le?.title&&i$($,le.title,e)},[yt,o]);(0,ae.useEffect)(()=>{if(S(!1),ie(null),he(!1),st.current=null,!t){D.current++,Ke.current=null,l(null),c([]),d(null),h(null),y(null),x(""),E("");return}Ke.current=null,l(null),E(""),Ut(t).catch($=>E(ks($,at.current)))},[t,Ut]),(0,ae.useEffect)(()=>()=>{D.current++},[]),(0,ae.useEffect)(()=>{T.current=w},[w]),(0,ae.useEffect)(()=>{if(!t)return;let $=!1,te=()=>{$||document.visibilityState==="hidden"||T.current||Ut(t).catch(()=>{})},le=setInterval(te,2500);return document.addEventListener("visibilitychange",te),()=>{$=!0,clearInterval(le),document.removeEventListener("visibilitychange",te)}},[t,Ut]);let ln=(0,ae.useMemo)(()=>[...s?.suggestions||[]].sort(($,te)=>($.from??0)-(te.from??0)),[s]),mt=!!s&&!ln.some($=>["pending","conflicted"].includes($.status))&&!u.some($=>["pending","sending","failed","unknown"].includes($.status)),be=$=>b$[$.status]?r(b$[$.status]):$.status,Tt=$=>{h(null),d($);let te=s?.suggestions?.find(le=>le.id===$);(!te||!w$(xe.current,te.from,s?.content||""))&&E(r("suggestion.unavailable"))},Dt=$=>{h(null),d($),Ce.current.get($)?.scrollIntoView({block:"nearest",behavior:"auto"})},vt=async $=>{k(!0),E("");try{return await $()}catch(te){return E(ks(te,at.current)),null}finally{k(!1)}},I=($,te)=>vt(async()=>{await yt("decide",{docId:t,suggestionId:$,decision:te,operationId:lb()}),await Ut(t)}),R=()=>{if(!mt){E(r("edit.unavailable"));return}E(""),N(""),y(null),ie(s.version),he(!1),S(!0)},z=()=>vt(async()=>{if(q===null)throw Object.assign(new Error(r("edit.unavailable")),{code:"EDIT_REQUIRES_UNANNOTATED_DOCUMENT"});let $=st.current?.getMarkdown(),te=fe&&typeof $=="string"&&$!==s?.content;if(te)try{await yt("updateDocument",{docId:t,baseVersion:q,content:$,operationId:lb()})}catch(le){throw N(ks(le,at.current)),le}return S(!1),ie(null),he(!1),st.current=null,N(""),te&&await Ut(t),!0}),ne=()=>{N(""),E("")},j=()=>vt(async()=>{if(!m||!g.trim())throw Error(r("comment.required"));let $=await yt("createComment",{docId:t,quote:m.quote,body:g.trim(),anchor:{from:m.from,to:m.to,version:m.version}});return x(""),await Ut(t),h($.id),$}),W=tm(a?.capabilities,"clipboard.write")&&typeof a?.clipboard?.writeText=="function",Y=tm(a?.capabilities,"conversation.send"),se=tm(a?.capabilities,"conversation.create")&&i?.canCreate===!0;return{doc:s,setDoc:l,comments:u,active:f,setActive:d,activeComment:p,setActiveComment:h,draft:g,setDraft:x,selection:m,setSelection:y,zoom:b,setZoom:v,busy:w,message:_,setMessage:E,surface:xe,cardRefs:Ce,commentRefs:Fe,reload:Ut,suggestions:ln,statusText:be,chooseCard:Tt,chooseFromText:Dt,decide:I,addComment:j,deleteComment:$=>vt(async()=>{await yt("deleteComment",{docId:t,commentId:$}),h(null),await Ut(t)}),send:($=n&&Y?"current":se?"new":W?"copy":"unavailable")=>vt(async()=>{let te=u.filter(me=>["pending","failed"].includes(me.status)).map(me=>me.id);if(!te.length)throw Error(r("send.none"));if($==="copy"){if(!W)throw Object.assign(new Error(r("send.clipboardUnavailable")),{code:"CLIPBOARD_UNAVAILABLE"});if(typeof a?.clipboard?.writeText!="function")throw Object.assign(new Error(r("send.clipboardUnavailable")),{code:"CLIPBOARD_UNAVAILABLE"});let me=g$(`space:${encodeURIComponent(t)}`,te);return await a.clipboard.writeText(me),E(r("send.copied")),h(null),{copied:!0}}if($!=="current"&&$!=="new")throw Object.assign(new Error(r("send.createUnavailable")),{code:"SESSION_UNAVAILABLE"});if(!Y)throw Object.assign(new Error(r("send.createUnavailable")),{code:"SESSION_UNAVAILABLE"});if($==="current"&&!n)throw Object.assign(new Error(r("send.noSession")),{code:"SESSION_UNAVAILABLE"});if($==="new"&&!se)throw Object.assign(new Error(r("send.createUnavailable")),{code:"SESSION_UNAVAILABLE"});let le=$==="current"?n:void 0;try{if(typeof i?.send!="function")throw Object.assign(new Error(r("send.createUnavailable")),{code:"SESSION_UNAVAILABLE"});let me=await i.send({intent:"process-comments",documentId:t,commentIds:te,...le?{conversationId:le}:{createConversation:!0,...n?{excludeConversationId:n}:{}},requestId:lb()});return!le&&me?.createdConversation&&me.conversationId&&typeof i?.open=="function"&&i.open(me.conversationId),me}finally{await Ut(t),h(null)}}),canCopy:W,canSend:Y,canCreate:se,canEdit:mt,editing:M,autoFocus:s?.id===o,editSaveError:U,dismissEditSaveError:ne,editorRef:st,startEditing:R,switchToReview:z,markEditDirty:()=>he(!0)}}function tge({review:e,t=ub}){let{zoom:n,setZoom:r}=e;return(0,A.jsxs)("div",{className:"space-zoom-tools",role:"group","aria-label":t("zoom.label"),children:[(0,A.jsx)("button",{type:"button","aria-label":t("zoom.out"),title:t("zoom.out"),disabled:n<=.6,onClick:()=>r(a=>Math.max(.6,Math.round((a-.1)*10)/10)),children:"\u2212"}),(0,A.jsxs)("span",{children:[Math.round(n*100),"%"]}),(0,A.jsx)("button",{type:"button","aria-label":t("zoom.in"),title:t("zoom.in"),disabled:n>=1.5,onClick:()=>r(a=>Math.min(1.5,Math.round((a+.1)*10)/10)),children:"\uFF0B"})]})}function sb(e){return e.resolved||(!e.stale&&Number.isInteger(e.anchor?.from)&&Number.isInteger(e.anchor?.to)?{from:e.anchor.from,to:e.anchor.to}:null)}function nge({name:e,avatarUrl:t}){let[n,r]=(0,ae.useState)(!1);(0,ae.useEffect)(()=>{r(!1)},[t]);let a=Array.from(e.trim())[0]?.toLocaleUpperCase()||"?";return(0,A.jsx)("span",{className:`space-annotation-avatar${t&&!n?" is-image":""}`,"aria-hidden":"true",children:t&&!n?(0,A.jsx)("img",{src:t,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>r(!0)}):a})}function C$({name:e,createdAt:t,fallback:n,fallbackTime:r="",avatarUrl:a=null}){let o=e||n,i=Number.isFinite(Date.parse(t))?new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"";return(0,A.jsxs)("div",{className:"space-annotation-identity",children:[(0,A.jsx)(nge,{name:o,avatarUrl:a}),(0,A.jsxs)("span",{className:"space-annotation-byline",children:[(0,A.jsx)("strong",{children:o}),(i||r)&&(0,A.jsx)("time",{dateTime:i?t:void 0,children:i||r})]})]})}function v$({comment:e,author:t,active:n,busy:r,t:a,statusText:o,confirming:i,onAskDelete:s,onConfirmDelete:l,onCancelDelete:u,onActivate:c,setRef:f,style:d,className:p="",onPointerEnter:h,onPointerLeave:g}){let x=e.status,m=r||e.status==="sending",y=e.status==="pending"?e.stale?a("comment.staleStatus"):null:`${o(e)}${e.stale?a("comment.stale"):""}`,b=t?.name||(t?.signedIn?a("comment.accountUser"):null);return(0,A.jsxs)("article",{className:`space-annotation-balloon space-comment-balloon${n?" is-active":""}${e.stale?" is-stale":""}${i?" is-confirming":""} ${p}`,"data-comment-id":e.id,ref:v=>f(e.id,v),style:d,onPointerEnter:h,onPointerLeave:g,onClick:()=>c(e.id),children:[(0,A.jsx)(C$,{name:b,avatarUrl:t?.avatarUrl,createdAt:e.createdAt,fallback:a("comment.author")}),y&&(0,A.jsx)("div",{className:"space-annotation-head",children:(0,A.jsx)("span",{className:`space-comment-status is-${x}`,children:y})}),(0,A.jsx)("p",{className:"space-comment-body",children:e.body}),e.processing?.suggestions?.length>0&&(0,A.jsx)("div",{className:"space-comment-processing-meta",children:a("comment.relatedSuggestions",{states:e.processing.suggestions.map(v=>y$[v.status]?a(y$[v.status]):v.status).join("\u3001")})}),(0,A.jsx)("button",{type:"button",className:"space-annotation-action space-comment-delete-icon",disabled:m,"aria-label":a("comment.delete"),title:a("comment.delete"),onClick:v=>{v.stopPropagation(),s(e.id)},children:(0,A.jsx)(ws,{size:18,strokeWidth:2,"aria-hidden":"true"})}),i&&(0,A.jsxs)("div",{className:"space-comment-footer is-confirming",onClick:v=>v.stopPropagation(),children:[(0,A.jsx)("span",{className:"space-comment-confirm-text",children:a("comment.deleteConfirm")}),(0,A.jsx)("button",{type:"button",className:"space-comment-delete is-danger",disabled:m,onClick:()=>l(e.id),children:a("comment.delete")}),(0,A.jsx)("button",{type:"button",className:"space-comment-delete",disabled:m,onClick:()=>u(),children:a("comment.cancel")})]})]})}function rge({item:e,active:t,busy:n,t:r,onActivate:a,onDecide:o,setRef:i,style:s,className:l="",onPointerEnter:u,onPointerLeave:c}){let f=e.status==="conflicted";return(0,A.jsxs)("article",{className:`space-annotation-balloon space-suggestion-balloon${t?" is-active":""}${f?" is-conflicted":""} ${l}`,"data-suggestion-card":e.id,ref:d=>i(e.id,d),style:s,onPointerEnter:u,onPointerLeave:c,onClick:a,children:[(0,A.jsxs)("div",{className:"space-suggestion-head",children:[(0,A.jsx)(C$,{name:e.author,createdAt:e.createdAt,fallback:r("suggestion.defaultAuthor"),fallbackTime:r("suggestion.unknownTime")}),!f&&(0,A.jsxs)("div",{className:"space-suggestion-actions",children:[(0,A.jsx)("button",{type:"button",className:"space-annotation-action is-accept",disabled:n,"aria-label":r("action.accept"),title:r("action.accept"),onClick:d=>{d.stopPropagation(),o("accept")},children:(0,A.jsx)(Eg,{size:18,strokeWidth:2,"aria-hidden":"true"})}),(0,A.jsx)("button",{type:"button",className:"space-annotation-action is-reject",disabled:n,"aria-label":r("action.reject"),title:r("action.reject"),onClick:d=>{d.stopPropagation(),o("reject")},children:(0,A.jsx)(Ud,{size:18,strokeWidth:2,"aria-hidden":"true"})})]})]}),(0,A.jsxs)("div",{className:"space-suggestion-change",children:[e.expected&&(0,A.jsxs)("p",{className:"is-deleted",children:[(0,A.jsxs)("strong",{children:[r("suggestion.deletedLabel"),"\uFF1A"]}),e.expected]}),e.replacement&&(0,A.jsxs)("p",{className:"is-inserted",children:[(0,A.jsxs)("strong",{children:[r("suggestion.insertedLabel"),"\uFF1A"]}),e.replacement]}),!e.expected&&!e.replacement&&(0,A.jsx)("p",{className:"is-unavailable",children:r("suggestion.unavailable")})]}),f&&(0,A.jsx)("div",{className:"space-suggestion-meta",children:(0,A.jsx)("span",{className:"space-suggestion-conflict",children:r("suggestion.conflicted")})})]})}function age({review:e,sessionId:t,adapter:n=null,t:r=ub,compact:a=!1}){let o=(0,ae.useId)(),i=(0,ae.useId)(),[s,l]=(0,ae.useState)(!1),[u,c]=(0,ae.useState)("copy"),f=e.comments.filter(k=>["pending","failed"].includes(k.status)),d=n?.conversation||null,p=e.canSend&&!!t,h=e.canCreate,g=e.canCopy;(0,ae.useEffect)(()=>{l(!1)},[e.doc?.id,t,g,h,f.length===0]);let x=e.busy||!f.length,m=!p&&!h&&g?r("send.copyHint"):void 0,y=null,b=null;try{y=t&&d?.getConversationLabel?.(t)}catch{}try{b=t&&d?.getWorkspaceLabel?.(t)}catch{}let v=()=>{c(p?"current":h?"new":g?"copy":"unavailable"),l(!0)},w=u==="copy"?"send.copyConfirm":u==="new"?"send.newSessionConfirm":"send.confirm";return!f.length||!p&&!h&&!g?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("button",{type:"button",className:`space-send ${a?"space-send-compact":"space-send-header"}`,disabled:x,title:m,onClick:v,children:[(0,A.jsx)(Hd,{size:14,"aria-hidden":"true"}),(0,A.jsx)("span",{children:r("send.action")})]}),(0,A.jsxs)(nm,{open:s,onClose:()=>l(!1),labelledBy:o,title:r("send.chooseTitle"),closeLabel:r("dialog.close"),className:"space-send-dialog",actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",autoFocus:!0,onClick:()=>l(!1),children:r("comment.cancel")}),(0,A.jsx)("button",{type:"button",className:"is-primary",disabled:e.busy||!f.length||u==="current"&&!p||u==="new"&&!h,onClick:()=>{l(!1),e.send(u)},children:r(w)})]}),children:[(0,A.jsx)("p",{children:r("send.chooseDescription",{count:f.length})}),(0,A.jsxs)("fieldset",{className:"space-send-options",children:[(0,A.jsx)("legend",{children:r("send.destination")}),(0,A.jsxs)("label",{className:"space-send-option",children:[(0,A.jsx)("input",{type:"radio",name:i,value:"current",checked:u==="current",disabled:!p,onChange:()=>c("current")}),(0,A.jsxs)("span",{children:[(0,A.jsx)("strong",{children:r("send.currentOption")}),(0,A.jsxs)("small",{className:"space-send-conversation",children:[p&&b&&(0,A.jsx)("span",{className:"space-send-workspace",children:b}),p?y||r("send.sessionId",{id:t}):r("send.currentUnavailable")]})]})]}),(0,A.jsxs)("label",{className:"space-send-option",children:[(0,A.jsx)("input",{type:"radio",name:i,value:"new",checked:u==="new",disabled:!h,onChange:()=>c("new")}),(0,A.jsxs)("span",{children:[(0,A.jsx)("strong",{children:r("send.newOption")}),(0,A.jsx)("small",{children:r(h?"send.newOptionHint":"send.newUnavailable")})]})]}),g&&(0,A.jsxs)("label",{className:"space-send-option",children:[(0,A.jsx)("input",{type:"radio",name:i,value:"copy",checked:u==="copy",onChange:()=>c("copy")}),(0,A.jsxs)("span",{children:[(0,A.jsx)("strong",{children:r("send.copyOption")}),(0,A.jsx)("small",{children:r("send.copyOptionHint")})]})]})]})]})]})}function oge(e){let t=e.filter(s=>s.caret),n=e.filter(s=>!s.caret&&s.kind!=="comment"),r=e.filter(s=>!s.caret&&s.kind==="comment").sort((s,l)=>s.top-l.top||s.height-l.height||s.left-l.left),a=[];for(let s of r){let l=a.at(-1);if(l&&Math.abs(l.top-s.top)<=1&&Math.abs(l.height-s.height)<=1&&s.left<=l.left+l.width){let u=Math.max(l.left+l.width,s.left+s.width);l.width=u-l.left,l.active=l.active||s.active,l.keys.push(s.key),s.active&&l.activeRects.push(s)}else a.push({...s,active:!1,keys:[s.key],activeRects:s.active?[s]:[]})}let o=a.map(s=>({key:`comment-fill:${s.keys.join("|")}`,kind:"comment",active:!1,left:s.left,top:s.top,width:s.width,height:s.height,caret:!1})),i=a.flatMap(s=>s.activeRects.map(l=>({...l,key:`${l.key}:active-outline`,active:!0,outline:!0})));return[...o,...n,...t,...i]}function ige({review:e,user:t=null,t:n=ub}){let[r,a]=(0,ae.useState)(!1),[o,i]=(0,ae.useState)(null),[s,l]=(0,ae.useState)(0),[u,c]=(0,ae.useState)(null),f=(0,ae.useRef)(null),[d,p]=(0,ae.useState)({positions:{},lines:[],highlights:[],height:0,minHeight:0}),h=(0,ae.useId)(),g=(0,ae.useId)(),x=(0,ae.useId)(),m=(0,ae.useRef)(null),y=(0,ae.useRef)(null),b=(0,ae.useRef)(null),v=(0,ae.useRef)(null),w=(0,ae.useRef)(null),[k,_]=(0,ae.useState)(null),{doc:E,comments:M,active:S,setActive:U,activeComment:N,setActiveComment:q,draft:ie,setDraft:fe,selection:he,setSelection:xe,zoom:Ce,busy:Fe,message:D,setMessage:st,surface:Ke,cardRefs:T,commentRefs:at,suggestions:yt,statusText:Ut,chooseCard:ln,chooseFromText:mt,decide:be,addComment:Tt,deleteComment:Dt,editing:vt,editorRef:I,markEditDirty:R}=e,z=(0,ae.useMemo)(()=>M.filter(V=>!["sent","processed"].includes(V.status)),[M]),ne=(0,ae.useMemo)(()=>z.filter(V=>sb(V)),[z]),j=(0,ae.useMemo)(()=>z.filter(V=>!sb(V)),[z]),W=yt.length>0||z.length>0,Y=(0,ae.useMemo)(()=>yt.map((V,Le)=>({kind:"suggestion",key:`suggestion:${V.id}`,id:V.id,item:V,index:Le})),[yt]),se=(0,ae.useMemo)(()=>ne.map(V=>({kind:"comment",key:`comment:${V.id}`,id:V.id,item:V})),[ne]),K=(0,ae.useMemo)(()=>[...Y,...se],[Y,se]);if((0,ae.useLayoutEffect)(()=>{let V=y.current;if(!V)return;let Le=()=>l(et=>et+1);Le();let Oe=typeof ResizeObserver=="function"?new ResizeObserver(Le):null;return Oe?.observe(V),Ke.current&&Oe?.observe(Ke.current),window.addEventListener("resize",Le),()=>{Oe?.disconnect(),window.removeEventListener("resize",Le)}},[E?.content]),(0,ae.useEffect)(()=>{if(!document.fonts?.ready)return;let V=!0;return document.fonts.ready.then(()=>{V&&l(Le=>Le+1)}),()=>{V=!1}},[]),(0,ae.useEffect)(()=>{let V=Ke.current;if(!V||!E||vt)return;let Le=typeof requestAnimationFrame=="function"?requestAnimationFrame:cn=>setTimeout(cn,0),Oe=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout,et=0,lt=()=>{if(et=0,r||document.activeElement?.tagName==="TEXTAREA")return;let cn=window.getSelection?.();if(!cn||cn.rangeCount===0){xe(Je=>Je&&null);return}let wt=cn.getRangeAt(0);if(wt.collapsed){xe(Je=>Je&&null);return}if(!V.contains(wt.commonAncestorContainer)){xe(Je=>Je&&null);return}try{let Je=SR(V,wt,E.content,E.version);Je&&xe(zt=>zt&&zt.from===Je.from&&zt.to===Je.to&&zt.quote===Je.quote?zt:Je)}catch{}},An=()=>{et||(et=Le(lt))};return document.addEventListener("selectionchange",An),()=>{document.removeEventListener("selectionchange",An),et&&Oe(et)}},[r,E,vt,xe,Ke]),(0,ae.useLayoutEffect)(()=>{if(!W){p($e=>$e.height===0&&!$e.lines.length&&!$e.highlights?.length&&!Object.keys($e.positions).length?$e:{positions:{},lines:[],highlights:[],height:0,minHeight:0});return}let V=b.current,Le=Ke.current,Oe=v.current;if(!V||!Le||!Oe)return;let et=V.getBoundingClientRect(),lt=Ce,An=Le.getBoundingClientRect(),cn=Oe.getBoundingClientRect(),wt=Ki(Le,E.content),Je=S!=null?`suggestion:${S}`:N!=null?`comment:${N}`:null,zt=new Map,Qn=[];for(let $e of K){let En=$e.kind==="suggestion"?{from:$e.item.from,to:$e.item.to}:sb($e.item);if(!En)continue;let fn=Mf(wt,En.from,En.to);if(!fn)continue;let yn=WC(fn.range,et).map(en=>Object.fromEntries(Object.entries(en).map(([Zo,al])=>[Zo,typeof al=="number"?al/lt:al])));if(!yn.length){let en=fn.startSpan.element.getBoundingClientRect();en&&(en.width||en.height)&&(yn=[{left:(en.left-et.left)/lt,top:(en.top-et.top)/lt,right:(en.right-et.left)/lt,bottom:(en.bottom-et.top)/lt,width:en.width/lt,height:en.height/lt}])}let Vn=yn[0];if(!Vn)continue;let Zi=yn[yn.length-1];zt.set($e.key,{left:Vn.left,right:Vn.right,top:Vn.top,bottom:Vn.bottom,height:Vn.height,end:Zi});let xo=$e.key===Je;En.from===En.to?Qn.push({key:`${$e.key}:caret`,kind:$e.kind,active:xo,left:Math.max(0,Vn.left-1),top:Vn.top,width:2,height:Math.max(Vn.height,18),caret:!0}):yn.forEach((en,Zo)=>{en.width>0&&en.height>0&&Qn.push({key:`${$e.key}:${Zo}`,kind:$e.kind,deleted:$e.kind==="suggestion"&&!!$e.item.expected,active:xo,left:en.left,top:en.top,width:en.width,height:en.height,caret:!1})})}let mr=oge(Qn),Bu=[...K].sort(($e,En)=>{let fn=zt.get($e.key)?.top??$e.item.from??0,yn=zt.get(En.key)?.top??En.item.from??0;return fn-yn||$e.key.localeCompare(En.key)}),Xi={},Yi=[],go=8;for(let $e of Bu){let En=$e.kind==="suggestion"?T.current.get($e.id):at.current.get($e.id);if(!En)continue;let fn=zt.get($e.key),yn=En.offsetHeight||0,Vn=$e.item.from??$e.item.anchor?.from??0,Zi=E.content.length?Le.offsetHeight*Math.max(0,Math.min(1,Vn/E.content.length)):0,xo=Math.max(fn?.top??Zi,go);if(Xi[$e.key]=xo,go=xo+yn+10,fn){let en=d$(fn.end,(cn.left-et.left)/lt,xo,yn,(An.right-et.left)/lt);Yi.push({key:$e.key,kind:$e.kind,active:$e.key===Je,...en})}}let rl=Math.max(Le.offsetHeight,go);p($e=>JSON.stringify($e.positions)===JSON.stringify(Xi)&&JSON.stringify($e.lines)===JSON.stringify(Yi)&&JSON.stringify($e.highlights||[])===JSON.stringify(mr)&&$e.height===go&&$e.minHeight===rl?$e:{positions:Xi,lines:Yi,highlights:mr,height:go,minHeight:rl})},[W,K,yt,ne,E?.content,s,S,N,o,T,at,n,Ce]),(0,ae.useEffect)(()=>{he||a(!1)},[he]),(0,ae.useEffect)(()=>{i(null)},[M]),(0,ae.useEffect)(()=>(c(null),()=>{clearTimeout(f.current),f.current=null}),[E?.id]),(0,ae.useLayoutEffect)(()=>{let V=w.current,Le=Ke.current;if(!he||r||Fe||!V||!Le)return;let Oe={contextElement:Le,getBoundingClientRect(){let cn=Mf(Ki(Le,E?.content),he.from,he.to);if(cn)return cn.range.getBoundingClientRect?.()||Le.getBoundingClientRect();let wt=Le.closest(".space-paper-wrap"),Je=wt?.getBoundingClientRect(),zt=he.anchor;if(Je&&zt){let Qn=Je.left+zt.x-wt.scrollLeft,mr=Je.top+zt.top-wt.scrollTop;return{x:Qn,y:mr,left:Qn,right:Qn,top:mr,bottom:Je.top+zt.bottom-wt.scrollTop,width:1,height:Math.max(1,zt.bottom-zt.top)}}return Le.getBoundingClientRect()}},et=!0,An=Sg(Oe,V,()=>zr(Oe,V,{placement:"top",middleware:[Pa(10),zl(),xv({padding:8})]}).then(({x:cn,y:wt})=>{et&&_({left:cn,top:wt})}).catch(()=>{}));return()=>{et=!1,An()}},[he,r,Fe,Ke,s,Ce,E?.content]),!E)return(0,A.jsx)("section",{className:"space-paper-wrap",children:(0,A.jsx)("p",{className:"space-loading",role:"status",children:e.message||n("empty.loading")})});let Z=()=>{st(""),a(!0)},$=()=>{a(!1),st("")},te=async()=>{await Tt()&&(a(!1),st(""),xe(null))},le=V=>i(V),me=async V=>{await Dt(V),i(null)},P=V=>{let Le=ne.find(Oe=>Oe.id===V);if(Le){let Oe=sb(Le);w$(Ke.current,Oe.from,E.content)}},G=V=>{U(null),q(V),at.current.get(V)?.scrollIntoView({block:"nearest",inline:"nearest",behavior:"auto"})},de=V=>{U(null),q(V),P(V)},ve=V=>{q(null),U(V),ln(V)},oe=()=>{clearTimeout(f.current),f.current=null},ce=()=>{f.current===null&&(f.current=setTimeout(()=>{f.current=null,c(null)},180))},Ee=V=>{let Le=V.target?.closest?.("[data-suggestion-id]")?.getAttribute("data-suggestion-id"),Oe=Le==null?null:Y.find(wt=>String(wt.id)===Le);if(Oe){oe(),c(wt=>wt?.key===Oe.key?wt:{key:Oe.key,left:V.clientX,top:V.clientY});return}let et=document.caretRangeFromPoint?.(V.clientX,V.clientY),lt=et?{node:et.startContainer,offset:et.startOffset}:document.caretPositionFromPoint?.(V.clientX,V.clientY);if(!lt){ce();return}let An=Zj(Ke.current,lt.node||lt.offsetNode,lt.offset,E.content);if(!Number.isInteger(An)){ce();return}let cn=K.find(wt=>{let Je=wt.kind==="suggestion"?{from:wt.item.from,to:wt.item.to}:sb(wt.item);return Je&&(Je.from===Je.to?An===Je.from:An>=Je.from&&An<=Je.to)});cn?(oe(),c(wt=>wt?.key===cn.key?wt:{key:cn.key,left:V.clientX,top:V.clientY})):ce()},tt=V=>{let Le=V.target?.closest?.("a[href]");if(!Le||!Ke.current?.contains(Le))return;let Oe=Le.getAttribute("href")?.trim();if(!Oe)return;let et;try{et=new URL(Oe,window.location.href)}catch{V.preventDefault();return}let lt=new URL(window.location.href);if(Oe.startsWith("#")&&et.origin===lt.origin&&et.pathname===lt.pathname&&et.search===lt.search)return;if(["http:","https:","mailto:","tel:"].includes(et.protocol)){Le.target="_blank",Le.rel="noopener noreferrer";return}let An=adapter.navigation?.parseDocumentLink?.(Oe);if(An){V.preventDefault(),adapter.navigation?.openDocument?.(An);return}V.preventDefault()},un=he?.anchor,Et=(un?.top||0)<60,Qt=Math.max(40,Math.min(un?.x||0,(un?.wrapWidth||120)-40));return(0,A.jsxs)("section",{className:`space-paper-wrap${vt?" is-editing":""}`,"aria-label":n("paper.aria"),ref:y,children:[(0,A.jsxs)("div",{className:`space-doc-stage${W?" has-annotations":""}`,ref:b,style:{zoom:Ce},children:[(0,A.jsx)("div",{ref:Ke,onClickCapture:tt,onPointerMove:vt?void 0:Ee,onPointerLeave:ce,className:`space-paper${E.content.replace(/^# [^\r\n]*(?:\r?\n)+/,"").trim()?"":" is-empty"}`,tabIndex:-1,children:(0,A.jsx)(t$,{markdown:E.content,editorRef:I,onChange:R,onDecorationsReady:()=>l(V=>V+1),t:n,readOnly:!vt,autoFocus:e.autoFocus,suggestions:yt},vt?"edit":`review-${E.version}`)}),(0,A.jsx)("div",{className:"space-anchor-layer","aria-hidden":"true",children:d.highlights?.map(V=>(0,A.jsx)("span",{className:`space-anchor-rect is-${V.kind}${V.deleted?" is-deleted":""}${V.active?" is-active":""}${V.caret?" is-caret":""}${V.outline?" is-outline":""}`,style:{left:V.left,top:V.top,width:V.width,height:V.height}},V.key))}),W&&(0,A.jsxs)("aside",{className:"space-comment-rail",ref:v,"aria-label":n("annotations.title"),style:{minHeight:d.minHeight||void 0},children:[(0,A.jsx)("div",{className:"space-comment-spacer",style:{height:d.height||0}}),(0,A.jsxs)("div",{className:"space-comment-balloons is-positioned",children:[Y.map(V=>(0,A.jsx)(rge,{item:V.item,index:V.index,active:S===V.item.id,busy:Fe,t:n,onActivate:()=>ve(V.item.id),onDecide:Le=>be(V.item.id,Le),onPointerEnter:oe,onPointerLeave:ce,setRef:(Le,Oe)=>{Oe?T.current.set(Le,Oe):T.current.delete(Le)},style:{top:d.positions[V.key],visibility:d.positions[V.key]===void 0?"hidden":void 0,...u?.key===V.key?{"--hover-x":`${u.left}px`,"--hover-y":`${u.top}px`}:{}},className:u?.key===V.key?"is-hover-preview":""},V.key)),ne.map(V=>(0,A.jsx)(v$,{comment:V,author:t,active:N===V.id,busy:Fe,t:n,statusText:Ut,confirming:o===V.id,onAskDelete:le,onConfirmDelete:me,onCancelDelete:()=>i(null),onActivate:de,onPointerEnter:oe,onPointerLeave:ce,setRef:(Le,Oe)=>{Oe?at.current.set(Le,Oe):at.current.delete(Le)},style:{top:d.positions[`comment:${V.id}`],visibility:d.positions[`comment:${V.id}`]===void 0?"hidden":void 0,...u?.key===`comment:${V.id}`?{"--hover-x":`${u.left}px`,"--hover-y":`${u.top}px`}:{}},className:u?.key===`comment:${V.id}`?"is-hover-preview":""},V.id))]}),j.length>0&&(0,A.jsxs)("section",{className:"space-comment-stale","aria-label":n("comment.staleGroup"),children:[(0,A.jsx)("h3",{children:n("comment.staleGroup")}),(0,A.jsx)("p",{className:"space-muted",children:n("comment.staleHint")}),j.map(V=>(0,A.jsx)(v$,{comment:V,author:t,active:N===V.id,busy:Fe,t:n,statusText:Ut,confirming:o===V.id,onAskDelete:le,onConfirmDelete:me,onCancelDelete:()=>i(null),onActivate:()=>{},setRef:(Le,Oe)=>{Oe?at.current.set(Le,Oe):at.current.delete(Le)}},V.id))]})]}),d.lines.length>0&&(0,A.jsx)("svg",{className:"space-comment-lines","aria-hidden":"true",children:d.lines.map(V=>(0,A.jsxs)("g",{className:V.active?"is-active":void 0,children:[(0,A.jsx)("path",{pathLength:"1",className:`space-connector-line ${V.kind==="suggestion"?"is-suggestion":"is-comment"}`,d:V.d}),(0,A.jsx)("circle",{className:`space-connector-dot is-origin ${V.kind==="suggestion"?"is-suggestion":"is-comment"}`,cx:V.x1,cy:V.y1,r:"2"}),(0,A.jsx)("circle",{className:`space-connector-dot is-target ${V.kind==="suggestion"?"is-suggestion":"is-comment"}`,cx:V.x2,cy:V.y2,r:"4"})]},V.key))})]}),(0,A.jsxs)("div",{className:"space-comment-layer",children:[he&&!r&&!Fe&&(0,A.jsxs)("button",{ref:w,type:"button",className:`space-comment-fab${!k&&Et?" is-below":""}${k?" is-positioned":""}`,style:k||{left:Qt,top:Et?(un?.bottom||0)+10:(un?.top||0)-10},onMouseDown:V=>V.preventDefault(),onClick:Z,"aria-haspopup":"dialog","aria-label":n("comment.bubble"),children:[(0,A.jsx)(Zme,{}),(0,A.jsx)("span",{children:n("comment.bubble")})]}),(0,A.jsx)(nm,{open:!!(he&&r),onClose:()=>{a(!1),st("")},labelledBy:g,title:n("comment.addTitle"),closeLabel:n("dialog.close"),className:"space-comment-dialog",actions:he&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",onClick:$,children:n("comment.cancel")}),(0,A.jsx)("button",{type:"button",className:"is-primary",disabled:Fe||!ie.trim(),onClick:te,children:n("comment.save")})]}),children:he&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("p",{className:"space-comment-selected",children:n("comment.selected",{quote:he.quote})}),(0,A.jsx)("label",{htmlFor:h,children:n("comment.label")}),(0,A.jsx)("textarea",{ref:m,autoFocus:!0,id:h,rows:"4",maxLength:"4000",value:ie,onChange:V=>{fe(V.target.value),D&&st("")},onKeyDown:V=>{(V.metaKey||V.ctrlKey)&&V.key==="Enter"&&(V.preventDefault(),!Fe&&ie.trim()&&te())}}),D&&(0,A.jsx)("p",{className:"space-comment-error",role:"alert",children:D})]})}),(0,A.jsxs)(nm,{open:!!e.editSaveError,onClose:e.dismissEditSaveError,labelledBy:x,title:n("edit.saveErrorTitle"),closeLabel:n("dialog.close"),className:"space-comment-dialog",actions:(0,A.jsx)("button",{type:"button",autoFocus:!0,onClick:e.dismissEditSaveError,children:n("edit.keepEditing")}),children:[(0,A.jsx)("p",{role:"alert",children:e.editSaveError}),(0,A.jsx)("p",{className:"space-muted",children:n("edit.saveErrorKeepEditing")})]}),r&&he?.rects?.map((V,Le)=>(0,A.jsx)("span",{className:"space-selection-hint",style:{left:V.left,top:V.top,width:V.width,height:V.height}},Le))]})]})}function S$({adapter:e,t=ub}){let n=e.conversation?.current?.id||null,r=e.core.request,[a,o]=(0,ae.useState)([]),[i,s]=(0,ae.useState)(null),[l,u]=(0,ae.useState)(""),[c,f]=(0,ae.useState)(!1),[d,p]=(0,ae.useState)(null),[h,g]=(0,ae.useState)(""),[x,m]=(0,ae.useState)("all"),[y,b]=(0,ae.useState)("recent"),[v,w]=(0,ae.useState)(null),[k,_]=(0,ae.useState)(!1),[E,M]=(0,ae.useState)(null),[S,U]=(0,ae.useState)(""),[N,q]=(0,ae.useState)("document"),[ie,fe]=(0,ae.useState)(""),[he,xe]=(0,ae.useState)("idle"),[Ce,Fe]=(0,ae.useState)(!1),[D,st]=(0,ae.useState)(!1),[Ke,T]=(0,ae.useState)(null),[at,yt]=(0,ae.useState)(!1),Ut=(0,ae.useId)(),ln=(0,ae.useId)(),mt=f$(e.identity?.getCurrentUser),be=ege(r,i,n,t,e,d),Tt=(0,ae.useRef)(t);Tt.current=t;let Dt=(0,ae.useCallback)((oe,ce={})=>r(oe,ce),[r]),vt=(0,ae.useRef)(null),I=(0,ae.useCallback)(async()=>{let oe=await Dt("listDocuments"),ce=JSON.stringify(oe);return ce!==vt.current&&(vt.current=ce,o(oe)),oe},[Dt]);(0,ae.useEffect)(()=>{let oe=!1;return I().catch(ce=>{oe||u(ks(ce,Tt.current))}),()=>{oe=!0}},[I]),(0,ae.useEffect)(()=>{if(i)return;let oe=!1,ce=()=>{!oe&&document.visibilityState!=="hidden"&&I().catch(()=>{})},Ee=setInterval(ce,4e3);return document.addEventListener("visibilitychange",ce),()=>{oe=!0,clearInterval(Ee),document.removeEventListener("visibilitychange",ce)}},[i,I]);let R=async()=>{f(!0),u("");try{let oe=await Dt("createDocument",{title:t("document.untitled"),operationId:lb()});await I(),p(oe.id),s(oe.id)}catch(oe){u(ks(oe,t))}finally{f(!1)}},z=async()=>{if(v){f(!0),u("");try{await Dt("deleteDocument",{docId:v.id}),await I(),w(null),i===v.id&&s(null)}catch(oe){u(ks(oe,Tt.current))}finally{f(!1)}}},ne=async oe=>{st(!0),u("");try{let ce=await Dt("readDocument",{docId:i});if(!ce||typeof ce.content!="string")throw new Error("Document unavailable");let Ee=l$(ce.title,oe),tt=oe==="md"?{name:Ee,type:"text/markdown;charset=utf-8",bytes:new TextEncoder().encode(ce.content)}:oe==="docx"?{name:Ee,type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",bytes:new Uint8Array(await u$(ce.content).arrayBuffer())}:null;if(!tt||!tm(e.capabilities,"files.export.save")||typeof e.files?.saveExport!="function")throw new Error("Export saving is unavailable");if(await e.files.saveExport(tt)!==!0)throw new Error("Export saving was not accepted")}catch{u(t("export.failed"))}finally{st(!1)}},j=async oe=>{M(null),U(""),q(oe),fe(""),xe("idle"),_(!0),Fe(!0);try{let ce=await Dt("readCollaboration",{docId:oe==="document"?i:void 0});M(ce),fe((oe==="global"?ce.global:ce.document)?.content||"")}catch(ce){U(ce?.code==="METHOD_NOT_FOUND"?t("collab.backendOutdated"):ks(ce,t))}finally{Fe(!1)}},W=(0,ae.useCallback)(async oe=>{let ce=N==="global"?E?.global:E?.document;xe("saving");try{await Dt("saveInstructions",{scope:N,docId:N==="document"?i:void 0,content:oe,baseVersion:ce?.version||0,operationId:lb()});let Ee=await Dt("readCollaboration",{docId:N==="document"?i:void 0});M(Ee),xe("saved")}catch(Ee){U(Ee?.code==="METHOD_NOT_FOUND"?t("collab.backendOutdated"):ks(Ee,t)),xe("error")}},[Dt,i,N,E,t]),Y=async()=>{await W(ie)},se=()=>{_(!1)},K=async()=>{be.editing&&!await be.switchToReview()||s(null)},Z=be.comments.filter(oe=>!["sent","processed"].includes(oe.status)),$=a.find(oe=>oe.id===i),te=Ke?Ke.docId?m$(`space:${encodeURIComponent(Ke.docId)}`):"\u8BF7\u6839\u636E\u6211\u7684\u8981\u6C42\uFF0C\u901A\u8FC7 CoSpace MCP \u521B\u5EFA\u4E00\u4EFD\u65B0\u6587\u6863\u5E76\u63D0\u4EA4\u5B8C\u6574\u521D\u7A3F\u3002":"",le=async()=>{try{await navigator.clipboard.writeText(te),yt(!0)}catch{yt(!1)}},me=a.reduce((oe,ce)=>oe+(ce.pending||0),0),P=(0,ae.useMemo)(()=>{let oe=h.trim().toLocaleLowerCase(),ce=Ee=>{let tt=Date.parse(Ee.updatedAt||Ee.createdAt||"");return Number.isFinite(tt)?tt:0};return a.filter(Ee=>(!oe||(Ee.title||Ee.id||"").toLocaleLowerCase().includes(oe))&&(x!=="pending"||Ee.pending>0)).sort((Ee,tt)=>y==="title"?(Ee.title||Ee.id||"").localeCompare(tt.title||tt.id||"",void 0,{numeric:!0}):ce(tt)-ce(Ee))},[a,h,x,y]),G=!i,de=N==="global"?E?.global:E?.document,ve=!!E&&ie!==(de?.content||"");return(0,A.jsxs)("div",{className:"space-app",children:[G?(0,A.jsxs)("main",{className:"space-home","aria-labelledby":"space-home-title",children:[(0,A.jsxs)("header",{className:"space-home-header",children:[(0,A.jsxs)("div",{className:"space-brand",children:[(0,A.jsx)(Xme,{className:"space-brand-icon"}),(0,A.jsxs)("span",{className:"space-brand-names",children:[(0,A.jsx)("strong",{children:t("brand.name")}),(0,A.jsxs)("small",{children:[t("brand.nameEnglish")," ",(0,A.jsxs)("span",{className:"space-build-version",title:t("build.versionTitle"),children:["v",Kme]})]})]})]}),(0,A.jsxs)("div",{className:"space-header-tools",children:[e.prompts&&(0,A.jsx)("button",{type:"button",className:"space-collab-trigger",onClick:()=>T({kind:"create"}),children:"\u8BA9 Agent \u8D77\u8349"}),(0,A.jsxs)("button",{type:"button",className:"space-home-new",disabled:c,onClick:R,children:[(0,A.jsx)(Vd,{size:16,"aria-hidden":"true"}),t("nav.newDocument")]})]})]}),(0,A.jsxs)("section",{className:"space-home-intro",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{className:"space-home-eyebrow",children:t("home.eyebrow")}),(0,A.jsx)("h1",{id:"space-home-title",children:t("home.title")}),(0,A.jsx)("p",{className:"space-home-description",children:t("home.description")})]}),(0,A.jsxs)("div",{className:"space-home-stats","aria-label":t("nav.aria"),children:[(0,A.jsxs)("span",{children:[(0,A.jsx)("strong",{children:a.length}),t("home.documentCount",{count:a.length})]}),(0,A.jsx)("i",{"aria-hidden":"true"}),(0,A.jsxs)("span",{children:[(0,A.jsx)("strong",{children:me}),t("home.pendingCount",{count:me})]})]})]}),(0,A.jsxs)("section",{className:"space-home-content","aria-label":t("nav.documents"),children:[(0,A.jsxs)("div",{className:"space-home-section-title",children:[(0,A.jsx)("h2",{children:t("nav.documents")}),a.length>0&&(0,A.jsx)("span",{children:a.length})]}),a.length>0&&(0,A.jsxs)("div",{className:"space-document-tools",children:[(0,A.jsxs)("label",{className:"space-document-search",children:[(0,A.jsx)(_g,{size:16,"aria-hidden":"true"}),(0,A.jsx)("span",{className:"space-visually-hidden",children:t("home.search")}),(0,A.jsx)("input",{type:"search",value:h,onChange:oe=>g(oe.target.value),placeholder:t("home.search")})]}),(0,A.jsx)("span",{className:"space-visually-hidden",children:t("home.filter")}),(0,A.jsx)(x$,{label:t("home.filter"),value:x,onChange:m,options:[{value:"all",label:t("home.filterAll")},{value:"pending",label:t("home.filterPending")}]}),(0,A.jsx)("span",{className:"space-visually-hidden",children:t("home.sort")}),(0,A.jsx)(x$,{label:t("home.sort"),value:y,onChange:b,options:[{value:"recent",label:t("home.sortRecent")},{value:"title",label:t("home.sortTitle")}]})]}),P.length?(0,A.jsx)("div",{className:"space-home-grid",children:P.map((oe,ce)=>(0,A.jsxs)("article",{className:"space-home-card",children:[(0,A.jsxs)("button",{type:"button",className:"space-home-card-open","aria-label":t("home.openDocument",{title:oe.title||oe.id}),onClick:()=>s(oe.id),children:[(0,A.jsxs)("span",{className:`space-home-card-art is-tone-${ce%4}`,"aria-hidden":"true",children:[(0,A.jsxs)("span",{className:"space-paper-icon",children:[(0,A.jsx)("i",{}),(0,A.jsx)("i",{}),(0,A.jsx)("i",{}),(0,A.jsx)("b",{})]}),(0,A.jsx)("span",{className:"space-home-card-art-label",children:kn.name.en.toUpperCase()})]}),(0,A.jsxs)("span",{className:"space-home-card-copy",children:[(0,A.jsx)("strong",{title:oe.title||oe.id,children:oe.title||oe.id}),(0,A.jsx)("span",{className:"space-home-card-meta",children:Wme(oe,t)})]}),(0,A.jsxs)("span",{className:"space-home-card-footer",children:[oe.pending>0?(0,A.jsxs)("span",{className:"space-home-pending",children:[(0,A.jsx)("i",{"aria-hidden":"true"}),t("annotations.suggestions",{count:oe.pending})]}):(0,A.jsx)("span",{className:"space-home-clear",children:t("home.noPending")}),(0,A.jsx)("span",{className:"space-home-open-icon","aria-hidden":"true",children:"\u2197"})]})]}),(0,A.jsx)("button",{type:"button",className:"space-home-delete",disabled:c,"aria-label":t("nav.deleteDocumentLabel",{title:oe.title||oe.id}),title:t("nav.deleteDocument"),onClick:()=>w(oe),children:(0,A.jsx)(Yme,{size:15})})]},oe.id))}):a.length?(0,A.jsx)("p",{className:"space-document-no-results",role:"status",children:t("home.noResults")}):(0,A.jsxs)("div",{className:"space-home-empty",children:[(0,A.jsxs)("span",{className:"space-empty-mark","aria-hidden":"true",children:[(0,A.jsx)("span",{}),(0,A.jsx)("span",{}),(0,A.jsx)("span",{})]}),(0,A.jsx)("h2",{children:t("home.emptyTitle")}),(0,A.jsx)("p",{children:t("home.emptyDescription")}),(0,A.jsxs)("button",{type:"button",className:"space-home-new",disabled:c,onClick:R,children:[(0,A.jsx)(Vd,{size:16,"aria-hidden":"true"}),t("nav.newDocument")]})]})]}),(0,A.jsx)("div",{className:"space-message space-home-message",role:"status","aria-live":"polite",children:l})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("header",{className:"space-top space-preview-top",children:[(0,A.jsx)(Jme,{className:"space-back",label:t("home.back"),disabled:c||be.busy,onClick:K,children:(0,A.jsx)(Ag,{size:18,"aria-hidden":"true"})}),(0,A.jsxs)("div",{className:"space-preview-heading",children:[(0,A.jsxs)("span",{children:[t("home.eyebrow")," ",(0,A.jsx)("small",{className:"space-build-version",title:t("build.versionTitle"),children:k$})]}),(0,A.jsx)("h1",{title:be.doc?.title||$?.title||i,children:be.doc?.title||$?.title||i})]}),(0,A.jsxs)("div",{className:"space-header-tools",role:"group","aria-label":t("toolbar.aria"),children:[be.doc&&(0,A.jsx)(Qme,{exporting:D,onExport:ne,onReview:e.prompts?()=>T({kind:"review",docId:i}):null,onPreferences:()=>j("document"),canExport:tm(e.capabilities,"files.export.save"),t}),be.doc&&(0,A.jsxs)("div",{className:"space-toolbar-group is-view",children:[(0,A.jsxs)("div",{className:"space-mode-switch",role:"group","aria-label":t("edit.modeLabel"),children:[(0,A.jsx)("button",{type:"button","aria-pressed":!be.editing,disabled:c||be.busy,title:be.editing?t("edit.autoSaveHint"):void 0,onClick:()=>be.editing?be.switchToReview():null,children:t("edit.reviewMode")}),(0,A.jsxs)("span",{className:`space-edit-mode-option${!be.canEdit&&!be.editing?" is-unavailable":""}`,tabIndex:!be.canEdit&&!be.editing?0:void 0,"aria-describedby":!be.canEdit&&!be.editing?ln:void 0,"data-tooltip":t("edit.unavailableReason"),children:[(0,A.jsx)("button",{type:"button","aria-pressed":be.editing,disabled:c||be.busy||!be.canEdit&&!be.editing,onClick:()=>be.editing?null:be.startEditing(),children:t("edit.editMode")}),!be.canEdit&&!be.editing&&(0,A.jsx)("span",{id:ln,role:"tooltip",className:"space-edit-tooltip",children:t("edit.unavailableReason")})]})]}),(0,A.jsx)(tge,{review:be,t})]}),be.editing&&be.busy&&(0,A.jsx)("span",{className:"space-edit-status",role:"status",children:t("edit.saving")}),!be.editing&&Z.length>0&&(0,A.jsx)(age,{review:be,sessionId:n,adapter:e,t})]})]}),be.doc?(0,A.jsx)("main",{className:"space-main",children:(0,A.jsx)(ige,{review:be,user:mt,t})}):(0,A.jsx)("main",{className:"space-preview-loading","aria-live":"polite",children:be.message||t("empty.loading")})]}),!G&&(0,A.jsx)("div",{className:"space-message",role:"status","aria-live":"polite",children:be.editSaveError?"":l||(be.doc?be.message:"")}),(0,A.jsxs)(nm,{open:!!Ke,onClose:()=>{T(null),yt(!1)},labelledBy:"space-agent-prompt-title",title:"\u53D1\u9001\u7ED9 Agent \u7684\u63D0\u793A\u8BCD",closeLabel:t("dialog.close"),actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",onClick:()=>{T(null),yt(!1)},children:t("dialog.close")}),(0,A.jsx)("button",{type:"button",className:"is-primary",onClick:le,children:at?"\u5DF2\u590D\u5236":"\u590D\u5236\u63D0\u793A\u8BCD"})]}),children:[e.prompts?.mcpReady===!1&&(0,A.jsx)("p",{children:"\u8BF7\u5148\u5728 Agent \u63A5\u5165\u8BBE\u7F6E\u4E2D\u914D\u7F6E CoSpace MCP\u3002"}),(0,A.jsx)("textarea",{readOnly:!0,rows:"8",value:te})]}),(0,A.jsx)(nm,{open:!!v,onClose:()=>w(null),labelledBy:Ut,title:t("document.deleteTitle"),closeLabel:t("dialog.close"),className:"space-delete-dialog",actions:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{type:"button",autoFocus:!0,disabled:c,onClick:()=>w(null),children:t("document.deleteCancel")}),(0,A.jsx)("button",{type:"button",className:"is-danger",disabled:c,onClick:z,children:t("document.deleteConfirm")})]}),children:(0,A.jsx)("p",{children:t("document.deleteDescription",{title:v?.title||v?.id||""})})}),(0,A.jsxs)(nm,{open:k,onClose:se,labelledBy:"space-collab-title",title:t("collab.documentTitle"),closeLabel:t("dialog.close"),closeOnBackdrop:!0,actions:(0,A.jsx)("button",{type:"button",className:"is-primary",disabled:!ve||he==="saving"||Ce||!!S,onClick:Y,children:t("collab.save")}),children:[S&&(0,A.jsx)("p",{className:"space-collab-error",role:"alert",children:S}),Ce&&!E?(0,A.jsx)("p",{role:"status",children:t("collab.loading")}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("textarea",{rows:"8",maxLength:12e3,value:ie,onChange:oe=>{U(""),xe("idle"),fe(oe.target.value)},placeholder:t("collab.placeholder")}),(0,A.jsx)("p",{className:"space-collab-save-status",role:"status",children:he==="saving"?t("collab.saving"):he==="saved"?t("collab.saved"):he==="error"?t("collab.saveError"):""})]})]})]})}var L$="/cospace-api";async function AR(e,t={},n={}){let r=window.__COSPACE_LOCAL_TOKEN__,a=await fetch(L$,{method:"POST",headers:{"content-type":"application/json",...r?{"x-cospace-token":r}:{}},body:JSON.stringify({method:e,args:t}),...n.signal?{signal:n.signal}:{}}),o=await a.json();if(!a.ok||o.error)throw Object.assign(new Error(o.error?.message||"Request failed"),o.error||{code:"REQUEST_FAILED"});return o.result}var A$=gr(Nf(),1);function lge({name:e,type:t,bytes:n}){if(typeof Blob>"u"||typeof URL>"u"||typeof URL.createObjectURL!="function")return!1;let r=URL.createObjectURL(new Blob([n],{type:t})),a=document.createElement("a");return a.href=r,a.download=e,a.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3),!0}var uge={id:"local-server",version:"0.1.10",contractVersion:1,capabilities:["files.export.save","clipboard.write","identity.current.read"]},ER=["identity.current.read"];typeof Blob<"u"&&typeof URL?.createObjectURL=="function"&&ER.push("files.export.save");typeof navigator<"u"&&typeof navigator.clipboard?.writeText=="function"&&ER.push("clipboard.write");var cge={core:{request:AR},prompts:{mcpReady:!0},files:{saveExport:lge},clipboard:{writeText:e=>navigator.clipboard.writeText(e)},identity:{getCurrentUser:()=>AR("getUser")},capabilities:h$(uge,ER)};(0,I$.createRoot)(document.getElementById("root")).render((0,A$.jsx)(S$,{adapter:cge}));
|
|
694
|
+
/*! Bundled license information:
|
|
695
|
+
|
|
696
|
+
react/cjs/react.production.js:
|
|
697
|
+
(**
|
|
698
|
+
* @license React
|
|
699
|
+
* react.production.js
|
|
700
|
+
*
|
|
701
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
702
|
+
*
|
|
703
|
+
* This source code is licensed under the MIT license found in the
|
|
704
|
+
* LICENSE file in the root directory of this source tree.
|
|
705
|
+
*)
|
|
706
|
+
|
|
707
|
+
scheduler/cjs/scheduler.production.js:
|
|
708
|
+
(**
|
|
709
|
+
* @license React
|
|
710
|
+
* scheduler.production.js
|
|
711
|
+
*
|
|
712
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
713
|
+
*
|
|
714
|
+
* This source code is licensed under the MIT license found in the
|
|
715
|
+
* LICENSE file in the root directory of this source tree.
|
|
716
|
+
*)
|
|
717
|
+
|
|
718
|
+
react-dom/cjs/react-dom.production.js:
|
|
719
|
+
(**
|
|
720
|
+
* @license React
|
|
721
|
+
* react-dom.production.js
|
|
722
|
+
*
|
|
723
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
724
|
+
*
|
|
725
|
+
* This source code is licensed under the MIT license found in the
|
|
726
|
+
* LICENSE file in the root directory of this source tree.
|
|
727
|
+
*)
|
|
728
|
+
|
|
729
|
+
react-dom/cjs/react-dom-client.production.js:
|
|
730
|
+
(**
|
|
731
|
+
* @license React
|
|
732
|
+
* react-dom-client.production.js
|
|
733
|
+
*
|
|
734
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
735
|
+
*
|
|
736
|
+
* This source code is licensed under the MIT license found in the
|
|
737
|
+
* LICENSE file in the root directory of this source tree.
|
|
738
|
+
*)
|
|
739
|
+
|
|
740
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
741
|
+
(**
|
|
742
|
+
* @license React
|
|
743
|
+
* react-jsx-runtime.production.js
|
|
744
|
+
*
|
|
745
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
746
|
+
*
|
|
747
|
+
* This source code is licensed under the MIT license found in the
|
|
748
|
+
* LICENSE file in the root directory of this source tree.
|
|
749
|
+
*)
|
|
750
|
+
|
|
751
|
+
lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs:
|
|
752
|
+
lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs:
|
|
753
|
+
lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs:
|
|
754
|
+
lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs:
|
|
755
|
+
lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs:
|
|
756
|
+
lucide-react/dist/esm/shared/src/build/defaultAttributes.mjs:
|
|
757
|
+
lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs:
|
|
758
|
+
lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs:
|
|
759
|
+
lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs:
|
|
760
|
+
lucide-react/dist/esm/context.mjs:
|
|
761
|
+
lucide-react/dist/esm/Icon.mjs:
|
|
762
|
+
lucide-react/dist/esm/createLucideIcon.mjs:
|
|
763
|
+
lucide-react/dist/esm/icons/arrow-left.mjs:
|
|
764
|
+
lucide-react/dist/esm/icons/check.mjs:
|
|
765
|
+
lucide-react/dist/esm/icons/ellipsis.mjs:
|
|
766
|
+
lucide-react/dist/esm/icons/message-square.mjs:
|
|
767
|
+
lucide-react/dist/esm/icons/plus.mjs:
|
|
768
|
+
lucide-react/dist/esm/icons/search.mjs:
|
|
769
|
+
lucide-react/dist/esm/icons/trash.mjs:
|
|
770
|
+
lucide-react/dist/esm/icons/x.mjs:
|
|
771
|
+
lucide-react/dist/esm/lucide-react.mjs:
|
|
772
|
+
(**
|
|
773
|
+
* @license lucide-react v1.78.0 - ISC
|
|
774
|
+
*
|
|
775
|
+
* This source code is licensed under the ISC license.
|
|
776
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
777
|
+
*)
|
|
778
|
+
|
|
779
|
+
dompurify/dist/purify.es.mjs:
|
|
780
|
+
(*! @license DOMPurify 3.5.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.5.0/LICENSE *)
|
|
781
|
+
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
782
|
+
|
|
783
|
+
@vue/shared/dist/shared.esm-bundler.js:
|
|
784
|
+
(**
|
|
785
|
+
* @vue/shared v3.5.46
|
|
786
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
787
|
+
* @license MIT
|
|
788
|
+
**)
|
|
789
|
+
|
|
790
|
+
@vue/reactivity/dist/reactivity.esm-bundler.js:
|
|
791
|
+
(**
|
|
792
|
+
* @vue/reactivity v3.5.46
|
|
793
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
794
|
+
* @license MIT
|
|
795
|
+
**)
|
|
796
|
+
|
|
797
|
+
@vue/runtime-core/dist/runtime-core.esm-bundler.js:
|
|
798
|
+
(**
|
|
799
|
+
* @vue/runtime-core v3.5.46
|
|
800
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
801
|
+
* @license MIT
|
|
802
|
+
**)
|
|
803
|
+
|
|
804
|
+
@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:
|
|
805
|
+
(**
|
|
806
|
+
* @vue/runtime-dom v3.5.46
|
|
807
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
808
|
+
* @license MIT
|
|
809
|
+
**)
|
|
810
|
+
|
|
811
|
+
vue/dist/vue.runtime.esm-bundler.js:
|
|
812
|
+
(**
|
|
813
|
+
* vue v3.5.46
|
|
814
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
815
|
+
* @license MIT
|
|
816
|
+
**)
|
|
817
|
+
|
|
818
|
+
lodash-es/lodash.js:
|
|
819
|
+
(**
|
|
820
|
+
* @license
|
|
821
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
822
|
+
* Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
|
|
823
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
824
|
+
* Released under MIT license <https://lodash.com/license>
|
|
825
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
826
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
827
|
+
*)
|
|
828
|
+
|
|
829
|
+
markdown-it/dist/markdown-it.mjs:
|
|
830
|
+
(*! markdown-it 15.0.3 https://github.com/markdown-it/markdown-it @license MIT *)
|
|
831
|
+
*/
|