const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ls9WDZKZ.js","assets/base-80a1f760-BFHJLZCG.js","assets/consoleHook-59e792cb-BWqyNZmr.js","assets/index-599aeaf7-CcX4Lt6n.js","assets/index-DZpWGLPZ.js"])))=>i.map(i=>d[i]); var bR=Object.defineProperty;var SR=(t,e,n)=>e in t?bR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Jl=(t,e,n)=>SR(t,typeof e!="symbol"?e+"":e,n);function wR(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xP={exports:{}},Ip={},kP={exports:{}},rt={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var rd=Symbol.for("react.element"),xR=Symbol.for("react.portal"),kR=Symbol.for("react.fragment"),CR=Symbol.for("react.strict_mode"),PR=Symbol.for("react.profiler"),ER=Symbol.for("react.provider"),_R=Symbol.for("react.context"),TR=Symbol.for("react.forward_ref"),$R=Symbol.for("react.suspense"),AR=Symbol.for("react.memo"),RR=Symbol.for("react.lazy"),$S=Symbol.iterator;function MR(t){return t===null||typeof t!="object"?null:(t=$S&&t[$S]||t["@@iterator"],typeof t=="function"?t:null)}var CP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PP=Object.assign,EP={};function Nl(t,e,n){this.props=t,this.context=e,this.refs=EP,this.updater=n||CP}Nl.prototype.isReactComponent={};Nl.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Nl.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _P(){}_P.prototype=Nl.prototype;function B1(t,e,n){this.props=t,this.context=e,this.refs=EP,this.updater=n||CP}var F1=B1.prototype=new _P;F1.constructor=B1;PP(F1,Nl.prototype);F1.isPureReactComponent=!0;var AS=Array.isArray,TP=Object.prototype.hasOwnProperty,Z1={current:null},$P={key:!0,ref:!0,__self:!0,__source:!0};function AP(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)TP.call(e,r)&&!$P.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,M=j[Q];if(0>>1;Qi(K,H))oei(pe,K)?(j[Q]=pe,j[oe]=H,Q=oe):(j[Q]=K,j[X]=H,Q=X);else if(oei(pe,H))j[Q]=pe,j[oe]=H,Q=oe;else break e}}return B}function i(j,B){var H=j.sortIndex-B.sortIndex;return H!==0?H:j.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(j){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=j)r(c),B.sortIndex=B.expirationTime,e(l,B);else break;B=n(c)}}function b(j){if(m=!1,O(j),!p)if(n(l)!==null)p=!0,F(S);else{var B=n(c);B!==null&&I(b,B.startTime-j)}}function S(j,B){p=!1,m&&(m=!1,g($),$=-1),h=!0;var H=f;try{for(O(B),d=n(l);d!==null&&(!(d.expirationTime>B)||j&&!N());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,f=d.priorityLevel;var M=Q(d.expirationTime<=B);B=t.unstable_now(),typeof M=="function"?d.callback=M:d===n(l)&&r(l),O(B)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var X=n(c);X!==null&&I(b,X.startTime-B),G=!1}return G}finally{d=null,f=H,h=!1}}var w=!1,C=null,$=-1,A=5,k=-1;function N(){return!(t.unstable_now()-kj||125Q?(j.sortIndex=H,e(c,j),n(l)===null&&j===n(c)&&(m?(g($),$=-1):m=!0,I(b,H-Q))):(j.sortIndex=M,e(l,j),p||h||(p=!0,F(S))),j},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(j){var B=f;return function(){var H=f;f=B;try{return j.apply(this,arguments)}finally{f=H}}}})(LP);QP.exports=LP;var VR=QP.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var UR=T,Cr=VR;function ve(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),a0=Object.prototype.hasOwnProperty,qR=/^[: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]*$/,MS={},IS={};function WR(t){return a0.call(IS,t)?!0:a0.call(MS,t)?!1:qR.test(t)?IS[t]=!0:(MS[t]=!0,!1)}function XR(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function HR(t,e,n,r){if(e===null||typeof e>"u"||XR(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Yn(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var kn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){kn[t]=new Yn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];kn[e]=new Yn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){kn[t]=new Yn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){kn[t]=new Yn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){kn[t]=new Yn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){kn[t]=new Yn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){kn[t]=new Yn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){kn[t]=new Yn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){kn[t]=new Yn(t,5,!1,t.toLowerCase(),null,!1,!1)});var U1=/[\-:]([a-z])/g;function q1(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(U1,q1);kn[e]=new Yn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(U1,q1);kn[e]=new Yn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(U1,q1);kn[e]=new Yn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){kn[t]=new Yn(t,1,!1,t.toLowerCase(),null,!1,!1)});kn.xlinkHref=new Yn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){kn[t]=new Yn(t,1,!1,t.toLowerCase(),null,!0,!0)});function W1(t,e,n,r){var i=kn.hasOwnProperty(e)?kn[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` `+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Eg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Cc(t):""}function YR(t){switch(t.tag){case 5:return Cc(t.type);case 16:return Cc("Lazy");case 13:return Cc("Suspense");case 19:return Cc("SuspenseList");case 0:case 2:case 15:return t=_g(t.type,!1),t;case 11:return t=_g(t.type.render,!1),t;case 1:return t=_g(t.type,!0),t;default:return""}}function d0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ra:return"Fragment";case Aa:return"Portal";case l0:return"Profiler";case X1:return"StrictMode";case c0:return"Suspense";case u0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case DP:return(t.displayName||"Context")+".Consumer";case NP:return(t._context.displayName||"Context")+".Provider";case H1:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y1:return e=t.displayName||null,e!==null?e:d0(t.type)||"Memo";case Io:e=t._payload,t=t._init;try{return d0(t(e))}catch{}}return null}function GR(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return d0(e);case 8:return e===X1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ss(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function BP(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function KR(t){var e=BP(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Dd(t){t._valueTracker||(t._valueTracker=KR(t))}function FP(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=BP(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ch(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function f0(t,e){var n=e.checked;return Ft({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function LS(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ss(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ZP(t,e){e=e.checked,e!=null&&W1(t,"checked",e,!1)}function h0(t,e){ZP(t,e);var n=ss(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?p0(t,e.type,n):e.hasOwnProperty("defaultValue")&&p0(t,e.type,ss(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function jS(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function p0(t,e,n){(e!=="number"||Ch(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Pc=Array.isArray;function Xa(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=zd.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function du(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Fc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},JR=["Webkit","ms","Moz","O"];Object.keys(Fc).forEach(function(t){JR.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Fc[e]=Fc[t]})});function WP(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Fc.hasOwnProperty(t)&&Fc[t]?(""+e).trim():e+"px"}function XP(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=WP(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var e4=Ft({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function v0(t,e){if(e){if(e4[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ve(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ve(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ve(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ve(62))}}function O0(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 y0=null;function G1(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var b0=null,Ha=null,Ya=null;function zS(t){if(t=sd(t)){if(typeof b0!="function")throw Error(ve(280));var e=t.stateNode;e&&(e=Dp(e),b0(t.stateNode,t.type,e))}}function HP(t){Ha?Ya?Ya.push(t):Ya=[t]:Ha=t}function YP(){if(Ha){var t=Ha,e=Ya;if(Ya=Ha=null,zS(t),e)for(t=0;t>>=0,t===0?32:31-(d4(t)/f4|0)|0}var Bd=64,Fd=4194304;function Ec(t){switch(t&-t){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Th(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Ec(a):(o&=s,o!==0&&(r=Ec(o)))}else s=n&~i,s!==0?r=Ec(s):o!==0&&(r=Ec(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function id(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-vi(e),t[e]=n}function g4(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Vc),HS=" ",YS=!1;function gE(t,e){switch(t){case"keyup":return V4.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vE(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ma=!1;function q4(t,e){switch(t){case"compositionend":return vE(e);case"keypress":return e.which!==32?null:(YS=!0,HS);case"textInput":return t=e.data,t===HS&&YS?null:t;default:return null}}function W4(t,e){if(Ma)return t==="compositionend"||!oy&&gE(t,e)?(t=pE(),Ff=ny=qo=null,Ma=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ew(n)}}function SE(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?SE(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wE(){for(var t=window,e=Ch();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ch(t.document)}return e}function sy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function nM(t){var e=wE(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&SE(n.ownerDocument.documentElement,n)){if(r!==null&&sy(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=tw(n,o);var s=tw(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ia=null,P0=null,qc=null,E0=!1;function nw(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;E0||Ia==null||Ia!==Ch(r)||(r=Ia,"selectionStart"in r&&sy(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}),qc&&vu(qc,r)||(qc=r,r=Rh(P0,"onSelect"),0ja||(t.current=M0[ja],M0[ja]=null,ja--)}function At(t,e){ja++,M0[ja]=t.current,t.current=e}var as={},Dn=gs(as),rr=gs(!1),Zs=as;function dl(t,e){var n=t.type.contextTypes;if(!n)return as;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ir(t){return t=t.childContextTypes,t!=null}function Ih(){Qt(rr),Qt(Dn)}function cw(t,e,n){if(Dn.current!==as)throw Error(ve(168));At(Dn,e),At(rr,n)}function AE(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ve(108,GR(t)||"Unknown",i));return Ft({},n,r)}function Qh(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||as,Zs=Dn.current,At(Dn,t),At(rr,rr.current),!0}function uw(t,e,n){var r=t.stateNode;if(!r)throw Error(ve(169));n?(t=AE(t,e,Zs),r.__reactInternalMemoizedMergedChildContext=t,Qt(rr),Qt(Dn),At(Dn,t)):Qt(rr),At(rr,n)}var uo=null,zp=!1,Fg=!1;function RE(t){uo===null?uo=[t]:uo.push(t)}function pM(t){zp=!0,RE(t)}function vs(){if(!Fg&&uo!==null){Fg=!0;var t=0,e=yt;try{var n=uo;for(yt=1;t>=s,i-=s,ho=1<<32-vi(e)+i|n<$?(A=C,C=null):A=C.sibling;var k=f(g,C,O[$],b);if(k===null){C===null&&(C=A);break}t&&C&&k.alternate===null&&e(g,C),v=o(k,v,$),w===null?S=k:w.sibling=k,w=k,C=A}if($===O.length)return n(g,C),jt&&Ps(g,$),S;if(C===null){for(;$$?(A=C,C=null):A=C.sibling;var N=f(g,C,k.value,b);if(N===null){C===null&&(C=A);break}t&&C&&N.alternate===null&&e(g,C),v=o(N,v,$),w===null?S=N:w.sibling=N,w=N,C=A}if(k.done)return n(g,C),jt&&Ps(g,$),S;if(C===null){for(;!k.done;$++,k=O.next())k=d(g,k.value,b),k!==null&&(v=o(k,v,$),w===null?S=k:w.sibling=k,w=k);return jt&&Ps(g,$),S}for(C=r(g,C);!k.done;$++,k=O.next())k=h(C,g,$,k.value,b),k!==null&&(t&&k.alternate!==null&&C.delete(k.key===null?$:k.key),v=o(k,v,$),w===null?S=k:w.sibling=k,w=k);return t&&C.forEach(function(E){return e(g,E)}),jt&&Ps(g,$),S}function y(g,v,O,b){if(typeof O=="object"&&O!==null&&O.type===Ra&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case Nd:e:{for(var S=O.key,w=v;w!==null;){if(w.key===S){if(S=O.type,S===Ra){if(w.tag===7){n(g,w.sibling),v=i(w,O.props.children),v.return=g,g=v;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Io&&hw(S)===w.type){n(g,w.sibling),v=i(w,O.props),v.ref=oc(g,w,O),v.return=g,g=v;break e}n(g,w);break}else e(g,w);w=w.sibling}O.type===Ra?(v=Ds(O.props.children,g.mode,b,O.key),v.return=g,g=v):(b=Yf(O.type,O.key,O.props,null,g.mode,b),b.ref=oc(g,v,O),b.return=g,g=b)}return s(g);case Aa:e:{for(w=O.key;v!==null;){if(v.key===w)if(v.tag===4&&v.stateNode.containerInfo===O.containerInfo&&v.stateNode.implementation===O.implementation){n(g,v.sibling),v=i(v,O.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=Yg(O,g.mode,b),v.return=g,g=v}return s(g);case Io:return w=O._init,y(g,v,w(O._payload),b)}if(Pc(O))return p(g,v,O,b);if(ec(O))return m(g,v,O,b);Hd(g,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,O),v.return=g,g=v):(n(g,v),v=Hg(O,g.mode,b),v.return=g,g=v),s(g)):n(g,v)}return y}var hl=LE(!0),jE=LE(!1),Nh=gs(null),Dh=null,za=null,uy=null;function dy(){uy=za=Dh=null}function fy(t){var e=Nh.current;Qt(Nh),t._currentValue=e}function L0(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ka(t,e){Dh=t,uy=za=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(tr=!0),t.firstContext=null)}function Xr(t){var e=t._currentValue;if(uy!==t)if(t={context:t,memoizedValue:e,next:null},za===null){if(Dh===null)throw Error(ve(308));za=t,Dh.dependencies={lanes:0,firstContext:t}}else za=za.next=t;return e}var Rs=null;function hy(t){Rs===null?Rs=[t]:Rs.push(t)}function NE(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,hy(e)):(n.next=i.next,i.next=n),e.interleaved=n,So(t,r)}function So(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Qo=!1;function py(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DE(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function mo(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function es(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,lt&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,So(t,n)}return i=r.interleaved,i===null?(e.next=e,hy(r)):(e.next=i.next,i.next=e),r.interleaved=e,So(t,n)}function Vf(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,J1(t,n)}}function pw(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function zh(t,e,n,r){var i=t.updateQueue;Qo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,u=c=l=null,a=o;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,m=a;switch(f=e,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=Ft({},d,f);break e;case 2:Qo=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,s|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);qs|=s,t.lanes=s,t.memoizedState=d}}function mw(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Vg.transition;Vg.transition={};try{t(!1),e()}finally{yt=n,Vg.transition=r}}function n_(){return Hr().memoizedState}function OM(t,e,n){var r=ns(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},r_(t))i_(e,n);else if(n=NE(t,e,n,r),n!==null){var i=Un();Oi(n,t,r,i),o_(n,e,r)}}function yM(t,e,n){var r=ns(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(r_(t))i_(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,bi(a,s)){var l=e.interleaved;l===null?(i.next=i,hy(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=NE(t,e,i,r),n!==null&&(i=Un(),Oi(n,t,r,i),o_(n,e,r))}}function r_(t){var e=t.alternate;return t===zt||e!==null&&e===zt}function i_(t,e){Wc=Fh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function o_(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,J1(t,n)}}var Zh={readContext:Xr,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useInsertionEffect:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useSyncExternalStore:Pn,useId:Pn,unstable_isNewReconciler:!1},bM={readContext:Xr,useCallback:function(t,e){return ji().memoizedState=[t,e===void 0?null:e],t},useContext:Xr,useEffect:vw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,qf(4194308,4,GE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return qf(4194308,4,t,e)},useInsertionEffect:function(t,e){return qf(4,2,t,e)},useMemo:function(t,e){var n=ji();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ji();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=OM.bind(null,zt,t),[r.memoizedState,t]},useRef:function(t){var e=ji();return t={current:t},e.memoizedState=t},useState:gw,useDebugValue:wy,useDeferredValue:function(t){return ji().memoizedState=t},useTransition:function(){var t=gw(!1),e=t[0];return t=vM.bind(null,t[1]),ji().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=zt,i=ji();if(jt){if(n===void 0)throw Error(ve(407));n=n()}else{if(n=e(),mn===null)throw Error(ve(349));Us&30||ZE(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,vw(UE.bind(null,r,o,t),[t]),r.flags|=2048,Cu(9,VE.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=ji(),e=mn.identifierPrefix;if(jt){var n=po,r=ho;n=(r&~(1<<32-vi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=xu++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Bi]=e,t[bu]=r,m_(t,e,!1,!1),e.stateNode=t;e:{switch(s=O0(n,r),n){case"dialog":Mt("cancel",t),Mt("close",t),i=r;break;case"iframe":case"object":case"embed":Mt("load",t),i=r;break;case"video":case"audio":for(i=0;i<_c.length;i++)Mt(_c[i],t);i=r;break;case"source":Mt("error",t),i=r;break;case"img":case"image":case"link":Mt("error",t),Mt("load",t),i=r;break;case"details":Mt("toggle",t),i=r;break;case"input":LS(t,r),i=f0(t,r),Mt("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Ft({},r,{value:void 0}),Mt("invalid",t);break;case"textarea":NS(t,r),i=m0(t,r),Mt("invalid",t);break;default:i=r}v0(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?XP(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&qP(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&du(t,l):typeof l=="number"&&du(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(uu.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Mt("scroll",t):l!=null&&W1(t,o,l,s))}switch(n){case"input":Dd(t),jS(t,r,!1);break;case"textarea":Dd(t),DS(t);break;case"option":r.value!=null&&t.setAttribute("value",""+ss(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Xa(t,!!r.multiple,o,!1):r.defaultValue!=null&&Xa(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Mh)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return En(e),null;case 6:if(t&&e.stateNode!=null)v_(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ve(166));if(n=Ms(wu.current),Ms(Gi.current),Xd(e)){if(r=e.stateNode,n=e.memoizedProps,r[Bi]=e,(o=r.nodeValue!==n)&&(t=br,t!==null))switch(t.tag){case 3:Wd(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Wd(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Bi]=e,e.stateNode=r}return En(e),null;case 13:if(Qt(Nt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(jt&&Or!==null&&e.mode&1&&!(e.flags&128))QE(),fl(),e.flags|=98560,o=!1;else if(o=Xd(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(ve(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ve(317));o[Bi]=e}else fl(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;En(e),o=!1}else pi!==null&&(K0(pi),pi=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Nt.current&1?dn===0&&(dn=3):Ty())),e.updateQueue!==null&&(e.flags|=4),En(e),null);case 4:return pl(),V0(t,e),t===null&&Ou(e.stateNode.containerInfo),En(e),null;case 10:return fy(e.type._context),En(e),null;case 17:return ir(e.type)&&Ih(),En(e),null;case 19:if(Qt(Nt),o=e.memoizedState,o===null)return En(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)sc(o,!1);else{if(dn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=Bh(t),s!==null){for(e.flags|=128,sc(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return At(Nt,Nt.current&1|2),e.child}t=t.sibling}o.tail!==null&&Ht()>gl&&(e.flags|=128,r=!0,sc(o,!1),e.lanes=4194304)}else{if(!r)if(t=Bh(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),sc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!jt)return En(e),null}else 2*Ht()-o.renderingStartTime>gl&&n!==1073741824&&(e.flags|=128,r=!0,sc(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ht(),e.sibling=null,n=Nt.current,At(Nt,r?n&1|2:n&1),e):(En(e),null);case 22:case 23:return _y(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?hr&1073741824&&(En(e),e.subtreeFlags&6&&(e.flags|=8192)):En(e),null;case 24:return null;case 25:return null}throw Error(ve(156,e.tag))}function _M(t,e){switch(ly(e),e.tag){case 1:return ir(e.type)&&Ih(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pl(),Qt(rr),Qt(Dn),vy(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return gy(e),null;case 13:if(Qt(Nt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ve(340));fl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Qt(Nt),null;case 4:return pl(),null;case 10:return fy(e.type._context),null;case 22:case 23:return _y(),null;case 24:return null;default:return null}}var Gd=!1,An=!1,TM=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Ba(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(t,e,r)}else n.current=null}function U0(t,e,n){try{n()}catch(r){Wt(t,e,r)}}var _w=!1;function $M(t,e){if(_0=$h,t=wE(),sy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++c===i&&(a=s),f===o&&++u===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(T0={focusedElem:t,selectionRange:n},$h=!1,_e=e;_e!==null;)if(e=_e,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,_e=t;else for(;_e!==null;){e=_e;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:fi(e.type,m),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var O=e.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ve(163))}}catch(b){Wt(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,_e=t;break}_e=e.return}return p=_w,_w=!1,p}function Xc(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&U0(e,n,o)}i=i.next}while(i!==r)}}function Zp(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function q0(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function O_(t){var e=t.alternate;e!==null&&(t.alternate=null,O_(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Bi],delete e[bu],delete e[R0],delete e[fM],delete e[hM])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function y_(t){return t.tag===5||t.tag===3||t.tag===4}function Tw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||y_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function W0(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Mh));else if(r!==4&&(t=t.child,t!==null))for(W0(t,e,n),t=t.sibling;t!==null;)W0(t,e,n),t=t.sibling}function X0(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(X0(t,e,n),t=t.sibling;t!==null;)X0(t,e,n),t=t.sibling}var On=null,hi=!1;function Ro(t,e,n){for(n=n.child;n!==null;)b_(t,e,n),n=n.sibling}function b_(t,e,n){if(Yi&&typeof Yi.onCommitFiberUnmount=="function")try{Yi.onCommitFiberUnmount(Qp,n)}catch{}switch(n.tag){case 5:An||Ba(n,e);case 6:var r=On,i=hi;On=null,Ro(t,e,n),On=r,hi=i,On!==null&&(hi?(t=On,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):On.removeChild(n.stateNode));break;case 18:On!==null&&(hi?(t=On,n=n.stateNode,t.nodeType===8?Bg(t.parentNode,n):t.nodeType===1&&Bg(t,n),mu(t)):Bg(On,n.stateNode));break;case 4:r=On,i=hi,On=n.stateNode.containerInfo,hi=!0,Ro(t,e,n),On=r,hi=i;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&U0(n,e,s),i=i.next}while(i!==r)}Ro(t,e,n);break;case 1:if(!An&&(Ba(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Wt(n,e,a)}Ro(t,e,n);break;case 21:Ro(t,e,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Ro(t,e,n),An=r):Ro(t,e,n);break;default:Ro(t,e,n)}}function $w(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new TM),e.forEach(function(r){var i=DM.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ui(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*RM(r/1960))-r,10t?16:t,Wo===null)var r=!1;else{if(t=Wo,Wo=null,qh=0,lt&6)throw Error(ve(331));var i=lt;for(lt|=4,_e=t.current;_e!==null;){var o=_e,s=o.child;if(_e.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lHt()-Py?Ns(t,0):Cy|=n),or(t,e)}function __(t,e){e===0&&(t.mode&1?(e=Fd,Fd<<=1,!(Fd&130023424)&&(Fd=4194304)):e=1);var n=Un();t=So(t,e),t!==null&&(id(t,e,n),or(t,n))}function NM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),__(t,n)}function DM(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ve(314))}r!==null&&r.delete(e),__(t,n)}var T_;T_=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||rr.current)tr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return tr=!1,PM(t,e,n);tr=!!(t.flags&131072)}else tr=!1,jt&&e.flags&1048576&&ME(e,jh,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Wf(t,e),t=e.pendingProps;var i=dl(e,Dn.current);Ka(e,n),i=yy(null,e,r,t,i,n);var o=by();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ir(r)?(o=!0,Qh(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,py(e),i.updater=Fp,e.stateNode=i,i._reactInternals=e,N0(e,r,t,n),e=B0(null,e,r,!0,o,n)):(e.tag=0,jt&&o&&ay(e),Zn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Wf(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=BM(r),t=fi(r,t),i){case 0:e=z0(null,e,r,t,n);break e;case 1:e=Cw(null,e,r,t,n);break e;case 11:e=xw(null,e,r,t,n);break e;case 14:e=kw(null,e,r,fi(r.type,t),n);break e}throw Error(ve(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:fi(r,i),z0(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:fi(r,i),Cw(t,e,r,i,n);case 3:e:{if(f_(e),t===null)throw Error(ve(387));r=e.pendingProps,o=e.memoizedState,i=o.element,DE(t,e),zh(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=ml(Error(ve(423)),e),e=Pw(t,e,r,n,i);break e}else if(r!==i){i=ml(Error(ve(424)),e),e=Pw(t,e,r,n,i);break e}else for(Or=Jo(e.stateNode.containerInfo.firstChild),br=e,jt=!0,pi=null,n=jE(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fl(),r===i){e=wo(t,e,n);break e}Zn(t,e,r,n)}e=e.child}return e;case 5:return zE(e),t===null&&Q0(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,$0(r,i)?s=null:o!==null&&$0(r,o)&&(e.flags|=32),d_(t,e),Zn(t,e,s,n),e.child;case 6:return t===null&&Q0(e),null;case 13:return h_(t,e,n);case 4:return my(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=hl(e,null,r,n):Zn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:fi(r,i),xw(t,e,r,i,n);case 7:return Zn(t,e,e.pendingProps,n),e.child;case 8:return Zn(t,e,e.pendingProps.children,n),e.child;case 12:return Zn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,At(Nh,r._currentValue),r._currentValue=s,o!==null)if(bi(o.value,s)){if(o.children===i.children&&!rr.current){e=wo(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=mo(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),L0(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ve(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),L0(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Zn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ka(e,n),i=Xr(i),r=r(i),e.flags|=1,Zn(t,e,r,n),e.child;case 14:return r=e.type,i=fi(r,e.pendingProps),i=fi(r.type,i),kw(t,e,r,i,n);case 15:return c_(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:fi(r,i),Wf(t,e),e.tag=1,ir(r)?(t=!0,Qh(e)):t=!1,Ka(e,n),s_(e,r,i),N0(e,r,i,n),B0(null,e,r,!0,t,n);case 19:return p_(t,e,n);case 22:return u_(t,e,n)}throw Error(ve(156,e.tag))};function $_(t,e){return rE(t,e)}function zM(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 zr(t,e,n,r){return new zM(t,e,n,r)}function $y(t){return t=t.prototype,!(!t||!t.isReactComponent)}function BM(t){if(typeof t=="function")return $y(t)?1:0;if(t!=null){if(t=t.$$typeof,t===H1)return 11;if(t===Y1)return 14}return 2}function rs(t,e){var n=t.alternate;return n===null?(n=zr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Yf(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")$y(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Ra:return Ds(n.children,i,o,e);case X1:s=8,i|=8;break;case l0:return t=zr(12,n,e,i|2),t.elementType=l0,t.lanes=o,t;case c0:return t=zr(13,n,e,i),t.elementType=c0,t.lanes=o,t;case u0:return t=zr(19,n,e,i),t.elementType=u0,t.lanes=o,t;case zP:return Up(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case NP:s=10;break e;case DP:s=9;break e;case H1:s=11;break e;case Y1:s=14;break e;case Io:s=16,r=null;break e}throw Error(ve(130,t==null?t:typeof t,""))}return e=zr(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ds(t,e,n,r){return t=zr(7,t,r,e),t.lanes=n,t}function Up(t,e,n,r){return t=zr(22,t,r,e),t.elementType=zP,t.lanes=n,t.stateNode={isHidden:!1},t}function Hg(t,e,n){return t=zr(6,t,null,e),t.lanes=n,t}function Yg(t,e,n){return e=zr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function FM(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$g(0),this.expirationTimes=$g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ay(t,e,n,r,i,o,s,a,l){return t=new FM(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=zr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},py(o),t}function ZM(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I_)}catch(t){console.error(t)}}I_(),IP.exports=_r;var Qy=IP.exports;const ef=nd(Qy);var Q_,Nw=Qy;Q_=Nw.createRoot,Nw.hydrateRoot;function xo(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const yi="$$material";function Hh(){return Hh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?bn(Bl,--cr):0,vl--,rn===10&&(vl=1,Gp--),rn}function Sr(){return rn=cr2||_u(rn)>3?"":" "}function u6(t,e){for(;--e&&Sr()&&!(rn<48||rn>102||rn>57&&rn<65||rn>70&&rn<97););return ld(t,Gf()+(e<6&&Ki()==32&&Sr()==32))}function eO(t){for(;Sr();)switch(rn){case t:return cr;case 34:case 39:t!==34&&t!==39&&eO(rn);break;case 40:t===41&&eO(t);break;case 92:Sr();break}return cr}function d6(t,e){for(;Sr()&&t+rn!==57;)if(t+rn===84&&Ki()===47)break;return"/*"+ld(e,cr-1)+"*"+Yp(t===47?t:Sr())}function f6(t){for(;!_u(Ki());)Sr();return ld(t,cr)}function h6(t){return F_(Jf("",null,null,null,[""],t=B_(t),0,[0],t))}function Jf(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,m=1,y=1,g=1,v=0,O="",b=i,S=o,w=r,C=O;y;)switch(p=v,v=Sr()){case 40:if(p!=108&&bn(C,d-1)==58){J0(C+=pt(Kf(v),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:C+=Kf(v);break;case 9:case 10:case 13:case 32:C+=c6(p);break;case 92:C+=u6(Gf()-1,7);continue;case 47:switch(Ki()){case 42:case 47:tf(p6(d6(Sr(),Gf()),e,n),l);break;default:C+="/"}break;case 123*m:a[c++]=Ni(C)*g;case 125*m:case 59:case 0:switch(v){case 0:case 125:y=0;case 59+u:g==-1&&(C=pt(C,/\f/g,"")),h>0&&Ni(C)-d&&tf(h>32?zw(C+";",r,n,d-1):zw(pt(C," ","")+";",r,n,d-2),l);break;case 59:C+=";";default:if(tf(w=Dw(C,e,n,c,u,i,a,O,b=[],S=[],d),o),v===123)if(u===0)Jf(C,e,w,w,b,o,d,a,S);else switch(f===99&&bn(C,3)===110?100:f){case 100:case 108:case 109:case 115:Jf(t,w,w,r&&tf(Dw(t,w,w,0,0,i,a,O,i,b=[],d),S),i,S,d,a,r?b:S);break;default:Jf(C,w,w,w,[""],S,0,a,S)}}c=u=h=0,m=g=1,O=C="",d=s;break;case 58:d=1+Ni(C),h=p;default:if(m<1){if(v==123)--m;else if(v==125&&m++==0&&l6()==125)continue}switch(C+=Yp(v),v*m){case 38:g=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(Ni(C)-1)*g,g=1;break;case 64:Ki()===45&&(C+=Kf(Sr())),f=Ki(),u=d=Ni(O=C+=f6(Gf())),v++;break;case 45:p===45&&Ni(C)==2&&(m=0)}}return o}function Dw(t,e,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=i===0?o:[""],h=Ny(f),p=0,m=0,y=0;p0?f[g]+" "+v:pt(v,/&\f/g,f[g])))&&(l[y++]=O);return Kp(t,e,n,i===0?Ly:a,l,c,u)}function p6(t,e,n){return Kp(t,e,n,j_,Yp(a6()),Eu(t,2,-2),0)}function zw(t,e,n,r){return Kp(t,e,n,jy,Eu(t,0,r),Eu(t,r+1,-1),r)}function el(t,e){for(var n="",r=Ny(t),i=0;i6)switch(bn(t,e+1)){case 109:if(bn(t,e+4)!==45)break;case 102:return pt(t,/(.+:)(.+)-([^]+)/,"$1"+ht+"$2-$3$1"+Yh+(bn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~J0(t,"stretch")?Z_(pt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(bn(t,e+1)!==115)break;case 6444:switch(bn(t,Ni(t)-3-(~J0(t,"!important")&&10))){case 107:return pt(t,":",":"+ht)+t;case 101:return pt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ht+(bn(t,14)===45?"inline-":"")+"box$3$1"+ht+"$2$3$1"+_n+"$2box$3")+t}break;case 5936:switch(bn(t,e+11)){case 114:return ht+t+_n+pt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ht+t+_n+pt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ht+t+_n+pt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ht+t+_n+t+t}return t}var x6=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case jy:e.return=Z_(e.value,e.length);break;case N_:return el([lc(e,{value:pt(e.value,"@","@"+ht)})],i);case Ly:if(e.length)return s6(e.props,function(o){switch(o6(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return el([lc(e,{props:[pt(o,/:(read-\w+)/,":"+Yh+"$1")]})],i);case"::placeholder":return el([lc(e,{props:[pt(o,/:(plac\w+)/,":"+ht+"input-$1")]}),lc(e,{props:[pt(o,/:(plac\w+)/,":"+Yh+"$1")]}),lc(e,{props:[pt(o,/:(plac\w+)/,_n+"input-$1")]})],i)}return""})}},k6=[x6],C6=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var y=m.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||k6,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var y=m.getAttribute("data-emotion").split(" "),g=1;g=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var j6={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},N6=!1,D6=/[A-Z]|^ms/g,z6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Y_=function(e){return e.charCodeAt(1)===45},Fw=function(e){return e!=null&&typeof e!="boolean"},Gg=L_(function(t){return Y_(t)?t:t.replace(D6,"-$&").toLowerCase()}),Zw=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(z6,function(r,i,o){return Di={name:i,styles:o,next:Di},i})}return j6[e]!==1&&!Y_(e)&&typeof n=="number"&&n!==0?n+"px":n},B6="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Tu(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Di={name:i.name,styles:i.styles,next:Di},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Di={name:s.name,styles:s.styles,next:Di},s=s.next;var a=o.styles+";";return a}return F6(t,e,n)}case"function":{if(t!==void 0){var l=Di,c=n(t);return Di=l,Tu(t,e,c)}break}}var u=n;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function F6(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?W6:X6},Ww=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},H6=!1,Y6=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return X_(n,r,i),V6(function(){return H_(n,r,i)}),null},G6=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=Ww(e,n,r),l=a||qw(i),c=!l("as");return function(){var u=arguments,d=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,h=1;he(J6(i)?n:i):e;return _.jsx(U6,{styles:r})}/** * @mui/styled-engine v6.1.3 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function tT(t,e){return tO(t,e)}function eI(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const Xw=[];function Hw(t){return Xw[0]=t,cm(Xw)}function Fi(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function nT(t){if(!Fi(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=nT(t[n])}),e}function Ln(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return Fi(t)&&Fi(e)&&Object.keys(e).forEach(i=>{Fi(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Fi(t[i])?r[i]=Ln(t[i],e[i],n):n.clone?r[i]=Fi(e[i])?nT(e[i]):e[i]:r[i]=e[i]}),r}const tI=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function nI(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=t,o=tI(e),s=Object.keys(o);function a(f){return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof e[f]=="number"?e[f]:f)-r/100}${n})`}function c(f,h){const p=s.indexOf(h);return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function u(f){return s.indexOf(f)+1r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=e[i];return delete r[i],r[i]=o,r},{...e}):e}function iI(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function oI(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return t.containerQueries(i).up(o)}function sI(t){const e=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>e(t.breakpoints.up(...a),s),o.down=(...a)=>e(t.breakpoints.down(...a),s),o.between=(...a)=>e(t.breakpoints.between(...a),s),o.only=(...a)=>e(t.breakpoints.only(...a),s),o.not=(...a)=>{const l=e(t.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...t,containerQueries:i}}const aI={borderRadius:4};function Gc(t,e){return e?Ln(t,e,{clone:!1}):t}const dm={xs:0,sm:600,md:900,lg:1200,xl:1536},Yw={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${dm[t]}px)`},lI={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:dm[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function Yr(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||Yw;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||Yw;return Object.keys(e).reduce((s,a)=>{if(iI(o.keys,a)){const l=oI(r.containerQueries?r:lI,a);l&&(s[l]=n(e[a],a))}else if(Object.keys(o.values||dm).includes(a)){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function cI(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function uI(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function dI(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function fm({values:t,breakpoints:e,base:n}){const r=n||dI(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function be(t){if(typeof t!="string")throw new Error(xo(7));return t.charAt(0).toUpperCase()+t.slice(1)}function hm(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function Gh(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=hm(t,n)||r,e&&(i=e(i,r,t)),i}function Kt(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=hm(l,r)||{};return Yr(s,a,d=>{let f=Gh(c,i,d);return d===f&&typeof d=="string"&&(f=Gh(c,i,`${e}${d==="default"?"":be(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[e],o}function fI(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const hI={m:"margin",p:"padding"},pI={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Gw={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},mI=fI(t=>{if(t.length>2)if(Gw[t])t=Gw[t];else return[t];const[e,n]=t.split(""),r=hI[e],i=pI[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Zy=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Vy=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Zy,...Vy];function cd(t,e,n,r){const i=hm(t,e,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function Uy(t){return cd(t,"spacing",8)}function ud(t,e){return typeof e=="string"||e==null?e:t(e)}function gI(t,e){return n=>t.reduce((r,i)=>(r[i]=ud(e,n),r),{})}function vI(t,e,n,r){if(!e.includes(n))return null;const i=mI(n),o=gI(i,r),s=t[n];return Yr(t,s,o)}function rT(t,e){const n=Uy(t.theme);return Object.keys(t).map(r=>vI(t,e,r,n)).reduce(Gc,{})}function Ut(t){return rT(t,Zy)}Ut.propTypes={};Ut.filterProps=Zy;function qt(t){return rT(t,Vy)}qt.propTypes={};qt.filterProps=Vy;function iT(t=8,e=Uy({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function pm(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Gc(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Nr(t){return typeof t!="number"?t:`${t}px solid`}function ti(t,e){return Kt({prop:t,themeKey:"borders",transform:e})}const OI=ti("border",Nr),yI=ti("borderTop",Nr),bI=ti("borderRight",Nr),SI=ti("borderBottom",Nr),wI=ti("borderLeft",Nr),xI=ti("borderColor"),kI=ti("borderTopColor"),CI=ti("borderRightColor"),PI=ti("borderBottomColor"),EI=ti("borderLeftColor"),_I=ti("outline",Nr),TI=ti("outlineColor"),mm=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=cd(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:ud(e,r)});return Yr(t,t.borderRadius,n)}return null};mm.propTypes={};mm.filterProps=["borderRadius"];pm(OI,yI,bI,SI,wI,xI,kI,CI,PI,EI,mm,_I,TI);const gm=t=>{if(t.gap!==void 0&&t.gap!==null){const e=cd(t.theme,"spacing",8),n=r=>({gap:ud(e,r)});return Yr(t,t.gap,n)}return null};gm.propTypes={};gm.filterProps=["gap"];const vm=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=cd(t.theme,"spacing",8),n=r=>({columnGap:ud(e,r)});return Yr(t,t.columnGap,n)}return null};vm.propTypes={};vm.filterProps=["columnGap"];const Om=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=cd(t.theme,"spacing",8),n=r=>({rowGap:ud(e,r)});return Yr(t,t.rowGap,n)}return null};Om.propTypes={};Om.filterProps=["rowGap"];const $I=Kt({prop:"gridColumn"}),AI=Kt({prop:"gridRow"}),RI=Kt({prop:"gridAutoFlow"}),MI=Kt({prop:"gridAutoColumns"}),II=Kt({prop:"gridAutoRows"}),QI=Kt({prop:"gridTemplateColumns"}),LI=Kt({prop:"gridTemplateRows"}),jI=Kt({prop:"gridTemplateAreas"}),NI=Kt({prop:"gridArea"});pm(gm,vm,Om,$I,AI,RI,MI,II,QI,LI,jI,NI);function tl(t,e){return e==="grey"?e:t}const DI=Kt({prop:"color",themeKey:"palette",transform:tl}),zI=Kt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:tl}),BI=Kt({prop:"backgroundColor",themeKey:"palette",transform:tl});pm(DI,zI,BI);function vr(t){return t<=1&&t!==0?`${t*100}%`:t}const FI=Kt({prop:"width",transform:vr}),qy=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var i,o,s,a,l;const r=((s=(o=(i=t.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||dm[n];return r?((l=(a=t.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:vr(n)}};return Yr(t,t.maxWidth,e)}return null};qy.filterProps=["maxWidth"];const ZI=Kt({prop:"minWidth",transform:vr}),VI=Kt({prop:"height",transform:vr}),UI=Kt({prop:"maxHeight",transform:vr}),qI=Kt({prop:"minHeight",transform:vr});Kt({prop:"size",cssProperty:"width",transform:vr});Kt({prop:"size",cssProperty:"height",transform:vr});const WI=Kt({prop:"boxSizing"});pm(FI,qy,ZI,VI,UI,qI,WI);const dd={border:{themeKey:"borders",transform:Nr},borderTop:{themeKey:"borders",transform:Nr},borderRight:{themeKey:"borders",transform:Nr},borderBottom:{themeKey:"borders",transform:Nr},borderLeft:{themeKey:"borders",transform:Nr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Nr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:mm},color:{themeKey:"palette",transform:tl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:tl},backgroundColor:{themeKey:"palette",transform:tl},p:{style:qt},pt:{style:qt},pr:{style:qt},pb:{style:qt},pl:{style:qt},px:{style:qt},py:{style:qt},padding:{style:qt},paddingTop:{style:qt},paddingRight:{style:qt},paddingBottom:{style:qt},paddingLeft:{style:qt},paddingX:{style:qt},paddingY:{style:qt},paddingInline:{style:qt},paddingInlineStart:{style:qt},paddingInlineEnd:{style:qt},paddingBlock:{style:qt},paddingBlockStart:{style:qt},paddingBlockEnd:{style:qt},m:{style:Ut},mt:{style:Ut},mr:{style:Ut},mb:{style:Ut},ml:{style:Ut},mx:{style:Ut},my:{style:Ut},margin:{style:Ut},marginTop:{style:Ut},marginRight:{style:Ut},marginBottom:{style:Ut},marginLeft:{style:Ut},marginX:{style:Ut},marginY:{style:Ut},marginInline:{style:Ut},marginInlineStart:{style:Ut},marginInlineEnd:{style:Ut},marginBlock:{style:Ut},marginBlockStart:{style:Ut},marginBlockEnd:{style:Ut},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gm},rowGap:{style:Om},columnGap:{style:vm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:vr},maxWidth:{style:qy},minWidth:{transform:vr},height:{transform:vr},maxHeight:{transform:vr},minHeight:{transform:vr},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function XI(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function HI(t,e){return typeof t=="function"?t(e):t}function YI(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const f=hm(i,c)||{};return d?d(s):Yr(s,r,p=>{let m=Gh(f,u,p);return p===m&&typeof p=="string"&&(m=Gh(f,u,`${n}${p==="default"?"":be(p)}`,p)),l===!1?m:{[l]:m}})}function e(n){const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=i.unstable_sxConfig??dd;function s(a){let l=a;if(typeof a=="function")l=a(i);else if(typeof a!="object")return a;if(!l)return null;const c=cI(i.breakpoints),u=Object.keys(c);let d=c;return Object.keys(l).forEach(f=>{const h=HI(l[f],i);if(h!=null)if(typeof h=="object")if(o[f])d=Gc(d,t(f,h,i,o));else{const p=Yr({theme:i},h,m=>({[f]:m}));XI(p,h)?d[f]=e({sx:h,theme:i}):d=Gc(d,p)}else d=Gc(d,t(f,h,i,o))}),rI(i,uI(u,d))}return Array.isArray(r)?r.map(s):s(r)}return e}const ls=YI();ls.filterProps=["sx"];function GI(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(t);return i==="&"?e:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:e})}return n.palette.mode===t?e:{}}function ym(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=t,a=nI(n),l=iT(i);let c=Ln({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...aI,...o}},s);return c=sI(c),c.applyStyles=GI,c=e.reduce((u,d)=>Ln(u,d),c),c.unstable_sxConfig={...dd,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(d){return ls({sx:d,theme:this})},c}function KI(t){return Object.keys(t).length===0}function Wy(t=null){const e=T.useContext(um);return!e||KI(e)?t:e}const JI=ym();function bm(t=JI){return Wy(t)}function e8({styles:t,themeId:e,defaultTheme:n={}}){const r=bm(n),i=typeof t=="function"?t(e&&r[e]||r):t;return _.jsx(eT,{styles:i})}const t8=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??dd;return Object.keys(t).forEach(i=>{n[i]?e.systemProps[i]=t[i]:e.otherProps[i]=t[i]}),e};function Xy(t){const{sx:e,...n}=t,{systemProps:r,otherProps:i}=t8(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return Fi(a)?{...r,...a}:r}:o={...r,...e},{...i,sx:o}}const Kw=t=>t,n8=()=>{let t=Kw;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Kw}}},oT=n8();function sT(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(ls);return T.forwardRef(function(l,c){const u=bm(n),{className:d,component:f="div",...h}=Xy(l);return _.jsx(o,{as:f,ref:c,className:Qe(d,i?i(r):r),theme:e&&u[e]||u,...h})})}const i8={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ot(t,e,n="Mui"){const r=i8[e];return r?`${n}-${r}`:`${oT.generate(t)}-${e}`}function Ke(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=ot(t,i,n)}),r}var xt={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Hy=Symbol.for("react.element"),Yy=Symbol.for("react.portal"),Sm=Symbol.for("react.fragment"),wm=Symbol.for("react.strict_mode"),xm=Symbol.for("react.profiler"),km=Symbol.for("react.provider"),Cm=Symbol.for("react.context"),o8=Symbol.for("react.server_context"),Pm=Symbol.for("react.forward_ref"),Em=Symbol.for("react.suspense"),_m=Symbol.for("react.suspense_list"),Tm=Symbol.for("react.memo"),$m=Symbol.for("react.lazy"),s8=Symbol.for("react.offscreen"),aT;aT=Symbol.for("react.module.reference");function ni(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Hy:switch(t=t.type,t){case Sm:case xm:case wm:case Em:case _m:return t;default:switch(t=t&&t.$$typeof,t){case o8:case Cm:case Pm:case $m:case Tm:case km:return t;default:return e}}case Yy:return e}}}xt.ContextConsumer=Cm;xt.ContextProvider=km;xt.Element=Hy;xt.ForwardRef=Pm;xt.Fragment=Sm;xt.Lazy=$m;xt.Memo=Tm;xt.Portal=Yy;xt.Profiler=xm;xt.StrictMode=wm;xt.Suspense=Em;xt.SuspenseList=_m;xt.isAsyncMode=function(){return!1};xt.isConcurrentMode=function(){return!1};xt.isContextConsumer=function(t){return ni(t)===Cm};xt.isContextProvider=function(t){return ni(t)===km};xt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Hy};xt.isForwardRef=function(t){return ni(t)===Pm};xt.isFragment=function(t){return ni(t)===Sm};xt.isLazy=function(t){return ni(t)===$m};xt.isMemo=function(t){return ni(t)===Tm};xt.isPortal=function(t){return ni(t)===Yy};xt.isProfiler=function(t){return ni(t)===xm};xt.isStrictMode=function(t){return ni(t)===wm};xt.isSuspense=function(t){return ni(t)===Em};xt.isSuspenseList=function(t){return ni(t)===_m};xt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Sm||t===xm||t===wm||t===Em||t===_m||t===s8||typeof t=="object"&&t!==null&&(t.$$typeof===$m||t.$$typeof===Tm||t.$$typeof===km||t.$$typeof===Cm||t.$$typeof===Pm||t.$$typeof===aT||t.getModuleId!==void 0)};xt.typeOf=ni;function lT(t){const{variants:e,...n}=t,r={variants:e,style:Hw(n),isProcessed:!0};return r.style===n||e&&e.forEach(i=>{typeof i.style!="function"&&(i.style=Hw(i.style))}),r}const a8=ym();function Kg(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function l8(t){return t?(e,n)=>n[t]:null}function c8(t,e,n){t.theme=d8(t.theme)?n:t.theme[e]||t.theme}function eh(t,e){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(r=>eh(t,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:i,...o}=n;r=o}return cT(t,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function cT(t,e,n=[]){var i;let r;e:for(let o=0;o{eI(a,S=>S.filter(w=>w!==ls));const{name:c,slot:u,skipVariantsResolver:d,skipSx:f,overridesResolver:h=l8(h8(u)),...p}=l,m=d!==void 0?d:u&&u!=="Root"&&u!=="root"||!1,y=f||!1;let g=Kg;u==="Root"||u==="root"?g=r:u?g=i:f8(a)&&(g=void 0);const v=tT(a,{shouldForwardProp:g,label:u8(),...p}),O=S=>{if(typeof S=="function"&&S.__emotion_real!==S)return function(C){return eh(C,S)};if(Fi(S)){const w=lT(S);return w.variants?function($){return eh($,w)}:w.style}return S},b=(...S)=>{const w=[],C=S.map(O),$=[];if(w.push(o),c&&h&&$.push(function(E){var F,I;const x=(I=(F=E.theme.components)==null?void 0:F[c])==null?void 0:I.styleOverrides;if(!x)return null;const z={};for(const j in x)z[j]=eh(E,x[j]);return h(E,z)}),c&&!m&&$.push(function(E){var z,F;const L=E.theme,x=(F=(z=L==null?void 0:L.components)==null?void 0:z[c])==null?void 0:F.variants;return x?cT(E,x):null}),y||$.push(ls),Array.isArray(C[0])){const N=C.shift(),E=new Array(w.length).fill(""),L=new Array($.length).fill("");let x;x=[...E,...N,...L],x.raw=[...E,...N.raw,...L],w.unshift(x)}const A=[...w,...C,...$],k=v(...A);return a.muiName&&(k.muiName=a.muiName),k};return v.withConfig&&(b.withConfig=v.withConfig),b}}function u8(t,e){return void 0}function d8(t){for(const e in t)return!1;return!0}function f8(t){return typeof t=="string"&&t.charCodeAt(0)>96}function h8(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const p8=uT();function $u(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=r;if(i==="components"||i==="slots")n[i]={...t[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=t[i],s=e[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=$u(o[l],s[l])}}}else n[i]===void 0&&(n[i]=t[i])}return n}function dT(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:$u(e.components[n].defaultProps,r)}function fT({props:t,name:e,defaultTheme:n,themeId:r}){let i=bm(n);return r&&(i=i[r]||i),dT({theme:i,name:e,props:t})}const Si=typeof window<"u"?T.useLayoutEffect:T.useEffect;function m8(t,e,n,r,i){const[o,s]=T.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Si(()=>{if(!n)return;const a=n(t),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[t,n]),o}const g8={...cu},hT=g8.useSyncExternalStore;function v8(t,e,n,r,i){const o=T.useCallback(()=>e,[e]),s=T.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[a,l]=T.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,d=>(u.addEventListener("change",d),()=>{u.removeEventListener("change",d)})]},[o,n,t]);return hT(l,a,s)}function Gy(t,e={}){const n=Wy(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=dT({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(hT!==void 0?v8:m8)(l,i,o,s,a)}function O8(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function Ky(t,e=0,n=1){return O8(t,e,n)}function y8(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function cs(t){if(t.type)return t;if(t.charAt(0)==="#")return cs(y8(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(xo(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(xo(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const b8=t=>{const e=cs(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Tc=(t,e)=>{try{return b8(t)}catch{return t}};function Am(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function pT(t){t=cs(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Am({type:a,values:l})}function nO(t){t=cs(t);let e=t.type==="hsl"||t.type==="hsla"?cs(pT(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function S8(t,e){const n=nO(t),r=nO(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Pt(t,e){return t=cs(t),e=Ky(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Am(t)}function nf(t,e,n){try{return Pt(t,e)}catch{return t}}function Jy(t,e){if(t=cs(t),e=Ky(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Am(t)}function kt(t,e,n){try{return Jy(t,e)}catch{return t}}function eb(t,e){if(t=cs(t),e=Ky(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Am(t)}function Ct(t,e,n){try{return eb(t,e)}catch{return t}}function w8(t,e=.15){return nO(t)>.5?Jy(t,e):eb(t,e)}function rf(t,e,n){try{return w8(t,e)}catch{return t}}function Jw(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function mT(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function Jg(t,e){var n,r,i;return T.isValidElement(t)&&e.indexOf(t.type.muiName??((i=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:i.muiName))!==-1}function Pr(t){return t&&t.ownerDocument||document}function ko(t){return Pr(t).defaultView||window}function Kh(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let ex=0;function x8(t){const[e,n]=T.useState(t),r=t||e;return T.useEffect(()=>{e==null&&(ex+=1,n(`mui-${ex}`))},[e]),r}const k8={...cu},tx=k8.useId;function tb(t){if(tx!==void 0){const e=tx();return t??e}return x8(t)}function nl({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=T.useRef(t!==void 0),[o,s]=T.useState(e),a=i?t:o,l=T.useCallback(c=>{i||s(c)},[]);return[a,l]}function Ui(t){const e=T.useRef(t);return Si(()=>{e.current=t}),T.useRef((...n)=>(0,e.current)(...n)).current}function Gt(...t){return T.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{Kh(n,e)})},t)}const nx={};function gT(t,e){const n=T.useRef(nx);return n.current===nx&&(n.current=t(e)),n}const C8=[];function P8(t){T.useEffect(t,C8)}class nb{constructor(){Jl(this,"currentId",null);Jl(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Jl(this,"disposeEffect",()=>this.clear)}static create(){return new nb}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function rb(){const t=gT(nb.create).current;return P8(t.disposeEffect),t}function rx(t){try{return t.matches(":focus-visible")}catch{}return!1}function vT(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}const E8=t=>{const e=T.useRef({});return T.useEffect(()=>{e.current=t}),e.current};function st(t,e,n=void 0){const r={};for(const i in t){const o=t[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function ix(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function bT(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=Qe(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},m={...n,...i,...r};return h.length>0&&(m.className=h),Object.keys(p).length>0&&(m.style=p),{props:m,internalRef:void 0}}const s=yT({...i,...r}),a=ix(r),l=ix(i),c=e(s),u=Qe(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d={...c==null?void 0:c.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},f={...c,...n,...l,...a};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}function ST(t,e,n){return typeof t=="function"?t(e,n):t}function rO(t){var d;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=t,s=i?{}:ST(n,r),{props:a,internalRef:l}=bT({...o,externalSlotProps:s}),c=Gt(l,s==null?void 0:s.ref,(d=t.additionalProps)==null?void 0:d.ref);return OT(e,{...a,ref:c},r)}function fd(t){var e;return parseInt(T.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const wT=T.createContext(null);function ib(){return T.useContext(wT)}const T8=typeof Symbol=="function"&&Symbol.for,$8=T8?Symbol.for("mui.nested"):"__THEME_NESTED__";function A8(t,e){return typeof e=="function"?e(t):{...t,...e}}function R8(t){const{children:e,theme:n}=t,r=ib(),i=T.useMemo(()=>{const o=r===null?{...n}:A8(r,n);return o!=null&&(o[$8]=r!==null),o},[n,r]);return _.jsx(wT.Provider,{value:i,children:e})}const xT=T.createContext();function M8({value:t,...e}){return _.jsx(xT.Provider,{value:t??!0,...e})}const kT=()=>T.useContext(xT)??!1,CT=T.createContext(void 0);function I8({value:t,children:e}){return _.jsx(CT.Provider,{value:t,children:e})}function Q8(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?$u(i.defaultProps,r):!i.styleOverrides&&!i.variants?$u(i,r):r}function L8({props:t,name:e}){const n=T.useContext(CT);return Q8({props:t,name:e,theme:{components:n}})}const ox={};function sx(t,e,n,r=!1){return T.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?{...e,[t]:o}:o;return r?()=>s:s}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function PT(t){const{children:e,theme:n,themeId:r}=t,i=Wy(ox),o=ib()||ox,s=sx(r,i,n),a=sx(r,o,n,!0),l=s.direction==="rtl";return _.jsx(R8,{theme:a,children:_.jsx(um.Provider,{value:s,children:_.jsx(M8,{value:l,children:_.jsx(I8,{value:s==null?void 0:s.components,children:e})})})})}const ax={theme:void 0};function j8(t){let e,n;return function(i){let o=e;return(o===void 0||i.theme!==n)&&(ax.theme=i.theme,o=lT(t(ax)),e=o,n=i.theme),o}}const ob="mode",sb="color-scheme",N8="data-color-scheme";function D8(t){const{defaultLightColorScheme:e="light",defaultDarkColorScheme:n="dark",modeStorageKey:r=ob,colorSchemeStorageKey:i=sb,attribute:o=N8,colorSchemeNode:s="document.documentElement",nonce:a}=t||{};let l="",c=o;if(o==="class"&&(c=".%s"),o==="data"&&(c="[data-%s]"),c.startsWith(".")){const d=c.substring(1);l+=`${s}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); ${s}.classList.add('${d}'.replace('%s', colorScheme));`}const u=c.match(/\[([^\]]+)\]/);if(u){const[d,f]=u[1].split("=");f||(l+=`${s}.removeAttribute('${d}'.replace('%s', light)); ${s}.removeAttribute('${d}'.replace('%s', dark));`),l+=` ${s}.setAttribute('${d}'.replace('%s', colorScheme), ${f?`${f}.replace('%s', colorScheme)`:'""'});`}else l+=`${s}.setAttribute('${c}', colorScheme);`;return _.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(function() { try { let colorScheme = ''; const mode = localStorage.getItem('${r}') || 'system'; const dark = localStorage.getItem('${i}-dark') || '${n}'; const light = localStorage.getItem('${i}-light') || '${e}'; if (mode === 'system') { // handle system mode const mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { colorScheme = dark } else { colorScheme = light } } if (mode === 'light') { colorScheme = light; } if (mode === 'dark') { colorScheme = dark; } if (colorScheme) { ${l} } } catch(e){}})();`}},"mui-color-scheme-init")}function lx(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ET(t,e){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return e("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return e("dark")}function z8(t){return ET(t,e=>{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function ev(t,e){if(typeof window>"u")return;let n;try{n=localStorage.getItem(t)||void 0,n||localStorage.setItem(t,e)}catch{}return n||e}function B8(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=ob,colorSchemeStorageKey:s=sb,storageWindow:a=typeof window>"u"?void 0:window}=t,l=i.join(","),c=i.length>1,[u,d]=T.useState(()=>{const O=ev(o,e),b=ev(`${s}-light`,n),S=ev(`${s}-dark`,r);return{mode:O,systemMode:lx(O),lightColorScheme:b,darkColorScheme:S}}),[,f]=T.useState(!1),h=T.useRef(!1);T.useEffect(()=>{c&&f(!0),h.current=!0},[c]);const p=z8(u),m=T.useCallback(O=>{d(b=>{if(O===b.mode)return b;const S=O??e;try{localStorage.setItem(o,S)}catch{}return{...b,mode:S,systemMode:lx(S)}})},[o,e]),y=T.useCallback(O=>{O?typeof O=="string"?O&&!l.includes(O)?console.error(`\`${O}\` does not exist in \`theme.colorSchemes\`.`):d(b=>{const S={...b};return ET(b,w=>{try{localStorage.setItem(`${s}-${w}`,O)}catch{}w==="light"&&(S.lightColorScheme=O),w==="dark"&&(S.darkColorScheme=O)}),S}):d(b=>{const S={...b},w=O.light===null?n:O.light,C=O.dark===null?r:O.dark;if(w)if(!l.includes(w))console.error(`\`${w}\` does not exist in \`theme.colorSchemes\`.`);else{S.lightColorScheme=w;try{localStorage.setItem(`${s}-light`,w)}catch{}}if(C)if(!l.includes(C))console.error(`\`${C}\` does not exist in \`theme.colorSchemes\`.`);else{S.darkColorScheme=C;try{localStorage.setItem(`${s}-dark`,C)}catch{}}return S}):d(b=>{try{localStorage.setItem(`${s}-light`,n),localStorage.setItem(`${s}-dark`,r)}catch{}return{...b,lightColorScheme:n,darkColorScheme:r}})},[l,s,n,r]),g=T.useCallback(O=>{u.mode==="system"&&d(b=>{const S=O!=null&&O.matches?"dark":"light";return b.systemMode===S?b:{...b,systemMode:S}})},[u.mode]),v=T.useRef(g);return v.current=g,T.useEffect(()=>{if(typeof window.matchMedia!="function"||!c)return;const O=(...S)=>v.current(...S),b=window.matchMedia("(prefers-color-scheme: dark)");return b.addListener(O),O(b),()=>{b.removeListener(O)}},[c]),T.useEffect(()=>{if(a&&c){const O=b=>{const S=b.newValue;typeof b.key=="string"&&b.key.startsWith(s)&&(!S||l.match(S))&&(b.key.endsWith("light")&&y({light:S}),b.key.endsWith("dark")&&y({dark:S})),b.key===o&&(!S||["light","dark","system"].includes(S))&&m(S||e)};return a.addEventListener("storage",O),()=>{a.removeEventListener("storage",O)}}},[y,m,o,s,l,e,a,c]),{...u,mode:h.current||!c?u.mode:void 0,systemMode:h.current||!c?u.systemMode:void 0,colorScheme:h.current||!c?p:void 0,setMode:m,setColorScheme:y}}const F8="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Z8(t){const{themeId:e,theme:n={},modeStorageKey:r=ob,colorSchemeStorageKey:i=sb,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=t,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=T.createContext(void 0),u=()=>T.useContext(c)||l;function d(m){var W,ee,de,he,xe;const{children:y,theme:g,modeStorageKey:v=r,colorSchemeStorageKey:O=i,disableTransitionOnChange:b=o,storageWindow:S=typeof window>"u"?void 0:window,documentNode:w=typeof document>"u"?void 0:document,colorSchemeNode:C=typeof document>"u"?void 0:document.documentElement,disableNestedContext:$=!1,disableStyleSheetGeneration:A=!1,defaultMode:k="system"}=m,N=T.useRef(!1),E=ib(),L=T.useContext(c),x=!!L&&!$,z=T.useMemo(()=>g||(typeof n=="function"?n():n),[g]),F=z[e],{colorSchemes:I={},components:j={},cssVarPrefix:B,...H}=F||z,Q=Object.keys(I).filter(Te=>!!I[Te]).join(","),M=T.useMemo(()=>Q.split(","),[Q]),G=typeof s=="string"?s:s.light,X=typeof s=="string"?s:s.dark,K=I[G]&&I[X]?k:((ee=(W=I[H.defaultColorScheme])==null?void 0:W.palette)==null?void 0:ee.mode)||((de=H.palette)==null?void 0:de.mode),{mode:oe,setMode:pe,systemMode:fe,lightColorScheme:me,darkColorScheme:Oe,colorScheme:ke,setColorScheme:ue}=B8({supportedColorSchemes:M,defaultLightColorScheme:G,defaultDarkColorScheme:X,modeStorageKey:v,colorSchemeStorageKey:O,defaultMode:K,storageWindow:S});let Ce=oe,P=ke;x&&(Ce=L.mode,P=L.colorScheme);const Y=P||H.defaultColorScheme,V=((he=H.generateThemeVars)==null?void 0:he.call(H))||H.vars,D={...H,components:j,colorSchemes:I,cssVarPrefix:B,vars:V};if(typeof D.generateSpacing=="function"&&(D.spacing=D.generateSpacing()),Y){const Te=I[Y];Te&&typeof Te=="object"&&Object.keys(Te).forEach(ye=>{Te[ye]&&typeof Te[ye]=="object"?D[ye]={...D[ye],...Te[ye]}:D[ye]=Te[ye]})}const R=H.colorSchemeSelector;T.useEffect(()=>{if(P&&C&&R&&R!=="media"){const Te=R;let ye=R;if(Te==="class"&&(ye=".%s"),Te==="data"&&(ye="[data-%s]"),Te!=null&&Te.startsWith("data-")&&!Te.includes("%s")&&(ye=`[${Te}="%s"]`),ye.startsWith("."))C.classList.remove(...M.map(Ne=>ye.substring(1).replace("%s",Ne))),C.classList.add(ye.substring(1).replace("%s",P));else{const Ne=ye.replace("%s",P).match(/\[([^\]]+)\]/);if(Ne){const[Tt,Fe]=Ne[1].split("=");Fe||M.forEach(en=>{C.removeAttribute(Tt.replace(P,en))}),C.setAttribute(Tt,Fe?Fe.replace(/"|'/g,""):"")}else C.setAttribute(ye,P)}}},[P,R,C,M]),T.useEffect(()=>{let Te;if(b&&N.current&&w){const ye=w.createElement("style");ye.appendChild(w.createTextNode(F8)),w.head.appendChild(ye),window.getComputedStyle(w.body),Te=setTimeout(()=>{w.head.removeChild(ye)},1)}return()=>{clearTimeout(Te)}},[P,b,w]),T.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]);const U=T.useMemo(()=>({allColorSchemes:M,colorScheme:P,darkColorScheme:Oe,lightColorScheme:me,mode:Ce,setColorScheme:ue,setMode:pe,systemMode:fe}),[M,P,Oe,me,Ce,ue,pe,fe]);let te=!0;(A||H.cssVariables===!1||x&&(E==null?void 0:E.cssVarPrefix)===B)&&(te=!1);const J=_.jsxs(T.Fragment,{children:[_.jsx(PT,{themeId:F?e:void 0,theme:a?a(D):D,children:y}),te&&_.jsx(eT,{styles:((xe=D.generateStyleSheets)==null?void 0:xe.call(D))||[]})]});return x?J:_.jsx(c.Provider,{value:U,children:J})}const f=typeof s=="string"?s:s.light,h=typeof s=="string"?s:s.dark;return{CssVarsProvider:d,useColorScheme:u,getInitColorSchemeScript:m=>D8({colorSchemeStorageKey:i,defaultLightColorScheme:f,defaultDarkColorScheme:h,modeStorageKey:r,...m})}}function V8(t=""){function e(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${i}${e(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${t?`${t}-`:""}${r}${e(...i)})`}const cx=(t,e,n,r=[])=>{let i=t;e.forEach((o,s)=>{s===e.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},U8=(t,e,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):e([...o,a],l,s))})}r(t)},q8=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function tv(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},i={},o={},s={};return U8(t,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,d=q8(a,l);Object.assign(i,{[u]:d}),cx(o,a,`var(${u})`,c),cx(s,a,`var(${u}, ${d})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function W8(t,e={}){const{getSelector:n=y,disableCssColorScheme:r,colorSchemeSelector:i}=e,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=t,{vars:c,css:u,varsWithDefaults:d}=tv(l,e);let f=d;const h={},{[a]:p,...m}=o;if(Object.entries(m||{}).forEach(([O,b])=>{const{vars:S,css:w,varsWithDefaults:C}=tv(b,e);f=Ln(f,C),h[O]={css:w,vars:S}}),p){const{css:O,vars:b,varsWithDefaults:S}=tv(p,e);f=Ln(f,S),h[a]={css:O,vars:b}}function y(O,b){var w,C;let S=i;if(i==="class"&&(S=".%s"),i==="data"&&(S="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(S=`[${i}="%s"]`),O){if(S==="media")return t.defaultColorScheme===O?":root":{[`@media (prefers-color-scheme: ${((C=(w=o[O])==null?void 0:w.palette)==null?void 0:C.mode)||O})`]:{":root":b}};if(S)return t.defaultColorScheme===O?`:root, ${S.replace("%s",String(O))}`:S.replace("%s",String(O))}return":root"}return{vars:f,generateThemeVars:()=>{let O={...c};return Object.entries(h).forEach(([,{vars:b}])=>{O=Ln(O,b)}),O},generateStyleSheets:()=>{var $,A;const O=[],b=t.defaultColorScheme||"light";function S(k,N){Object.keys(N).length&&O.push(typeof k=="string"?{[k]:{...N}}:k)}S(n(void 0,{...u}),u);const{[b]:w,...C}=h;if(w){const{css:k}=w,N=(A=($=o[b])==null?void 0:$.palette)==null?void 0:A.mode,E=!r&&N?{colorScheme:N,...k}:{...k};S(n(b,{...E}),E)}return Object.entries(C).forEach(([k,{css:N}])=>{var x,z;const E=(z=(x=o[k])==null?void 0:x.palette)==null?void 0:z.mode,L=!r&&E?{colorScheme:E,...N}:{...N};S(n(k,{...L}),L)}),O}}}function X8(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}const H8=ym(),Y8=p8("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${be(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),G8=t=>fT({props:t,name:"MuiContainer",defaultTheme:H8}),K8=(t,e)=>{const n=l=>ot(e,l),{classes:r,fixed:i,disableGutters:o,maxWidth:s}=t,a={root:["root",s&&`maxWidth${be(String(s))}`,i&&"fixed",o&&"disableGutters"]};return st(a,n,r)};function J8(t={}){const{createStyledComponent:e=Y8,useThemeProps:n=G8,componentName:r="MuiContainer"}=t,i=e(({theme:s,ownerState:a})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!a.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}}),({theme:s,ownerState:a})=>a.fixed&&Object.keys(s.breakpoints.values).reduce((l,c)=>{const u=c,d=s.breakpoints.values[u];return d!==0&&(l[s.breakpoints.up(u)]={maxWidth:`${d}${s.breakpoints.unit}`}),l},{}),({theme:s,ownerState:a})=>({...a.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},...a.maxWidth&&a.maxWidth!=="xs"&&{[s.breakpoints.up(a.maxWidth)]:{maxWidth:`${s.breakpoints.values[a.maxWidth]}${s.breakpoints.unit}`}}}));return T.forwardRef(function(a,l){const c=n(a),{className:u,component:d="div",disableGutters:f=!1,fixed:h=!1,maxWidth:p="lg",classes:m,...y}=c,g={...c,component:d,disableGutters:f,fixed:h,maxWidth:p},v=K8(g,r);return _.jsx(i,{as:d,ownerState:g,className:Qe(v.root,u),ref:l,...y})})}const Au={black:"#000",white:"#fff"},eQ={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Oa={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},ya={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},cc={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ba={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Sa={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},wa={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},ux={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Au.white,default:Au.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},nv={text:{primary:Au.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Au.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function dx(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=eb(t.main,i):e==="dark"&&(t.dark=Jy(t.main,o)))}function tQ(t="light"){return t==="dark"?{main:ba[200],light:ba[50],dark:ba[400]}:{main:ba[700],light:ba[400],dark:ba[800]}}function nQ(t="light"){return t==="dark"?{main:Oa[200],light:Oa[50],dark:Oa[400]}:{main:Oa[500],light:Oa[300],dark:Oa[700]}}function rQ(t="light"){return t==="dark"?{main:ya[500],light:ya[300],dark:ya[700]}:{main:ya[700],light:ya[400],dark:ya[800]}}function iQ(t="light"){return t==="dark"?{main:Sa[400],light:Sa[300],dark:Sa[700]}:{main:Sa[700],light:Sa[500],dark:Sa[900]}}function oQ(t="light"){return t==="dark"?{main:wa[400],light:wa[300],dark:wa[700]}:{main:wa[800],light:wa[500],dark:wa[900]}}function sQ(t="light"){return t==="dark"?{main:cc[400],light:cc[300],dark:cc[700]}:{main:"#ed6c02",light:cc[500],dark:cc[900]}}function ab(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=t,o=t.primary||tQ(e),s=t.secondary||nQ(e),a=t.error||rQ(e),l=t.info||iQ(e),c=t.success||oQ(e),u=t.warning||sQ(e);function d(m){return S8(m,nv.text.primary)>=n?nv.text.primary:ux.text.primary}const f=({color:m,name:y,mainShade:g=500,lightShade:v=300,darkShade:O=700})=>{if(m={...m},!m.main&&m[g]&&(m.main=m[g]),!m.hasOwnProperty("main"))throw new Error(xo(11,y?` (${y})`:"",g));if(typeof m.main!="string")throw new Error(xo(12,y?` (${y})`:"",JSON.stringify(m.main)));return dx(m,"light",v,r),dx(m,"dark",O,r),m.contrastText||(m.contrastText=d(m.main)),m},h={dark:nv,light:ux};return Ln({common:{...Au},mode:e,primary:f({color:o,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:eQ,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r,...h[e]},i)}function aQ(t){const e={};return Object.entries(t).forEach(r=>{const[i,o]=r;typeof o=="object"&&(e[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function lQ(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function cQ(t){return Math.round(t*1e5)/1e5}const fx={textTransform:"uppercase"},hx='"Roboto", "Helvetica", "Arial", sans-serif';function _T(t,e){const{fontFamily:n=hx,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...d}=typeof e=="function"?e(t):e,f=r/14,h=u||(y=>`${y/l*f}rem`),p=(y,g,v,O,b)=>({fontFamily:n,fontWeight:y,fontSize:h(g),lineHeight:v,...n===hx?{letterSpacing:`${cQ(O/g)}em`}:{},...b,...c}),m={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,fx),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,fx),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ln({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...m},d,{clone:!1})}const uQ=.2,dQ=.14,fQ=.12;function Lt(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${uQ})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${dQ})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${fQ})`].join(",")}const hQ=["none",Lt(0,2,1,-1,0,1,1,0,0,1,3,0),Lt(0,3,1,-2,0,2,2,0,0,1,5,0),Lt(0,3,3,-2,0,3,4,0,0,1,8,0),Lt(0,2,4,-1,0,4,5,0,0,1,10,0),Lt(0,3,5,-1,0,5,8,0,0,1,14,0),Lt(0,3,5,-1,0,6,10,0,0,1,18,0),Lt(0,4,5,-2,0,7,10,1,0,2,16,1),Lt(0,5,5,-3,0,8,10,1,0,3,14,2),Lt(0,5,6,-3,0,9,12,1,0,3,16,2),Lt(0,6,6,-3,0,10,14,1,0,4,18,3),Lt(0,6,7,-4,0,11,15,1,0,4,20,3),Lt(0,7,8,-4,0,12,17,2,0,5,22,4),Lt(0,7,8,-4,0,13,19,2,0,5,24,4),Lt(0,7,9,-4,0,14,21,2,0,5,26,4),Lt(0,8,9,-5,0,15,22,2,0,6,28,5),Lt(0,8,10,-5,0,16,24,2,0,6,30,5),Lt(0,8,11,-5,0,17,26,2,0,6,32,5),Lt(0,9,11,-5,0,18,28,2,0,7,34,6),Lt(0,9,12,-6,0,19,29,2,0,7,36,6),Lt(0,10,13,-6,0,20,31,3,0,8,38,7),Lt(0,10,13,-6,0,21,33,3,0,8,40,7),Lt(0,10,14,-6,0,22,35,3,0,8,42,7),Lt(0,11,14,-7,0,23,36,3,0,9,44,8),Lt(0,11,15,-7,0,24,38,3,0,9,46,8)],pQ={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},TT={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function px(t){return`${Math.round(t)}ms`}function mQ(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function gQ(t){const e={...pQ,...t.easing},n={...TT,...t.duration};return{getAutoHeightDuration:mQ,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:px(s)} ${a} ${typeof l=="string"?l:px(l)}`).join(",")},...t,easing:e,duration:n}}const vQ={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function iO(t={},...e){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,...c}=t;if(t.vars)throw new Error(xo(20));const u=ab(o),d=ym(t);let f=Ln(d,{mixins:lQ(d.breakpoints,r),palette:u,shadows:hQ.slice(),typography:_T(u,a),transitions:gQ(s),zIndex:{...vQ}});return f=Ln(f,c),f=e.reduce((h,p)=>Ln(h,p),f),f.unstable_sxConfig={...dd,...c==null?void 0:c.unstable_sxConfig},f.unstable_sx=function(p){return ls({sx:p,theme:this})},f}function oO(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const OQ=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=oO(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function $T(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function AT(t){return t==="dark"?OQ:[]}function yQ(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...i}=t,o=ab(e);return{palette:o,opacity:{...$T(o.mode),...n},overlays:r||AT(o.mode),...i}}function bQ(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const SQ=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],wQ=t=>(e,n)=>{const r=t.rootSelector||":root",i=t.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return SQ(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",e)]:s,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function xQ(t){return Fi(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function kQ(t={}){const e={...t};function n(r){const i=Object.entries(r);for(let o=0;o{t[n]||(t[n]={})})}function se(t,e,n){!t[e]&&n&&(t[e]=n)}function $c(t){return!t||!t.startsWith("hsl")?t:pT(t)}function ao(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Tc($c(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function PQ(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const $i=t=>{try{return t()}catch{}},EQ=(t="mui")=>V8(t);function rv(t,e,n,r){if(!e)return;e=e===!0?{}:e;const i=r==="dark"?"dark":"light";if(!n){t[r]=yQ({...e,palette:{mode:i,...e==null?void 0:e.palette}});return}const{palette:o,...s}=iO({...n,palette:{mode:i,...e==null?void 0:e.palette}});return t[r]={...e,palette:o,opacity:{...$T(i),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||AT(i)},s}function _Q(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=bQ,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=t,u=Object.keys(n)[0],d=r||(n.light&&u!=="light"?"light":u),f=EQ(o),{[d]:h,light:p,dark:m,...y}=n,g={...y};let v=h;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(v=!0),!v)throw new Error(xo(21,d));const O=rv(g,v,c,d);p&&!g.light&&rv(g,p,void 0,"light"),m&&!g.dark&&rv(g,m,void 0,"dark");let b={defaultColorScheme:d,...O,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:f,colorSchemes:g,font:{...aQ(O.typography),...O.font},spacing:PQ(c.spacing)};Object.keys(b.colorSchemes).forEach(A=>{const k=b.colorSchemes[A].palette,N=E=>{const L=E.split("-"),x=L[1],z=L[2];return f(E,k[x][z])};if(k.mode==="light"&&(se(k.common,"background","#fff"),se(k.common,"onBackground","#000")),k.mode==="dark"&&(se(k.common,"background","#000"),se(k.common,"onBackground","#fff")),CQ(k,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),k.mode==="light"){se(k.Alert,"errorColor",kt(k.error.light,.6)),se(k.Alert,"infoColor",kt(k.info.light,.6)),se(k.Alert,"successColor",kt(k.success.light,.6)),se(k.Alert,"warningColor",kt(k.warning.light,.6)),se(k.Alert,"errorFilledBg",N("palette-error-main")),se(k.Alert,"infoFilledBg",N("palette-info-main")),se(k.Alert,"successFilledBg",N("palette-success-main")),se(k.Alert,"warningFilledBg",N("palette-warning-main")),se(k.Alert,"errorFilledColor",$i(()=>k.getContrastText(k.error.main))),se(k.Alert,"infoFilledColor",$i(()=>k.getContrastText(k.info.main))),se(k.Alert,"successFilledColor",$i(()=>k.getContrastText(k.success.main))),se(k.Alert,"warningFilledColor",$i(()=>k.getContrastText(k.warning.main))),se(k.Alert,"errorStandardBg",Ct(k.error.light,.9)),se(k.Alert,"infoStandardBg",Ct(k.info.light,.9)),se(k.Alert,"successStandardBg",Ct(k.success.light,.9)),se(k.Alert,"warningStandardBg",Ct(k.warning.light,.9)),se(k.Alert,"errorIconColor",N("palette-error-main")),se(k.Alert,"infoIconColor",N("palette-info-main")),se(k.Alert,"successIconColor",N("palette-success-main")),se(k.Alert,"warningIconColor",N("palette-warning-main")),se(k.AppBar,"defaultBg",N("palette-grey-100")),se(k.Avatar,"defaultBg",N("palette-grey-400")),se(k.Button,"inheritContainedBg",N("palette-grey-300")),se(k.Button,"inheritContainedHoverBg",N("palette-grey-A100")),se(k.Chip,"defaultBorder",N("palette-grey-400")),se(k.Chip,"defaultAvatarColor",N("palette-grey-700")),se(k.Chip,"defaultIconColor",N("palette-grey-700")),se(k.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),se(k.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),se(k.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),se(k.LinearProgress,"primaryBg",Ct(k.primary.main,.62)),se(k.LinearProgress,"secondaryBg",Ct(k.secondary.main,.62)),se(k.LinearProgress,"errorBg",Ct(k.error.main,.62)),se(k.LinearProgress,"infoBg",Ct(k.info.main,.62)),se(k.LinearProgress,"successBg",Ct(k.success.main,.62)),se(k.LinearProgress,"warningBg",Ct(k.warning.main,.62)),se(k.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.11)`),se(k.Slider,"primaryTrack",Ct(k.primary.main,.62)),se(k.Slider,"secondaryTrack",Ct(k.secondary.main,.62)),se(k.Slider,"errorTrack",Ct(k.error.main,.62)),se(k.Slider,"infoTrack",Ct(k.info.main,.62)),se(k.Slider,"successTrack",Ct(k.success.main,.62)),se(k.Slider,"warningTrack",Ct(k.warning.main,.62));const E=rf(k.background.default,.8);se(k.SnackbarContent,"bg",E),se(k.SnackbarContent,"color",$i(()=>k.getContrastText(E))),se(k.SpeedDialAction,"fabHoverBg",rf(k.background.paper,.15)),se(k.StepConnector,"border",N("palette-grey-400")),se(k.StepContent,"border",N("palette-grey-400")),se(k.Switch,"defaultColor",N("palette-common-white")),se(k.Switch,"defaultDisabledColor",N("palette-grey-100")),se(k.Switch,"primaryDisabledColor",Ct(k.primary.main,.62)),se(k.Switch,"secondaryDisabledColor",Ct(k.secondary.main,.62)),se(k.Switch,"errorDisabledColor",Ct(k.error.main,.62)),se(k.Switch,"infoDisabledColor",Ct(k.info.main,.62)),se(k.Switch,"successDisabledColor",Ct(k.success.main,.62)),se(k.Switch,"warningDisabledColor",Ct(k.warning.main,.62)),se(k.TableCell,"border",Ct(nf(k.divider,1),.88)),se(k.Tooltip,"bg",nf(k.grey[700],.92))}if(k.mode==="dark"){se(k.Alert,"errorColor",Ct(k.error.light,.6)),se(k.Alert,"infoColor",Ct(k.info.light,.6)),se(k.Alert,"successColor",Ct(k.success.light,.6)),se(k.Alert,"warningColor",Ct(k.warning.light,.6)),se(k.Alert,"errorFilledBg",N("palette-error-dark")),se(k.Alert,"infoFilledBg",N("palette-info-dark")),se(k.Alert,"successFilledBg",N("palette-success-dark")),se(k.Alert,"warningFilledBg",N("palette-warning-dark")),se(k.Alert,"errorFilledColor",$i(()=>k.getContrastText(k.error.dark))),se(k.Alert,"infoFilledColor",$i(()=>k.getContrastText(k.info.dark))),se(k.Alert,"successFilledColor",$i(()=>k.getContrastText(k.success.dark))),se(k.Alert,"warningFilledColor",$i(()=>k.getContrastText(k.warning.dark))),se(k.Alert,"errorStandardBg",kt(k.error.light,.9)),se(k.Alert,"infoStandardBg",kt(k.info.light,.9)),se(k.Alert,"successStandardBg",kt(k.success.light,.9)),se(k.Alert,"warningStandardBg",kt(k.warning.light,.9)),se(k.Alert,"errorIconColor",N("palette-error-main")),se(k.Alert,"infoIconColor",N("palette-info-main")),se(k.Alert,"successIconColor",N("palette-success-main")),se(k.Alert,"warningIconColor",N("palette-warning-main")),se(k.AppBar,"defaultBg",N("palette-grey-900")),se(k.AppBar,"darkBg",N("palette-background-paper")),se(k.AppBar,"darkColor",N("palette-text-primary")),se(k.Avatar,"defaultBg",N("palette-grey-600")),se(k.Button,"inheritContainedBg",N("palette-grey-800")),se(k.Button,"inheritContainedHoverBg",N("palette-grey-700")),se(k.Chip,"defaultBorder",N("palette-grey-700")),se(k.Chip,"defaultAvatarColor",N("palette-grey-300")),se(k.Chip,"defaultIconColor",N("palette-grey-300")),se(k.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),se(k.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),se(k.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),se(k.LinearProgress,"primaryBg",kt(k.primary.main,.5)),se(k.LinearProgress,"secondaryBg",kt(k.secondary.main,.5)),se(k.LinearProgress,"errorBg",kt(k.error.main,.5)),se(k.LinearProgress,"infoBg",kt(k.info.main,.5)),se(k.LinearProgress,"successBg",kt(k.success.main,.5)),se(k.LinearProgress,"warningBg",kt(k.warning.main,.5)),se(k.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.13)`),se(k.Slider,"primaryTrack",kt(k.primary.main,.5)),se(k.Slider,"secondaryTrack",kt(k.secondary.main,.5)),se(k.Slider,"errorTrack",kt(k.error.main,.5)),se(k.Slider,"infoTrack",kt(k.info.main,.5)),se(k.Slider,"successTrack",kt(k.success.main,.5)),se(k.Slider,"warningTrack",kt(k.warning.main,.5));const E=rf(k.background.default,.98);se(k.SnackbarContent,"bg",E),se(k.SnackbarContent,"color",$i(()=>k.getContrastText(E))),se(k.SpeedDialAction,"fabHoverBg",rf(k.background.paper,.15)),se(k.StepConnector,"border",N("palette-grey-600")),se(k.StepContent,"border",N("palette-grey-600")),se(k.Switch,"defaultColor",N("palette-grey-300")),se(k.Switch,"defaultDisabledColor",N("palette-grey-600")),se(k.Switch,"primaryDisabledColor",kt(k.primary.main,.55)),se(k.Switch,"secondaryDisabledColor",kt(k.secondary.main,.55)),se(k.Switch,"errorDisabledColor",kt(k.error.main,.55)),se(k.Switch,"infoDisabledColor",kt(k.info.main,.55)),se(k.Switch,"successDisabledColor",kt(k.success.main,.55)),se(k.Switch,"warningDisabledColor",kt(k.warning.main,.55)),se(k.TableCell,"border",kt(nf(k.divider,1),.68)),se(k.Tooltip,"bg",nf(k.grey[700],.92))}ao(k.background,"default"),ao(k.background,"paper"),ao(k.common,"background"),ao(k.common,"onBackground"),ao(k,"divider"),Object.keys(k).forEach(E=>{const L=k[E];L&&typeof L=="object"&&(L.main&&se(k[E],"mainChannel",Tc($c(L.main))),L.light&&se(k[E],"lightChannel",Tc($c(L.light))),L.dark&&se(k[E],"darkChannel",Tc($c(L.dark))),L.contrastText&&se(k[E],"contrastTextChannel",Tc($c(L.contrastText))),E==="text"&&(ao(k[E],"primary"),ao(k[E],"secondary")),E==="action"&&(L.active&&ao(k[E],"active"),L.selected&&ao(k[E],"selected")))})}),b=e.reduce((A,k)=>Ln(A,k),b);const S={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:wQ(b)},{vars:w,generateThemeVars:C,generateStyleSheets:$}=W8(b,S);return b.vars=w,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([A,k])=>{b[A]=k}),b.generateThemeVars=C,b.generateStyleSheets=$,b.generateSpacing=function(){return iT(c.spacing,Uy(this))},b.getColorSchemeSelector=X8(a),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...dd,...c==null?void 0:c.unstable_sxConfig},b.unstable_sx=function(k){return ls({sx:k,theme:this})},b.toRuntimeSource=kQ,b}function mx(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:ab({...n===!0?{}:n.palette,mode:e})})}function Rm(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=t,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return iO(t,...e);let u=n;"palette"in t||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const d=iO({...t,palette:u},...e);return d.defaultColorScheme=a,d.colorSchemes=c,d.palette.mode==="light"&&(d.colorSchemes.light={...c.light!==!0&&c.light,palette:d.palette},mx(d,"dark",c.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:d.palette},mx(d,"light",c.light)),d}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),_Q({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const Mm=Rm();function sa(){const t=bm(Mm);return t[yi]||t}function lb({props:t,name:e}){return fT({props:t,name:e,defaultTheme:Mm,themeId:yi})}function RT(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const ri=t=>RT(t)&&t!=="classes",Pe=uT({themeId:yi,defaultTheme:Mm,rootShouldForwardProp:ri});function gx({theme:t,...e}){const n=yi in t?t[yi]:void 0;return _.jsx(PT,{...e,themeId:n?yi:void 0,theme:n||t})}const of={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:TQ,useColorScheme:_ee,getInitColorSchemeScript:Tee}=Z8({themeId:yi,theme:()=>Rm({cssVariables:!0}),colorSchemeStorageKey:of.colorSchemeStorageKey,modeStorageKey:of.modeStorageKey,defaultColorScheme:{light:of.defaultLightColorScheme,dark:of.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:_T(t.palette,t.typography)};return e.unstable_sx=function(r){return ls({sx:r,theme:this})},e}}),$Q=TQ;function AQ({theme:t,...e}){return typeof t=="function"?_.jsx(gx,{theme:t,...e}):"colorSchemes"in(yi in t?t[yi]:t)?_.jsx($Q,{theme:t,...e}):_.jsx(gx,{theme:t,...e})}function RQ(t){return _.jsx(e8,{...t,defaultTheme:Mm,themeId:yi})}function cb(t){return function(n){return _.jsx(RQ,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function MQ(){return Xy}function ct(t){return L8(t)}const sO=typeof cb({})=="function",IQ=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),QQ=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),MT=(t,e=!1)=>{var o,s;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,l])=>{var u,d;const c=t.getColorSchemeSelector(a);c.startsWith("@")?n[c]={":root":{colorScheme:(u=l.palette)==null?void 0:u.mode}}:n[c.replace(/\s*&/,"")]={colorScheme:(d=l.palette)==null?void 0:d.mode}});let r={html:IQ(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...QQ(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const i=(s=(o=t.components)==null?void 0:o.MuiCssBaseline)==null?void 0:s.styleOverrides;return i&&(r=[r,i]),r},th="mui-ecs",LQ=t=>{const e=MT(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${th})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,i])=>{var s,a;const o=t.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${th}))`]:{colorScheme:(s=i.palette)==null?void 0:s.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${th}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}}),e},jQ=cb(sO?({theme:t,enableColorScheme:e})=>MT(t,e):({theme:t})=>LQ(t));function NQ(t){const e=ct({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return _.jsxs(T.Fragment,{children:[sO&&_.jsx(jQ,{enableColorScheme:r}),!sO&&!r&&_.jsx("span",{className:th,style:{display:"none"}}),n]})}const DQ=Ke("MuiBox",["root"]),zQ=Rm(),zi=r8({themeId:yi,defaultTheme:zQ,defaultClassName:DQ.root,generateClassName:oT.generate}),tt=j8;function BQ(t){return typeof t.main=="string"}function FQ(t,e=[]){if(!BQ(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function yr(t=[]){return([,e])=>e&&FQ(e,t)}function ZQ(t){return ot("MuiPaper",t)}Ke("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const VQ=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return st(o,ZQ,i)},UQ=Pe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(tt(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),hd=T.forwardRef(function(e,n){var h;const r=ct({props:e,name:"MuiPaper"}),i=sa(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,d={...r,component:s,elevation:a,square:l,variant:c},f=VQ(d);return _.jsx(UQ,{as:s,ownerState:d,className:Qe(f.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":(h=i.vars.overlays)==null?void 0:h[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Pt("#fff",oO(a))}, ${Pt("#fff",oO(a))})`}},...u.style}})});function qQ(t){return ot("MuiAppBar",t)}Ke("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const WQ=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${be(e)}`,`position${be(n)}`]};return st(i,qQ,r)},vx=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,XQ=Pe(hd,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${be(n.position)}`],e[`color${be(n.color)}`]]}})(tt(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(yr(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?vx(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?vx(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),HQ=T.forwardRef(function(e,n){const r=ct({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=WQ(c);return _.jsx(XQ,{square:!0,component:"header",ownerState:c,elevation:4,className:Qe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function YQ(t){return ot("MuiToolbar",t)}Ke("MuiToolbar",["root","gutters","regular","dense"]);const GQ=t=>{const{classes:e,disableGutters:n,variant:r}=t;return st({root:["root",!n&&"gutters",r]},YQ,e)},KQ=Pe("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(tt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),JQ=T.forwardRef(function(e,n){const r=ct({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=GQ(c);return _.jsx(KQ,{as:o,className:Qe(u.root,i),ref:n,ownerState:c,...l})});function eL(t){return ot("MuiTypography",t)}Ke("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const tL={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},nL=MQ(),rL=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${be(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return st(a,eL,s)},iL=Pe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${be(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(tt(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(yr()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${be(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),Ox={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},IT=T.forwardRef(function(e,n){const{color:r,...i}=ct({props:e,name:"MuiTypography"}),o=!tL[r],s=nL({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:d=!1,paragraph:f=!1,variant:h="body1",variantMapping:p=Ox,...m}=s,y={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:d,paragraph:f,variant:h,variantMapping:p},g=c||(f?"p":p[h]||Ox[h])||"span",v=rL(y);return _.jsx(iL,{as:g,ref:n,className:Qe(v.root,l),...m,ownerState:y,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...m.style}})}),oL=J8({createStyledComponent:Pe("div",{name:"MuiContainer",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`maxWidth${be(String(n.maxWidth))}`],n.fixed&&e.fixed,n.disableGutters&&e.disableGutters]}}),useThemeProps:t=>lb({props:t,name:"MuiContainer"})}),yx=T.createContext();function sL(t){return ot("MuiGrid",t)}const aL=[0,1,2,3,4,5,6,7,8,9,10],lL=["column-reverse","column","row-reverse","row"],cL=["nowrap","wrap-reverse","wrap"],uc=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Ru=Ke("MuiGrid",["root","container","item","zeroMinWidth",...aL.map(t=>`spacing-xs-${t}`),...lL.map(t=>`direction-xs-${t}`),...cL.map(t=>`wrap-xs-${t}`),...uc.map(t=>`grid-xs-${t}`),...uc.map(t=>`grid-sm-${t}`),...uc.map(t=>`grid-md-${t}`),...uc.map(t=>`grid-lg-${t}`),...uc.map(t=>`grid-xl-${t}`)]);function uL({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=fm({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const d=`calc(${l} + ${u})`;c={flexBasis:d,maxWidth:d}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function dL({theme:t,ownerState:e}){const n=fm({values:e.direction,breakpoints:t.breakpoints.values});return Yr({theme:t},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${Ru.item}`]={maxWidth:"none"}),i})}function QT({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function fL({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=fm({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=QT({breakpoints:t.breakpoints.values,values:o})),i=Yr({theme:t},o,(a,l)=>{const c=t.spacing(a);return c!=="0px"?{marginTop:t.spacing(-a),[`& > .${Ru.item}`]:{paddingTop:c}}:s!=null&&s.includes(l)?{}:{marginTop:0,[`& > .${Ru.item}`]:{paddingTop:0}}})}return i}function hL({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=fm({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=QT({breakpoints:t.breakpoints.values,values:o})),i=Yr({theme:t},o,(a,l)=>{const c=t.spacing(a);if(c!=="0px"){const u=t.spacing(-a);return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${Ru.item}`]:{paddingLeft:c}}}return s!=null&&s.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Ru.item}`]:{paddingLeft:0}}})}return i}function pL(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const mL=Pe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=pL(s,c,e));const d=[];return c.forEach(f=>{const h=n[f];h&&d.push(e[`grid-${f}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...d]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),dL,fL,hL,uL);function gL(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const vL=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=gL(o,l));const u=[];l.forEach(f=>{const h=t[f];h&&u.push(`grid-${f}-${String(h)}`)});const d={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return st(d,sL,e)},iv=T.forwardRef(function(e,n){const r=lb({props:e,name:"MuiGrid"}),{breakpoints:i}=sa(),o=Xy(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:d="row",item:f=!1,rowSpacing:h,spacing:p=0,wrap:m="wrap",zeroMinWidth:y=!1,...g}=o,v=h||p,O=l||p,b=T.useContext(yx),S=u?a||12:b,w={},C={...g};i.keys.forEach(k=>{g[k]!=null&&(w[k]=g[k],delete C[k])});const $={...o,columns:S,container:u,direction:d,item:f,rowSpacing:v,columnSpacing:O,wrap:m,zeroMinWidth:y,spacing:p,...w,breakpoints:i.keys},A=vL($);return _.jsx(yx.Provider,{value:S,children:_.jsx(mL,{ownerState:$,className:Qe(A.root,s),as:c,ref:n,...C})})});var St="colors",Fn="sizes",$e="space",OL={gap:$e,gridGap:$e,columnGap:$e,gridColumnGap:$e,rowGap:$e,gridRowGap:$e,inset:$e,insetBlock:$e,insetBlockEnd:$e,insetBlockStart:$e,insetInline:$e,insetInlineEnd:$e,insetInlineStart:$e,margin:$e,marginTop:$e,marginRight:$e,marginBottom:$e,marginLeft:$e,marginBlock:$e,marginBlockEnd:$e,marginBlockStart:$e,marginInline:$e,marginInlineEnd:$e,marginInlineStart:$e,padding:$e,paddingTop:$e,paddingRight:$e,paddingBottom:$e,paddingLeft:$e,paddingBlock:$e,paddingBlockEnd:$e,paddingBlockStart:$e,paddingInline:$e,paddingInlineEnd:$e,paddingInlineStart:$e,top:$e,right:$e,bottom:$e,left:$e,scrollMargin:$e,scrollMarginTop:$e,scrollMarginRight:$e,scrollMarginBottom:$e,scrollMarginLeft:$e,scrollMarginX:$e,scrollMarginY:$e,scrollMarginBlock:$e,scrollMarginBlockEnd:$e,scrollMarginBlockStart:$e,scrollMarginInline:$e,scrollMarginInlineEnd:$e,scrollMarginInlineStart:$e,scrollPadding:$e,scrollPaddingTop:$e,scrollPaddingRight:$e,scrollPaddingBottom:$e,scrollPaddingLeft:$e,scrollPaddingX:$e,scrollPaddingY:$e,scrollPaddingBlock:$e,scrollPaddingBlockEnd:$e,scrollPaddingBlockStart:$e,scrollPaddingInline:$e,scrollPaddingInlineEnd:$e,scrollPaddingInlineStart:$e,fontSize:"fontSizes",background:St,backgroundColor:St,backgroundImage:St,borderImage:St,border:St,borderBlock:St,borderBlockEnd:St,borderBlockStart:St,borderBottom:St,borderBottomColor:St,borderColor:St,borderInline:St,borderInlineEnd:St,borderInlineStart:St,borderLeft:St,borderLeftColor:St,borderRight:St,borderRightColor:St,borderTop:St,borderTopColor:St,caretColor:St,color:St,columnRuleColor:St,fill:St,outline:St,outlineColor:St,stroke:St,textDecorationColor:St,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:Fn,minBlockSize:Fn,maxBlockSize:Fn,inlineSize:Fn,minInlineSize:Fn,maxInlineSize:Fn,width:Fn,minWidth:Fn,maxWidth:Fn,height:Fn,minHeight:Fn,maxHeight:Fn,flexBasis:Fn,gridTemplateColumns:Fn,gridTemplateRows:Fn,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},yL=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,pd=()=>{const t=Object.create(null);return(e,n,...r)=>{const i=(o=>JSON.stringify(o,yL))(e);return i in t?t[i]:t[i]=n(e,...r)}},nh=Symbol.for("sxs.internal"),ub=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),bx=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:bL}=Object.prototype,aO=t=>t.includes("-")?t:t.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),SL=/\s+(?![^()]*\))/,xa=t=>e=>t(...typeof e=="string"?String(e).split(SL):[e]),Sx={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:xa((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t})),marginInline:xa((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t})),maxSize:xa((t,e)=>({maxBlockSize:t,maxInlineSize:e||t})),minSize:xa((t,e)=>({minBlockSize:t,minInlineSize:e||t})),paddingBlock:xa((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t})),paddingInline:xa((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t}))},ov=/([\d.]+)([^]*)/,wL=(t,e)=>t.length?t.reduce((n,r)=>(n.push(...e.map(i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i)),n),[]):e,xL=(t,e)=>t in kL&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,i,o)=>r+(i==="stretch"?`-moz-available${o};${aO(t)}:${r}-webkit-fill-available`:`-moz-fit-content${o};${aO(t)}:${r}fit-content`)+o):String(e),kL={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Co=t=>t?t+"-":"",LT=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,i,o,s,a)=>s=="$"==!!o?r:(i||s=="--"?"calc(":"")+"var(--"+(s==="$"?Co(e)+(a.includes("$")?"":Co(n))+a.replace(/\$/g,"-"):a)+")"+(i||s=="--"?"*"+(i||"")+(o||"1")+")":"")),CL=/\s*,\s*(?![^()]*\))/,PL=Object.prototype.toString,Za=(t,e,n,r,i)=>{let o,s,a;const l=(c,u,d)=>{let f,h;const p=m=>{for(f in m){const v=f.charCodeAt(0)===64,O=v&&Array.isArray(m[f])?m[f]:[m[f]];for(h of O){const b=/[A-Z]/.test(g=f)?g:g.replace(/-[^]/g,w=>w[1].toUpperCase()),S=typeof h=="object"&&h&&h.toString===PL&&(!r.utils[b]||!u.length);if(b in r.utils&&!S){const w=r.utils[b];if(w!==s){s=w,p(w(h)),s=null;continue}}else if(b in Sx){const w=Sx[b];if(w!==a){a=w,p(w(h)),a=null;continue}}if(v&&(y=f.slice(1)in r.media?"@media "+r.media[f.slice(1)]:f,f=y.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(w,C,$,A,k,N)=>{const E=ov.test(C),L=.0625*(E?-1:1),[x,z]=E?[A,C]:[C,A];return"("+($[0]==="="?"":$[0]===">"===E?"max-":"min-")+x+":"+($[0]!=="="&&$.length===1?z.replace(ov,(F,I,j)=>Number(I)+L*($===">"?1:-1)+j):z)+(k?") and ("+(k[0]===">"?"min-":"max-")+x+":"+(k.length===1?N.replace(ov,(F,I,j)=>Number(I)+L*(k===">"?-1:1)+j):N):"")+")"})),S){const w=v?d.concat(f):[...d],C=v?[...u]:wL(u,f.split(CL));o!==void 0&&i(wx(...o)),o=void 0,l(h,C,w)}else o===void 0&&(o=[[],u,d]),f=v||f.charCodeAt(0)!==36?f:`--${Co(r.prefix)}${f.slice(1).replace(/\$/g,"-")}`,h=S?h:typeof h=="number"?h&&b in EL?String(h)+"px":String(h):LT(xL(b,h??""),r.prefix,r.themeMap[b]),o[0].push(`${v?`${f} `:`${aO(f)}:`}${h}`)}}var y,g};p(c),o!==void 0&&i(wx(...o)),o=void 0};l(t,e,n)},wx=(t,e,n)=>`${n.map(r=>`${r}{`).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,EL={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},xx=t=>String.fromCharCode(t+(t>25?39:97)),zs=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=xx(n%52)+r;return xx(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),Ac=["themed","global","styled","onevar","resonevar","allvar","inline"],_L=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},TL=t=>{let e;const n=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,(o,s)=>{const{cssText:a}=o;let l="";if(a.startsWith("--sxs"))return"";if(i[s-1]&&(l=i[s-1].cssText).startsWith("--sxs")){if(!o.cssRules.length)return"";for(const c in e.rules)if(e.rules[c].group===o)return`--sxs{--sxs:${[...e.rules[c].cache].join(" ")}}${a}`;return o.cssRules.length?`${l}${a}`:""}return a}).join("")},r=()=>{if(e){const{rules:a,sheet:l}=e;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const c in a)delete a[c]}const i=Object(t).styleSheets||[];for(const a of i)if(_L(a)){for(let l=0,c=a.cssRules;c[l];++l){const u=Object(c[l]);if(u.type!==1)continue;const d=Object(c[l+1]);if(d.type!==4)continue;++l;const{cssText:f}=u;if(!f.startsWith("--sxs"))continue;const h=f.slice(14,-3).trim().split(/\s+/),p=Ac[h[0]];p&&(e||(e={sheet:a,reset:r,rules:{},toString:n}),e.rules[p]={group:d,index:l,cache:new Set(h)})}if(e)break}if(!e){const a=(l,c)=>({type:c,cssRules:[],insertRule(u,d){this.cssRules.splice(d,0,a(u,{import:3,undefined:1}[(u.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,u=>u.cssText).join("")}}`:l}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:a("","text/css"),rules:{},reset:r,toString:n}}const{sheet:o,rules:s}=e;for(let a=Ac.length-1;a>=0;--a){const l=Ac[a];if(!s[l]){const c=Ac[a+1],u=s[c]?s[c].index:o.cssRules.length;o.insertRule("@media{}",u),o.insertRule(`--sxs{--sxs:${a}}`,u),s[l]={group:o.cssRules[u+1],index:u,cache:new Set([a])}}$L(s[l])}};return r(),e},$L=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},dc=Symbol(),AL=pd(),RL=(t,e)=>AL(t,()=>(...n)=>{let r={type:null,composers:new Set};for(const i of n)if(i!=null)if(i[nh]){r.type==null&&(r.type=i[nh].type);for(const o of i[nh].composers)r.composers.add(o)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(ML(i,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),IL(t,r,e)}),ML=({variants:t,compoundVariants:e,defaultVariants:n,...r},i)=>{const o=`${Co(i.prefix)}c-${zs(r)}`,s=[],a=[],l=Object.create(null),c=[];for(const f in n)l[f]=String(n[f]);if(typeof t=="object"&&t)for(const f in t){u=l,d=f,bL.call(u,d)||(l[f]="undefined");const h=t[f];for(const p in h){const m={[f]:String(p)};String(p)==="undefined"&&c.push(f);const y=h[p],g=[m,y,!bx(y)];s.push(g)}}var u,d;if(typeof e=="object"&&e)for(const f of e){let{css:h,...p}=f;h=typeof h=="object"&&h||{};for(const y in p)p[y]=String(p[y]);const m=[p,h,!bx(h)];a.push(m)}return[o,r,s,a,l,c]},IL=(t,e,n)=>{const[r,i,o,s]=QL(e.composers),a=typeof e.type=="function"||e.type.$$typeof?(d=>{function f(){for(let h=0;hf.rules[h]={apply:p=>f[dc].push([h,p])}),f})(n):null,l=(a||n).rules,c=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,u=d=>{d=typeof d=="object"&&d||LL;const{css:f,...h}=d,p={};for(const g in o)if(delete h[g],g in d){let v=d[g];typeof v=="object"&&v?p[g]={"@initial":o[g],...v}:(v=String(v),p[g]=v!=="undefined"||s.has(g)?v:o[g])}else p[g]=o[g];const m=new Set([...i]);for(const[g,v,O,b]of e.composers){n.rules.styled.cache.has(g)||(n.rules.styled.cache.add(g),Za(v,[`.${g}`],[],t,C=>{l.styled.apply(C)}));const S=kx(O,p,t.media),w=kx(b,p,t.media,!0);for(const C of S)if(C!==void 0)for(const[$,A,k]of C){const N=`${g}-${zs(A)}-${$}`;m.add(N);const E=(k?n.rules.resonevar:n.rules.onevar).cache,L=k?l.resonevar:l.onevar;E.has(N)||(E.add(N),Za(A,[`.${N}`],[],t,x=>{L.apply(x)}))}for(const C of w)if(C!==void 0)for(const[$,A]of C){const k=`${g}-${zs(A)}-${$}`;m.add(k),n.rules.allvar.cache.has(k)||(n.rules.allvar.cache.add(k),Za(A,[`.${k}`],[],t,N=>{l.allvar.apply(N)}))}}if(typeof f=="object"&&f){const g=`${r}-i${zs(f)}-css`;m.add(g),n.rules.inline.cache.has(g)||(n.rules.inline.cache.add(g),Za(f,[`.${g}`],[],t,v=>{l.inline.apply(v)}))}for(const g of String(d.className||"").trim().split(/\s+/))g&&m.add(g);const y=h.className=[...m].join(" ");return{type:e.type,className:y,selector:c,props:h,toString:()=>y,deferredInjector:a}};return ub(u,{className:r,selector:c,[nh]:e,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},QL=t=>{let e="";const n=[],r={},i=[];for(const[o,,,,s,a]of t){e===""&&(e=o),n.push(o),i.push(...a);for(const l in s){const c=s[l];(r[l]===void 0||c!=="undefined"||a.includes(c))&&(r[l]=c)}}return[e,n,r,new Set(i)]},kx=(t,e,n,r)=>{const i=[];e:for(let[o,s,a]of t){if(a)continue;let l,c=0,u=!1;for(l in o){const d=o[l];let f=e[l];if(f!==d){if(typeof f!="object"||!f)continue e;{let h,p,m=0;for(const y in f){if(d===String(f[y])){if(y!=="@initial"){const g=y.slice(1);(p=p||[]).push(g in n?n[g]:y.replace(/^@media ?/,"")),u=!0}c+=m,h=!0}++m}if(p&&p.length&&(s={["@media "+p.join(", ")]:s}),!h)continue e}}}(i[c]=i[c]||[]).push([r?"cv":`${l}-${o[l]}`,s,u])}return i},LL={},jL=pd(),NL=(t,e)=>jL(t,()=>(...n)=>{const r=()=>{for(let i of n){i=typeof i=="object"&&i||{};let o=zs(i);if(!e.rules.global.cache.has(o)){if(e.rules.global.cache.add(o),"@import"in i){let s=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let a of[].concat(i["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,e.sheet.insertRule(`@import ${a};`,s++);delete i["@import"]}Za(i,[],[],t,s=>{e.rules.global.apply(s)})}}return""};return ub(r,{toString:r})}),DL=pd(),zL=(t,e)=>DL(t,()=>n=>{const r=`${Co(t.prefix)}k-${zs(n)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const o=[];Za(n,[],[],t,a=>o.push(a));const s=`@keyframes ${r}{${o.join("")}}`;e.rules.global.apply(s)}return r};return ub(i,{get name(){return i()},toString:i})}),BL=class{constructor(e,n,r,i){this.token=e==null?"":String(e),this.value=n==null?"":String(n),this.scale=r==null?"":String(r),this.prefix=i==null?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Co(this.prefix)+Co(this.scale)+this.token}toString(){return this.computedValue}},FL=pd(),ZL=(t,e)=>FL(t,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const i=`.${n=(n=typeof n=="string"?n:"")||`${Co(t.prefix)}t-${zs(r)}`}`,o={},s=[];for(const l in r){o[l]={};for(const c in r[l]){const u=`--${Co(t.prefix)}${l}-${c}`,d=LT(String(r[l][c]),t.prefix,l);o[l][c]=new BL(c,d,l,t.prefix),s.push(`${u}:${d}`)}}const a=()=>{if(s.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const l=`${r===t.theme?":root,":""}.${n}{${s.join(";")}}`;e.rules.themed.apply(l)}return n};return{...o,get className(){return a()},selector:i,toString:a}}),VL=pd(),UL=t=>{let e=!1;const n=VL(t,r=>{e=!0;const i="prefix"in(r=typeof r=="object"&&r||{})?String(r.prefix):"",o=typeof r.media=="object"&&r.media||{},s=typeof r.root=="object"?r.root||null:globalThis.document||null,a=typeof r.theme=="object"&&r.theme||{},l={prefix:i,media:o,theme:a,themeMap:typeof r.themeMap=="object"&&r.themeMap||{...OL},utils:typeof r.utils=="object"&&r.utils||{}},c=TL(s),u={css:RL(l,c),globalCss:NL(l,c),keyframes:zL(l,c),createTheme:ZL(l,c),reset(){c.reset(),u.theme.toString()},theme:{},sheet:c,config:l,prefix:i,getCssText:c.toString,toString:c.toString};return String(u.theme=u.createTheme(a)),u});return e||n.reset(),n},Cx=Object.prototype.hasOwnProperty;function Px(t,e,n){for(n of t.keys())if(Kc(n,e))return n}function Kc(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Kc(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=Px(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=Px(e,i),!i)||!Kc(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(Cx.call(t,n)&&++r&&!Cx.call(e,n)||!(n in e)||!Kc(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const qL="modulepreload",WL=function(t){return"/"+t},Ex={},sv=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=WL(l),l in Ex)return;Ex[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":qL,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};var XL=/(%?)(%([sdjo]))/g;function HL(t,e){switch(e){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const n=JSON.stringify(t);return n==="{}"||n==="[]"||/^\[object .+?\]$/.test(n)?t:n}}}function lO(t,...e){if(e.length===0)return t;let n=0,r=t.replace(XL,(i,o,s,a)=>{const l=e[n],c=HL(l,a);return o?i:(n++,c)});return n{if(!t)throw new KL(e,...n)};jT.as=(t,e,n,...r)=>{if(!e)throw t.prototype.name!=null?new t(lO(n,r)):t(lO(n,r))};var cO=function(t,e){return cO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},cO(t,e)};function Aee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");cO(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Va=function(){return Va=Object.assign||function(e){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]":" ",c=a.lineNumber.toString().length===n?"".concat(a.lineNumber):" ".concat(a.lineNumber),u=a.highlight?` `+" ".repeat(o)+"^":"";return s+` `+l+" "+c+" | "+a.content+u},"")}function c9(t,e,n,r){return"".concat(t,": ").concat(e).concat(n,` `).concat(r)}var Xs=function(t){return typeof t=="string"?t.startsWith("/")?t:"/".concat(t):Array.isArray(t)?t.map(function(e){return e.startsWith("/")?e:"/".concat(e)}):typeof t=="object"&&t!==null?Object.entries(t).reduce(function(e,n){var r=n[0],i=n[1],o=r.startsWith("/")?r:"/".concat(r);return e[o]=i,e},{}):null};function u9(t,e,n){var r;return n===void 0&&(n={}),JL(this,void 0,void 0,function(){var i,o,s;return e9(this,function(a){switch(a.label){case 0:switch(i=(r=e.template)!==null&&r!==void 0?r:"parcel",s=i,s){case"node":return[3,1];case"static":return[3,3]}return[3,5];case 1:return[4,sv(()=>import("./index-Ls9WDZKZ.js"),__vite__mapDeps([0,1,2])).then(function(l){return l.SandpackNode})];case 2:return o=a.sent(),[3,7];case 3:return[4,sv(()=>import("./index-599aeaf7-CcX4Lt6n.js"),__vite__mapDeps([3,2,1])).then(function(l){return l.SandpackStatic})];case 4:return o=a.sent(),[3,7];case 5:return[4,sv(()=>import("./index-DZpWGLPZ.js"),__vite__mapDeps([4,1])).then(function(l){return l.SandpackRuntime})];case 6:o=a.sent(),a.label=7;case 7:return[2,new o(t,e,n)]}})})}class at{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Ol(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Zi.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ol(this,e,n);let r=[];return this.decompose(e,n,r,0),Zi.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Jc(this),o=new Jc(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Jc(this,e)}iterRange(e,n=this.length){return new NT(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new DT(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?at.empty:e.length<=32?new Xt(e):Zi.from(Xt.split(e,[]))}}class Xt extends at{constructor(e,n=d9(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new f9(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Xt($x(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=rh(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Xt(a,s.length+o.length));else{let l=a.length>>1;r.push(new Xt(a.slice(0,l)),new Xt(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Xt))return super.replace(e,n,r);[e,n]=Ol(this,e,n);let i=rh(this.text,rh(r.text,$x(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Xt(i,o):Zi.from(Xt.split(i,[]),o)}sliceString(e,n=this.length,r=` `){[e,n]=Ol(this,e,n);let i="";for(let o=0,s=0;o<=n&&se&&s&&(i+=r),eo&&(i+=a.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Xt(r,i)),r=[],i=-1);return i>-1&&n.push(new Xt(r,i)),n}}class Zi extends at{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=Ol(this,e,n),r.lines=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Zi(u,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` `){[e,n]=Ol(this,e,n);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Zi))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Xt(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function d(h){let p;if(h.lines>o&&h instanceof Zi)for(let m of h.children)d(m);else h.lines>s&&(l>s||!l)?(f(),a.push(h)):h instanceof Xt&&l&&(p=u[u.length-1])instanceof Xt&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Xt(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&f(),l+=h.lines,c+=h.length+1,u.push(h))}function f(){l!=0&&(a.push(u.length==1?u[0]:Zi.from(u,c)),c=-1,l=u.length=0)}for(let h of e)d(h);return f(),a.length==1?a[0]:new Zi(a,n)}}at.empty=new Xt([""],0);function d9(t){let e=-1;for(let n of t)e+=n.length+1;return e}function rh(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Xt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Xt?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Xt){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Xt?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class NT{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Jc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class DT{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},Jc.prototype[Symbol.iterator]=NT.prototype[Symbol.iterator]=DT.prototype[Symbol.iterator]=function(){return this});class f9{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ol(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let rl="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return rl[e-1]<=t;return!1}function Ax(t){return t>=127462&&t<=127487}const Rx=8205;function Vn(t,e,n=!0,r=!0){return(n?zT:p9)(t,e,r)}function zT(t,e,n){if(e==t.length)return e;e&&BT(t.charCodeAt(e))&&FT(t.charCodeAt(e-1))&&e--;let r=Ji(t,e);for(e+=yl(r);e=0&&Ax(Ji(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function p9(t,e,n){for(;e>0;){let r=zT(t,e-2,n);if(r=56320&&t<57344}function FT(t){return t>=55296&&t<56320}function Ji(t,e){let n=t.charCodeAt(e);if(!FT(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return BT(r)?(n-55296<<10)+(r-56320)+65536:n}function m9(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function yl(t){return t<65536?1:2}const uO=/\r\n?|\n/;var Mn=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Mn||(Mn={}));class eo{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=a}else{if(r!=Mn.Simple&&c>=e&&(r==Mn.TrackDel&&ie||r==Mn.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new eo(e)}static create(e){return new eo(e)}}class cn extends eo{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return dO(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return fO(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&Xo(r,n,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sf||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let p=h?typeof h=="string"?at.of(h.split(r||uO)):h:at.empty,m=p.length;if(d==f&&m==0)return;ds&&$n(i,d-s,-1),$n(i,f-d,m),Xo(o,i,p),s=f}}return c(e),l(!a),a}static empty(e){return new cn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Xo(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,d),i=c,o=u}}}function fO(t,e,n,r=!1){let i=[],o=r?[]:null,s=new Mu(t),a=new Mu(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);$n(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let d=Math.min(u,a.len);c+=d,u-=d,a.forward(d)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class Mu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?at.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?at.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Is{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Is(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return ge.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return ge.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ge.range(e.anchor,e.head)}static create(e,n,r){return new Is(e,n,r)}}class ge{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:ge.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ge(e.ranges.map(n=>Is.fromJSON(n)),e.main)}static single(e,n=e){return new ge([ge.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;io.head?ge.range(l,a):ge.range(a,l))}}return new ge(e,n)}}function VT(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let db=0;class Le{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=db++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new Le(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:fb),!!e.static,e.enables)}of(e){return new ih([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ih(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new ih(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function fb(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class ih{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=db++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:((n=e[d.id])!==null&&n!==void 0?n:1)&1||u.push(e[d.id]);return{create(d){return d.values[s]=r(d),1},update(d,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||hO(d,u)){let h=r(d);if(a?!Mx(h,d.values[s],i):!i(h,d.values[s]))return d.values[s]=h,1}return 0},reconfigure:(d,f)=>{let h,p=f.config.address[o];if(p!=null){let m=ep(f,p);if(this.dependencies.every(y=>y instanceof Le?f.facet(y)===d.facet(y):y instanceof Ci?f.field(y,!1)==d.field(y,!1):!0)||(a?Mx(h=r(d),m,i):i(h=r(d),m)))return d.values[s]=m,0}else h=r(d);return d.values[s]=h,1}}}}function Mx(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ix).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,Ix.of({field:this,create:e})]}get extension(){return this}}const $s={lowest:4,low:3,default:2,high:1,highest:0};function fc(t){return e=>new UT(e,t)}const Im={highest:fc($s.highest),high:fc($s.high),default:fc($s.default),low:fc($s.low),lowest:fc($s.lowest)};class UT{constructor(e,n){this.inner=e,this.prec=n}}class Qm{of(e){return new pO(this,e)}reconfigure(e){return Qm.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class pO{constructor(e,n){this.compartment=e,this.inner=n}}class Jh{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let f of v9(e,n,s))f instanceof Ci?i.push(f):(o[f.facet.id]||(o[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of i)a[f.id]=c.length<<1,c.push(h=>f.slot(h));let u=r==null?void 0:r.config.facets;for(let f in o){let h=o[f],p=h[0].facet,m=u&&u[f]||[];if(h.every(y=>y.type==0))if(a[p.id]=l.length<<1|1,fb(m,h))l.push(r.facet(p));else{let y=p.combine(h.map(g=>g.value));l.push(r&&p.compare(y,r.facet(p))?r.facet(p):y)}else{for(let y of h)y.type==0?(a[y.id]=l.length<<1|1,l.push(y.value)):(a[y.id]=c.length<<1,c.push(g=>y.dynamicSlot(g)));a[p.id]=c.length<<1,c.push(y=>g9(y,p,h))}}let d=c.map(f=>f(a));return new Jh(e,s,d,a,l,o)}}function v9(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof pO&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof pO){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof UT)o(s.inner,s.prec);else if(s instanceof Ci)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof ih)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,$s.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,$s.default),r.reduce((s,a)=>s.concat(a))}function eu(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function ep(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const qT=Le.define(),mO=Le.define({combine:t=>t.some(e=>e),static:!0}),WT=Le.define({combine:t=>t.length?t[0]:void 0,static:!0}),XT=Le.define(),HT=Le.define(),YT=Le.define(),GT=Le.define({combine:t=>t.length?t[0]:!1});class wi{constructor(e,n){this.type=e,this.value=n}static define(){return new O9}}class O9{of(e){return new wi(this,e)}}class y9{constructor(e){this.map=e}of(e){return new wt(this,e)}}class wt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new wt(this.type,n)}is(e){return this.type==e}static define(e={}){return new y9(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}wt.reconfigure=wt.define();wt.appendConfig=wt.define();class sn{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&VT(r,n.newLength),o.some(a=>a.type==sn.time)||(this.annotations=o.concat(sn.time.of(Date.now())))}static create(e,n,r,i,o,s){return new sn(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(sn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}sn.time=wi.define();sn.userEvent=wi.define();sn.addToHistory=wi.define();sn.remote=wi.define();function b9(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r=t[r]))o=t[r++],s=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof sn?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof sn?t=o[0]:t=JT(e,il(o),!1)}return t}function w9(t){let e=t.startState,n=e.facet(YT),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=KT(r,gO(e,o,t.changes.newLength),!0))}return r==t?t:sn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const x9=[];function il(t){return t==null?x9:Array.isArray(t)?t:[t]}var Br=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Br||(Br={}));const k9=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let vO;try{vO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function C9(t){if(vO)return vO.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||k9.test(n)))return!0}return!1}function P9(t){return e=>{if(!/\S/.test(e))return Br.Space;if(C9(e))return Br.Word;for(let n=0;n-1)return Br.Word;return Br.Other}}class mt{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(wt.reconfigure)?(n=null,r=a.value):a.is(wt.appendConfig)&&(n=null,r=il(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=Jh.resolve(r,i,this),o=new mt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(mO)?e.newSelection:e.newSelection.asSingle();new mt(n,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:ge.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=il(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return mt.create({doc:e.doc,selection:ge.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Jh.resolve(e.extensions||[],new Map),r=e.doc instanceof at?e.doc:at.of((e.doc||"").split(n.staticFacet(mt.lineSeparator)||uO)),i=e.selection?e.selection instanceof ge?e.selection:ge.single(e.selection.anchor,e.selection.head):ge.single(0);return VT(i,r.length),n.staticFacet(mO)||(i=i.asSingle()),new mt(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(mt.tabSize)}get lineBreak(){return this.facet(mt.lineSeparator)||` `}get readOnly(){return this.facet(GT)}phrase(e,...n){for(let r of this.facet(mt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(qT))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return P9(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=Vn(n,s,!1);if(o(n.slice(l,s))!=Br.Word)break;s=l}for(;at.length?t[0]:4});mt.lineSeparator=WT;mt.readOnly=GT;mt.phrases=Le.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});mt.languageData=qT;mt.changeFilter=XT;mt.transactionFilter=HT;mt.transactionExtender=YT;Qm.reconfigure=wt.define();function Lm(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Hs{eq(e){return this==e}range(e,n=e){return OO.create(e,n,this)}}Hs.prototype.startSide=Hs.prototype.endSide=0;Hs.prototype.point=!1;Hs.prototype.mapMode=Mn.TrackDel;let OO=class e${constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new e$(e,n,r)}};function yO(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class hb{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||f==h&&c.startSide>0&&c.endSide<=0)continue;(h-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,h-f)),r.push(c),i.push(f-s),o.push(h-s))}return{mapped:r.length?new hb(i,o,r,a):null,pos:s}}}class gt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new gt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(yO)),this.isEmpty)return n.length?gt.of(n):this;let a=new t$(this,null,-1).goto(0),l=0,c=[],u=new bl;for(;a.value||l=0){let d=n[l++];u.addInner(d.from,d.to,d.value)||c.push(d)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Iu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Iu.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=o),a=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=o),l=Qx(s,a,r),c=new hc(s,l,o),u=new hc(a,l,o);r.iterGaps((d,f,h)=>Lx(c,d,u,f,h,i)),r.empty&&r.length==0&&Lx(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=Qx(o,s),l=new hc(o,a,0).goto(r),c=new hc(s,a,0).goto(r);for(;;){if(l.to!=c.to||!bO(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new hc(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),d=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new bl;for(let i of e instanceof OO?[e]:n?E9(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return gt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=gt.empty;i=i.nextLayer)n=new gt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}gt.empty=new gt([],[],null,-1);function E9(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(yO);e=r}return t}gt.empty.nextLayer=gt.empty;class bl{finishChunk(e){this.chunks.push(new hb(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new bl)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(gt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=gt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function Qx(t,e,n){let r=new Map;for(let o of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new t$(s,n,r,o));return i.length==1?i[0]:new Iu(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)lv(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)lv(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),lv(this.heap,0)}}}function lv(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class hc{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Iu.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){sf(this.active,e),sf(this.activeTo,e),sf(this.activeRank,e),this.minActive=jx(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;af(this.active,n,r),af(this.activeTo,n,i),af(this.activeRank,n,o),e&&af(e,n,this.cursor.from),this.minActive=jx(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&sf(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function Lx(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,d=Math.min(u,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&bO(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,d,t.point,n.point):d>a&&!bO(t.active,n.active)&&o.compareRange(a,d,t.active,n.active),u>s)break;a=u,c<=0&&t.next(),c>=0&&n.next()}}function bO(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function jx(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=Vn(t,i)}return r===!0?-1:t.length}const SO="ͼ",Nx=typeof Symbol>"u"?"__"+SO:Symbol.for(SO),wO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Dx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class us{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>s.map(y=>m.replace(/&/,y))).reduce((m,y)=>m.concat(y)),p,l);else if(p&&typeof p=="object"){if(!d)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,f)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||f)&&l.push((r&&!d&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=Dx[Nx]||1;return Dx[Nx]=e+1,SO+e.toString(36)}static mount(e,n,r){let i=e[wO],o=r&&r.nonce;i?o&&i.setNonce(o):i=new T9(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let zx=new Map;class T9{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=zx.get(r);if(o)return e[wO]=o;this.sheet=new i.CSSStyleSheet,zx.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[wO]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$9=typeof navigator<"u"&&/Mac/.test(navigator.platform),A9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Sn=0;Sn<10;Sn++)ds[48+Sn]=ds[96+Sn]=String(Sn);for(var Sn=1;Sn<=24;Sn++)ds[Sn+111]="F"+Sn;for(var Sn=65;Sn<=90;Sn++)ds[Sn]=String.fromCharCode(Sn+32),Qu[Sn]=String.fromCharCode(Sn);for(var cv in ds)Qu.hasOwnProperty(cv)||(Qu[cv]=ds[cv]);function R9(t){var e=$9&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||A9&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Qu:ds)[t.keyCode]||t.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}function Lu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function xO(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function oh(t,e){if(!e.anchorNode)return!1;try{return xO(t,e.anchorNode)}catch{return!1}}function ju(t){return t.nodeType==3?Gs(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function tu(t,e,n,r){return n?Bx(t,e,n,r,-1)||Bx(t,e,n,r,1):!1}function Ys(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function tp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Bx(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ro(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=Ys(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?ro(t):0}else return!1}}function ro(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function jm(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function M9(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function n$(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function I9(t,e,n,r,i,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,d=!1;u&&!d;)if(u.nodeType==1){let f,h=u==l.body,p=1,m=1;if(h)f=M9(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let v=u.getBoundingClientRect();({scaleX:p,scaleY:m}=n$(u,v)),f={left:v.left,right:v.left+u.clientWidth*p,top:v.top,bottom:v.top+u.clientHeight*m}}let y=0,g=0;if(i=="nearest")e.top0&&e.bottom>f.bottom+g&&(g=e.bottom-f.bottom+g+s)):e.bottom>f.bottom&&(g=e.bottom-f.bottom+s,n<0&&e.top-g0&&e.right>f.right+y&&(y=e.right-f.right+y+o)):e.right>f.right&&(y=e.right-f.right+o,n<0&&e.lefti.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class L9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ro(n):0),r,Math.min(e.focusOffset,r?ro(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let ka=null;function r$(t){if(t.setActive)return t.setActive();if(ka)return t.focus(ka);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ka==null?{get preventScroll(){return ka={preventScroll:!0},!0}}:void 0),!ka){ka=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function s$(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ro(n)}else if(n.parentNode&&!tp(n))r=Ys(n),n=n.parentNode;else return null}}function a$(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return d.domBoundsAround(e,n,c);if(f>=e&&i==-1&&(i=l,o=c),c>n&&d.dom.parentNode==this.dom){s=l,a=u;break}u=f,c=f+d.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=pb){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function c$(t,e,n,r,i,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,d=o.length?o[o.length-1]:null,f=d?d.breakAfter:s;if(!(e==r&&u&&!s&&!f&&o.length<2&&u.merge(n,i,o.length?d:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var Ae={mac:qx||/Mac/.test(er.platform),windows:/Win/.test(er.platform),linux:/Linux|X11/.test(er.platform),ie:Nm,ie_version:d$?kO.documentMode||6:PO?+PO[1]:CO?+CO[1]:0,gecko:Vx,gecko_version:Vx?+(/Firefox\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,chrome:!!uv,chrome_version:uv?+uv[1]:0,ios:qx,android:/Android\b/.test(er.userAgent),webkit:Ux,safari:f$,webkit_version:Ux?+(/\bAppleWebKit\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,tabSize:kO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const D9=256;class xi extends _t{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof xi)||this.length-(n-e)+r.length>D9||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new xi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new In(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return z9(this.dom,e,n)}}class Po extends _t{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(i$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Po&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Po(this.mark,n,s)}domAtPos(e){return h$(this,e)}coordsAt(e,n){return m$(this,e,n)}}function z9(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?Ae.chrome||Ae.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return Ae.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?jm(l,s<0):l||null}class Qs extends _t{static create(e,n,r){return new Qs(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Qs.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof Qs)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?In.before(this.dom):In.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?In.before(this.dom):In.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return at.empty}get isHidden(){return!0}}xi.prototype.children=Qs.prototype.children=Sl.prototype.children=pb;function h$(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof Po&&i.length&&(r=i[i.length-1])instanceof Po&&r.mark.eq(e.mark)?p$(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function m$(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let d=0,f=0;d=u&&(h.children.length?a(h,u-f):(!o||o.isHidden&&n>0)&&(p>u||f==p&&h.getSide()>0)?(o=h,s=u-f):(f-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function _O(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function F9(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new fs(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=g$(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new fs(e,r,i,n,e.widget||null,!0)}static line(e){return new vd(e)}static set(e,n=!1){return gt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ge.none=gt.empty;class gd extends Ge{constructor(e){let{start:n,end:r}=g$(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof gd&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&np(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}gd.prototype.point=!1;class vd extends Ge{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof vd&&this.spec.class==e.spec.class&&np(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}vd.prototype.mapMode=Mn.TrackBefore;vd.prototype.point=!0;class fs extends Ge{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?Mn.TrackBefore:Mn.TrackAfter:Mn.TrackDel}get type(){return this.startSide!=this.endSide?Ur.WidgetRange:this.startSide<=0?Ur.WidgetBefore:Ur.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof fs&&Z9(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}fs.prototype.point=!0;function g$(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function Z9(t,e){return t==e||!!(t&&e&&t.compare(e))}function TO(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class nn extends _t{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof nn))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),u$(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new nn;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){np(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){p$(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=EO(n,this.attrs||{})),r&&(this.attrs=EO({class:r},this.attrs||{}))}domAtPos(e){return h$(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(i$(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(_O(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&_t.get(i)instanceof Po;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=_t.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!Ae.ios||!this.children.some(o=>o instanceof xi))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof xi)||/[^ -~]/.test(r.text))return null;let i=ju(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=m$(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof nn)return o;if(s>n)break}i=s+o.breakAfter}return null}}class go extends _t{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof go)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class $O extends Fl{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class nu{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof go&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new nn),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(lf(new Sl(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof go)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(lf(new xi(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof fs){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof fs)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new go(r.widget||wl.block,a,r));else{let l=Qs.create(r.widget||wl.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(d.append(lf(new Sl(1),i),o),o=i.length+Math.max(0,o-i.length)),d.append(lf(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new nu(e,n,r,o);return s.openEnd=gt.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function lf(t,e){for(let n of e)t=new Po(n,[t],t.length);return t}class wl extends Fl{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}wl.inline=new wl("span");wl.block=new wl("div");var fn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(fn||(fn={}));const Ks=fn.LTR,mb=fn.RTL;function v$(t){let e=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function y$(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;m-=3)if(Ai[m+1]==-h){let y=Ai[m+2],g=y&2?i:y&4?y&1?o:i:0;g&&(Et[d]=Et[Ai[m]]=g),a=m;break}}else{if(Ai.length==189)break;Ai[a++]=d,Ai[a++]=f,Ai[a++]=l}else if((p=Et[d])==2||p==1){let m=p==i;l=m?0:1;for(let y=a-3;y>=0;y-=3){let g=Ai[y+2];if(g&2)break;if(m)Ai[y+2]|=2;else{if(g&4)break;Ai[y+2]|=4}}}}}function H9(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=il;)p==y&&(p=n[--m].from,y=m?n[m-1].to:t),Et[--p]=h;l=u}else o=c,l++}}}function RO(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Ho(l,m.from,h));let y=m.direction==Ks!=!(h%2);MO(t,y?r+1:r,i,m.inner,m.from,m.to,s),l=m.to}p=m.to}else{if(p==n||(u?Et[p]!=a:Et[p]==a))break;p++}f?RO(t,l,p,r+1,i,f,s):le;){let u=!0,d=!1;if(!c||l>o[c-1].to){let m=Et[l-1];m!=a&&(u=!1,d=m==16)}let f=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(d)break e;let m=o[--c];if(!u)for(let y=m.from,g=c;;){if(y==e)break e;if(g&&o[g-1].to==y)y=o[--g].from;else{if(Et[y-1]==a)break e;break}}if(f)f.push(m);else{m.toEt.length;)Et[Et.length]=256;let r=[],i=e==Ks?0:1;return MO(t,i,i,n,0,t.length,r),r}function b$(t){return[new Ho(0,t,0)]}let S$="";function G9(t,e,n,r,i){var o;let s=r.head-t.from,a=Ho.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let f=a+=i?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!i,n),c=l.side(i,n)}let u=Vn(t.text,s,l.forward(i,n));(ul.to)&&(u=c),S$=t.text.slice(Math.min(s,u),Math.max(s,u));let d=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return d&&u==c&&d.level+(i?0:1)t.some(e=>e)}),J9=Le.define({combine:t=>t.some(e=>e)}),T$=Le.define();class sl{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new sl(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new sl(ge.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const cf=wt.define({map:(t,e)=>t.map(e)}),$$=wt.define();function qi(t,e,n){let r=t.facet(C$);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const zo=Le.define({combine:t=>t.length?t[0]:!0});let ej=0;const Rc=Le.define();class Gr{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Gr(ej++,e,r,i,a=>{let l=[Rc.of(a)];return s&&l.push(Nu.of(c=>{let u=c.plugin(a);return u?s(u):Ge.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Gr.define(r=>new e(r),n)}}class dv{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(qi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){qi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){qi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const A$=Le.define(),Ob=Le.define(),Nu=Le.define(),R$=Le.define(),yb=Le.define(),M$=Le.define();function Xx(t,e){let n=t.state.facet(M$);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return gt.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,d=i;for(let f=a.length-1;f>=0;f--,l--){let h=a[f].spec.bidiIsolate,p;if(h==null&&(h=K9(e.text,c,u)),l>0&&d.length&&(p=d[d.length-1]).to==c&&p.direction==h)p.to=u,d=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};d.push(m),d=m.inner}}}}),i}const I$=Le.define();function Q$(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(I$)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Mc=Le.define();class qr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new qr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new qr(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class rp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=cn.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new qr(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new rp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Hx extends _t{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ge.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new nn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new qr(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!aj(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?nj(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new qr(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Ae.ie||Ae.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=oj(s,a,e.changes);return r=qr.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Ae.chrome||Ae.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:d}=a,f,h,p,m;if(r&&r.range.fromBu){let b=nu.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),S=nu.build(this.view.state.doc,r.range.toB,d,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,m=S.openEnd;let w=this.compositionView(r);S.breakAtStart?w.breakAfter=1:S.content.length&&w.merge(w.length,w.length,S.content[0],!1,S.openStart,0)&&(w.breakAfter=S.content[0].breakAfter,S.content.shift()),b.content.length&&w.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),f=b.content.concat(w).concat(S.content)}else({content:f,breakAtStart:h,openStart:p,openEnd:m}=nu.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:y,off:g}=o.findPos(c,1),{i:v,off:O}=o.findPos(l,-1);c$(this,v,O,y,g,f,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is($$)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new xi(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Po(i,[n],n.length);let r=new nn;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=_t.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&oh(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Ae.gecko&&a.empty&&!this.hasComposition&&tj(l)){let d=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(d,l.node.childNodes[l.offset]||null)),l=c=new In(d,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!tu(l.node,l.offset,u.anchorNode,u.anchorOffset)||!tu(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{Ae.android&&Ae.chrome&&this.dom.contains(u.focusNode)&&sj(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Lu(this.view.root);if(d)if(a.empty){if(Ae.gecko){let f=rj(l.node,l.offset);if(f&&f!=3){let h=(f==1?s$:a$)(l.node,l.offset);h&&(l=new In(h.node,h.offset))}}d.collapse(l.node,l.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(l.node,l.offset);try{d.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new In(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new In(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&tu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Lu(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=nn.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let o=_t.get(n.childNodes[i]);o instanceof nn&&(r=o.domAtPos(o.length))}return r?new In(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=_t.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof nn&&!(r instanceof nn&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof go&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof nn))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof xi))return null;let o=Vn(i.text,r);if(o==r)return null;let s=Gs(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==fn.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=d.dom.getBoundingClientRect();if(n.push(h.height),s){let p=d.dom.lastChild,m=p?ju(p):[];if(m.length){let y=m[m.length-1],g=l?y.right-h.left:h.right-y.left;g>a&&(a=g,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+d.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?fn.RTL:fn.LTR}measureTextSize(){for(let o of this.children)if(o instanceof nn){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=ju(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new l$(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ge.replace({widget:new $O(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ge.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Nu).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(R$).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(gt.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=Q$(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;I9(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function lj(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return ge.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=Vn(i.text,o,!1):a=Vn(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=Vn(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;at?e.left-t:Math.max(0,t-e.right)}function uj(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function fv(t,e){return t.tope.top+1}function Yx(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function QO(t,e,n){let r,i,o,s,a=!1,l,c,u,d;for(let p=t.firstChild;p;p=p.nextSibling){let m=ju(p);for(let y=0;yO||s==O&&o>v){r=p,i=g,o=v,s=O;let b=O?n0?y0)}v==0?n>g.bottom&&(!u||u.bottomg.top)&&(c=p,d=g):u&&fv(u,g)?u=Gx(u,g.bottom):d&&fv(d,g)&&(d=Yx(d,g.top))}}if(u&&u.bottom>=n?(r=l,i=u):d&&d.top<=n&&(r=c,i=d),!r)return{node:t,offset:0};let f=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return Kx(r,f,n);if(a&&r.contentEditable!="false")return QO(r,f,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function Kx(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&d=(u.left+u.right)/2,h=f;if((Ae.chrome||Ae.gecko)&&Gs(t,a).getBoundingClientRect().left==u.right&&(h=!f),d<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),o=d}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function j$(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:d}=e,f=d-a;if(f<0)return 0;if(f>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,S=!1;l=t.elementAtHeight(f),l.type!=Ur.Text;)for(;f=r>0?l.bottom+b:l.top-b,!(f>=0&&f<=c);){if(S)return n?null:0;S=!0,r=-r}d=a+f;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:Jx(t,s,l,u,d);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,y=m.elementFromPoint(u,d);y&&!t.contentDOM.contains(y)&&(y=null),y||(u=Math.max(s.left+1,Math.min(s.right-1,u)),y=m.elementFromPoint(u,d),y&&!t.contentDOM.contains(y)&&(y=null));let g,v=-1;if(y&&((i=t.docView.nearest(y))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,d);b&&({offsetNode:g,offset:v}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,d);b&&({startContainer:g,startOffset:v}=b,(!t.contentDOM.contains(g)||Ae.safari&&dj(g,v,u)||Ae.chrome&&fj(g,v,u))&&(g=void 0))}g&&(v=Math.min(ro(g),v))}if(!g||!t.docView.dom.contains(g)){let b=nn.find(t.docView,h);if(!b)return f>l.top+l.height/2?l.to:l.from;({node:g,offset:v}=QO(b.dom,u,d))}let O=t.docView.nearest(g);if(!O)return null;if(O.isWidget&&((o=O.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=O.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+_9(s,o,t.state.tabSize)}function dj(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Gs(t,r-1,r).getBoundingClientRect().left>n}function fj(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():Gs(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function hj(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==Ur.Text))return r}return n}function pj(t,e,n,r){let i=hj(t,e.head),o=!r||i.type!=Ur.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==fn.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return ge.cursor(l,n?-1:1)}return ge.cursor(n?i.to:i.from,n?-1:1)}function ek(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=G9(i,o,s,a,n),u=S$;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=` `,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function mj(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==Br.Space&&(i=s),i==s}}function gj(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return ge.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let d=l.left+s,f=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(f+h)*o,m=j$(t,{x:d,y:p},!1,o);if(pl.bottom||(o<0?mi)){let y=t.docView.coordsForChar(m),g=!y||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:ge.cursor(r,ro)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=_t.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Oj(e,r.node,r.offset)?n:0))}}function Oj(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:wj(e),l=new vj(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=xj(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!xO(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!xO(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((Ae.ios||Ae.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||Ae.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(Ae.mac||Ae.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:at.of([" "])}):Ae.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` `&&t.lineWrapping&&(r&&(r=ge.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:at.of([" "])}),n)return bb(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function bb(t,e,n,r=-1){if(Ae.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Ae.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ol(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&ol(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&ol(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=bj(t,e,n));return t.state.facet(P$).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function bj(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,d=n&&L$(t,n.main.head);if(d){let p=e.insert.length-(e.to-e.from);u={from:d.from,to:d.to-p}}else u=t.state.doc.lineAt(o.head);let f=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let m=p.to-f,y=m-c.length;if(p.to-p.from!=h||t.state.sliceDoc(y,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let g=i.changes({from:y,to:m,insert:e.insert}),v=p.to-o.to;return{changes:g,range:l?ge.range(Math.max(0,l.anchor+v),Math.max(0,l.head+v)):p.map(g)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Sj(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function wj(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new tk(n,r)),(i!=n||o!=r)&&e.push(new tk(i,o))),e}function xj(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?ge.single(n+e,r+e):null}class kj{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ae.safari&&e.contentDOM.addEventListener("input",()=>null),Ae.gecko&&zj(e.contentDOM.ownerDocument)}handleEvent(e){!Rj(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Cj(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&z$.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ae.android&&Ae.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ae.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=D$.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Pj.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:Ae.safari&&!Ae.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function nk(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){qi(n.state,i)}}}function Cj(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(nk(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(nk(r.value,s))}}for(let r in ki)n(r).handlers.push(ki[r]);for(let r in Kr)n(r).observers.push(Kr[r]);return e}const D$=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Pj="dthko",z$=[16,17,18,20,91,92,224,225],uf=6;function df(t){return Math.max(0,t)*.7+8}function Ej(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class _j{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Q9(e.contentDOM),this.atoms=e.state.facet(yb).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(mt.allowMultipleSelections)&&Tj(e,n),this.dragging=Aj(e,n)&&Z$(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Ej(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Q$(this.view);e.clientX-l.left<=i+uf?n=-df(i-e.clientX):e.clientX+l.right>=s-uf&&(n=df(e.clientX-s)),e.clientY-l.top<=o+uf?r=-df(o-e.clientY):e.clientY+l.bottom>=a-uf&&(r=df(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rn.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Tj(t,e){let n=t.state.facet(w$);return n.length?n[0](e):Ae.mac?e.metaKey:e.ctrlKey}function $j(t,e){let n=t.state.facet(x$);return n.length?n[0](e):Ae.mac?!e.altKey:!e.ctrlKey}function Aj(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Lu(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function Rj(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=_t.get(n))&&r.ignoreEvent(e))return!1;return!0}const ki=Object.create(null),Kr=Object.create(null),B$=Ae.ie&&Ae.ie_version<15||Ae.ios&&Ae.webkit_version<604;function Mj(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),F$(t,n.value)},50)}function Dm(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function F$(t,e){e=Dm(t.state,gb,e);let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(LO!=null&&n.selection.ranges.every(l=>l.empty)&&LO==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let d=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:d},range:ge.cursor(c.from+d.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:ge.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Kr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ki.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Kr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Kr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ki.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(k$))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Lj(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new _j(t,e,n,r)),r&&t.observer.ignore(()=>{r$(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function rk(t,e,n,r){if(r==1)return ge.cursor(e,n);if(r==2)return lj(t.state,e,n);{let i=nn.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Ij(t,e,n,r){let i=nn.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&ik(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&ik(n,r,a)?1:s&&s.bottom>=r?-1:1}function ok(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Ij(t,n,e.clientX,e.clientY)}}const Qj=Ae.ie&&Ae.ie_version<=11;let sk=null,ak=0,lk=0;function Z$(t){if(!Qj)return t.detail;let e=sk,n=lk;return sk=t,lk=Date.now(),ak=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(ak+1)%3:1}function Lj(t,e){let n=ok(t,e),r=Z$(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=ok(t,o),c,u=rk(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let d=rk(t,n.pos,n.bias,r),f=Math.min(d.from,u.from),h=Math.max(d.to,u.to);u=f1&&(c=jj(i,l.pos))?c:a?i.addRange(u):ge.create([u])}}}function jj(t,e){for(let n=0;n=e)return ge.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}ki.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=ge.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Dm(t.state,vb,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ki.dragend=t=>(t.inputState.draggedContent=null,!1);function ck(t,e,n,r){if(n=Dm(t.state,gb,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&$j(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ki.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&ck(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return ck(t,e,r,!0),!0}return!1};ki.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=B$?null:e.clipboardData;return n?(F$(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Mj(t),!1)};function Nj(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function Dj(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:Dm(t,vb,e.join(t.lineBreak)),ranges:n,linewise:r}}let LO=null;ki.copy=ki.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=Dj(t.state);if(!n&&!i)return!1;LO=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=B$?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Nj(t,n),!1)};const V$=wi.define();function U$(t,e){let n=[];for(let r of t.facet(E$)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:V$.of(!0)}):null}function q$(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=U$(t.state,e);n?t.dispatch(n):t.update([])}},10)}Kr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),q$(t)};Kr.blur=t=>{t.observer.clearSelectionRange(),q$(t)};Kr.compositionstart=Kr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Kr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ae.chrome&&Ae.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Kr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ki.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return bb(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(Ae.chrome&&Ae.android&&(i=D$.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ae.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ae.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Kr.compositionend(t,e),20),!1};const uk=new Set;function zj(t){uk.has(t)||(uk.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const dk=["pre-wrap","normal","pre-line","break-spaces"];let xl=!1;function fk(){xl=!1}class Bj{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return dk.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ah&&(xl=!0),this.height=e)}replace(e,n,r){return qn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:d}=i[a],f=o.lineAt(l,It.ByPosNoHeight,r.setDoc(n),0,0),h=f.to>=c?f:o.lineAt(c,It.ByPosNoHeight,r,0,0);for(d+=h.to-c,c=h.to;a>0&&f.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class pr extends W${constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Vi(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof pr||i instanceof yn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof yn?i=new pr(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):qn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class yn extends qn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof yn?r[r.length-1]=new yn(o.length+i):r.push(null,new yn(i-1))}if(e>0){let o=r[0];o instanceof yn?r[0]=new yn(e+o.length):r.unshift(new yn(e-1),null)}return qn.of(r)}decomposeLeft(e,n){n.push(new yn(e-1),null)}decomposeRight(e,n){n.push(null,new yn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new yn(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let d=i.heights[i.index++];l==-1?l=d:Math.abs(d-l)>=ah&&(l=-2);let f=new pr(u,d);f.outdated=!1,s.push(f),a+=u+1}a<=o&&s.push(null,new yn(o-a).updateHeight(e,a));let c=qn.of(s);return(l<0||Math.abs(c.height-this.height)>=ah||Math.abs(l-this.heightMetrics(e,n).perLine)>=ah)&&(xl=!0),ip(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Zj extends qn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return ea))return c;let u=n==It.ByPosNoHeight?It.ByPosNoHeight:It.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,It.ByPos,r,i,o);e=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&hk(o,s-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?qn.of(this.break?[e,null,n]:[e,n]):(this.left=ip(this.left,e),this.right=ip(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hk(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof yn&&(r=t[e+1])instanceof yn&&t.splice(e-1,3,new yn(n.length+1+r.length))}const Vj=5;class Sb{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof pr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new pr(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=Vj)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new pr(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new yn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof pr)return e;let n=new pr(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof pr)&&!this.isCovered?this.nodes.push(new pr(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&d.overflow!="visible"){let f=u.getBoundingClientRect();o=Math.max(o,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?i.innerHeight:l,f.bottom)}c=d.position=="absolute"||d.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function Xj(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class pv{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Bj(n),this.stateDeco=e.facet(Nu).filter(r=>typeof r!="function"),this.heightMap=qn.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(e.doc),[new qr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ge.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new ff(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?mk:new wb(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Qc(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Nu).filter(u=>typeof u!="function");let i=e.changedRanges,o=qr.extendWithRanges(i,Uj(r,this.stateDeco,e?e.changes:cn.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);fk(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||xl)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(J9)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?fn.RTL:fn.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:b,scaleY:S}=n$(n,a);(b>.005&&Math.abs(this.scaleX-b)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=b,this.scaleY=S,c|=8,s=l=!0)}let d=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=o$(e.scrollDOM);let p=(this.printing?Xj:Wj)(n,this.paddingTop),m=p.top-this.pixelViewport.top,y=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let v=a.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(v-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:w,textHeight:C}=e.docView.measureTextSize();s=S>0&&i.refresh(o,S,w,C,v/w,b),s&&(e.docView.minWidth=0,c|=8)}m>0&&y>0?u=Math.max(m,y):m<0&&y<0&&(u=Math.min(m,y)),fk();for(let S of this.viewports){let w=S.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(S);this.heightMap=(s?qn.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new qr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new Fj(S.from,w))}xl&&(c|=2)}let O=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new ff(i.lineAt(s-r*1e3,It.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,It.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(c,It.ByPos,o,0,0),f;n.y=="center"?f=(d.top+d.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=fn.LTR&&!r)return[];let a=[],l=(u,d,f,h)=>{if(d-uu&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-u)g.fromv));if(!y){if(dO.from<=d&&O.to>=d)){let O=n.moveToLineBoundary(ge.cursor(d),!1,!0).head;O>u&&(d=O)}let g=this.gapSize(f,u,d,h),v=r||g<2e6?g:2e6;y=new pv(u,d,g,v)}a.push(y)},c=u=>{if(u.length2e6)for(let w of e)w.from>=u.from&&w.fromu.from&&l(u.from,h,u,d),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];gt.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Qc(this.heightMap.lineAt(e,It.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Qc(this.heightMap.lineAt(this.scaler.fromDOM(e),It.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Qc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ff{constructor(e,n){this.from=e,this.to=n}}function Yj(t,e,n){let r=[],i=t,o=0;return gt.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function pf(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Gj(t,e){for(let n of t)if(e(n))return n}const mk={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class wb{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,It.ByPos,e,0,0).top,u=n.lineAt(l,It.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Qc(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Vi(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Qc(i,e)):t._content)}const mf=Le.define({combine:t=>t.join(" ")}),jO=Le.define({combine:t=>t.indexOf(!0)>-1}),NO=us.newName(),X$=us.newName(),H$=us.newName(),Y$={"&light":"."+X$,"&dark":"."+H$};function DO(t,e,n){return new us(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Kj=DO("."+NO,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Y$),Jj={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},mv=Ae.ie&&Ae.ie_version<=11;class eN{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new L9,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Ae.ie&&Ae.ie_version<=11||Ae.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Ae.chrome&&Ae.chrome_version<126)&&(this.editContext=new nN(e),e.state.facet(zo)&&(e.contentDOM.editContext=this.editContext.editContext)),mv&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(zo)?r.root.activeElement!=this.dom:!oh(this.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ae.ie&&Ae.ie_version<=11||Ae.android&&Ae.chrome)&&!r.state.selection.main.empty&&i.focusNode&&tu(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Lu(e.root);if(!n)return!1;let r=Ae.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&tN(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=oh(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&ol(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&oh(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new yj(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=N$(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=gk(n,e.previousSibling||e.target.previousSibling,-1),i=gk(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(zo)!=e.state.facet(zo)&&(e.view.contentDOM.editContext=e.state.facet(zo)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function gk(t,e,n){for(;e;){let r=_t.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function vk(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return tu(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function tN(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return vk(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?vk(t,n):null}class nN{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:at.of(r.text.split(` `))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||bb(e,o,ge.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(Ge.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:$$.of(Ge.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Lu(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class je{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||j9(e.parent)||document,this.viewState=new pk(e.state||mt.create(e)),e.scrollTo&&e.scrollTo.is(cf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Rc).map(i=>new dv(i));for(let i of this.plugins)i.update(this);this.observer=new eN(this),this.inputState=new kj(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Hx(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof sn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let f of e){if(f.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=f.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(V$))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=U$(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(mt.phrases)!=this.state.facet(mt.phrases))return this.setState(o);i=rp.create(this,o,e),i.flags|=a;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:h}=f.state.selection;d=new sl(h.empty?h:ge.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of f.effects)h.is(cf)&&(d=h.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=op.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Mc)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(mf)!=i.state.facet(mf)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(IO))try{f(i)}catch(h){qi(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!N$(this,u)&&c.force&&ol(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new pk(e),this.plugins=e.facet(Rc).map(r=>new dv(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Hx(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Rc),r=e.state.facet(Rc);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new dv(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(o$(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return qi(this.state,p),Ok}}),d=rp.create(this,this.state,[]),f=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(IO))a(n)}get themeClasses(){return NO+" "+(this.state.facet(jO)?H$:X$)+" "+this.state.facet(mf)}updateAttrs(){let e=yk(this,A$,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(zo)?"true":"false",class:"cm-content",style:`${Ae.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),yk(this,Ob,n);let r=this.observer.ignore(()=>{let i=_O(this.contentDOM,this.contentAttrs,n),o=_O(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(je.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Mc);let e=this.state.facet(je.cspNonce);us.mount(this.root,this.styleModules.concat(Kj).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return hv(this,e,ek(this,e,n,r))}moveByGroup(e,n){return hv(this,e,ek(this,e,n,r=>mj(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return ge.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return pj(this,e,n,r)}moveVertically(e,n,r){return hv(this,e,gj(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),j$(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Ho.find(o,e-i.from,-1,n)];return jm(r,s.dir==fn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(_$)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>rN)return b$(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||y$(o.isolates,r=Xx(this,e))))return o.order;r||(r=Xx(this,e));let i=Y9(e.text,n,r);return this.bidiCache.push(new op(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ae.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{r$(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return cf.of(new sl(typeof e=="number"?ge.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return cf.of(new sl(ge.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Gr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Gr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=us.newName(),i=[mf.of(r),Mc.of(DO(`.${r}`,e))];return n&&n.dark&&i.push(jO.of(!0)),i}static baseTheme(e){return Im.lowest(Mc.of(DO("."+NO,e,Y$)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&_t.get(r)||_t.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}je.styleModule=Mc;je.inputHandler=P$;je.clipboardInputFilter=gb;je.clipboardOutputFilter=vb;je.scrollHandler=T$;je.focusChangeEffect=E$;je.perLineTextDirection=_$;je.exceptionSink=C$;je.updateListener=IO;je.editable=zo;je.mouseSelectionStyle=k$;je.dragMovesSelection=x$;je.clickAddsSelectionRange=w$;je.decorations=Nu;je.outerDecorations=R$;je.atomicRanges=yb;je.bidiIsolatedRanges=M$;je.scrollMargins=I$;je.darkTheme=jO;je.cspNonce=Le.define({combine:t=>t.length?t[0]:""});je.contentAttributes=Ob;je.editorAttributes=A$;je.lineWrapping=je.contentAttributes.of({class:"cm-lineWrapping"});je.announce=wt.define();const rN=4096,Ok={};class op{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:fn.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&EO(s,n)}return n}const iN=Ae.mac?"mac":Ae.windows?"win":Ae.linux?"linux":"key";function oN(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}let Bo=null;const lN=4e3;function cN(t,e=iN){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var d,f;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(g=>oN(g,e));for(let g=1;g{let b=Bo={view:O,prefix:v,scope:s};return setTimeout(()=>{Bo==b&&(Bo=null)},lN),!0}]})}let m=p.join(" ");i(m,!1);let y=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((f=(d=h._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&y.run.push(l),c&&(y.preventDefault=!0),u&&(y.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=s;for(let f in u)u[f].run.push(h=>d(h,zO))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let zO=null;function uN(t,e,n,r){zO=e;let i=R9(e),o=Ji(i,0),s=yl(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;Bo&&Bo.view==n&&Bo.scope==r&&(a=Bo.prefix+" ",z$.indexOf(e.keyCode)<0&&(c=!0,Bo=null));let d=new Set,f=y=>{if(y){for(let g of y.run)if(!d.has(g)&&(d.add(g),g(n)))return y.stopPropagation&&(u=!0),!0;y.preventDefault&&(y.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,m;return h&&(f(h[a+gf(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ae.windows&&e.ctrlKey&&e.altKey)&&(p=ds[e.keyCode])&&p!=i?(f(h[a+gf(p,e,!0)])||e.shiftKey&&(m=Qu[e.keyCode])!=i&&m!=p&&f(h[a+gf(m,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(h[a+gf(i,e,!0)])&&(l=!0),!l&&f(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),zO=null,l}const dN=!Ae.ios,Sk={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};dN&&(Sk[".cm-line"].caretColor=Sk[".cm-content"].caretColor="transparent !important");function wk(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function fN(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class hN{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let d=r(a,l,c);d&&u(c,c+a[0].length,d)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new bl,r=n.add.bind(n);for(let{from:i,to:o}of fN(e,this.maxLength))wk(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;af.push(g.range(m,y));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(y,e,m,p));n=n.update({filterFrom:u,filterTo:d,filter:(m,y)=>md,add:f})}}return n}}const BO=/x/.unicode!=null?"gu":"g",pN=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,BO),mN={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let gv=null;function gN(){var t;if(gv==null&&typeof document<"u"&&document.body){let e=document.body.style;gv=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return gv||!1}const lh=Le.define({combine(t){let e=Lm(t,{render:null,specialChars:pN,addSpecialChars:null});return(e.replaceTabs=!gN())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,BO)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,BO)),e}});function vN(t={}){return[lh.of(t),ON()]}let xk=null;function ON(){return xk||(xk=Gr.fromClass(class{constructor(t){this.view=t,this.decorations=Ge.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(lh)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new hN({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Ji(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=md(s.text,a,r-s.from);return Ge.replace({widget:new wN((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ge.replace({widget:new SN(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(lh);t.startState.facet(lh)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const yN="•";function bN(t){return t>=32?yN:t==10?"␤":String.fromCharCode(9216+t)}class SN extends Fl{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=bN(this.code),r=e.state.phrase("Control character")+" "+(mN[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class wN extends Fl{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function xN(){return CN}const kN=Ge.line({class:"cm-activeLine"}),CN=Gr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(kN.range(i.from)),e=i.from)}return Ge.set(n)}},{decorations:t=>t.decorations});class Js extends Hs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Js.prototype.elementClass="";Js.prototype.toDOM=void 0;Js.prototype.mapMode=Mn.TrackBefore;Js.prototype.startSide=Js.prototype.endSide=-1;Js.prototype.point=!0;const vv=Le.define(),PN=Le.define(),ch=Le.define(),kk=Le.define({combine:t=>t.some(e=>e)});function EN(t){return[_N]}const _N=Gr.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ch).map(e=>new Pk(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(kk),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(kk)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=gt.iter(this.view.state.facet(vv),this.view.viewport.from),r=[],i=this.gutters.map(o=>new TN(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==Ur.Text&&s){FO(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==Ur.Text){FO(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(ch),n=t.state.facet(ch),r=t.docChanged||t.heightChanged||t.viewportChanged||!gt.eq(t.startState.facet(vv),t.state.facet(vv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new Pk(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>je.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==fn.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function Ck(t){return Array.isArray(t)?t:[t]}function FO(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class TN{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=gt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new G$(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];FO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(PN)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class Pk{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Ck(n.markers(e)),n.initialSpacer&&(this.spacer=new G$(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Ck(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!gt.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class G${constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),$N(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class Ov extends Js{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function yv(t,e){return t.state.facet(Ua).formatNumber(e,t.state)}const MN=ch.compute([Ua],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(AN)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Ov(yv(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(RN)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Ua)!=e.state.facet(Ua),initialSpacer(e){return new Ov(yv(e,Ek(e.state.doc.lines)))},updateSpacer(e,n){let r=yv(n.view,Ek(n.view.state.doc.lines));return r==e.number?e:new Ov(r)},domEventHandlers:t.facet(Ua).domEventHandlers}));function IN(t={}){return[Ua.of(t),EN(),MN]}function Ek(t){let e=9;for(;e{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}He.closedBy=new He({deserialize:t=>t.split(" ")});He.openedBy=new He({deserialize:t=>t.split(" ")});He.group=new He({deserialize:t=>t.split(" ")});He.isolate=new He({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});He.contextHash=new He({perNode:!0});He.lookAhead=new He({perNode:!0});He.mounted=new He({perNode:!0});class Du{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[He.mounted.id]}}const LN=Object.create(null);class Wn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):LN,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wn(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(He.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(He.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Wn.none=new Wn("",Object.create(null),0,8);class xb{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(s|$t.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Pb(Wn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Dt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Dt(Wn.none,n,r,i)))}static build(e){return zN(e)}}Dt.empty=new Dt(Wn.none,[],[],0);class kb{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new kb(this.buffer,this.index)}}class hs{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Wn.none}toString(){let e=[];for(let n=0;n0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function zu(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=c;e+=n){let u=a[e],d=l[e]+s.from;if(J$(i,r,d,d+u.length)){if(u instanceof hs){if(o&$t.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,n,r-d,i);if(f>-1)return new Wi(new jN(s,u,e,d),null,f)}else if(o&$t.IncludeAnonymous||!u.type.isAnonymous||Cb(u)){let f;if(!(o&$t.IgnoreMounts)&&(f=Du.get(u))&&!f.overlay)return new jn(f.tree,d,e,s);let h=new jn(u,d,e,s);return o&$t.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&$t.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&$t.IgnoreOverlays)&&(i=Du.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new jn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Tk(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function ZO(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class jN{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Wi extends e5{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new Wi(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&$t.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Wi(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Wi(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Wi(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new Dt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function t5(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||s.to=e){let a=new jn(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(zu(a,e,n,!1))}}return i?t5(i):r}class ap{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof jn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof jn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&$t.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&$t.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&$t.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&$t.IncludeAnonymous||a instanceof hs||!a.type.isAnonymous||Cb(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return ZO(this._tree,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Cb(t){return t.children.some(e=>e instanceof hs||!e.type.isAnonymous||Cb(e))}function zN(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=K$,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new kb(n,n.length):n,l=r.types,c=0,u=0;function d(S,w,C,$,A,k){let{id:N,start:E,end:L,size:x}=a,z=u,F=c;for(;x<0;)if(a.next(),x==-1){let Q=o[N];C.push(Q),$.push(E-S);return}else if(x==-3){c=N;return}else if(x==-4){u=N;return}else throw new RangeError(`Unrecognized record size: ${x}`);let I=l[N],j,B,H=E-S;if(L-E<=i&&(B=y(a.pos-w,A))){let Q=new Uint16Array(B.size-B.skip),M=a.pos-B.size,G=Q.length;for(;a.pos>M;)G=g(B.start,Q,G);j=new hs(Q,L-B.start,r),H=B.start-S}else{let Q=a.pos-x;a.next();let M=[],G=[],X=N>=s?N:-1,K=0,oe=L;for(;a.pos>Q;)X>=0&&a.id==X&&a.size>=0?(a.end<=oe-i&&(p(M,G,E,K,a.end,oe,X,z,F),K=M.length,oe=a.end),a.next()):k>2500?f(E,Q,M,G):d(E,Q,M,G,X,k+1);if(X>=0&&K>0&&K-1&&K>0){let pe=h(I,F);j=Pb(I,M,G,0,M.length,0,L-E,pe,pe)}else j=m(I,M,G,L-E,z-L,F)}C.push(j),$.push(H)}function f(S,w,C,$){let A=[],k=0,N=-1;for(;a.pos>w;){let{id:E,start:L,end:x,size:z}=a;if(z>4)a.next();else{if(N>-1&&L=0;x-=3)E[z++]=A[x],E[z++]=A[x+1]-L,E[z++]=A[x+2]-L,E[z++]=z;C.push(new hs(E,A[2]-L,r)),$.push(L-S)}}function h(S,w){return(C,$,A)=>{let k=0,N=C.length-1,E,L;if(N>=0&&(E=C[N])instanceof Dt){if(!N&&E.type==S&&E.length==A)return E;(L=E.prop(He.lookAhead))&&(k=$[N]+E.length+L)}return m(S,C,$,A,k,w)}}function p(S,w,C,$,A,k,N,E,L){let x=[],z=[];for(;S.length>$;)x.push(S.pop()),z.push(w.pop()+C-A);S.push(m(r.types[N],x,z,k-A,E-k,L)),w.push(A-C)}function m(S,w,C,$,A,k,N){if(k){let E=[He.contextHash,k];N=N?[E].concat(N):[E]}if(A>25){let E=[He.lookAhead,A];N=N?[E].concat(N):[E]}return new Dt(S,w,C,$,N)}function y(S,w){let C=a.fork(),$=0,A=0,k=0,N=C.end-i,E={size:0,start:0,skip:0};e:for(let L=C.pos-S;C.pos>L;){let x=C.size;if(C.id==w&&x>=0){E.size=$,E.start=A,E.skip=k,k+=4,$+=4,C.next();continue}let z=C.pos-x;if(x<0||z=s?4:0,I=C.start;for(C.next();C.pos>z;){if(C.size<0)if(C.size==-3)F+=4;else break e;else C.id>=s&&(F+=4);C.next()}A=I,$+=x,k+=F}return(w<0||$==S)&&(E.size=$,E.start=A,E.skip=k),E.size>4?E:void 0}function g(S,w,C){let{id:$,start:A,end:k,size:N}=a;if(a.next(),N>=0&&$4){let L=a.pos-(N-4);for(;a.pos>L;)C=g(S,w,C)}w[--C]=E,w[--C]=k-S,w[--C]=A-S,w[--C]=$}else N==-3?c=$:N==-4&&(u=$);return C}let v=[],O=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,v,O,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:v.length?O[0]+v[0].length:0;return new Dt(l[t.topID],v.reverse(),O.reverse(),b)}const $k=new WeakMap;function uh(t,e){if(!t.isAnonymous||e instanceof hs||e.type!=t)return 1;let n=$k.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Dt)){n=1;break}n+=uh(t,r)}$k.set(e,n)}return n}function Pb(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;w+=C}if(O==b+1){if(w>u){let C=p[b];h(C.children,C.positions,0,C.children.length,m[b]+v);continue}d.push(p[b])}else{let C=m[O-1]+p[O-1].length-S;d.push(Pb(t,p,m,b,O,S,C,null,l))}f.push(S+v-o)}}return h(e,n,r,i,0),(a||l)(d,f,s)}class n5{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Wi?this.setBuffer(e.context.buffer,e.index,n):e instanceof jn&&this.map.set(e.tree,n)}get(e){return e instanceof Wi?this.getBuffer(e.context.buffer,e.index):e instanceof jn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vo{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new vo(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=f.from||d<=f.to||c){let h=Math.max(f.from,l)-c,p=Math.min(f.to,d)-c;f=h>=p?null:new vo(h,p,f.tree,f.offset+c,a>0,!!u)}if(f&&i.push(f),s.to>d)break;s=onew Fr(i.from,i.to)):[new Fr(0,0)]:[new Fr(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class BN{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function FN(t){return(e,n,r,i)=>new VN(e,t,n,r,i)}class Ak{constructor(e,n,r,i,o){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=o}}function Rk(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class ZN{constructor(e,n,r,i,o,s,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const VO=new He({perNode:!0});class VN{constructor(e,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Dt(r.type,r.children,r.positions,r.length,r.propValues.concat([[VO,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[He.mounted.id]=new Du(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let d=u.from+c.pos,f=u.to+c.pos;d>=i.from&&f<=i.to&&!n.ranges.some(h=>h.fromd)&&n.ranges.push({from:d,to:f})}}a=!1}else if(r&&(s=UN(r.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.fromnew Fr(d.from-i.from,d.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(n&&(l=n.predicate(i))&&(l===!0&&(l=new Fr(i.from,i.to)),l.from=0&&n.ranges[c].to==l.from?n.ranges[c]={from:n.ranges[c].from,to:l.to}:n.ranges.push(l)}if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=Qk(this.ranges,n.ranges);c.length&&(Rk(c),this.inner.splice(n.index,0,new Ak(n.parser,n.parser.startParse(this.input,Lk(n.mounts,c),c),n.ranges.map(u=>new Fr(u.from-n.start,u.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function UN(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function Mk(t,e,n,r,i,o){if(e=e&&n.enter(r,1,$t.IgnoreOverlays|$t.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Dt)n=n.children[0];else break}return!1}}let WN=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(VO))!==null&&n!==void 0?n:r.to,this.inner=new Ik(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(VO))!==null&&e!==void 0?e:n.to,this.inner=new Ik(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(He.mounted);if(s&&s.parser==n)for(let a=this.fragI;a=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}};function Qk(t,e){let n=null,r=e;for(let i=1,o=0;i=a)break;l.to<=s||(n||(r=n=e.slice()),l.froma&&n.splice(o+1,0,new Fr(a,l.to))):l.to>a?n[o--]=new Fr(a,l.to):n.splice(o--,1))}}return r}function XN(t,e,n,r){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,d=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let f=Math.max(l,n),h=Math.min(u,d,r);fnew Fr(f.from+r,f.to+r)),d=XN(e,u,l,c);for(let f=0,h=l;;f++){let p=f==d.length,m=p?c:d[f].from;if(m>h&&n.push(new vo(h,m,i.tree,-s,o.from>=h||o.openStart,o.to<=m||o.openEnd)),p)break;h=d[f].to}}else n.push(new vo(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return n}let HN=0;class Dr{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=HN++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Dr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Dr(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new lp(e);return r=>r.modified.indexOf(n)>-1?r:lp.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let YN=0;class lp{constructor(e){this.name=e,this.instances=[],this.id=YN++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&GN(n,a.modified));if(r)return r;let i=[],o=new Dr(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=KN(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(lp.get(a,l));return o}}function GN(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function KN(t){let e=[[]];for(let n=0;nr.length-n.length)}function zm(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let d=0;;){if(a=="..."&&d>0&&d+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+i);if(o.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==i.length)break;let h=i[d++];if(d==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(d)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new cp(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return i5.add(e)}const i5=new He;class cp{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function JN(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function s5(t,e,n,r=0,i=t.length){let o=new e7(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class e7{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=t7(e)||cp.empty,d=JN(o,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(n,a),c),u.opaque)return;let f=e.tree&&e.tree.prop(He.mounted);if(f&&f.overlay){let h=e.node.enter(f.overlay[0].from+a,1),p=this.highlighters.filter(y=>!y.scope||y.scope(f.tree.type)),m=e.firstChild();for(let y=0,g=a;;y++){let v=y=O||!e.nextSibling())););if(!v||O>r)break;g=v.to+a,g>n&&(this.highlightRange(h.cursor(),Math.max(n,v.from+a),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),c))}m&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function t7(t){let e=t.type.prop(i5);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const we=Dr.define,Of=we(),Lo=we(),jk=we(Lo),Nk=we(Lo),jo=we(),yf=we(jo),bv=we(jo),Qi=we(),Ss=we(Qi),Ri=we(),Mi=we(),UO=we(),pc=we(UO),bf=we(),q={comment:Of,lineComment:we(Of),blockComment:we(Of),docComment:we(Of),name:Lo,variableName:we(Lo),typeName:jk,tagName:we(jk),propertyName:Nk,attributeName:we(Nk),className:we(Lo),labelName:we(Lo),namespace:we(Lo),macroName:we(Lo),literal:jo,string:yf,docString:we(yf),character:we(yf),attributeValue:we(yf),number:bv,integer:we(bv),float:we(bv),bool:we(jo),regexp:we(jo),escape:we(jo),color:we(jo),url:we(jo),keyword:Ri,self:we(Ri),null:we(Ri),atom:we(Ri),unit:we(Ri),modifier:we(Ri),operatorKeyword:we(Ri),controlKeyword:we(Ri),definitionKeyword:we(Ri),moduleKeyword:we(Ri),operator:Mi,derefOperator:we(Mi),arithmeticOperator:we(Mi),logicOperator:we(Mi),bitwiseOperator:we(Mi),compareOperator:we(Mi),updateOperator:we(Mi),definitionOperator:we(Mi),typeOperator:we(Mi),controlOperator:we(Mi),punctuation:UO,separator:we(UO),bracket:pc,angleBracket:we(pc),squareBracket:we(pc),paren:we(pc),brace:we(pc),content:Qi,heading:Ss,heading1:we(Ss),heading2:we(Ss),heading3:we(Ss),heading4:we(Ss),heading5:we(Ss),heading6:we(Ss),contentSeparator:we(Qi),list:we(Qi),quote:we(Qi),emphasis:we(Qi),strong:we(Qi),link:we(Qi),monospace:we(Qi),strikethrough:we(Qi),inserted:we(),deleted:we(),changed:we(),invalid:we(),meta:bf,documentMeta:we(bf),annotation:we(bf),processingInstruction:we(bf),definition:Dr.defineModifier("definition"),constant:Dr.defineModifier("constant"),function:Dr.defineModifier("function"),standard:Dr.defineModifier("standard"),local:Dr.defineModifier("local"),special:Dr.defineModifier("special")};for(let t in q){let e=q[t];e instanceof Dr&&(e.name=t)}o5([{tag:q.link,class:"tok-link"},{tag:q.heading,class:"tok-heading"},{tag:q.emphasis,class:"tok-emphasis"},{tag:q.strong,class:"tok-strong"},{tag:q.keyword,class:"tok-keyword"},{tag:q.atom,class:"tok-atom"},{tag:q.bool,class:"tok-bool"},{tag:q.url,class:"tok-url"},{tag:q.labelName,class:"tok-labelName"},{tag:q.inserted,class:"tok-inserted"},{tag:q.deleted,class:"tok-deleted"},{tag:q.literal,class:"tok-literal"},{tag:q.string,class:"tok-string"},{tag:q.number,class:"tok-number"},{tag:[q.regexp,q.escape,q.special(q.string)],class:"tok-string2"},{tag:q.variableName,class:"tok-variableName"},{tag:q.local(q.variableName),class:"tok-variableName tok-local"},{tag:q.definition(q.variableName),class:"tok-variableName tok-definition"},{tag:q.special(q.variableName),class:"tok-variableName2"},{tag:q.definition(q.propertyName),class:"tok-propertyName tok-definition"},{tag:q.typeName,class:"tok-typeName"},{tag:q.namespace,class:"tok-namespace"},{tag:q.className,class:"tok-className"},{tag:q.macroName,class:"tok-macroName"},{tag:q.propertyName,class:"tok-propertyName"},{tag:q.operator,class:"tok-operator"},{tag:q.comment,class:"tok-comment"},{tag:q.meta,class:"tok-meta"},{tag:q.invalid,class:"tok-invalid"},{tag:q.punctuation,class:"tok-punctuation"}]);var Sv;const qa=new He;function a5(t){return Le.define({combine:t?e=>e.concat(t):void 0})}const Eb=new He;class gi{constructor(e,n,r=[],i=""){this.data=e,this.name=i,mt.prototype.hasOwnProperty("tree")||Object.defineProperty(mt.prototype,"tree",{get(){return gn(this)}}),this.parser=n,this.extension=[Pl.of(this),mt.languageData.of((o,s,a)=>{let l=Dk(o,s,a),c=l.type.prop(qa);if(!c)return[];let u=o.facet(c),d=l.type.prop(Eb);if(d){let f=l.resolve(s-l.from,a);for(let h of d)if(h.test(f,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return Dk(e,n,r).type.prop(qa)==this.data}findRegions(e){let n=e.facet(Pl);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(qa)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(He.mounted);if(a){if(a.tree.prop(qa)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new kl(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function gn(t){let e=t.field(gi.state,!1);return e?e.tree:Dt.empty}class n7{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let mc=null;class up{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new up(e,n,[],Dt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new n7(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Dt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(vo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=mc;mc=this;try{return e()}finally{mc=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=zk(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,d,f)=>l.push({fromA:c,toA:u,fromB:d,toB:f})),r=vo.applyChanges(r,l),i=Dt.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);ue.from&&(this.fragments=zk(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends r5{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=mc;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new Dt(Wn.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return mc}}function zk(t,e,n){return vo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Cl{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Cl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=up.create(e.facet(Pl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Cl(r)}}gi.state=Ci.define({create:Cl.init,update(t,e){for(let n of e.effects)if(n.is(gi.setState))return n.value;return e.startState.facet(Pl)!=e.state.facet(Pl)?Cl.init(e.state):t.apply(e)}});let l5=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(l5=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const wv=typeof navigator<"u"&&(!((Sv=navigator.scheduling)===null||Sv===void 0)&&Sv.isInputPending)?()=>navigator.scheduling.isInputPending():null,r7=Gr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(gi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(gi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=l5(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>wv&&wv()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:gi.setState.of(new Cl(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>qi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Pl=Le.define({combine(t){return t.length?t[0]:null},enables:t=>[gi.state,r7,je.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class _b{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const i7=Le.define(),Bm=Le.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function dp(t){let e=t.facet(Bm);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function fp(t,e){let n="",r=t.tabSize,i=t.facet(Bm)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?o7(t,n,e):null}class Fm{constructor(e,n={}){this.state=e,this.options=n,this.unit=dp(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return md(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Zm=new He;function o7(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return u5(r,t,n)}function u5(t,e,n){for(let r=t;r;r=r.next){let i=a7(r.node);if(i)return i(Tb.create(e,n,r))}return 0}function s7(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function a7(t){let e=t.type.prop(Zm);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(He.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>d5(s,!0,1,void 0,o&&!s7(s)?i.from:void 0)}return t.parent==null?l7:null}function l7(){return 0}class Tb extends Fm{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Tb(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(c7(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return u5(this.context.next,this.base,this.pos)}}function c7(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function u7(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function d7({closing:t,align:e=!0,units:n=1}){return r=>d5(r,e,n,t)}function d5(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?u7(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const f7=t=>t.baseIndent;function dh({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const $b=new He;function f5(t){let e=t.firstChild,n=t.lastChild;return e&&e.toa.prop(qa)==s.data:s?a=>a==s:void 0,this.style=o5(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new us(r):null,this.themeType=n.themeType}static define(e,n){return new Od(e,n||{})}}const qO=Le.define(),h7=Le.define({combine(t){return t.length?[t[0]]:null}});function xv(t){let e=t.facet(qO);return e.length?e:t.facet(h7)}function p7(t,e){let n=[g7],r;return t instanceof Od&&(t.module&&n.push(je.styleModule.of(t.module)),r=t.themeType),r?n.push(qO.computeN([je.darkTheme],i=>i.facet(je.darkTheme)==(r=="dark")?[t]:[])):n.push(qO.of(t)),n}class m7{constructor(e){this.markCache=Object.create(null),this.tree=gn(e.state),this.decorations=this.buildDeco(e,xv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=gn(e.state),r=xv(e.state),i=r!=xv(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return Ge.none;let r=new bl;for(let{from:i,to:o}of e.visibleRanges)s5(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=Ge.mark({class:l})))},i,o);return r.finish()}}const g7=Im.high(Gr.fromClass(m7,{decorations:t=>t.decorations}));q.meta,q.link,q.heading,q.emphasis,q.strong,q.strikethrough,q.keyword,q.atom,q.bool,q.url,q.contentSeparator,q.labelName,q.literal,q.inserted,q.string,q.deleted,q.regexp,q.escape,q.string,q.variableName,q.variableName,q.typeName,q.namespace,q.className,q.variableName,q.macroName,q.propertyName,q.comment,q.invalid;const v7=je.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),h5=1e4,p5="()[]{}",m5=Le.define({combine(t){return Lm(t,{afterCursor:!0,brackets:p5,maxScanDistance:h5,renderMatch:b7})}}),O7=Ge.mark({class:"cm-matchingBracket"}),y7=Ge.mark({class:"cm-nonmatchingBracket"});function b7(t){let e=[],n=t.matched?O7:y7;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const S7=Ci.define({create(){return Ge.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(m5);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Xi(e.state,i.head,-1,r)||i.head>0&&Xi(e.state,i.head-1,1,r)||r.afterCursor&&(Xi(e.state,i.head,1,r)||i.headje.decorations.from(t)}),w7=[S7,v7];function x7(t={}){return[m5.of(t),w7]}const g5=new He;function WO(t,e,n){let r=t.prop(e<0?He.openedBy:He.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function XO(t){let e=t.type.prop(g5);return e?e(t.node):t}function Xi(t,e,n,r={}){let i=r.maxScanDistance||h5,o=r.brackets||p5,s=gn(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=WO(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return k7(t,e,n,l,u,c,o)}}return C7(t,e,n,s,a.type,i,o)}function k7(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),d=0;for(let f=0;!u.next().done&&f<=o;){let h=u.value;n<0&&(f+=h.length);let p=e+f*n;for(let m=n>0?0:h.length-1,y=n>0?h.length:-1;m!=y;m+=n){let g=s.indexOf(h[m]);if(!(g<0||r.resolveInner(p+m,1).type!=i))if(g%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:p+m,to:p+m+1},matched:g>>1==l>>1};d--}}n>0&&(f+=h.length)}return u.done?{start:c,matched:!1}:null}const P7=Object.create(null),Bk=[Wn.none],Fk=[],Zk=Object.create(null),E7=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])E7[t]=_7(P7,e);function kv(t,e){Fk.indexOf(t)>-1||(Fk.push(t),console.warn(e))}function _7(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||q[c];u?typeof u=="function"?l.length?l=l.map(u):kv(c,`Modifier ${c} used at start of tag`):l.length?kv(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:kv(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=Zk[i];if(o)return o.id;let s=Zk[i]=Wn.define({id:Bk.length,name:r,props:[zm({[r]:n})]});return Bk.push(s),s.id}fn.RTL,fn.LTR;function Vk(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function T7(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:T7(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function A7(t,e){return n=>{for(let r=gn(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}const R7=wi.define(),M7=je.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class I7{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Ab{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Mn.TrackDel),r=e.mapPos(this.to,1,Mn.TrackDel);return n==null||r==null?null:new Ab(this.field,n,r)}}class Rb{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let d=0;dnew Ab(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,d=>d[1]);for(let d=0;d=c&&f.field++}i.push(new I7(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new Rb(r,i)}}let Q7=Ge.widget({widget:new class extends Fl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),L7=Ge.mark({class:"cm-snippetField"});class Zl{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ge.set(e.map(r=>(r.from==r.to?Q7:L7).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Zl(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const yd=wt.define({map(t,e){return t&&t.map(e)}}),j7=wt.define(),Bu=Ci.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(yd))return n.value;if(n.is(j7)&&t)return new Zl(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>je.decorations.from(t,e=>e?e.deco:Ge.none)});function Mb(t,e){return ge.create(t.filter(n=>n.field==e).map(n=>ge.range(n.from,n.to)))}function N7(t){let e=Rb.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:at.of(s)},scrollIntoView:!0,annotations:r?[R7.of(r),sn.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Mb(a,0)),a.some(c=>c.field>0)){let c=new Zl(a,0),u=l.effects=[yd.of(c)];n.state.field(Bu,!1)===void 0&&u.push(wt.appendConfig.of([Bu,Z7,V7,M7]))}n.dispatch(n.state.update(l))}}function v5(t){return({state:e,dispatch:n})=>{let r=e.field(Bu,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:Mb(r.ranges,i),effects:yd.of(o?null:new Zl(r.ranges,i)),scrollIntoView:!0})),!0}}const D7=({state:t,dispatch:e})=>t.field(Bu,!1)?(e(t.update({effects:yd.of(null)})),!0):!1,z7=v5(1),B7=v5(-1),F7=[{key:"Tab",run:z7,shift:B7},{key:"Escape",run:D7}],Uk=Le.define({combine(t){return t.length?t[0]:F7}}),Z7=Im.highest(sp.compute([Uk],t=>t.facet(Uk)));function Gn(t,e){return Object.assign(Object.assign({},e),{apply:N7(t)})}const V7=je.domEventHandlers({mousedown(t,e){let n=e.state.field(Bu,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Mb(n.ranges,i.field),effects:yd.of(n.ranges.some(o=>o.field>i.field)?new Zl(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Fu={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ls=wt.define({map(t,e){let n=e.mapPos(t,-1,Mn.TrackAfter);return n??void 0}}),Ib=new class extends Hs{};Ib.startSide=1;Ib.endSide=-1;const O5=Ci.define({create(){return gt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Ls)&&(t=t.update({add:[Ib.range(n.value,n.value+1)]}));return t}});function U7(){return[W7,O5]}const Cv="()[]{}<>";function y5(t){for(let e=0;e{if((q7?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&yl(Ji(r,0))==1||e!=i.from||n!=i.to)return!1;let o=Y7(t.state,r);return o?(t.dispatch(o),!0):!1}),X7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=b5(t,t.selection.main.head).brackets||Fu.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=G7(t.doc,s.head);for(let l of r)if(l==a&&Vm(t.doc,s.head)==y5(Ji(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:ge.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},H7=[{key:"Backspace",run:X7}];function Y7(t,e){let n=b5(t,t.selection.main.head),r=n.brackets||Fu.brackets;for(let i of r){let o=y5(Ji(i,0));if(e==i)return o==i?eD(t,i,r.indexOf(i+i+i)>-1,n):K7(t,i,o,n.before||Fu.before);if(e==o&&S5(t,t.selection.main.from))return J7(t,i,o)}return null}function S5(t,e){let n=!1;return t.field(O5).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Vm(t,e){let n=t.sliceString(e,e+2);return n.slice(0,yl(Ji(n,0)))}function G7(t,e){let n=t.sliceString(e-2,e);return yl(Ji(n,0))==n.length?n:n.slice(1)}function K7(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Ls.of(s.to+e.length),range:ge.range(s.anchor+e.length,s.head+e.length)};let a=Vm(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Ls.of(s.head+e.length),range:ge.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function J7(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&Vm(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:ge.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function eD(t,e,n,r){let i=r.stringPrefixes||Fu.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Ls.of(a.to+e.length),range:ge.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Vm(t.doc,l),u;if(c==e){if(qk(t,l))return{changes:{insert:e+e,from:l},effects:Ls.of(l+e.length),range:ge.cursor(l+e.length)};if(S5(t,l)){let f=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:ge.cursor(l+f.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=Wk(t,l-2*e.length,i))>-1&&qk(t,u))return{changes:{insert:e+e+e+e,from:l},effects:Ls.of(l+e.length),range:ge.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Br.Word&&Wk(t,l,i)>-1&&!tD(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Ls.of(l+e.length),range:ge.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function qk(t,e){let n=gn(t).resolveInner(e+1);return n.parent&&n.from==e}function tD(t,e,n,r){let i=gn(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Wk(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Br.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=Br.Word)return o}return-1}const nD=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Lb(t.state,n.from);return r.line?rD(t):r.block?oD(t):!1};function Qb(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const rD=Qb(lD,0),iD=Qb(w5,0),oD=Qb((t,e)=>w5(t,e,aD(e)),0);function Lb(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const gc=50;function sD(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-gc,r),s=t.sliceDoc(i,i+gc),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,d;i-r<=2*gc?u=d=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+gc),d=t.sliceDoc(i-gc,i));let f=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(d)[0].length,p=d.length-h-n.length;return u.slice(f,f+e.length)==e&&d.slice(p,p+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(d.charAt(p-1))?1:0}}:null}function aD(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function w5(t,e,n=e.selection.ranges){let r=n.map(o=>Lb(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>sD(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>d.from)){i=d.from;let f=/^\s*/.exec(d.text)[0].length,h=f==d.length,p=d.text.slice(f,f+c.length)==c?f:-1;fo.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:d}of r)(d||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const HO=wi.define(),cD=wi.define(),uD=Le.define(),x5=Le.define({combine(t){return Lm(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),k5=Ci.define({create(){return Hi.empty},update(t,e){let n=e.state.facet(x5),r=e.annotation(HO);if(r){let l=nr.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=hp(u,u.length,n.minDepth,l):u=E5(u,e.startState.selection),new Hi(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(cD);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(sn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=nr.fromTransaction(e),s=e.annotation(sn.time),a=e.annotation(sn.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Hi(t.done.map(nr.fromJSON),t.undone.map(nr.fromJSON))}});function dD(t={}){return[k5,x5.of(t),je.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?C5:e.inputType=="historyRedo"?YO:null;return r?(e.preventDefault(),r(n)):!1}})]}function Um(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(k5,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const C5=Um(0,!1),YO=Um(1,!1),fD=Um(0,!0),hD=Um(1,!0);class nr{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new nr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new nr(e.changes&&cn.fromJSON(e.changes),[],e.mapped&&eo.fromJSON(e.mapped),e.startSelection&&ge.fromJSON(e.startSelection),e.selectionsAfter.map(ge.fromJSON))}static fromTransaction(e,n){let r=Zr;for(let i of e.startState.facet(uD)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new nr(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Zr)}static selection(e){return new nr(void 0,Zr,void 0,void 0,e)}}function hp(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function pD(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function mD(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function P5(t,e){return t.length?e.length?t.concat(e):t:e}const Zr=[],gD=200;function E5(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gD));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),hp(t,t.length-1,1e9,n.setSelAfter(r)))}else return[nr.selection([e])]}function vD(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Pv(t,e){if(!t.length)return t;let n=t.length,r=Zr;for(;n;){let i=OD(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[nr.selection(r)]:Zr}function OD(t,e,n){let r=P5(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Zr,n);if(!t.changes)return nr.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new nr(i,wt.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const yD=/^(input\.type|delete)($|\.)/;class Hi{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Hi(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||yD.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):qm(n,e))}function zn(t){return t.textDirectionAt(t.state.selection.main.head)==fn.LTR}const T5=t=>_5(t,!zn(t)),$5=t=>_5(t,zn(t));function A5(t,e){return Pi(t,n=>n.empty?t.moveByGroup(n,e):qm(n,e))}const SD=t=>A5(t,!zn(t)),wD=t=>A5(t,zn(t));function xD(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Wm(t,e,n){let r=gn(t).resolveInner(e.head),i=n?He.closedBy:He.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;xD(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?Xi(t,r.from,1):Xi(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,ge.cursor(a,n?-1:1)}const kD=t=>Pi(t,e=>Wm(t.state,e,!zn(t))),CD=t=>Pi(t,e=>Wm(t.state,e,zn(t)));function R5(t,e){return Pi(t,n=>{if(!n.empty)return qm(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const M5=t=>R5(t,!1),I5=t=>R5(t,!0);function Q5(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,n.height):qm(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottomL5(t,!1),GO=t=>L5(t,!0);function Os(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=ge.cursor(r.from+o))}return i}const PD=t=>Pi(t,e=>Os(t,e,!0)),ED=t=>Pi(t,e=>Os(t,e,!1)),_D=t=>Pi(t,e=>Os(t,e,!zn(t))),TD=t=>Pi(t,e=>Os(t,e,zn(t))),$D=t=>Pi(t,e=>ge.cursor(t.lineBlockAt(e.head).from,1)),AD=t=>Pi(t,e=>ge.cursor(t.lineBlockAt(e.head).to,-1));function RD(t,e,n){let r=!1,i=Vl(t.selection,o=>{let s=Xi(t,o.head,-1)||Xi(t,o.head,1)||o.head>0&&Xi(t,o.head-1,1)||o.headRD(t,e);function ii(t,e){let n=Vl(t.state.selection,r=>{let i=e(r);return ge.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(oo(t.state,n)),!0)}function j5(t,e){return ii(t,n=>t.moveByChar(n,e))}const N5=t=>j5(t,!zn(t)),D5=t=>j5(t,zn(t));function z5(t,e){return ii(t,n=>t.moveByGroup(n,e))}const ID=t=>z5(t,!zn(t)),QD=t=>z5(t,zn(t)),LD=t=>ii(t,e=>Wm(t.state,e,!zn(t))),jD=t=>ii(t,e=>Wm(t.state,e,zn(t)));function B5(t,e){return ii(t,n=>t.moveVertically(n,e))}const F5=t=>B5(t,!1),Z5=t=>B5(t,!0);function V5(t,e){return ii(t,n=>t.moveVertically(n,e,Q5(t).height))}const Hk=t=>V5(t,!1),Yk=t=>V5(t,!0),ND=t=>ii(t,e=>Os(t,e,!0)),DD=t=>ii(t,e=>Os(t,e,!1)),zD=t=>ii(t,e=>Os(t,e,!zn(t))),BD=t=>ii(t,e=>Os(t,e,zn(t))),FD=t=>ii(t,e=>ge.cursor(t.lineBlockAt(e.head).from)),ZD=t=>ii(t,e=>ge.cursor(t.lineBlockAt(e.head).to)),Gk=({state:t,dispatch:e})=>(e(oo(t,{anchor:0})),!0),Kk=({state:t,dispatch:e})=>(e(oo(t,{anchor:t.doc.length})),!0),Jk=({state:t,dispatch:e})=>(e(oo(t,{anchor:t.selection.main.anchor,head:0})),!0),e2=({state:t,dispatch:e})=>(e(oo(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),VD=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),UD=({state:t,dispatch:e})=>{let n=Xm(t).map(({from:r,to:i})=>ge.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:ge.create(n),userEvent:"select"})),!0},qD=({state:t,dispatch:e})=>{let n=Vl(t.selection,r=>{let i=gn(t),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return ge.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(oo(t,n)),!0)},WD=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=ge.create([n.main]):n.main.empty||(r=ge.create([ge.cursor(n.main.head)])),r?(e(oo(t,r)),!0):!1};function bd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(n="delete.forward",l=Sf(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=Sf(t,s,!1),a=Sf(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:ge.cursor(s,si(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const U5=(t,e,n)=>bd(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&iU5(t,!1,!0),q5=t=>U5(t,!0,!1),W5=(t,e)=>bd(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=Vn(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),jb=t=>W5(t,!1),XD=t=>W5(t,!0),HD=t=>bd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headbd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),GD=t=>bd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:at.of(["",""])},range:ge.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},JD=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:Vn(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Vn(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:ge.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Xm(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function X5(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of Xm(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(ge.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(ge.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:ge.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ez=({state:t,dispatch:e})=>X5(t,e,!1),tz=({state:t,dispatch:e})=>X5(t,e,!0);function H5(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of Xm(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const nz=({state:t,dispatch:e})=>H5(t,e,!1),rz=({state:t,dispatch:e})=>H5(t,e,!0),iz=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Xm(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function oz(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=gn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(He.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const t2=Y5(!1),sz=Y5(!0);function Y5(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&oz(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Fm(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=c5(c,o);for(u==null&&(u=md(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:ge.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const az=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Fm(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=Nb(t,(o,s,a)=>{let l=c5(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=fp(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(Nb(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Bm)})}),{userEvent:"input.indent"})),!0),K5=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Nb(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=md(i,t.tabSize),s=0,a=fp(t,Math.max(0,o-dp(t)));for(;s(t.setTabFocusMode(),!0),cz=[{key:"Ctrl-b",run:T5,shift:N5,preventDefault:!0},{key:"Ctrl-f",run:$5,shift:D5},{key:"Ctrl-p",run:M5,shift:F5},{key:"Ctrl-n",run:I5,shift:Z5},{key:"Ctrl-a",run:$D,shift:FD},{key:"Ctrl-e",run:AD,shift:ZD},{key:"Ctrl-d",run:q5},{key:"Ctrl-h",run:KO},{key:"Ctrl-k",run:HD},{key:"Ctrl-Alt-h",run:jb},{key:"Ctrl-o",run:KD},{key:"Ctrl-t",run:JD},{key:"Ctrl-v",run:GO}],uz=[{key:"ArrowLeft",run:T5,shift:N5,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:SD,shift:ID,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:_D,shift:zD,preventDefault:!0},{key:"ArrowRight",run:$5,shift:D5,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:wD,shift:QD,preventDefault:!0},{mac:"Cmd-ArrowRight",run:TD,shift:BD,preventDefault:!0},{key:"ArrowUp",run:M5,shift:F5,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Gk,shift:Jk},{mac:"Ctrl-ArrowUp",run:Xk,shift:Hk},{key:"ArrowDown",run:I5,shift:Z5,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Kk,shift:e2},{mac:"Ctrl-ArrowDown",run:GO,shift:Yk},{key:"PageUp",run:Xk,shift:Hk},{key:"PageDown",run:GO,shift:Yk},{key:"Home",run:ED,shift:DD,preventDefault:!0},{key:"Mod-Home",run:Gk,shift:Jk},{key:"End",run:PD,shift:ND,preventDefault:!0},{key:"Mod-End",run:Kk,shift:e2},{key:"Enter",run:t2,shift:t2},{key:"Mod-a",run:VD},{key:"Backspace",run:KO,shift:KO},{key:"Delete",run:q5},{key:"Mod-Backspace",mac:"Alt-Backspace",run:jb},{key:"Mod-Delete",mac:"Alt-Delete",run:XD},{mac:"Mod-Backspace",run:YD},{mac:"Mod-Delete",run:GD}].concat(cz.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),dz=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:kD,shift:LD},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:CD,shift:jD},{key:"Alt-ArrowUp",run:ez},{key:"Shift-Alt-ArrowUp",run:nz},{key:"Alt-ArrowDown",run:tz},{key:"Shift-Alt-ArrowDown",run:rz},{key:"Escape",run:WD},{key:"Mod-Enter",run:sz},{key:"Alt-l",mac:"Ctrl-l",run:UD},{key:"Mod-i",run:qD,preventDefault:!0},{key:"Mod-[",run:K5},{key:"Mod-]",run:G5},{key:"Mod-Alt-\\",run:az},{key:"Shift-Mod-k",run:iz},{key:"Shift-Mod-\\",run:MD},{key:"Mod-/",run:nD},{key:"Alt-A",run:iD},{key:"Ctrl-m",mac:"Shift-Alt-m",run:lz}].concat(uz);(function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}var t=window.document,e=[],n=null,r=null;function i(v){this.time=v.time,this.target=v.target,this.rootBounds=h(v.rootBounds),this.boundingClientRect=h(v.boundingClientRect),this.intersectionRect=h(v.intersectionRect||f()),this.isIntersecting=!!v.intersectionRect;var O=this.boundingClientRect,b=O.width*O.height,S=this.intersectionRect,w=S.width*S.height;b?this.intersectionRatio=Number((w/b).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function o(v,O){var b=O||{};if(typeof v!="function")throw new Error("callback must be a function");if(b.root&&b.root.nodeType!=1)throw new Error("root must be an Element");this._checkForIntersections=a(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=v,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(b.rootMargin),this.thresholds=this._initThresholds(b.threshold),this.root=b.root||null,this.rootMargin=this._rootMarginValues.map(function(S){return S.value+S.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return n||(n=function(v,O){!v||!O?r=f():r=p(v,O),e.forEach(function(b){b._checkForIntersections()})}),n},o._resetCrossOriginUpdater=function(){n=null,r=null},o.prototype.observe=function(v){var O=this._observationTargets.some(function(b){return b.element==v});if(!O){if(!(v&&v.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:v,entry:null}),this._monitorIntersections(v.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(v){this._observationTargets=this._observationTargets.filter(function(O){return O.element!=v}),this._unmonitorIntersections(v.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var v=this._queuedEntries.slice();return this._queuedEntries=[],v},o.prototype._initThresholds=function(v){var O=v||[0];return Array.isArray(O)||(O=[O]),O.sort().filter(function(b,S,w){if(typeof b!="number"||isNaN(b)||b<0||b>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return b!==w[S-1]})},o.prototype._parseRootMargin=function(v){var O=v||"0px",b=O.split(/\s+/).map(function(S){var w=/^(-?\d*\.?\d+)(px|%)$/.exec(S);if(!w)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(w[1]),unit:w[2]}});return b[1]=b[1]||b[0],b[2]=b[2]||b[0],b[3]=b[3]||b[1],b},o.prototype._monitorIntersections=function(v){var O=v.defaultView;if(O&&this._monitoringDocuments.indexOf(v)==-1){var b=this._checkForIntersections,S=null,w=null;if(this.POLL_INTERVAL?S=O.setInterval(b,this.POLL_INTERVAL):(l(O,"resize",b,!0),l(v,"scroll",b,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in O&&(w=new O.MutationObserver(b),w.observe(v,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(v),this._monitoringUnsubscribes.push(function(){var $=v.defaultView;$&&(S&&$.clearInterval(S),c($,"resize",b,!0)),c(v,"scroll",b,!0),w&&w.disconnect()}),v!=(this.root&&this.root.ownerDocument||t)){var C=g(v);C&&this._monitorIntersections(C.ownerDocument)}}},o.prototype._unmonitorIntersections=function(v){var O=this._monitoringDocuments.indexOf(v);if(O!=-1){var b=this.root&&this.root.ownerDocument||t,S=this._observationTargets.some(function($){var A=$.element.ownerDocument;if(A==v)return!0;for(;A&&A!=b;){var k=g(A);if(A=k&&k.ownerDocument,A==v)return!0}return!1});if(!S){var w=this._monitoringUnsubscribes[O];if(this._monitoringDocuments.splice(O,1),this._monitoringUnsubscribes.splice(O,1),w(),v!=b){var C=g(v);C&&this._unmonitorIntersections(C.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var v=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var O=0;O=0&&A>=0&&{top:b,bottom:S,left:w,right:C,width:$,height:A}||null}function d(v){var O;try{O=v.getBoundingClientRect()}catch{}return O?(O.width&&O.height||(O={top:O.top,right:O.right,bottom:O.bottom,left:O.left,width:O.right-O.left,height:O.bottom-O.top}),O):f()}function f(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function h(v){return!v||"x"in v?v:{top:v.top,y:v.top,bottom:v.bottom,left:v.left,x:v.left,right:v.right,width:v.width,height:v.height}}function p(v,O){var b=O.top-v.top,S=O.left-v.left;return{top:b,left:S,height:O.height,width:O.width,bottom:b+O.height,right:S+O.width}}function m(v,O){for(var b=O;b;){if(b==v)return!0;b=y(b)}return!1}function y(v){var O=v.parentNode;return v.nodeType==9&&v!=t?g(v):O&&O.nodeType==11&&O.host?O.host:O&&O.assignedSlot?O.assignedSlot.parentNode:O}function g(v){try{return v.defaultView&&v.defaultView.frameElement||null}catch{return null}}window.IntersectionObserver=o,window.IntersectionObserverEntry=i})();const fz=mi[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"];function hz(t,e={}){const{root:n=null,pollInterval:r=null,useMutationObserver:i=!1,rootMargin:o="0px 0px 0px 0px",threshold:s=0,initialIsIntersecting:a=!1}=e,[l,c]=T.useState(()=>({boundingClientRect:null,intersectionRatio:0,intersectionRect:null,isIntersecting:a,rootBounds:null,target:null,time:0})),[u,d]=T.useState(()=>r2({root:n,pollInterval:r,useMutationObserver:i,rootMargin:o,threshold:s}));return T.useEffect(()=>{const f=r2({root:n,pollInterval:r,useMutationObserver:i,rootMargin:o,threshold:s});d(f)},[n,o,r,i,JSON.stringify(s)]),fz(()=>{const f=t&&"current"in t?t.current:t;if(!u||!f)return;let h=!1;u.observer.observe(f);const p=m=>{if(!h)for(let y=0;y{h=!0,u.observer.unobserve(f),u.unsubscribe(p)}},[t,u]),l}function pz({root:t=null,pollInterval:e=null,useMutationObserver:n=!1,rootMargin:r="0px 0px 0px 0px",threshold:i=0}){const o=new Set;if(typeof IntersectionObserver>"u")return null;const s=new IntersectionObserver(a=>{for(const l of o)l(a,s)},{root:t,rootMargin:r,threshold:i});return s.POLL_INTERVAL=e,s.USE_MUTATION_OBSERVER=n,{observer:s,getListeners(){return o},subscribe:a=>o.add(a),unsubscribe:a=>o.delete(a)}}const n2=new Map;function r2(t){const{root:e,...n}=t,r=JSON.stringify(n);let i=n2.get(e);return i||(i={},n2.set(e,i)),i[r]?i[r]:i[r]=pz(t)}var i2={};class pp{constructor(e,n,r,i,o,s,a,l,c,u=0,d){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=d}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new pp(e,[],n,r,r,0,[],0,i?new o2(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new pp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new mz(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class o2{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class mz{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class mp{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new mp(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new mp(this.stack,this.pos,this.index)}}function Lc(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class fh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const s2=new fh;class gz{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=s2,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=s2,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class al{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;J5(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}al.prototype.contextual=al.prototype.fallback=al.prototype.extend=!1;class gp{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Lc(e):e}token(e,n){let r=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(J5(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(o||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}gp.prototype.contextual=al.prototype.fallback=al.prototype.extend=!1;class oi{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function J5(t,e,n,r,i,o){let s=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||vz(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;d>1,p=c+h+(h<<1),m=t[p],y=t[p+1]||65536;if(u=y)d=h+1;else{s=t[p+2],e.advance();continue e}}break}}function a2(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function vz(t,e,n,r){let i=a2(n,r,e);return i<0||a2(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class Oz{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?l2(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?l2(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof Dt){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class yz{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new fh)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cd.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let f=n;if(d.extended>-1&&(n=this.addActions(e,d.extended,d.end,n)),n=this.addActions(e,d.value,d.end,n),!u.extend&&(r=d,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new fh,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new fh,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;oe.bufferLength*4?new Oz(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&wz(i);if(s)return dr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw dr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return dr&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?o.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!c||(d.prop(He.contextHash)||0)==u))return e.useNode(d,f),dr&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(d.type.id)})`),!0;if(!(d instanceof Dt)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Dt&&d.positions[0]==0)d=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),dr&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return c2(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),dr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let d=a.split(),f=u;for(let h=0;d.forceReduce()&&h<10&&(dr&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,r));h++)dr&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))dr&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),dr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),c2(a,r)):(!i||i.scoret;class e3{constructor(e){this.start=e.start,this.shift=e.shift||_v,this.reduce=e.reduce||_v,this.reuse=e.reuse||_v,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class El extends r5{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let d=a[c+-u];for(let f=-u;f>0;f--)o(a[c++],l,d);c++}}}this.nodeSet=new xb(n.map((a,l)=>Wn.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=K$;let s=Lc(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new al(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new bz(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=fo(this.data,o+2);else break;i=n(fo(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=fo(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(El.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=u2(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const xz=99,d2=1,kz=100,Cz=101,f2=2,t3=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Pz=58,Ez=40,n3=95,_z=91,hh=45,Tz=46,$z=35,Az=37,Rz=38,Mz=92,Iz=10;function Zu(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function r3(t){return t>=48&&t<=57}const Qz=new oi((t,e)=>{for(let n=!1,r=0,i=0;;i++){let{next:o}=t;if(Zu(o)||o==hh||o==n3||n&&r3(o))!n&&(o!=hh||i>0)&&(n=!0),r===i&&o==hh&&r++,t.advance();else if(o==Mz&&t.peek(1)!=Iz)t.advance(),t.next>-1&&t.advance(),n=!0;else{n&&t.acceptToken(o==Ez?kz:r==2&&e.canShift(f2)?f2:Cz);break}}}),Lz=new oi(t=>{if(t3.includes(t.peek(-1))){let{next:e}=t;(Zu(e)||e==n3||e==$z||e==Tz||e==_z||e==Pz&&Zu(t.peek(1))||e==hh||e==Rz)&&t.acceptToken(xz)}}),jz=new oi(t=>{if(!t3.includes(t.peek(-1))){let{next:e}=t;if(e==Az&&(t.advance(),t.acceptToken(d2)),Zu(e)){do t.advance();while(Zu(t.next)||r3(t.next));t.acceptToken(d2)}}}),Nz=zm({"AtKeyword import charset namespace keyframes media supports":q.definitionKeyword,"from to selector":q.keyword,NamespaceName:q.namespace,KeyframeName:q.labelName,KeyframeRangeName:q.operatorKeyword,TagName:q.tagName,ClassName:q.className,PseudoClassName:q.constant(q.className),IdName:q.labelName,"FeatureName PropertyName":q.propertyName,AttributeName:q.attributeName,NumberLiteral:q.number,KeywordQuery:q.keyword,UnaryQueryOp:q.operatorKeyword,"CallTag ValueName":q.atom,VariableName:q.variableName,Callee:q.operatorKeyword,Unit:q.unit,"UniversalSelector NestingSelector":q.definitionOperator,MatchOp:q.compareOperator,"ChildOp SiblingOp, LogicOp":q.logicOperator,BinOp:q.arithmeticOperator,Important:q.modifier,Comment:q.blockComment,ColorLiteral:q.color,"ParenthesizedContent StringLiteral":q.string,":":q.punctuation,"PseudoOp #":q.derefOperator,"; ,":q.separator,"( )":q.paren,"[ ]":q.squareBracket,"{ }":q.brace}),Dz={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},zz={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},Bz={__proto__:null,not:132,only:132},Fz=El.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Lz,jz,Qz,1,2,3,4,new gp("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:t=>Dz[t]||-1},{term:58,get:t=>zz[t]||-1},{term:101,get:t=>Bz[t]||-1}],tokenPrec:1219});let Tv=null;function $v(){if(!Tv&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));Tv=e.sort().map(r=>({type:"property",label:r}))}return Tv||[]}const h2=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),p2=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),Zz=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Vz=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),lo=/^(\w[\w-]*|-\w[\w-]*|)$/,Uz=/^-(-[\w-]*)?$/;function qz(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const m2=new n5,Wz=["Declaration"];function Xz(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function i3(t,e,n){if(e.to-e.from>4096){let r=m2.get(e);if(r)return r;let i=[],o=new Set,s=e.cursor($t.IncludeAnonymous);if(s.firstChild())do for(let a of i3(t,s.node,n))o.has(a.label)||(o.add(a.label),i.push(a));while(s.nextSibling());return m2.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(o=>{var s;if(n(o)&&o.matchContext(Wz)&&((s=o.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let a=t.sliceString(o.from,o.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const Hz=t=>e=>{let{state:n,pos:r}=e,i=gn(n).resolveInner(r,-1),o=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(o||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:$v(),validFor:lo};if(i.name=="ValueName")return{from:i.from,options:p2,validFor:lo};if(i.name=="PseudoClassName")return{from:i.from,options:h2,validFor:lo};if(t(i)||(e.explicit||o)&&qz(i,n.doc))return{from:t(i)||o?i.from:r,options:i3(n.doc,Xz(i),t),validFor:Uz};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:$v(),validFor:lo};return{from:i.from,options:Zz,validFor:lo}}if(i.name=="AtKeyword")return{from:i.from,options:Vz,validFor:lo};if(!e.explicit)return null;let s=i.resolve(r),a=s.childBefore(r);return a&&a.name==":"&&s.name=="PseudoClassSelector"?{from:r,options:h2,validFor:lo}:a&&a.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:r,options:p2,validFor:lo}:s.name=="Block"||s.name=="Styles"?{from:r,options:$v(),validFor:lo}:null},Yz=Hz(t=>t.name=="VariableName"),vp=kl.define({name:"css",parser:Fz.configure({props:[Zm.add({Declaration:dh()}),$b.add({"Block KeyframeList":f5})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function o3(){return new _b(vp,vp.data.of({autocomplete:Yz}))}const Gz=54,Kz=1,Jz=55,eB=2,tB=56,nB=3,g2=4,rB=5,Op=6,s3=7,a3=8,l3=9,c3=10,iB=11,oB=12,sB=13,Av=57,aB=14,v2=58,u3=20,lB=22,d3=23,cB=24,JO=26,f3=27,uB=28,dB=31,fB=34,hB=36,pB=37,mB=0,gB=1,vB={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},OB={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},O2={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function yB(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function h3(t){return t==9||t==10||t==13||t==32}let y2=null,b2=null,S2=0;function e1(t,e){let n=t.pos+e;if(S2==n&&b2==t)return y2;let r=t.peek(e);for(;h3(r);)r=t.peek(++e);let i="";for(;yB(r);)i+=String.fromCharCode(r),r=t.peek(++e);return b2=t,S2=n,y2=i?i.toLowerCase():r==bB||r==SB?void 0:null}const p3=60,yp=62,Db=47,bB=63,SB=33,wB=45;function w2(t,e){this.name=t,this.parent=e}const xB=[Op,c3,s3,a3,l3],kB=new e3({start:null,shift(t,e,n,r){return xB.indexOf(e)>-1?new w2(e1(r,1)||"",t):t},reduce(t,e){return e==u3&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==Op||i==hB?new w2(e1(r,1)||"",t):t},strict:!1}),CB=new oi((t,e)=>{if(t.next!=p3){t.next<0&&e.context&&t.acceptToken(Av);return}t.advance();let n=t.next==Db;n&&t.advance();let r=e1(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?aB:Op);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(iB);if(i&&OB[i])return t.acceptToken(Av,-2);if(e.dialectEnabled(mB))return t.acceptToken(oB);for(let o=e.context;o;o=o.parent)if(o.name==r)return;t.acceptToken(sB)}else{if(r=="script")return t.acceptToken(s3);if(r=="style")return t.acceptToken(a3);if(r=="textarea")return t.acceptToken(l3);if(vB.hasOwnProperty(r))return t.acceptToken(c3);i&&O2[i]&&O2[i][r]?t.acceptToken(Av,-1):t.acceptToken(Op)}},{contextual:!0}),PB=new oi(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(v2);break}if(t.next==wB)e++;else if(t.next==yp&&e>=2){n>=3&&t.acceptToken(v2,-2);break}else e=0;t.advance()}});function EB(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const _B=new oi((t,e)=>{if(t.next==Db&&t.peek(1)==yp){let n=e.dialectEnabled(gB)||EB(e.context);t.acceptToken(n?rB:g2,2)}else t.next==yp&&t.acceptToken(g2,1)});function zb(t,e,n){let r=2+t.length;return new oi(i=>{for(let o=0,s=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(o==0&&i.next==p3||o==1&&i.next==Db||o>=2&&os?i.acceptToken(e,-s):i.acceptToken(n,-(s-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else o=s=0;i.advance()}})}const TB=zb("script",Gz,Kz),$B=zb("style",Jz,eB),AB=zb("textarea",tB,nB),RB=zm({"Text RawText":q.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":q.angleBracket,TagName:q.tagName,"MismatchedCloseTag/TagName":[q.tagName,q.invalid],AttributeName:q.attributeName,"AttributeValue UnquotedAttributeValue":q.attributeValue,Is:q.definitionOperator,"EntityReference CharacterReference":q.character,Comment:q.blockComment,ProcessingInst:q.processingInstruction,DoctypeDecl:q.documentMeta}),MB=El.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:kB,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[RB],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=a.type.id;if(c==uB)return Rv(a,l,n);if(c==dB)return Rv(a,l,r);if(c==fB)return Rv(a,l,i);if(c==u3&&o.length){let u=a.node,d=u.firstChild,f=d&&x2(d,l),h;if(f){for(let p of o)if(p.tag==f&&(!p.attrs||p.attrs(h||(h=m3(d,l))))){let m=u.lastChild,y=m.type.id==pB?m.from:u.to;if(y>d.to)return{parser:p.parser,overlay:[{from:d.to,to:y}]}}}}if(s&&c==d3){let u=a.node,d;if(d=u.firstChild){let f=s[l.read(d.from,d.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=x2(u.parent,l))continue;let p=u.lastChild;if(p.type.id==JO){let m=p.from+1,y=p.lastChild,g=p.to-(y&&y.isError?0:1);if(g>m)return{parser:h.parser,overlay:[{from:m,to:g}]}}else if(p.type.id==f3)return{parser:h.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const IB=312,QB=313,k2=1,LB=2,jB=3,NB=4,DB=314,zB=316,BB=317,FB=5,ZB=6,VB=0,t1=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],v3=125,UB=59,n1=47,qB=42,WB=43,XB=45,HB=60,YB=44,GB=63,KB=46,JB=91,eF=new e3({start:!1,shift(t,e){return e==FB||e==ZB||e==zB?t:e==BB},strict:!1}),tF=new oi((t,e)=>{let{next:n}=t;(n==v3||n==-1||e.context)&&t.acceptToken(DB)},{contextual:!0,fallback:!0}),nF=new oi((t,e)=>{let{next:n}=t,r;t1.indexOf(n)>-1||n==n1&&((r=t.peek(1))==n1||r==qB)||n!=v3&&n!=UB&&n!=-1&&!e.context&&t.acceptToken(IB)},{contextual:!0}),rF=new oi((t,e)=>{t.next==JB&&!e.context&&t.acceptToken(QB)},{contextual:!0}),iF=new oi((t,e)=>{let{next:n}=t;if(n==WB||n==XB){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(k2);t.acceptToken(r?k2:LB)}}else n==GB&&t.peek(1)==KB&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(jB))},{contextual:!0});function Mv(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const oF=new oi((t,e)=>{if(t.next!=HB||!e.dialectEnabled(VB)||(t.advance(),t.next==n1))return;let n=0;for(;t1.indexOf(t.next)>-1;)t.advance(),n++;if(Mv(t.next,!0)){for(t.advance(),n++;Mv(t.next,!1);)t.advance(),n++;for(;t1.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==YB)return;for(let r=0;;r++){if(r==7){if(!Mv(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(NB,-n)}),sF=zm({"get set async static":q.modifier,"for while do if else switch try catch finally return throw break continue default case":q.controlKeyword,"in of await yield void typeof delete instanceof":q.operatorKeyword,"let var const using function class extends":q.definitionKeyword,"import export from":q.moduleKeyword,"with debugger as new":q.keyword,TemplateString:q.special(q.string),super:q.atom,BooleanLiteral:q.bool,this:q.self,null:q.null,Star:q.modifier,VariableName:q.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":q.function(q.variableName),VariableDefinition:q.definition(q.variableName),Label:q.labelName,PropertyName:q.propertyName,PrivatePropertyName:q.special(q.propertyName),"CallExpression/MemberExpression/PropertyName":q.function(q.propertyName),"FunctionDeclaration/VariableDefinition":q.function(q.definition(q.variableName)),"ClassDeclaration/VariableDefinition":q.definition(q.className),PropertyDefinition:q.definition(q.propertyName),PrivatePropertyDefinition:q.definition(q.special(q.propertyName)),UpdateOp:q.updateOperator,"LineComment Hashbang":q.lineComment,BlockComment:q.blockComment,Number:q.number,String:q.string,Escape:q.escape,ArithOp:q.arithmeticOperator,LogicOp:q.logicOperator,BitOp:q.bitwiseOperator,CompareOp:q.compareOperator,RegExp:q.regexp,Equals:q.definitionOperator,Arrow:q.function(q.punctuation),": Spread":q.punctuation,"( )":q.paren,"[ ]":q.squareBracket,"{ }":q.brace,"InterpolationStart InterpolationEnd":q.special(q.brace),".":q.derefOperator,", ;":q.separator,"@":q.meta,TypeName:q.typeName,TypeDefinition:q.definition(q.typeName),"type enum interface implements namespace module declare":q.definitionKeyword,"abstract global Privacy readonly override":q.modifier,"is keyof unique infer":q.operatorKeyword,JSXAttributeValue:q.attributeValue,JSXText:q.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":q.angleBracket,"JSXIdentifier JSXNameSpacedName":q.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":q.attributeName,"JSXBuiltin/JSXIdentifier":q.standard(q.tagName)}),aF={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},lF={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},cF={__proto__:null,"<":187},uF=El.deserialize({version:14,states:"$CdQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D^O.QQlO'#DdO.bQlO'#DoO%[QlO'#DwO0fQlO'#EPOOQ!0Lf'#EX'#EXO1PQ`O'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQ`O'#GpO1dQ`O'#ElO1iQ`O'#ElO3hQ!0MxO'#JnO6[Q!0MxO'#JoO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#FzO9RQ`O'#FyOOQ!0Lf'#Jo'#JoOOQ!0Lb'#Jn'#JnO9WQ`O'#GtOOQ['#K['#K[O9cQ`O'#IUO9hQ!0LrO'#IVOOQ['#J['#J[OOQ['#IZ'#IZQ`QlOOQ`QlOOO9pQ!L^O'#DsO9wQlO'#D{O:OQlO'#D}O9^Q`O'#GpO:VQMhO'#CoO:eQ`O'#EkO:pQ`O'#EvO:uQMhO'#FdO;dQ`O'#GpOOQO'#K]'#K]O;iQ`O'#K]O;wQ`O'#GxO;wQ`O'#GyO;wQ`O'#G{O9^Q`O'#HOOVQ`O'#CeO>gQ`O'#H_O>oQ`O'#HeO>oQ`O'#HgO`QlO'#HiO>oQ`O'#HkO>oQ`O'#HnO>tQ`O'#HtO>yQ!0LsO'#HzO%[QlO'#H|O?UQ!0LsO'#IOO?aQ!0LsO'#IQO9hQ!0LrO'#ISO?lQ!0MxO'#CiO@nQpO'#DiQOQ`OOO%[QlO'#D}OAUQ`O'#EQO:VQMhO'#EkOAaQ`O'#EkOAlQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Dn'#DnOOQ!0Lb'#Jr'#JrO%[QlO'#JrOOQO'#Ju'#JuOOQO'#Id'#IdOBlQpO'#EdOOQ!0Lb'#Ec'#EcOOQ!0Lb'#Jy'#JyOChQ!0MSO'#EdOCrQpO'#ETOOQO'#Jt'#JtODWQpO'#JuOEeQpO'#ETOCrQpO'#EdPErO&2DjO'#CbPOOO)CDy)CDyOOOO'#I['#I[OE}O#tO,59UOOQ!0Lh,59U,59UOOOO'#I]'#I]OF]O&jO,59UOFkQ!L^O'#D`OOOO'#I_'#I_OFrO#@ItO,59xOOQ!0Lf,59x,59xOGQQlO'#I`OGeQ`O'#JpOIdQ!fO'#JpO+}QlO'#JpOIkQ`O,5:OOJRQ`O'#EmOJ`Q`O'#KPOJkQ`O'#KOOJkQ`O'#KOOJsQ`O,5;ZOJxQ`O'#J}OOQ!0Ln,5:Z,5:ZOKPQlO,5:ZOL}Q!0MxO,5:cOMnQ`O,5:kONXQ!0LrO'#J|ON`Q`O'#J{O9WQ`O'#J{ONtQ`O'#J{ON|Q`O,5;YO! RQ`O'#J{O!#WQ!fO'#JoOOQ!0Lh'#Ci'#CiO%[QlO'#EPO!#vQ!fO,5:pOOQS'#Jv'#JvOOQO-EpOOQ['#Jd'#JdOOQ[,5>q,5>qOOQ[-E[Q!0MxO,5:gO%[QlO,5:gO!@rQ!0MxO,5:iOOQO,5@w,5@wO!AcQMhO,5=[O!AqQ!0LrO'#JeO9RQ`O'#JeO!BSQ!0LrO,59ZO!B_QpO,59ZO!BgQMhO,59ZO:VQMhO,59ZO!BrQ`O,5;WO!BzQ`O'#H^O!C`Q`O'#KaO%[QlO,5;|O!9fQpO,5tQ`O'#HTO9^Q`O'#HVO!DwQ`O'#HVO:VQMhO'#HXO!D|Q`O'#HXOOQ[,5=m,5=mO!ERQ`O'#HYO!EdQ`O'#CoO!EiQ`O,59PO!EsQ`O,59PO!GxQlO,59POOQ[,59P,59PO!HYQ!0LrO,59PO%[QlO,59PO!JeQlO'#HaOOQ['#Hb'#HbOOQ['#Hc'#HcO`QlO,5=yO!J{Q`O,5=yO`QlO,5>PO`QlO,5>RO!KQQ`O,5>TO`QlO,5>VO!KVQ`O,5>YO!K[QlO,5>`OOQ[,5>f,5>fO%[QlO,5>fO9hQ!0LrO,5>hOOQ[,5>j,5>jO# fQ`O,5>jOOQ[,5>l,5>lO# fQ`O,5>lOOQ[,5>n,5>nO#!SQpO'#D[O%[QlO'#JrO#!uQpO'#JrO##PQpO'#DjO##bQpO'#DjO#%sQlO'#DjO#%zQ`O'#JqO#&SQ`O,5:TO#&XQ`O'#EqO#&gQ`O'#KQO#&oQ`O,5;[O#&tQpO'#DjO#'RQpO'#ESOOQ!0Lf,5:l,5:lO%[QlO,5:lO#'YQ`O,5:lO>tQ`O,5;VO!B_QpO,5;VO!BgQMhO,5;VO:VQMhO,5;VO#'bQ`O,5@^O#'gQ07dO,5:pOOQO-EzO+}QlO,5>zOOQO,5?Q,5?QO#*oQlO'#I`OOQO-E<^-E<^O#*|Q`O,5@[O#+UQ!fO,5@[O#+]Q`O,5@jOOQ!0Lf1G/j1G/jO%[QlO,5@kO#+eQ`O'#IfOOQO-EoQ`O1G3oO$4WQlO1G3qO$8[QlO'#HpOOQ[1G3t1G3tO$8iQ`O'#HvO>tQ`O'#HxOOQ[1G3z1G3zO$8qQlO1G3zO9hQ!0LrO1G4QOOQ[1G4S1G4SOOQ!0Lb'#G]'#G]O9hQ!0LrO1G4UO9hQ!0LrO1G4WO$tQ`O,5:UO!(vQlO,5:UO!B_QpO,5:UO$<}Q?MtO,5:UOOQO,5;],5;]O$=XQpO'#IaO$=oQ`O,5@]OOQ!0Lf1G/o1G/oO$=wQpO'#IgO$>RQ`O,5@lOOQ!0Lb1G0v1G0vO##bQpO,5:UOOQO'#Ic'#IcO$>ZQpO,5:nOOQ!0Ln,5:n,5:nO#']Q`O1G0WOOQ!0Lf1G0W1G0WO%[QlO1G0WOOQ!0Lf1G0q1G0qO>tQ`O1G0qO!B_QpO1G0qO!BgQMhO1G0qOOQ!0Lb1G5x1G5xO!BSQ!0LrO1G0ZOOQO1G0j1G0jO%[QlO1G0jO$>bQ!0LrO1G0jO$>mQ!0LrO1G0jO!B_QpO1G0ZOCrQpO1G0ZO$>{Q!0LrO1G0jOOQO1G0Z1G0ZO$?aQ!0MxO1G0jPOOO-EzO$?}Q`O1G5vO$@VQ`O1G6UO$@_Q!fO1G6VO9WQ`O,5?QO$@iQ!0MxO1G6SO%[QlO1G6SO$@yQ!0LrO1G6SO$A[Q`O1G6RO$A[Q`O1G6RO9WQ`O1G6RO$AdQ`O,5?TO9WQ`O,5?TOOQO,5?T,5?TO$AxQ`O,5?TO$)QQ`O,5?TOOQO-E[OOQ[,5>[,5>[O%[QlO'#HqO%<{Q`O'#HsOOQ[,5>b,5>bO9WQ`O,5>bOOQ[,5>d,5>dOOQ[7+)f7+)fOOQ[7+)l7+)lOOQ[7+)p7+)pOOQ[7+)r7+)rO%=QQpO1G5xO%=lQ?MtO1G0wO%=vQ`O1G0wOOQO1G/p1G/pO%>RQ?MtO1G/pO>tQ`O1G/pO!(vQlO'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQ`O7+&]O!B_QpO7+&]OOQO7+%u7+%uO$?aQ!0MxO7+&UOOQO7+&U7+&UO%[QlO7+&UO%>]Q!0LrO7+&UO!BSQ!0LrO7+%uO!B_QpO7+%uO%>hQ!0LrO7+&UO%>vQ!0MxO7++nO%[QlO7++nO%?WQ`O7++mO%?WQ`O7++mOOQO1G4o1G4oO9WQ`O1G4oO%?`Q`O1G4oOOQS7+%z7+%zO#']Q`O<|O%[QlO,5>|OOQO-E<`-E<`O%KlQ`O1G5yOOQ!0Lf<]OOQ[,5>_,5>_O&;hQ`O1G3|O9WQ`O7+&cO!(vQlO7+&cOOQO7+%[7+%[O&;mQ?MtO1G6VO>tQ`O7+%[OOQ!0Lf<tQ`O<tQ`O7+)hO'+dQ`O<{AN>{O%[QlOAN?[OOQO<{Oh%VOk+bO![']O%f+aO~O!d+dOa(XX![(XX'v(XX!Y(XX~Oa%lO![XO'v%lO~Oh%VO!i%cO~Oh%VO!i%cO(P%eO~O!d#vO#h(uO~Ob+oO%g+pO(P+lO(RTO(UUO!Z)UP~O!Y+qO`)TX~O[+uO~O`+vO~O![%}O(P%eO(Q!lO`)TP~Oh%VO#]+{O~Oh%VOk,OO![$|O~O![,QO~O},SO![XO~O%k%tO~O!u,XO~Oe,^O~Ob,_O(P#nO(RTO(UUO!Z)SP~Oe%{O~O%g!QO(P&WO~P=RO[,dO`,cO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(RTO(UUO(]VO(k[O(ziO~O![!eO!r!gO$V!kO(P!dO~P!E{O`,cOa%lO'v%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(P!dO(RTO(UUO(]VO(k[O(ziO~Oa,iO!rwO#t!OO%i!OO%j!OO%k!OO~P!HeO!i&lO~O&Y,oO~O![,qO~O&k,sO&m,tOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(P&ha(R&ha(U&ha(]&ha(k&ha(z&ha!Z&ha&a&hab&ha&f&ha~O(P,yO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# kO!d-OO#],}Oh(fX!Y#eX!Z#eX!d(fX!i(fX~O!Y(fX!Z(fX~P#!^Oh%VO!d-QO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(RTO(UUO(a!mO~OP;jOQ;jOSfOd=fOe!iOmkOo;jOpkOqkOwkOy;jO{;jO!PWO!TkO!UkO![!eO!f;mO!iZO!l;jO!m;jO!n;jO!p;nO!r;qO!u!hO$V!kO(RTO(UUO(]VO(k[O(z=dO~O(P{Og'XX!Y'XX~P!+oO!Y.xOg(la~OSfO![3vO$c3wO~O!Z3{O~Os3|O~P#.uOa$lq!Y$lq'v$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9}O!V4OO~P!&fO!P4PO~O}){O'u)|O(v%POk'ea(u'ea!Y'ea#]'ea~Og'ea#}'ea~P%+ZO}){O'u)|Ok'ga(u'ga(v'ga!Y'ga#]'ga~Og'ga#}'ga~P%+|O(n$YO~P#.uO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/nO(PU#>[#>|#?`#?f#?l#?z#@a#BQ#B`#Bg#C}#D]#Ey#FX#F_#Fe#Fk#Fu#F{#GR#G]#Go#GuPPPPPPPPPPP#G{PPPPPPP#Hp#Kw#Ma#Mh#MpPPP$%OP$%X$(Q$.k$.n$.q$/p$/s$/z$0SP$0Y$0]P$0y$0}$1u$3T$3Y$3pPP$3u$3{$4PP$4S$4W$4[$5W$5o$6W$6[$6_$6b$6h$6k$6o$6sR!|RoqOXst!Z#d%k&o&q&r&t,l,q1}2QY!vQ']-^1b5iQ%rvQ%zyQ&R|Q&g!VS'T!e-UQ'c!iS'i!r!yU*g$|*W*kQ+j%{Q+w&TQ,]&aQ-['[Q-f'dQ-n'jQ0S*mQ1l,^R < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:377,context:eF,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[sF],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(SpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(SpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Sp(V!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Sp(V!b'x0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(T#S$h&j'y0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Sp(V!b'y0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(R':f$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(V!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(V!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(V!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(V!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Sp(V!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(V!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(SpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(SpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Sp(V!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(V!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(V!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(V!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(V!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(V!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Sp(V!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-v$?V_!Z(CdsBr$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!n7`$h&j(Sp(V!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Sp(V!b'x0/l$[#t(P,2j(a$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Sp(V!b'y0/l$[#t(P,2j(a$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[nF,rF,iF,oF,2,3,4,5,6,7,8,9,10,11,12,13,14,tF,new gp("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(_~~",141,336),new gp("j~RQYZXz{^~^O'|~~aP!P!Qd~iO'}~~",25,319)],topRules:{Script:[0,7],SingleExpression:[1,272],SingleClassItem:[2,273]},dialects:{jsx:0,ts:14980},dynamicPrecedences:{77:1,79:1,91:1,167:1,196:1},specialized:[{term:323,get:t=>aF[t]||-1},{term:339,get:t=>lF[t]||-1},{term:92,get:t=>cF[t]||-1}],tokenPrec:15004}),O3=[Gn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Gn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Gn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Gn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Gn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Gn(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),Gn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Gn(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),Gn(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Gn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Gn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],dF=O3.concat([Gn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Gn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Gn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),C2=new n5,y3=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function vc(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const fF=["FunctionDeclaration"],hF={FunctionDeclaration:vc("function"),ClassDeclaration:vc("class"),ClassExpression:()=>!0,EnumDeclaration:vc("constant"),TypeAliasDeclaration:vc("type"),NamespaceDeclaration:vc("namespace"),VariableDefinition(t,e){t.matchContext(fF)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function b3(t,e){let n=C2.get(e);if(n)return n;let r=[],i=!0;function o(s,a){let l=t.sliceString(s.from,s.to);r.push({label:l,type:a})}return e.cursor($t.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let a=hF[s.name];if(a&&a(s,o)||y3.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of b3(t,s.node))r.push(a);return!1}}),C2.set(e,r),r}const P2=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,S3=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function pF(t){let e=gn(t.state).resolveInner(t.pos,-1);if(S3.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&P2.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)y3.has(i.name)&&(r=r.concat(b3(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:P2}}const to=kl.define({name:"javascript",parser:uF.configure({props:[Zm.add({IfStatement:dh({except:/^\s*({|else\b)/}),TryStatement:dh({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:f7,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:d7({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":dh({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),$b.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":f5,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),w3={test:t=>/^JSX/.test(t.name),facet:a5({commentTokens:{block:{open:"{/*",close:"*/}"}}})},x3=to.configure({dialect:"ts"},"typescript"),k3=to.configure({dialect:"jsx",props:[Eb.add(t=>t.isTop?[w3]:void 0)]}),C3=to.configure({dialect:"jsx ts",props:[Eb.add(t=>t.isTop?[w3]:void 0)]},"typescript");let P3=t=>({label:t,type:"keyword"});const E3="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(P3),mF=E3.concat(["declare","implements","private","protected","public"].map(P3));function r1(t={}){let e=t.jsx?t.typescript?C3:k3:t.typescript?x3:to,n=t.typescript?dF.concat(mF):O3.concat(E3);return new _b(e,[to.data.of({autocomplete:A7(S3,$7(n))}),to.data.of({autocomplete:pF}),t.jsx?OF:[]])}function gF(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function E2(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const vF=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),OF=je.inputHandler.of((t,e,n,r,i)=>{if((vF?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!to.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,a=s.changeByRange(l=>{var c;let{head:u}=l,d=gn(s).resolveInner(u-1,-1),f;if(d.name=="JSXStartTag"&&(d=d.parent),!(s.doc.sliceString(u-1,u)!=r||d.name=="JSXAttributeValue"&&d.to>u)){if(r==">"&&d.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:""}};if(r=="/"&&d.name=="JSXStartCloseTag"){let h=d.parent,p=h.parent;if(p&&h.from==u-2&&((f=E2(s.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:ge.cursor(u+m.length,-1),changes:{from:u,insert:m}}}}else if(r==">"){let h=gF(d);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(s.doc.sliceString(u,u+2))&&(f=E2(s.doc,h,u)))return{range:l,changes:{from:u,insert:``}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Oc=["_blank","_self","_top","_parent"],Iv=["ascii","utf-8","utf-16","latin1","latin1"],Qv=["get","post","put","delete"],Lv=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],fr=["true","false"],Ie={},yF={a:{attrs:{href:null,ping:null,type:null,media:null,target:Oc,hreflang:null}},abbr:Ie,address:Ie,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ie,aside:Ie,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ie,base:{attrs:{href:null,target:Oc}},bdi:Ie,bdo:Ie,blockquote:{attrs:{cite:null}},body:Ie,br:Ie,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Lv,formmethod:Qv,formnovalidate:["novalidate"],formtarget:Oc,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ie,center:Ie,cite:Ie,code:Ie,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ie,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ie,div:Ie,dl:Ie,dt:Ie,em:Ie,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ie,figure:Ie,footer:Ie,form:{attrs:{action:null,name:null,"accept-charset":Iv,autocomplete:["on","off"],enctype:Lv,method:Qv,novalidate:["novalidate"],target:Oc}},h1:Ie,h2:Ie,h3:Ie,h4:Ie,h5:Ie,h6:Ie,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ie,hgroup:Ie,hr:Ie,html:{attrs:{manifest:null}},i:Ie,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Lv,formmethod:Qv,formnovalidate:["novalidate"],formtarget:Oc,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ie,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ie,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ie,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Iv,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ie,noscript:Ie,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ie,param:{attrs:{name:null,value:null}},pre:Ie,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ie,rt:Ie,ruby:Ie,samp:Ie,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Iv}},section:Ie,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ie,source:{attrs:{src:null,type:null,media:null}},span:Ie,strong:Ie,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ie,summary:Ie,sup:Ie,table:Ie,tbody:Ie,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ie,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ie,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ie,time:{attrs:{datetime:null}},title:Ie,tr:Ie,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ie,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ie},_3={accesskey:null,class:null,contenteditable:fr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:fr,autocorrect:fr,autocapitalize:fr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":fr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":fr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":fr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":fr,"aria-hidden":fr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":fr,"aria-multiselectable":fr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":fr,"aria-relevant":null,"aria-required":fr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},T3="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of T3)_3[t]=null;class bp{constructor(e,n){this.tags=Object.assign(Object.assign({},yF),e),this.globalAttrs=Object.assign(Object.assign({},_3),n),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}bp.default=new bp;function _l(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Tl(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function $3(t,e,n){let r=n.tags[_l(t,Tl(e))];return(r==null?void 0:r.children)||n.allTags}function Bb(t,e){let n=[];for(let r=Tl(e);r&&!r.type.isTop;r=Tl(r.parent)){let i=_l(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const A3=/^[:\-\.\w\u00b7-\uffff]*$/;function _2(t,e,n,r,i){let o=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=Tl(n,!0);return{from:r,to:i,options:$3(t.doc,s,e).map(a=>({label:a,type:"type"})).concat(Bb(t.doc,n).map((a,l)=>({label:"/"+a,apply:"/"+a+o,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function T2(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Bb(t.doc,e).map((o,s)=>({label:o,apply:o+i,type:"type",boost:99-s})),validFor:A3}}function bF(t,e,n,r){let i=[],o=0;for(let s of $3(t.doc,n,e))i.push({label:"<"+s,type:"type"});for(let s of Bb(t.doc,n))i.push({label:"",type:"type",boost:99-o++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function SF(t,e,n,r,i){let o=Tl(n),s=o?e.tags[_l(t.doc,o)]:null,a=s&&s.attrs?Object.keys(s.attrs):[],l=s&&s.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:A3}}function wF(t,e,n,r,i){var o;let s=(o=n.parent)===null||o===void 0?void 0:o.getChild("AttributeName"),a=[],l;if(s){let c=t.sliceDoc(s.from,s.to),u=e.globalAttrs[c];if(!u){let d=Tl(n),f=d?e.tags[_l(t.doc,d)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[c]}if(u){let d=t.sliceDoc(r,i).toLowerCase(),f='"',h='"';/^['"]/.test(d)?(l=d[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=t.sliceDoc(i,i+1)==d[0]?"":d[0],d=d.slice(1),r++):l=/^[^\s<>='"]*$/;for(let p of u)a.push({label:p,apply:f+p+h,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function xF(t,e){let{state:n,pos:r}=e,i=gn(n).resolveInner(r,-1),o=i.resolve(r);for(let s=r,a;o==i&&(a=i.childBefore(s));){let l=a.lastChild;if(!l||!l.type.isError||l.fromxF(r,i)}const CF=to.parser.configure({top:"SingleExpression"}),R3=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:x3.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:k3.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:C3.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:CF},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:to.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:vp.parser}],M3=[{name:"style",parser:vp.parser.configure({top:"Styles"})}].concat(T3.map(t=>({name:t,parser:to.parser}))),I3=kl.define({name:"html",parser:MB.configure({props:[Zm.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ph=I3.configure({wrap:g3(R3,M3)});function PF(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=g3((t.nestedLanguages||[]).concat(R3),(t.nestedAttributes||[]).concat(M3)));let r=n?I3.configure({wrap:n,dialect:e}):e?ph.configure({dialect:e}):ph;return new _b(r,[ph.data.of({autocomplete:kF(t)}),t.autoCloseTags!==!1?EF:[],r1().support,o3().support])}const $2=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),EF=je.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ph.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,a=s.changeByRange(l=>{var c,u,d;let f=s.doc.sliceString(l.from-1,l.to)==r,{head:h}=l,p=gn(s).resolveInner(h,-1),m;if(f&&r==">"&&p.name=="EndTag"){let y=p.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(m=_l(s.doc,y.parent,h))&&!$2.has(m)){let g=h+(s.doc.sliceString(h,h+1)===">"?1:0),v=``;return{range:l,changes:{from:h,to:g,insert:v}}}}else if(f&&r=="/"&&p.name=="IncompleteCloseTag"){let y=p.parent;if(p.from==h-2&&((d=y.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(m=_l(s.doc,y,h))&&!$2.has(m)){let g=h+(s.doc.sliceString(h,h+1)===">"?1:0),v=`${m}>`;return{range:ge.cursor(h+v.length,-1),changes:{from:h,to:g,insert:v}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var A2=function(){function t(e,n){for(var r=0;r\"]/gm,function(r){return r=="&"?"&":r=='"'?""":r=="<"?"<":r==">"?">":""})}},{key:"linkify",value:function(n){return n.replace(TF,function(r){return''+r+""})}},{key:"ansiToHtml",value:function(n,r){return this.process(n,r,!0)}},{key:"ansiToJson",value:function(n,r){return r=r||{},r.json=!0,r.clearLine=!1,this.process(n,r,!0)}},{key:"ansiToText",value:function(n){return this.process(n,{},!1)}},{key:"process",value:function(n,r,i){var o=this,s=this,a=n.split(/\033\[/),l=a.shift();r==null&&(r={}),r.clearLine=/\r/.test(n);var c=a.map(function(d){return o.processChunk(d,r,i)});if(r&&r.json){var u=s.processChunkJson("");return u.content=l,u.clearLine=r.clearLine,c.unshift(u),r.remove_empty&&(c=c.filter(function(d){return!d.isEmpty()})),c}else c.unshift(l);return c.join("")}},{key:"processChunkJson",value:function(n,r,i){r=typeof r>"u"?{}:r;var o=r.use_classes=typeof r.use_classes<"u"&&r.use_classes,s=r.key=o?"class":"color",a={content:n,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:r.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:function(){return!a.content}},l=n.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!l)return a;a.content=l[4];var c=l[2].split(";");if(l[1]!==""||l[3]!=="m"||!i)return a;for(var u=this;c.length>0;){var d=c.shift(),f=parseInt(d);if(isNaN(f)||f===0)u.fg=u.bg=null,u.decorations=[];else if(f===1)u.decorations.push("bold");else if(f===2)u.decorations.push("dim");else if(f===3)u.decorations.push("italic");else if(f===4)u.decorations.push("underline");else if(f===5)u.decorations.push("blink");else if(f===7)u.decorations.push("reverse");else if(f===8)u.decorations.push("hidden");else if(f===9)u.decorations.push("strikethrough");else if(f===21)u.removeDecoration("bold");else if(f===22)u.removeDecoration("bold"),u.removeDecoration("dim");else if(f===23)u.removeDecoration("italic");else if(f===24)u.removeDecoration("underline");else if(f===25)u.removeDecoration("blink");else if(f===27)u.removeDecoration("reverse");else if(f===28)u.removeDecoration("hidden");else if(f===29)u.removeDecoration("strikethrough");else if(f===39)u.fg=null;else if(f===49)u.bg=null;else if(f>=30&&f<38)u.fg=Mo[0][f%10][s];else if(f>=90&&f<98)u.fg=Mo[1][f%10][s];else if(f>=40&&f<48)u.bg=Mo[0][f%10][s];else if(f>=100&&f<108)u.bg=Mo[1][f%10][s];else if(f===38||f===48){var h=f===38;if(c.length>=1){var p=c.shift();if(p==="5"&&c.length>=1){var m=parseInt(c.shift());if(m>=0&&m<=255)if(!o)this.PALETTE_COLORS||u.setupPalette(),h?u.fg=this.PALETTE_COLORS[m]:u.bg=this.PALETTE_COLORS[m];else{var y=m>=16?"ansi-palette-"+m:Mo[m>7?1:0][m%8].class;h?u.fg=y:u.bg=y}}else if(p==="2"&&c.length>=3){var g=parseInt(c.shift()),v=parseInt(c.shift()),O=parseInt(c.shift());if(g>=0&&g<=255&&v>=0&&v<=255&&O>=0&&O<=255){var b=g+", "+v+", "+O;o?h?(u.fg="ansi-truecolor",u.fg_truecolor=b):(u.bg="ansi-truecolor",u.bg_truecolor=b):h?u.fg=b:u.bg=b}}}}}return u.fg===null&&u.bg===null&&u.decorations.length===0||(a.fg=u.fg,a.bg=u.bg,a.fg_truecolor=u.fg_truecolor,a.bg_truecolor=u.bg_truecolor,a.decorations=u.decorations,a.decoration=u.decorations.slice(-1).pop()||null,a.was_processed=!0),a}},{key:"processChunk",value:function(n,r,i){var o=this;r=r||{};var s=this.processChunkJson(n,r,i),a=r.use_classes;if(s.decorations=s.decorations.filter(function(h){if(h==="reverse"){s.fg||(s.fg=Mo[0][7][a?"class":"color"]),s.bg||(s.bg=Mo[0][0][a?"class":"color"]);var p=s.fg;s.fg=s.bg,s.bg=p;var m=s.fg_truecolor;return s.fg_truecolor=s.bg_truecolor,s.bg_truecolor=m,s.isInverted=!0,!1}return!0}),r.json)return s;if(s.isEmpty())return"";if(!s.was_processed)return s.content;var l=[],c=[],u=[],d={},f=function(p){var m=[],y=void 0;for(y in p)p.hasOwnProperty(y)&&m.push("data-"+y+'="'+o.escapeForHtml(p[y])+'"');return m.length>0?" "+m.join(" "):""};return s.isInverted&&(d["ansi-is-inverted"]="true"),s.fg&&(a?(l.push(s.fg+"-fg"),s.fg_truecolor!==null&&(d["ansi-truecolor-fg"]=s.fg_truecolor,s.fg_truecolor=null)):l.push("color:rgb("+s.fg+")")),s.bg&&(a?(l.push(s.bg+"-bg"),s.bg_truecolor!==null&&(d["ansi-truecolor-bg"]=s.bg_truecolor,s.bg_truecolor=null)):l.push("background-color:rgb("+s.bg+")")),s.decorations.forEach(function(h){if(a){c.push("ansi-"+h);return}h==="bold"?c.push("font-weight:bold"):h==="dim"?c.push("opacity:0.5"):h==="italic"?c.push("font-style:italic"):h==="hidden"?c.push("visibility:hidden"):h==="strikethrough"?u.push("line-through"):u.push(h)}),u.length&&c.push("text-decoration:"+u.join(" ")),a?'"+s.content+"":'"+s.content+""}},{key:"removeDecoration",value:function(n){var r=this.decorations.indexOf(n);r>=0&&this.decorations.splice(r,1)}}]),t}(),AF=$F;const RF=nd(AF);var Fb={exports:{}};function Zb(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,` `);/\r./.test(t);)t=t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm,function(e,n,r){return r+n.slice(r.length)});return t}function MF(t){for(var e=0,n=0;n0;){var r=MF(e);n.push(e[r]),e=e.slice(r+1)}return n.join("\r")}function IF(t){if(!t)return"";if(!/\r/.test(t))return t;if(!/\n/.test(t))return R2(t);t=t.replace(/\r+\n/gm,` `);var e=t.lastIndexOf(` `);return Zb(t.slice(0,e))+` `+R2(t.slice(e+1))}Fb.exports=Zb;var QF=Fb.exports.escapeCarriageReturn=Zb;Fb.exports.escapeCarriageReturnSafe=IF;var Vb={exports:{}};Vb.exports;(function(t){var e=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function s(l,c){if(!o[l]){o[l]={};for(var u=0;u>>8,u[d*2+1]=h%256}return u},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var c=new Array(l.length/2),u=0,d=c.length;u>1}else{for(f=1,d=0;d>1}v--,v==0&&(v=Math.pow(2,b),b++),delete p[g]}else for(f=h[g],d=0;d>1;v--,v==0&&(v=Math.pow(2,b),b++),h[y]=O++,g=String(m)}if(g!==""){if(Object.prototype.hasOwnProperty.call(p,g)){if(g.charCodeAt(0)<256){for(d=0;d>1}else{for(f=1,d=0;d>1}v--,v==0&&(v=Math.pow(2,b),b++),delete p[g]}else for(f=h[g],d=0;d>1;v--,v==0&&(v=Math.pow(2,b),b++)}for(f=2,d=0;d>1;for(;;)if(w=w<<1,C==c-1){S.push(u(w));break}else C++;return S.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,u){var d=[],f=4,h=4,p=3,m="",y=[],g,v,O,b,S,w,C,$={val:u(0),position:c,index:1};for(g=0;g<3;g+=1)d[g]=g;for(O=0,S=Math.pow(2,2),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;switch(O){case 0:for(O=0,S=Math.pow(2,8),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;C=n(O);break;case 1:for(O=0,S=Math.pow(2,16),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;C=n(O);break;case 2:return""}for(d[3]=C,v=C,y.push(C);;){if($.index>l)return"";for(O=0,S=Math.pow(2,p),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;switch(C=O){case 0:for(O=0,S=Math.pow(2,8),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;d[h++]=n(O),C=h-1,f--;break;case 1:for(O=0,S=Math.pow(2,16),w=1;w!=S;)b=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=u($.index++)),O|=(b>0?1:0)*w,w<<=1;d[h++]=n(O),C=h-1,f--;break;case 2:return y.join("")}if(f==0&&(f=Math.pow(2,p),p++),d[C])m=d[C];else if(C===h)m=v+v.charAt(0);else return null;y.push(m),d[h++]=v+m.charAt(0),f--,v=m,f==0&&(f=Math.pow(2,p),p++)}}};return a}();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(Vb);var LF=Vb.exports;const jF=nd(LF);var ie=function(){return ie=Object.assign||function(e){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]Hello {data} `},".env":{code:'ASTRO_TELEMETRY_DISABLED="1"'},"/package.json":{code:JSON.stringify({dependencies:{astro:"^1.6.12","esbuild-wasm":"^0.15.16"},scripts:{dev:"astro dev",start:"astro dev",build:"astro build",preview:"astro preview",astro:"astro"}})}},main:"/src/pages/index.astro",environment:"node"},cZ={files:ie(ie({},Jt),{"/pages/_app.js":{code:`import '../styles.css' export default function MyApp({ Component, pageProps }) { return }`},"/pages/index.js":{code:`export default function Home({ data }) { return (

Hello {data}

); } export function getServerSideProps() { return { props: { data: "world" }, } } `},"/next.config.js":{code:`/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, swcMinify: true, } module.exports = nextConfig `},"/package.json":{code:JSON.stringify({name:"my-app",version:"0.1.0",private:!0,scripts:{dev:"NEXT_TELEMETRY_DISABLED=1 next dev",build:"next build",start:"next start",lint:"next lint"},dependencies:{next:"12.1.6",react:"18.2.0","react-dom":"18.2.0","@next/swc-wasm-nodejs":"12.1.6"}})}}),main:"/pages/index.js",environment:"node"},uZ={files:{"/index.js":{code:`const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/html'); res.end('Hello world'); }); server.listen(port, hostname, () => { console.log(\`Server running at http://\${hostname}:\${port}/\`); });`},"/package.json":{code:JSON.stringify({dependencies:{},scripts:{start:"node index.js"},main:"index.js"})}},main:"/index.js",environment:"node"},dZ={files:ie(ie({},Jt),{"/index.js":{code:`import "./styles.css"; document.getElementById("app").innerHTML = \`

Hello world

\`; `},"/index.html":{code:` Vite App