spytial-core 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,206 +1,206 @@
1
- "use strict";var IntegratedDemo=(()=>{var H4=Object.create;var Of=Object.defineProperty;var U4=Object.getOwnPropertyDescriptor;var F4=Object.getOwnPropertyNames;var j4=Object.getPrototypeOf,V4=Object.prototype.hasOwnProperty;var xx=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Y4=(t,e)=>{for(var n in e)Of(t,n,{get:e[n],enumerable:!0})},wx=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of F4(e))!V4.call(t,r)&&r!==n&&Of(t,r,{get:()=>e[r],enumerable:!(i=U4(e,r))||i.enumerable});return t};var Ve=(t,e,n)=>(n=t!=null?H4(j4(t)):{},wx(e||!t||!t.__esModule?Of(n,"default",{value:t,enumerable:!0}):n,t)),K4=t=>wx(Of({},"__esModule",{value:!0}),t);var Lx=x($=>{"use strict";var $m=Symbol.for("react.transitional.element"),Q4=Symbol.for("react.portal"),G4=Symbol.for("react.fragment"),$4=Symbol.for("react.strict_mode"),X4=Symbol.for("react.profiler"),W4=Symbol.for("react.consumer"),Z4=Symbol.for("react.context"),J4=Symbol.for("react.forward_ref"),e5=Symbol.for("react.suspense"),t5=Symbol.for("react.memo"),Ex=Symbol.for("react.lazy"),kx=Symbol.iterator;function n5(t){return t===null||typeof t!="object"?null:(t=kx&&t[kx]||t["@@iterator"],typeof t=="function"?t:null)}var Dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mx=Object.assign,Nx={};function Do(t,e,n){this.props=t,this.context=e,this.refs=Nx,this.updater=n||Dx}Do.prototype.isReactComponent={};Do.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Do.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Rx(){}Rx.prototype=Do.prototype;function Xm(t,e,n){this.props=t,this.context=e,this.refs=Nx,this.updater=n||Dx}var Wm=Xm.prototype=new Rx;Wm.constructor=Xm;Mx(Wm,Do.prototype);Wm.isPureReactComponent=!0;var Ax=Array.isArray,Re={H:null,A:null,T:null,S:null,V:null},_x=Object.prototype.hasOwnProperty;function Zm(t,e,n,i,r,s){return n=s.ref,{$$typeof:$m,type:t,key:e,ref:n!==void 0?n:null,props:s}}function i5(t,e){return Zm(t.type,e,void 0,void 0,void 0,t.props)}function Jm(t){return typeof t=="object"&&t!==null&&t.$$typeof===$m}function r5(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Ox=/\/+/g;function Gm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?r5(""+t.key):e.toString(36)}function Tx(){}function s5(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Tx,Tx):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Eo(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case $m:case Q4:o=!0;break;case Ex:return o=t._init,Eo(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+Gm(t,0):i,Ax(r)?(n="",o!=null&&(n=o.replace(Ox,"$&/")+"/"),Eo(r,e,n,"",function(c){return c})):r!=null&&(Jm(r)&&(r=i5(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Ox,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(Ax(t))for(var a=0;a<t.length;a++)i=t[a],s=l+Gm(i,a),o+=Eo(i,e,n,s,r);else if(a=n5(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+Gm(i,a++),o+=Eo(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return Eo(s5(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function Tf(t,e,n){if(t==null)return t;var i=[],r=0;return Eo(t,i,"","",function(s){return e.call(n,s,r++)}),i}function o5(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Cx=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function l5(){}$.Children={map:Tf,forEach:function(t,e,n){Tf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Tf(t,function(){e++}),e},toArray:function(t){return Tf(t,function(e){return e})||[]},only:function(t){if(!Jm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};$.Component=Do;$.Fragment=G4;$.Profiler=X4;$.PureComponent=Xm;$.StrictMode=$4;$.Suspense=e5;$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Re;$.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Re.H.useMemoCache(t)}};$.cache=function(t){return function(){return t.apply(null,arguments)}};$.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Mx({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!_x.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return Zm(t.type,r,void 0,void 0,s,i)};$.createContext=function(t){return t={$$typeof:Z4,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:W4,_context:t},t};$.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)_x.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return Zm(t,s,void 0,void 0,null,r)};$.createRef=function(){return{current:null}};$.forwardRef=function(t){return{$$typeof:J4,render:t}};$.isValidElement=Jm;$.lazy=function(t){return{$$typeof:Ex,_payload:{_status:-1,_result:t},_init:o5}};$.memo=function(t,e){return{$$typeof:t5,type:t,compare:e===void 0?null:e}};$.startTransition=function(t){var e=Re.T,n={};Re.T=n;try{var i=t(),r=Re.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(l5,Cx)}catch(s){Cx(s)}finally{Re.T=e}};$.unstable_useCacheRefresh=function(){return Re.H.useCacheRefresh()};$.use=function(t){return Re.H.use(t)};$.useActionState=function(t,e,n){return Re.H.useActionState(t,e,n)};$.useCallback=function(t,e){return Re.H.useCallback(t,e)};$.useContext=function(t){return Re.H.useContext(t)};$.useDebugValue=function(){};$.useDeferredValue=function(t,e){return Re.H.useDeferredValue(t,e)};$.useEffect=function(t,e,n){var i=Re.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};$.useId=function(){return Re.H.useId()};$.useImperativeHandle=function(t,e,n){return Re.H.useImperativeHandle(t,e,n)};$.useInsertionEffect=function(t,e){return Re.H.useInsertionEffect(t,e)};$.useLayoutEffect=function(t,e){return Re.H.useLayoutEffect(t,e)};$.useMemo=function(t,e){return Re.H.useMemo(t,e)};$.useOptimistic=function(t,e){return Re.H.useOptimistic(t,e)};$.useReducer=function(t,e,n){return Re.H.useReducer(t,e,n)};$.useRef=function(t){return Re.H.useRef(t)};$.useState=function(t){return Re.H.useState(t)};$.useSyncExternalStore=function(t,e,n){return Re.H.useSyncExternalStore(t,e,n)};$.useTransition=function(){return Re.H.useTransition()};$.version="19.1.0"});var di=x((sse,Bx)=>{"use strict";Bx.exports=Lx()});var Yx=x(_e=>{"use strict";function ig(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Cf(r,e))t[i]=e,t[n]=r,n=i;else break e}}function pi(t){return t.length===0?null:t[0]}function Df(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>Cf(l,n))a<r&&0>Cf(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>Cf(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function Cf(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}_e.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Ix=performance,_e.unstable_now=function(){return Ix.now()}):(eg=Date,qx=eg.now(),_e.unstable_now=function(){return eg.now()-qx});var Ix,eg,qx,ji=[],Ar=[],a5=1,wn=null,St=3,rg=!1,Na=!1,Ra=!1,sg=!1,Hx=typeof setTimeout=="function"?setTimeout:null,Ux=typeof clearTimeout=="function"?clearTimeout:null,Px=typeof setImmediate<"u"?setImmediate:null;function Ef(t){for(var e=pi(Ar);e!==null;){if(e.callback===null)Df(Ar);else if(e.startTime<=t)Df(Ar),e.sortIndex=e.expirationTime,ig(ji,e);else break;e=pi(Ar)}}function og(t){if(Ra=!1,Ef(t),!Na)if(pi(ji)!==null)Na=!0,No||(No=!0,Mo());else{var e=pi(Ar);e!==null&&lg(og,e.startTime-t)}}var No=!1,_a=-1,Fx=5,jx=-1;function Vx(){return sg?!0:!(_e.unstable_now()-jx<Fx)}function tg(){if(sg=!1,No){var t=_e.unstable_now();jx=t;var e=!0;try{e:{Na=!1,Ra&&(Ra=!1,Ux(_a),_a=-1),rg=!0;var n=St;try{t:{for(Ef(t),wn=pi(ji);wn!==null&&!(wn.expirationTime>t&&Vx());){var i=wn.callback;if(typeof i=="function"){wn.callback=null,St=wn.priorityLevel;var r=i(wn.expirationTime<=t);if(t=_e.unstable_now(),typeof r=="function"){wn.callback=r,Ef(t),e=!0;break t}wn===pi(ji)&&Df(ji),Ef(t)}else Df(ji);wn=pi(ji)}if(wn!==null)e=!0;else{var s=pi(Ar);s!==null&&lg(og,s.startTime-t),e=!1}}break e}finally{wn=null,St=n,rg=!1}e=void 0}}finally{e?Mo():No=!1}}}var Mo;typeof Px=="function"?Mo=function(){Px(tg)}:typeof MessageChannel<"u"?(ng=new MessageChannel,zx=ng.port2,ng.port1.onmessage=tg,Mo=function(){zx.postMessage(null)}):Mo=function(){Hx(tg,0)};var ng,zx;function lg(t,e){_a=Hx(function(){t(_e.unstable_now())},e)}_e.unstable_IdlePriority=5;_e.unstable_ImmediatePriority=1;_e.unstable_LowPriority=4;_e.unstable_NormalPriority=3;_e.unstable_Profiling=null;_e.unstable_UserBlockingPriority=2;_e.unstable_cancelCallback=function(t){t.callback=null};_e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fx=0<t?Math.floor(1e3/t):5};_e.unstable_getCurrentPriorityLevel=function(){return St};_e.unstable_next=function(t){switch(St){case 1:case 2:case 3:var e=3;break;default:e=St}var n=St;St=e;try{return t()}finally{St=n}};_e.unstable_requestPaint=function(){sg=!0};_e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=St;St=t;try{return e()}finally{St=n}};_e.unstable_scheduleCallback=function(t,e,n){var i=_e.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:a5++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,ig(Ar,t),pi(ji)===null&&t===pi(Ar)&&(Ra?(Ux(_a),_a=-1):Ra=!0,lg(og,n-i))):(t.sortIndex=r,ig(ji,t),Na||rg||(Na=!0,No||(No=!0,Mo()))),t};_e.unstable_shouldYield=Vx;_e.unstable_wrapCallback=function(t){var e=St;return function(){var n=St;St=e;try{return t.apply(this,arguments)}finally{St=n}}}});var Qx=x((lse,Kx)=>{"use strict";Kx.exports=Yx()});var $x=x(_t=>{"use strict";var c5=di();function Gx(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Or(){}var Rt={d:{f:Or,r:function(){throw Error(Gx(522))},D:Or,C:Or,L:Or,m:Or,X:Or,S:Or,M:Or},p:0,findDOMNode:null},u5=Symbol.for("react.portal");function f5(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u5,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var La=c5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Mf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}_t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rt;_t.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Gx(299));return f5(t,e,null,n)};_t.flushSync=function(t){var e=La.T,n=Rt.p;try{if(La.T=null,Rt.p=2,t)return t()}finally{La.T=e,Rt.p=n,Rt.d.f()}};_t.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Rt.d.C(t,e))};_t.prefetchDNS=function(t){typeof t=="string"&&Rt.d.D(t)};_t.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Mf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Rt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&Rt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};_t.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Mf(e.as,e.crossOrigin);Rt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Rt.d.M(t)};_t.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Mf(n,e.crossOrigin);Rt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};_t.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Mf(e.as,e.crossOrigin);Rt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Rt.d.m(t)};_t.requestFormReset=function(t){Rt.d.r(t)};_t.unstable_batchedUpdates=function(t,e){return t(e)};_t.useFormState=function(t,e,n){return La.H.useFormState(t,e,n)};_t.useFormStatus=function(){return La.H.useHostTransitionStatus()};_t.version="19.1.0"});var Zx=x((cse,Wx)=>{"use strict";function Xx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xx)}catch(t){console.error(t)}}Xx(),Wx.exports=$x()});var eT=x(Zh=>{"use strict";var it=Qx(),Sk=di(),h5=Zx();function C(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function xk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function xc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function wk(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Jx(t){if(xc(t)!==t)throw Error(C(188))}function d5(t){var e=t.alternate;if(!e){if(e=xc(t),e===null)throw Error(C(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Jx(r),t;if(s===i)return Jx(r),e;s=s.sibling}throw Error(C(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(C(189))}}if(n.alternate!==i)throw Error(C(190))}if(n.tag!==3)throw Error(C(188));return n.stateNode.current===n?t:e}function kk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=kk(t),e!==null)return e;t=t.sibling}return null}var De=Object.assign,p5=Symbol.for("react.element"),Nf=Symbol.for("react.transitional.element"),ja=Symbol.for("react.portal"),Po=Symbol.for("react.fragment"),Ak=Symbol.for("react.strict_mode"),zg=Symbol.for("react.profiler"),m5=Symbol.for("react.provider"),Ok=Symbol.for("react.consumer"),Gi=Symbol.for("react.context"),Ly=Symbol.for("react.forward_ref"),Hg=Symbol.for("react.suspense"),Ug=Symbol.for("react.suspense_list"),By=Symbol.for("react.memo"),Er=Symbol.for("react.lazy"),Fg=Symbol.for("react.activity"),g5=Symbol.for("react.memo_cache_sentinel"),ew=Symbol.iterator;function Ba(t){return t===null||typeof t!="object"?null:(t=ew&&t[ew]||t["@@iterator"],typeof t=="function"?t:null)}var y5=Symbol.for("react.client.reference");function jg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===y5?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Po:return"Fragment";case zg:return"Profiler";case Ak:return"StrictMode";case Hg:return"Suspense";case Ug:return"SuspenseList";case Fg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case ja:return"Portal";case Gi:return(t.displayName||"Context")+".Provider";case Ok:return(t._context.displayName||"Context")+".Consumer";case Ly:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case By:return e=t.displayName||null,e!==null?e:jg(t.type)||"Memo";case Er:e=t._payload,t=t._init;try{return jg(t(e))}catch{}}return null}var Va=Array.isArray,F=Sk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=h5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ns={pending:!1,data:null,method:null,action:null},Vg=[],zo=-1;function xi(t){return{current:t}}function ht(t){0>zo||(t.current=Vg[zo],Vg[zo]=null,zo--)}function Be(t,e){zo++,Vg[zo]=t.current,t.current=e}var bi=xi(null),lc=xi(null),Pr=xi(null),lh=xi(null);function ah(t,e){switch(Be(Pr,e),Be(lc,t),Be(bi,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?ok(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=ok(e),t=FO(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(bi),Be(bi,t)}function rl(){ht(bi),ht(lc),ht(Pr)}function Yg(t){t.memoizedState!==null&&Be(lh,t);var e=bi.current,n=FO(e,t.type);e!==n&&(Be(lc,t),Be(bi,n))}function ch(t){lc.current===t&&(ht(bi),ht(lc)),lh.current===t&&(ht(lh),yc._currentValue=Ns)}var Kg=Object.prototype.hasOwnProperty,Iy=it.unstable_scheduleCallback,ag=it.unstable_cancelCallback,b5=it.unstable_shouldYield,v5=it.unstable_requestPaint,vi=it.unstable_now,S5=it.unstable_getCurrentPriorityLevel,Tk=it.unstable_ImmediatePriority,Ck=it.unstable_UserBlockingPriority,uh=it.unstable_NormalPriority,x5=it.unstable_LowPriority,Ek=it.unstable_IdlePriority,w5=it.log,k5=it.unstable_setDisableYieldValue,wc=null,ln=null;function Lr(t){if(typeof w5=="function"&&k5(t),ln&&typeof ln.setStrictMode=="function")try{ln.setStrictMode(wc,t)}catch{}}var an=Math.clz32?Math.clz32:T5,A5=Math.log,O5=Math.LN2;function T5(t){return t>>>=0,t===0?32:31-(A5(t)/O5|0)|0}var Rf=256,_f=4194304;function Es(t){var e=t&42;if(e!==0)return e;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function qh(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=Es(i):(o&=l,o!==0?r=Es(o):n||(n=l&~t,n!==0&&(r=Es(n))))):(l=i&~s,l!==0?r=Es(l):o!==0?r=Es(o):n||(n=i&~t,n!==0&&(r=Es(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function kc(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function C5(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dk(){var t=Rf;return Rf<<=1,(Rf&4194048)===0&&(Rf=256),t}function Mk(){var t=_f;return _f<<=1,(_f&62914560)===0&&(_f=4194304),t}function cg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ac(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function E5(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-an(n),f=1<<u;l[u]=0,a[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&Nk(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function Nk(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-an(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function Rk(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-an(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function qy(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Py(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function _k(){var t=he.p;return t!==0?t:(t=window.event,t===void 0?32:ZO(t.type))}function D5(t,e){var n=he.p;try{return he.p=t,e()}finally{he.p=n}}var $r=Math.random().toString(36).slice(2),xt="__reactFiber$"+$r,$t="__reactProps$"+$r,ml="__reactContainer$"+$r,Qg="__reactEvents$"+$r,M5="__reactListeners$"+$r,N5="__reactHandles$"+$r,tw="__reactResources$"+$r,Oc="__reactMarker$"+$r;function zy(t){delete t[xt],delete t[$t],delete t[Qg],delete t[M5],delete t[N5]}function Ho(t){var e=t[xt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ml]||n[xt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=ck(t);t!==null;){if(n=t[xt])return n;t=ck(t)}return e}t=n,n=t.parentNode}return null}function gl(t){if(t=t[xt]||t[ml]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Ya(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(C(33))}function Xo(t){var e=t[tw];return e||(e=t[tw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ut(t){t[Oc]=!0}var Lk=new Set,Bk={};function Fs(t,e){sl(t,e),sl(t+"Capture",e)}function sl(t,e){for(Bk[t]=e,t=0;t<e.length;t++)Lk.add(e[t])}var R5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),nw={},iw={};function _5(t){return Kg.call(iw,t)?!0:Kg.call(nw,t)?!1:R5.test(t)?iw[t]=!0:(nw[t]=!0,!1)}function Gf(t,e,n){if(_5(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Lf(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Vi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var ug,rw;function Bo(t){if(ug===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ug=e&&e[1]||"",rw=-1<n.stack.indexOf(`
1
+ "use strict";var IntegratedDemo=(()=>{var G4=Object.create;var Mf=Object.defineProperty;var X4=Object.getOwnPropertyDescriptor;var W4=Object.getOwnPropertyNames;var Z4=Object.getPrototypeOf,J4=Object.prototype.hasOwnProperty;var Ex=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),e5=(t,e)=>{for(var n in e)Mf(t,n,{get:e[n],enumerable:!0})},Dx=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of W4(e))!J4.call(t,r)&&r!==n&&Mf(t,r,{get:()=>e[r],enumerable:!(i=X4(e,r))||i.enumerable});return t};var Pe=(t,e,n)=>(n=t!=null?G4(Z4(t)):{},Dx(e||!t||!t.__esModule?Mf(n,"default",{value:t,enumerable:!0}):n,t)),t5=t=>Dx(Mf({},"__esModule",{value:!0}),t);var Ux=x(G=>{"use strict";var Jm=Symbol.for("react.transitional.element"),n5=Symbol.for("react.portal"),i5=Symbol.for("react.fragment"),r5=Symbol.for("react.strict_mode"),s5=Symbol.for("react.profiler"),o5=Symbol.for("react.consumer"),l5=Symbol.for("react.context"),a5=Symbol.for("react.forward_ref"),c5=Symbol.for("react.suspense"),u5=Symbol.for("react.memo"),Bx=Symbol.for("react.lazy"),Mx=Symbol.iterator;function f5(t){return t===null||typeof t!="object"?null:(t=Mx&&t[Mx]||t["@@iterator"],typeof t=="function"?t:null)}var Ix={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qx=Object.assign,Px={};function Io(t,e,n){this.props=t,this.context=e,this.refs=Px,this.updater=n||Ix}Io.prototype.isReactComponent={};Io.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Io.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function zx(){}zx.prototype=Io.prototype;function eg(t,e,n){this.props=t,this.context=e,this.refs=Px,this.updater=n||Ix}var tg=eg.prototype=new zx;tg.constructor=eg;qx(tg,Io.prototype);tg.isPureReactComponent=!0;var Nx=Array.isArray,Re={H:null,A:null,T:null,S:null,V:null},Hx=Object.prototype.hasOwnProperty;function ng(t,e,n,i,r,s){return n=s.ref,{$$typeof:Jm,type:t,key:e,ref:n!==void 0?n:null,props:s}}function h5(t,e){return ng(t.type,e,void 0,void 0,void 0,t.props)}function ig(t){return typeof t=="object"&&t!==null&&t.$$typeof===Jm}function d5(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Rx=/\/+/g;function Zm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?d5(""+t.key):e.toString(36)}function _x(){}function p5(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(_x,_x):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Bo(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Jm:case n5:o=!0;break;case Bx:return o=t._init,Bo(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+Zm(t,0):i,Nx(r)?(n="",o!=null&&(n=o.replace(Rx,"$&/")+"/"),Bo(r,e,n,"",function(c){return c})):r!=null&&(ig(r)&&(r=h5(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Rx,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(Nx(t))for(var a=0;a<t.length;a++)i=t[a],s=l+Zm(i,a),o+=Bo(i,e,n,s,r);else if(a=f5(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+Zm(i,a++),o+=Bo(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return Bo(p5(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function Nf(t,e,n){if(t==null)return t;var i=[],r=0;return Bo(t,i,"","",function(s){return e.call(n,s,r++)}),i}function m5(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Lx=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function g5(){}G.Children={map:Nf,forEach:function(t,e,n){Nf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Nf(t,function(){e++}),e},toArray:function(t){return Nf(t,function(e){return e})||[]},only:function(t){if(!ig(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};G.Component=Io;G.Fragment=i5;G.Profiler=s5;G.PureComponent=eg;G.StrictMode=r5;G.Suspense=c5;G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Re;G.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Re.H.useMemoCache(t)}};G.cache=function(t){return function(){return t.apply(null,arguments)}};G.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=qx({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!Hx.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return ng(t.type,r,void 0,void 0,s,i)};G.createContext=function(t){return t={$$typeof:l5,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:o5,_context:t},t};G.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)Hx.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return ng(t,s,void 0,void 0,null,r)};G.createRef=function(){return{current:null}};G.forwardRef=function(t){return{$$typeof:a5,render:t}};G.isValidElement=ig;G.lazy=function(t){return{$$typeof:Bx,_payload:{_status:-1,_result:t},_init:m5}};G.memo=function(t,e){return{$$typeof:u5,type:t,compare:e===void 0?null:e}};G.startTransition=function(t){var e=Re.T,n={};Re.T=n;try{var i=t(),r=Re.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(g5,Lx)}catch(s){Lx(s)}finally{Re.T=e}};G.unstable_useCacheRefresh=function(){return Re.H.useCacheRefresh()};G.use=function(t){return Re.H.use(t)};G.useActionState=function(t,e,n){return Re.H.useActionState(t,e,n)};G.useCallback=function(t,e){return Re.H.useCallback(t,e)};G.useContext=function(t){return Re.H.useContext(t)};G.useDebugValue=function(){};G.useDeferredValue=function(t,e){return Re.H.useDeferredValue(t,e)};G.useEffect=function(t,e,n){var i=Re.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};G.useId=function(){return Re.H.useId()};G.useImperativeHandle=function(t,e,n){return Re.H.useImperativeHandle(t,e,n)};G.useInsertionEffect=function(t,e){return Re.H.useInsertionEffect(t,e)};G.useLayoutEffect=function(t,e){return Re.H.useLayoutEffect(t,e)};G.useMemo=function(t,e){return Re.H.useMemo(t,e)};G.useOptimistic=function(t,e){return Re.H.useOptimistic(t,e)};G.useReducer=function(t,e,n){return Re.H.useReducer(t,e,n)};G.useRef=function(t){return Re.H.useRef(t)};G.useState=function(t){return Re.H.useState(t)};G.useSyncExternalStore=function(t,e,n){return Re.H.useSyncExternalStore(t,e,n)};G.useTransition=function(){return Re.H.useTransition()};G.version="19.1.0"});var yi=x((mse,Fx)=>{"use strict";Fx.exports=Ux()});var Zx=x(_e=>{"use strict";function lg(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Rf(r,e))t[i]=e,t[n]=r,n=i;else break e}}function bi(t){return t.length===0?null:t[0]}function Lf(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>Rf(l,n))a<r&&0>Rf(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>Rf(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function Rf(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}_e.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(jx=performance,_e.unstable_now=function(){return jx.now()}):(rg=Date,Vx=rg.now(),_e.unstable_now=function(){return rg.now()-Vx});var jx,rg,Vx,$i=[],Mr=[],y5=1,An=null,kt=3,ag=!1,Ia=!1,qa=!1,cg=!1,Qx=typeof setTimeout=="function"?setTimeout:null,$x=typeof clearTimeout=="function"?clearTimeout:null,Yx=typeof setImmediate<"u"?setImmediate:null;function _f(t){for(var e=bi(Mr);e!==null;){if(e.callback===null)Lf(Mr);else if(e.startTime<=t)Lf(Mr),e.sortIndex=e.expirationTime,lg($i,e);else break;e=bi(Mr)}}function ug(t){if(qa=!1,_f(t),!Ia)if(bi($i)!==null)Ia=!0,Po||(Po=!0,qo());else{var e=bi(Mr);e!==null&&fg(ug,e.startTime-t)}}var Po=!1,Pa=-1,Gx=5,Xx=-1;function Wx(){return cg?!0:!(_e.unstable_now()-Xx<Gx)}function sg(){if(cg=!1,Po){var t=_e.unstable_now();Xx=t;var e=!0;try{e:{Ia=!1,qa&&(qa=!1,$x(Pa),Pa=-1),ag=!0;var n=kt;try{t:{for(_f(t),An=bi($i);An!==null&&!(An.expirationTime>t&&Wx());){var i=An.callback;if(typeof i=="function"){An.callback=null,kt=An.priorityLevel;var r=i(An.expirationTime<=t);if(t=_e.unstable_now(),typeof r=="function"){An.callback=r,_f(t),e=!0;break t}An===bi($i)&&Lf($i),_f(t)}else Lf($i);An=bi($i)}if(An!==null)e=!0;else{var s=bi(Mr);s!==null&&fg(ug,s.startTime-t),e=!1}}break e}finally{An=null,kt=n,ag=!1}e=void 0}}finally{e?qo():Po=!1}}}var qo;typeof Yx=="function"?qo=function(){Yx(sg)}:typeof MessageChannel<"u"?(og=new MessageChannel,Kx=og.port2,og.port1.onmessage=sg,qo=function(){Kx.postMessage(null)}):qo=function(){Qx(sg,0)};var og,Kx;function fg(t,e){Pa=Qx(function(){t(_e.unstable_now())},e)}_e.unstable_IdlePriority=5;_e.unstable_ImmediatePriority=1;_e.unstable_LowPriority=4;_e.unstable_NormalPriority=3;_e.unstable_Profiling=null;_e.unstable_UserBlockingPriority=2;_e.unstable_cancelCallback=function(t){t.callback=null};_e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Gx=0<t?Math.floor(1e3/t):5};_e.unstable_getCurrentPriorityLevel=function(){return kt};_e.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var n=kt;kt=e;try{return t()}finally{kt=n}};_e.unstable_requestPaint=function(){cg=!0};_e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=kt;kt=t;try{return e()}finally{kt=n}};_e.unstable_scheduleCallback=function(t,e,n){var i=_e.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:y5++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,lg(Mr,t),bi($i)===null&&t===bi(Mr)&&(qa?($x(Pa),Pa=-1):qa=!0,fg(ug,n-i))):(t.sortIndex=r,lg($i,t),Ia||ag||(Ia=!0,Po||(Po=!0,qo()))),t};_e.unstable_shouldYield=Wx;_e.unstable_wrapCallback=function(t){var e=kt;return function(){var n=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=n}}}});var ew=x((yse,Jx)=>{"use strict";Jx.exports=Zx()});var nw=x(Lt=>{"use strict";var b5=yi();function tw(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Nr(){}var _t={d:{f:Nr,r:function(){throw Error(tw(522))},D:Nr,C:Nr,L:Nr,m:Nr,X:Nr,S:Nr,M:Nr},p:0,findDOMNode:null},v5=Symbol.for("react.portal");function S5(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v5,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var za=b5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Bf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_t;Lt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(tw(299));return S5(t,e,null,n)};Lt.flushSync=function(t){var e=za.T,n=_t.p;try{if(za.T=null,_t.p=2,t)return t()}finally{za.T=e,_t.p=n,_t.d.f()}};Lt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,_t.d.C(t,e))};Lt.prefetchDNS=function(t){typeof t=="string"&&_t.d.D(t)};Lt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Bf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?_t.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&_t.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Lt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Bf(e.as,e.crossOrigin);_t.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&_t.d.M(t)};Lt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Bf(n,e.crossOrigin);_t.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Lt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Bf(e.as,e.crossOrigin);_t.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else _t.d.m(t)};Lt.requestFormReset=function(t){_t.d.r(t)};Lt.unstable_batchedUpdates=function(t,e){return t(e)};Lt.useFormState=function(t,e,n){return za.H.useFormState(t,e,n)};Lt.useFormStatus=function(){return za.H.useHostTransitionStatus()};Lt.version="19.1.0"});var sw=x((vse,rw)=>{"use strict";function iw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iw)}catch(t){console.error(t)}}iw(),rw.exports=nw()});var lT=x(id=>{"use strict";var tt=ew(),Ck=yi(),x5=sw();function C(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ek(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Tc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Dk(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function ow(t){if(Tc(t)!==t)throw Error(C(188))}function w5(t){var e=t.alternate;if(!e){if(e=Tc(t),e===null)throw Error(C(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return ow(r),t;if(s===i)return ow(r),e;s=s.sibling}throw Error(C(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(C(189))}}if(n.alternate!==i)throw Error(C(190))}if(n.tag!==3)throw Error(C(188));return n.stateNode.current===n?t:e}function Mk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=Mk(t),e!==null)return e;t=t.sibling}return null}var De=Object.assign,k5=Symbol.for("react.element"),If=Symbol.for("react.transitional.element"),$a=Symbol.for("react.portal"),Yo=Symbol.for("react.fragment"),Nk=Symbol.for("react.strict_mode"),jg=Symbol.for("react.profiler"),A5=Symbol.for("react.provider"),Rk=Symbol.for("react.consumer"),Ji=Symbol.for("react.context"),Py=Symbol.for("react.forward_ref"),Vg=Symbol.for("react.suspense"),Yg=Symbol.for("react.suspense_list"),zy=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),Kg=Symbol.for("react.activity"),O5=Symbol.for("react.memo_cache_sentinel"),lw=Symbol.iterator;function Ha(t){return t===null||typeof t!="object"?null:(t=lw&&t[lw]||t["@@iterator"],typeof t=="function"?t:null)}var T5=Symbol.for("react.client.reference");function Qg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===T5?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Yo:return"Fragment";case jg:return"Profiler";case Nk:return"StrictMode";case Vg:return"Suspense";case Yg:return"SuspenseList";case Kg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case $a:return"Portal";case Ji:return(t.displayName||"Context")+".Provider";case Rk:return(t._context.displayName||"Context")+".Consumer";case Py:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case zy:return e=t.displayName||null,e!==null?e:Qg(t.type)||"Memo";case Lr:e=t._payload,t=t._init;try{return Qg(t(e))}catch{}}return null}var Ga=Array.isArray,j=Ck.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=x5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Is={pending:!1,data:null,method:null,action:null},$g=[],Ko=-1;function Oi(t){return{current:t}}function ut(t){0>Ko||(t.current=$g[Ko],$g[Ko]=null,Ko--)}function Be(t,e){Ko++,$g[Ko]=t.current,t.current=e}var wi=Oi(null),hc=Oi(null),Vr=Oi(null),hh=Oi(null);function dh(t,e){switch(Be(Vr,e),Be(hc,t),Be(wi,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?dk(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=dk(e),t=GO(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ut(wi),Be(wi,t)}function fl(){ut(wi),ut(hc),ut(Vr)}function Gg(t){t.memoizedState!==null&&Be(hh,t);var e=wi.current,n=GO(e,t.type);e!==n&&(Be(hc,t),Be(wi,n))}function ph(t){hc.current===t&&(ut(wi),ut(hc)),hh.current===t&&(ut(hh),wc._currentValue=Is)}var Xg=Object.prototype.hasOwnProperty,Hy=tt.unstable_scheduleCallback,hg=tt.unstable_cancelCallback,C5=tt.unstable_shouldYield,E5=tt.unstable_requestPaint,ki=tt.unstable_now,D5=tt.unstable_getCurrentPriorityLevel,_k=tt.unstable_ImmediatePriority,Lk=tt.unstable_UserBlockingPriority,mh=tt.unstable_NormalPriority,M5=tt.unstable_LowPriority,Bk=tt.unstable_IdlePriority,N5=tt.log,R5=tt.unstable_setDisableYieldValue,Cc=null,un=null;function Hr(t){if(typeof N5=="function"&&R5(t),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Cc,t)}catch{}}var fn=Math.clz32?Math.clz32:B5,_5=Math.log,L5=Math.LN2;function B5(t){return t>>>=0,t===0?32:31-(_5(t)/L5|0)|0}var qf=256,Pf=4194304;function _s(t){var e=t&42;if(e!==0)return e;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Fh(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=_s(i):(o&=l,o!==0?r=_s(o):n||(n=l&~t,n!==0&&(r=_s(n))))):(l=i&~s,l!==0?r=_s(l):o!==0?r=_s(o):n||(n=i&~t,n!==0&&(r=_s(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function Ec(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function I5(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ik(){var t=qf;return qf<<=1,(qf&4194048)===0&&(qf=256),t}function qk(){var t=Pf;return Pf<<=1,(Pf&62914560)===0&&(Pf=4194304),t}function dg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Dc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function q5(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-fn(n),f=1<<u;l[u]=0,a[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&Pk(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function Pk(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-fn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function zk(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-fn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Uy(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Fy(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hk(){var t=de.p;return t!==0?t:(t=window.event,t===void 0?32:sT(t.type))}function P5(t,e){var n=de.p;try{return de.p=t,e()}finally{de.p=n}}var ts=Math.random().toString(36).slice(2),At="__reactFiber$"+ts,Xt="__reactProps$"+ts,wl="__reactContainer$"+ts,Wg="__reactEvents$"+ts,z5="__reactListeners$"+ts,H5="__reactHandles$"+ts,aw="__reactResources$"+ts,Mc="__reactMarker$"+ts;function jy(t){delete t[At],delete t[Xt],delete t[Wg],delete t[z5],delete t[H5]}function Qo(t){var e=t[At];if(e)return e;for(var n=t.parentNode;n;){if(e=n[wl]||n[At]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=gk(t);t!==null;){if(n=t[At])return n;t=gk(t)}return e}t=n,n=t.parentNode}return null}function kl(t){if(t=t[At]||t[wl]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Xa(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(C(33))}function il(t){var e=t[aw];return e||(e=t[aw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function at(t){t[Mc]=!0}var Uk=new Set,Fk={};function Qs(t,e){hl(t,e),hl(t+"Capture",e)}function hl(t,e){for(Fk[t]=e,t=0;t<e.length;t++)Uk.add(e[t])}var U5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cw={},uw={};function F5(t){return Xg.call(uw,t)?!0:Xg.call(cw,t)?!1:U5.test(t)?uw[t]=!0:(cw[t]=!0,!1)}function Jf(t,e,n){if(F5(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function zf(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Gi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var pg,fw;function Fo(t){if(pg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);pg=e&&e[1]||"",fw=-1<n.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ug+t+rw}var fg=!1;function hg(t,e){if(!t||fg)return"";fg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var h=d}Reflect.construct(t,[],f)}else{try{f.call()}catch(d){h=d}t.call(f.prototype)}}else{try{throw Error()}catch(d){h=d}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&h&&typeof d.stack=="string")return[d.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),o=s[0],l=s[1];if(o&&l){var a=o.split(`
3
+ `+pg+t+fw}var mg=!1;function gg(t,e){if(!t||mg)return"";mg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var h=d}Reflect.construct(t,[],f)}else{try{f.call()}catch(d){h=d}t.call(f.prototype)}}else{try{throw Error()}catch(d){h=d}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&h&&typeof d.stack=="string")return[d.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),o=s[0],l=s[1];if(o&&l){var a=o.split(`
4
4
  `),c=l.split(`
5
5
  `);for(r=i=0;i<a.length&&!a[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===a.length||r===c.length)for(i=a.length-1,r=c.length-1;1<=i&&0<=r&&a[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(a[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||a[i]!==c[r]){var u=`
6
- `+a[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{fg=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Bo(n):""}function L5(t){switch(t.tag){case 26:case 27:case 5:return Bo(t.type);case 16:return Bo("Lazy");case 13:return Bo("Suspense");case 19:return Bo("SuspenseList");case 0:case 15:return hg(t.type,!1);case 11:return hg(t.type.render,!1);case 1:return hg(t.type,!0);case 31:return Bo("Activity");default:return""}}function sw(t){try{var e="";do e+=L5(t),t=t.return;while(t);return e}catch(n){return`
6
+ `+a[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{mg=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Fo(n):""}function j5(t){switch(t.tag){case 26:case 27:case 5:return Fo(t.type);case 16:return Fo("Lazy");case 13:return Fo("Suspense");case 19:return Fo("SuspenseList");case 0:case 15:return gg(t.type,!1);case 11:return gg(t.type.render,!1);case 1:return gg(t.type,!0);case 31:return Fo("Activity");default:return""}}function hw(t){try{var e="";do e+=j5(t),t=t.return;while(t);return e}catch(n){return`
7
7
  Error generating stack: `+n.message+`
8
- `+n.stack}}function An(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ik(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function B5(t){var e=Ik(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fh(t){t._valueTracker||(t._valueTracker=B5(t))}function qk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=Ik(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function hh(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}}var I5=/[\n"\\]/g;function Cn(t){return t.replace(I5,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Gg(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+An(e)):t.value!==""+An(e)&&(t.value=""+An(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?$g(t,o,An(e)):n!=null?$g(t,o,An(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+An(l):t.removeAttribute("name")}function Pk(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+An(n):"",e=e!=null?""+An(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function $g(t,e,n){e==="number"&&hh(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function Wo(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+An(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function zk(t,e,n){if(e!=null&&(e=""+An(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+An(n):""}function Hk(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(C(92));if(Va(i)){if(1<i.length)throw Error(C(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=An(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function ol(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var q5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ow(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||q5.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Uk(t,e,n){if(e!=null&&typeof e!="object")throw Error(C(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&ow(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&ow(t,s,e[s])}function Hy(t){if(t.indexOf("-")===-1)return!1;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 P5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),z5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $f(t){return z5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Xg=null;function Uy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Uo=null,Zo=null;function lw(t){var e=gl(t);if(e&&(t=e.stateNode)){var n=t[$t]||null;e:switch(t=e.stateNode,e.type){case"input":if(Gg(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Cn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[$t]||null;if(!r)throw Error(C(90));Gg(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&qk(i)}break e;case"textarea":zk(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&Wo(t,!!n.multiple,e,!1)}}}var dg=!1;function Fk(t,e,n){if(dg)return t(e,n);dg=!0;try{var i=t(e);return i}finally{if(dg=!1,(Uo!==null||Zo!==null)&&(Qh(),Uo&&(e=Uo,t=Zo,Zo=Uo=null,lw(e),t)))for(e=0;e<t.length;e++)lw(t[e])}}function ac(t,e){var n=t.stateNode;if(n===null)return null;var i=n[$t]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(C(231,e,typeof n));return n}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wg=!1;if(tr)try{Ro={},Object.defineProperty(Ro,"passive",{get:function(){Wg=!0}}),window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{Wg=!1}var Ro,Br=null,Fy=null,Xf=null;function jk(){if(Xf)return Xf;var t,e=Fy,n=e.length,i,r="value"in Br?Br.value:Br.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return Xf=r.slice(t,1<i?1-i:void 0)}function Wf(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Bf(){return!0}function aw(){return!1}function Xt(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Bf:aw,this.isPropagationStopped=aw,this}return De(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Bf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bf)},persist:function(){},isPersistent:Bf}),e}var js={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ph=Xt(js),Tc=De({},js,{view:0,detail:0}),H5=Xt(Tc),pg,mg,Ia,zh=De({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jy,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ia&&(Ia&&t.type==="mousemove"?(pg=t.screenX-Ia.screenX,mg=t.screenY-Ia.screenY):mg=pg=0,Ia=t),pg)},movementY:function(t){return"movementY"in t?t.movementY:mg}}),cw=Xt(zh),U5=De({},zh,{dataTransfer:0}),F5=Xt(U5),j5=De({},Tc,{relatedTarget:0}),gg=Xt(j5),V5=De({},js,{animationName:0,elapsedTime:0,pseudoElement:0}),Y5=Xt(V5),K5=De({},js,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Q5=Xt(K5),G5=De({},js,{data:0}),uw=Xt(G5),$5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},W5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z5(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=W5[t])?!!e[t]:!1}function jy(){return Z5}var J5=De({},Tc,{key:function(t){if(t.key){var e=$5[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Wf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?X5[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jy,charCode:function(t){return t.type==="keypress"?Wf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eP=Xt(J5),tP=De({},zh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fw=Xt(tP),nP=De({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jy}),iP=Xt(nP),rP=De({},js,{propertyName:0,elapsedTime:0,pseudoElement:0}),sP=Xt(rP),oP=De({},zh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lP=Xt(oP),aP=De({},js,{newState:0,oldState:0}),cP=Xt(aP),uP=[9,13,27,32],Vy=tr&&"CompositionEvent"in window,Qa=null;tr&&"documentMode"in document&&(Qa=document.documentMode);var fP=tr&&"TextEvent"in window&&!Qa,Vk=tr&&(!Vy||Qa&&8<Qa&&11>=Qa),hw=" ",dw=!1;function Yk(t,e){switch(t){case"keyup":return uP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fo=!1;function hP(t,e){switch(t){case"compositionend":return Kk(e);case"keypress":return e.which!==32?null:(dw=!0,hw);case"textInput":return t=e.data,t===hw&&dw?null:t;default:return null}}function dP(t,e){if(Fo)return t==="compositionend"||!Vy&&Yk(t,e)?(t=jk(),Xf=Fy=Br=null,Fo=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Vk&&e.locale!=="ko"?null:e.data;default:return null}}var pP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!pP[t.type]:e==="textarea"}function Qk(t,e,n,i){Uo?Zo?Zo.push(i):Zo=[i]:Uo=i,e=Mh(e,"onChange"),0<e.length&&(n=new Ph("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Ga=null,cc=null;function mP(t){zO(t,0)}function Hh(t){var e=Ya(t);if(qk(e))return t}function mw(t,e){if(t==="change")return e}var Gk=!1;tr&&(tr?(qf="oninput"in document,qf||(yg=document.createElement("div"),yg.setAttribute("oninput","return;"),qf=typeof yg.oninput=="function"),If=qf):If=!1,Gk=If&&(!document.documentMode||9<document.documentMode));var If,qf,yg;function gw(){Ga&&(Ga.detachEvent("onpropertychange",$k),cc=Ga=null)}function $k(t){if(t.propertyName==="value"&&Hh(cc)){var e=[];Qk(e,cc,t,Uy(t)),Fk(mP,e)}}function gP(t,e,n){t==="focusin"?(gw(),Ga=e,cc=n,Ga.attachEvent("onpropertychange",$k)):t==="focusout"&&gw()}function yP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Hh(cc)}function bP(t,e){if(t==="click")return Hh(e)}function vP(t,e){if(t==="input"||t==="change")return Hh(e)}function SP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var fn=typeof Object.is=="function"?Object.is:SP;function uc(t,e){if(fn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Kg.call(e,r)||!fn(t[r],e[r]))return!1}return!0}function yw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bw(t,e){var n=yw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yw(n)}}function Xk(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Xk(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Wk(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=hh(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=hh(t.document)}return e}function Yy(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")}var xP=tr&&"documentMode"in document&&11>=document.documentMode,jo=null,Zg=null,$a=null,Jg=!1;function vw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jg||jo==null||jo!==hh(i)||(i=jo,"selectionStart"in i&&Yy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$a&&uc($a,i)||($a=i,i=Mh(Zg,"onSelect"),0<i.length&&(e=new Ph("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=jo)))}function Cs(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Vo={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},bg={},Zk={};tr&&(Zk=document.createElement("div").style,"AnimationEvent"in window||(delete Vo.animationend.animation,delete Vo.animationiteration.animation,delete Vo.animationstart.animation),"TransitionEvent"in window||delete Vo.transitionend.transition);function Vs(t){if(bg[t])return bg[t];if(!Vo[t])return t;var e=Vo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Zk)return bg[t]=e[n];return t}var Jk=Vs("animationend"),eA=Vs("animationiteration"),tA=Vs("animationstart"),wP=Vs("transitionrun"),kP=Vs("transitionstart"),AP=Vs("transitioncancel"),nA=Vs("transitionend"),iA=new Map,ey="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ey.push("scrollEnd");function Gn(t,e){iA.set(t,e),Fs(e,[t])}var Sw=new WeakMap;function En(t,e){if(typeof t=="object"&&t!==null){var n=Sw.get(t);return n!==void 0?n:(e={value:t,source:e,stack:sw(e)},Sw.set(t,e),e)}return{value:t,source:e,stack:sw(e)}}var kn=[],Yo=0,Ky=0;function Uh(){for(var t=Yo,e=Ky=Yo=0;e<t;){var n=kn[e];kn[e++]=null;var i=kn[e];kn[e++]=null;var r=kn[e];kn[e++]=null;var s=kn[e];if(kn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&rA(n,r,s)}}function Fh(t,e,n,i){kn[Yo++]=t,kn[Yo++]=e,kn[Yo++]=n,kn[Yo++]=i,Ky|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Qy(t,e,n,i){return Fh(t,e,n,i),dh(t)}function yl(t,e){return Fh(t,null,null,e),dh(t)}function rA(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-an(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function dh(t){if(50<sc)throw sc=0,xy=null,Error(C(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ko={};function OP(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function on(t,e,n,i){return new OP(t,e,n,i)}function Gy(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ji(t,e){var n=t.alternate;return n===null?(n=on(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&65011712,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.refCleanup=t.refCleanup,n}function sA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Zf(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")Gy(t)&&(o=1);else if(typeof t=="string")o=O6(t,n,bi.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Fg:return t=on(31,n,e,r),t.elementType=Fg,t.lanes=s,t;case Po:return Rs(n.children,r,s,e);case Ak:o=8,r|=24;break;case zg:return t=on(12,n,e,r|2),t.elementType=zg,t.lanes=s,t;case Hg:return t=on(13,n,e,r),t.elementType=Hg,t.lanes=s,t;case Ug:return t=on(19,n,e,r),t.elementType=Ug,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case m5:case Gi:o=10;break e;case Ok:o=9;break e;case Ly:o=11;break e;case By:o=14;break e;case Er:o=16,i=null;break e}o=29,n=Error(C(130,t===null?"null":typeof t,"")),i=null}return e=on(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Rs(t,e,n,i){return t=on(7,t,i,e),t.lanes=n,t}function vg(t,e,n){return t=on(6,t,null,e),t.lanes=n,t}function Sg(t,e,n){return e=on(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Qo=[],Go=0,ph=null,mh=0,On=[],Tn=0,_s=null,$i=1,Xi="";function Ds(t,e){Qo[Go++]=mh,Qo[Go++]=ph,ph=t,mh=e}function oA(t,e,n){On[Tn++]=$i,On[Tn++]=Xi,On[Tn++]=_s,_s=t;var i=$i;t=Xi;var r=32-an(i)-1;i&=~(1<<r),n+=1;var s=32-an(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,$i=1<<32-an(e)+r|n<<r|i,Xi=s+t}else $i=1<<s|n<<r|i,Xi=t}function $y(t){t.return!==null&&(Ds(t,1),oA(t,1,0))}function Xy(t){for(;t===ph;)ph=Qo[--Go],Qo[Go]=null,mh=Qo[--Go],Qo[Go]=null;for(;t===_s;)_s=On[--Tn],On[Tn]=null,Xi=On[--Tn],On[Tn]=null,$i=On[--Tn],On[Tn]=null}var Lt=null,He=null,fe=!1,Ls=null,gi=!1,ty=Error(C(519));function Ps(t){var e=Error(C(418,""));throw fc(En(e,t)),ty}function xw(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[xt]=t,e[$t]=i,n){case"dialog":ee("cancel",e),ee("close",e);break;case"iframe":case"object":case"embed":ee("load",e);break;case"video":case"audio":for(n=0;n<pc.length;n++)ee(pc[n],e);break;case"source":ee("error",e);break;case"img":case"image":case"link":ee("error",e),ee("load",e);break;case"details":ee("toggle",e);break;case"input":ee("invalid",e),Pk(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),fh(e);break;case"select":ee("invalid",e);break;case"textarea":ee("invalid",e),Hk(e,i.value,i.defaultValue,i.children),fh(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||UO(e.textContent,n)?(i.popover!=null&&(ee("beforetoggle",e),ee("toggle",e)),i.onScroll!=null&&ee("scroll",e),i.onScrollEnd!=null&&ee("scrollend",e),i.onClick!=null&&(e.onclick=Xh),e=!0):e=!1,e||Ps(t)}function ww(t){for(Lt=t.return;Lt;)switch(Lt.tag){case 5:case 13:gi=!1;return;case 27:case 3:gi=!0;return;default:Lt=Lt.return}}function qa(t){if(t!==Lt)return!1;if(!fe)return ww(t),fe=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Cy(t.type,t.memoizedProps)),n=!n),n&&He&&Ps(t),ww(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(C(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){He=Qn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}He=null}}else e===27?(e=He,Xr(t.type)?(t=My,My=null,He=t):He=e):He=Lt?Qn(t.stateNode.nextSibling):null;return!0}function Cc(){He=Lt=null,fe=!1}function kw(){var t=Ls;return t!==null&&(Gt===null?Gt=t:Gt.push.apply(Gt,t),Ls=null),t}function fc(t){Ls===null?Ls=[t]:Ls.push(t)}var ny=xi(null),Ys=null,Wi=null;function Mr(t,e,n){Be(ny,e._currentValue),e._currentValue=n}function er(t){t._currentValue=ny.current,ht(ny)}function iy(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ry(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),iy(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(C(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),iy(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Ec(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(C(387));if(o=o.memoizedProps,o!==null){var l=r.type;fn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===lh.current){if(o=r.alternate,o===null)throw Error(C(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(yc):t=[yc])}r=r.return}t!==null&&ry(e,t,n,i),e.flags|=262144}function gh(t){for(t=t.firstContext;t!==null;){if(!fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zs(t){Ys=t,Wi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wt(t){return lA(Ys,t)}function Pf(t,e){return Ys===null&&zs(t),lA(t,e)}function lA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Wi===null){if(t===null)throw Error(C(308));Wi=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Wi=Wi.next=e;return n}var TP=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},CP=it.unstable_scheduleCallback,EP=it.unstable_NormalPriority,tt={$$typeof:Gi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wy(){return{controller:new TP,data:new Map,refCount:0}}function Dc(t){t.refCount--,t.refCount===0&&CP(EP,function(){t.controller.abort()})}var Xa=null,sy=0,ll=0,Jo=null;function DP(t,e){if(Xa===null){var n=Xa=[];sy=0,ll=S0(),Jo={status:"pending",value:void 0,then:function(i){n.push(i)}}}return sy++,e.then(Aw,Aw),e}function Aw(){if(--sy===0&&Xa!==null){Jo!==null&&(Jo.status="fulfilled");var t=Xa;Xa=null,ll=0,Jo=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function MP(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var Ow=F.S;F.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&DP(t,e),Ow!==null&&Ow(t,e)};var Bs=xi(null);function Zy(){var t=Bs.current;return t!==null?t:Ae.pooledCache}function Jf(t,e){e===null?Be(Bs,Bs.current):Be(Bs,e.pool)}function aA(){var t=Zy();return t===null?null:{parent:tt._currentValue,pool:t}}var Mc=Error(C(460)),cA=Error(C(474)),jh=Error(C(542)),oy={then:function(){}};function Tw(t){return t=t.status,t==="fulfilled"||t==="rejected"}function zf(){}function uA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(zf,zf),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ew(t),t;default:if(typeof e.status=="string")e.then(zf,zf);else{if(t=Ae,t!==null&&100<t.shellSuspendCounter)throw Error(C(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ew(t),t}throw Wa=e,Mc}}var Wa=null;function Cw(){if(Wa===null)throw Error(C(459));var t=Wa;return Wa=null,t}function Ew(t){if(t===Mc||t===jh)throw Error(C(483))}var Dr=!1;function Jy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ly(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function zr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ye&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=dh(t),rA(t,null,n),e}return Fh(t,i,e,n),dh(t)}function Za(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Rk(t,n)}}function xg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var ay=!1;function Ja(){if(ay){var t=Jo;if(t!==null)throw t}}function ec(t,e,n,i){ay=!1;var r=t.updateQueue;Dr=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var h=l.lane&-536870913,d=h!==l.lane;if(d?(ae&h)===h:(i&h)===h){h!==0&&h===ll&&(ay=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=t,m=l;h=e;var b=n;switch(m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(b,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,h=typeof p=="function"?p.call(b,f,h):p,h==null)break e;f=De({},f,h);break e;case 2:Dr=!0}}h=l.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=d,a=f):u=u.next=d,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;d=l,l=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),Gr|=o,t.lanes=o,t.memoizedState=f}}function fA(t,e){if(typeof t!="function")throw Error(C(191,t));t.call(e)}function hA(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)fA(n[t],e)}var al=xi(null),yh=xi(0);function Dw(t,e){t=rr,Be(yh,t),Be(al,e),rr=t|e.baseLanes}function cy(){Be(yh,rr),Be(al,al.current)}function e0(){rr=yh.current,ht(al),ht(yh)}var Kr=0,X=null,Se=null,Ge=null,bh=!1,el=!1,Hs=!1,vh=0,hc=0,tl=null,NP=0;function Ye(){throw Error(C(321))}function t0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!fn(t[n],e[n]))return!1;return!0}function n0(t,e,n,i,r,s){return Kr=s,X=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,F.H=t===null||t.memoizedState===null?jA:VA,Hs=!1,s=n(i,r),Hs=!1,el&&(s=pA(e,n,i,r)),dA(t),s}function dA(t){F.H=Sh;var e=Se!==null&&Se.next!==null;if(Kr=0,Ge=Se=X=null,bh=!1,hc=0,tl=null,e)throw Error(C(300));t===null||ft||(t=t.dependencies,t!==null&&gh(t)&&(ft=!0))}function pA(t,e,n,i){X=t;var r=0;do{if(el&&(tl=null),hc=0,el=!1,25<=r)throw Error(C(301));if(r+=1,Ge=Se=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}F.H=PP,s=e(n,i)}while(el);return s}function RP(){var t=F.H,e=t.useState()[0];return e=typeof e.then=="function"?Nc(e):e,t=t.useState()[0],(Se!==null?Se.memoizedState:null)!==t&&(X.flags|=1024),e}function i0(){var t=vh!==0;return vh=0,t}function r0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function s0(t){if(bh){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}bh=!1}Kr=0,Ge=Se=X=null,el=!1,hc=vh=0,tl=null}function Kt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?X.memoizedState=Ge=t:Ge=Ge.next=t,Ge}function $e(){if(Se===null){var t=X.alternate;t=t!==null?t.memoizedState:null}else t=Se.next;var e=Ge===null?X.memoizedState:Ge.next;if(e!==null)Ge=e,Se=t;else{if(t===null)throw X.alternate===null?Error(C(467)):Error(C(310));Se=t,t={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},Ge===null?X.memoizedState=Ge=t:Ge=Ge.next=t}return Ge}function o0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nc(t){var e=hc;return hc+=1,tl===null&&(tl=[]),t=uA(tl,t,e),e=X,(Ge===null?e.memoizedState:Ge.next)===null&&(e=e.alternate,F.H=e===null||e.memoizedState===null?jA:VA),t}function Vh(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Nc(t);if(t.$$typeof===Gi)return wt(t)}throw Error(C(438,String(t)))}function l0(t){var e=null,n=X.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=X.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=o0(),X.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=g5;return e.index++,n}function nr(t,e){return typeof e=="function"?e(t):e}function eh(t){var e=$e();return a0(e,Se,t)}function a0(t,e,n){var i=t.queue;if(i===null)throw Error(C(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(ae&f)===f:(Kr&f)===f){var h=c.revertLane;if(h===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===ll&&(u=!0);else if((Kr&h)===h){c=c.next,h===ll&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,X.lanes|=h,Gr|=h;f=c.action,Hs&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=h,o=s):a=a.next=h,X.lanes|=f,Gr|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!fn(s,t.memoizedState)&&(ft=!0,u&&(n=Jo,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function wg(t){var e=$e(),n=e.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);fn(s,e.memoizedState)||(ft=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function mA(t,e,n){var i=X,r=$e(),s=fe;if(s){if(n===void 0)throw Error(C(407));n=n()}else n=e();var o=!fn((Se||r).memoizedState,n);o&&(r.memoizedState=n,ft=!0),r=r.queue;var l=bA.bind(null,i,r,t);if(Rc(2048,8,l,[t]),r.getSnapshot!==e||o||Ge!==null&&Ge.memoizedState.tag&1){if(i.flags|=2048,cl(9,Yh(),yA.bind(null,i,r,n,e),null),Ae===null)throw Error(C(349));s||(Kr&124)!==0||gA(i,e,n)}return n}function gA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=X.updateQueue,e===null?(e=o0(),X.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function yA(t,e,n,i){e.value=n,e.getSnapshot=i,vA(e)&&SA(t)}function bA(t,e,n){return n(function(){vA(e)&&SA(t)})}function vA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!fn(t,n)}catch{return!0}}function SA(t){var e=yl(t,2);e!==null&&un(e,t,2)}function uy(t){var e=Kt();if(typeof t=="function"){var n=t;if(t=n(),Hs){Lr(!0);try{n()}finally{Lr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:t},e}function xA(t,e,n,i){return t.baseState=n,a0(t,Se,typeof i=="function"?i:nr)}function _P(t,e,n,i,r){if(Kh(t))throw Error(C(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};F.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,wA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function wA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=F.T,o={};F.T=o;try{var l=n(r,i),a=F.S;a!==null&&a(o,l),Mw(t,e,l)}catch(c){fy(t,e,c)}finally{F.T=s}}else try{s=n(r,i),Mw(t,e,s)}catch(c){fy(t,e,c)}}function Mw(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Nw(t,e,i)},function(i){return fy(t,e,i)}):Nw(t,e,n)}function Nw(t,e,n){e.status="fulfilled",e.value=n,kA(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,wA(t,n)))}function fy(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,kA(e),e=e.next;while(e!==i)}t.action=null}function kA(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function AA(t,e){return e}function Rw(t,e){if(fe){var n=Ae.formState;if(n!==null){e:{var i=X;if(fe){if(He){t:{for(var r=He,s=gi;r.nodeType!==8;){if(!s){r=null;break t}if(r=Qn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){He=Qn(r.nextSibling),i=r.data==="F!";break e}}Ps(i)}i=!1}i&&(e=n[0])}}return n=Kt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:AA,lastRenderedState:e},n.queue=i,n=HA.bind(null,X,i),i.dispatch=n,i=uy(!1),s=h0.bind(null,X,!1,i.queue),i=Kt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=_P.bind(null,X,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function _w(t){var e=$e();return OA(e,Se,t)}function OA(t,e,n){if(e=a0(t,e,AA)[0],t=eh(nr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Nc(e)}catch(o){throw o===Mc?jh:o}else i=e;e=$e();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(X.flags|=2048,cl(9,Yh(),LP.bind(null,r,n),null)),[i,s,t]}function LP(t,e){t.action=e}function Lw(t){var e=$e(),n=Se;if(n!==null)return OA(e,n,t);$e(),e=e.memoizedState,n=$e();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function cl(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=X.updateQueue,e===null&&(e=o0(),X.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Yh(){return{destroy:void 0,resource:void 0}}function TA(){return $e().memoizedState}function th(t,e,n,i){var r=Kt();i=i===void 0?null:i,X.flags|=t,r.memoizedState=cl(1|e,Yh(),n,i)}function Rc(t,e,n,i){var r=$e();i=i===void 0?null:i;var s=r.memoizedState.inst;Se!==null&&i!==null&&t0(i,Se.memoizedState.deps)?r.memoizedState=cl(e,s,n,i):(X.flags|=t,r.memoizedState=cl(1|e,s,n,i))}function Bw(t,e){th(8390656,8,t,e)}function CA(t,e){Rc(2048,8,t,e)}function EA(t,e){return Rc(4,2,t,e)}function DA(t,e){return Rc(4,4,t,e)}function MA(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function NA(t,e,n){n=n!=null?n.concat([t]):null,Rc(4,4,MA.bind(null,e,t),n)}function c0(){}function RA(t,e){var n=$e();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&t0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function _A(t,e){var n=$e();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&t0(e,i[1]))return i[0];if(i=t(),Hs){Lr(!0);try{t()}finally{Lr(!1)}}return n.memoizedState=[i,e],i}function u0(t,e,n){return n===void 0||(Kr&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=kO(),X.lanes|=t,Gr|=t,n)}function LA(t,e,n,i){return fn(n,e)?n:al.current!==null?(t=u0(t,n,i),fn(t,e)||(ft=!0),t):(Kr&42)===0?(ft=!0,t.memoizedState=n):(t=kO(),X.lanes|=t,Gr|=t,e)}function BA(t,e,n,i,r){var s=he.p;he.p=s!==0&&8>s?s:8;var o=F.T,l={};F.T=l,h0(t,!1,e,n);try{var a=r(),c=F.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=MP(a,i);tc(t,e,u,cn(t))}else tc(t,e,i,cn(t))}catch(f){tc(t,e,{then:function(){},status:"rejected",reason:f},cn())}finally{he.p=s,F.T=o}}function BP(){}function hy(t,e,n,i){if(t.tag!==5)throw Error(C(476));var r=IA(t).queue;BA(t,r,e,Ns,n===null?BP:function(){return qA(t),n(i)})}function IA(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ns,baseState:Ns,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:Ns},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function qA(t){var e=IA(t).next.queue;tc(t,e,{},cn())}function f0(){return wt(yc)}function PA(){return $e().memoizedState}function zA(){return $e().memoizedState}function IP(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=cn();t=zr(n);var i=Hr(e,t,n);i!==null&&(un(i,e,n),Za(i,e,n)),e={cache:Wy()},t.payload=e;return}e=e.return}}function qP(t,e,n){var i=cn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Kh(t)?UA(e,n):(n=Qy(t,e,n,i),n!==null&&(un(n,t,i),FA(n,e,i)))}function HA(t,e,n){var i=cn();tc(t,e,n,i)}function tc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kh(t))UA(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,fn(l,o))return Fh(t,e,r,0),Ae===null&&Uh(),!1}catch{}if(n=Qy(t,e,r,i),n!==null)return un(n,t,i),FA(n,e,i),!0}return!1}function h0(t,e,n,i){if(i={lane:2,revertLane:S0(),action:i,hasEagerState:!1,eagerState:null,next:null},Kh(t)){if(e)throw Error(C(479))}else e=Qy(t,n,i,2),e!==null&&un(e,t,2)}function Kh(t){var e=t.alternate;return t===X||e!==null&&e===X}function UA(t,e){el=bh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function FA(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Rk(t,n)}}var Sh={readContext:wt,use:Vh,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye},jA={readContext:wt,use:Vh,useCallback:function(t,e){return Kt().memoizedState=[t,e===void 0?null:e],t},useContext:wt,useEffect:Bw,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,th(4194308,4,MA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return th(4194308,4,t,e)},useInsertionEffect:function(t,e){th(4,2,t,e)},useMemo:function(t,e){var n=Kt();e=e===void 0?null:e;var i=t();if(Hs){Lr(!0);try{t()}finally{Lr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Kt();if(n!==void 0){var r=n(e);if(Hs){Lr(!0);try{n(e)}finally{Lr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=qP.bind(null,X,t),[i.memoizedState,t]},useRef:function(t){var e=Kt();return t={current:t},e.memoizedState=t},useState:function(t){t=uy(t);var e=t.queue,n=HA.bind(null,X,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:c0,useDeferredValue:function(t,e){var n=Kt();return u0(n,t,e)},useTransition:function(){var t=uy(!1);return t=BA.bind(null,X,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=X,r=Kt();if(fe){if(n===void 0)throw Error(C(407));n=n()}else{if(n=e(),Ae===null)throw Error(C(349));(ae&124)!==0||gA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Bw(bA.bind(null,i,s,t),[t]),i.flags|=2048,cl(9,Yh(),yA.bind(null,i,s,n,e),null),n},useId:function(){var t=Kt(),e=Ae.identifierPrefix;if(fe){var n=Xi,i=$i;n=(i&~(1<<32-an(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=vh++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=NP++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:f0,useFormState:Rw,useActionState:Rw,useOptimistic:function(t){var e=Kt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=h0.bind(null,X,!0,n),n.dispatch=e,[t,e]},useMemoCache:l0,useCacheRefresh:function(){return Kt().memoizedState=IP.bind(null,X)}},VA={readContext:wt,use:Vh,useCallback:RA,useContext:wt,useEffect:CA,useImperativeHandle:NA,useInsertionEffect:EA,useLayoutEffect:DA,useMemo:_A,useReducer:eh,useRef:TA,useState:function(){return eh(nr)},useDebugValue:c0,useDeferredValue:function(t,e){var n=$e();return LA(n,Se.memoizedState,t,e)},useTransition:function(){var t=eh(nr)[0],e=$e().memoizedState;return[typeof t=="boolean"?t:Nc(t),e]},useSyncExternalStore:mA,useId:PA,useHostTransitionStatus:f0,useFormState:_w,useActionState:_w,useOptimistic:function(t,e){var n=$e();return xA(n,Se,t,e)},useMemoCache:l0,useCacheRefresh:zA},PP={readContext:wt,use:Vh,useCallback:RA,useContext:wt,useEffect:CA,useImperativeHandle:NA,useInsertionEffect:EA,useLayoutEffect:DA,useMemo:_A,useReducer:wg,useRef:TA,useState:function(){return wg(nr)},useDebugValue:c0,useDeferredValue:function(t,e){var n=$e();return Se===null?u0(n,t,e):LA(n,Se.memoizedState,t,e)},useTransition:function(){var t=wg(nr)[0],e=$e().memoizedState;return[typeof t=="boolean"?t:Nc(t),e]},useSyncExternalStore:mA,useId:PA,useHostTransitionStatus:f0,useFormState:Lw,useActionState:Lw,useOptimistic:function(t,e){var n=$e();return Se!==null?xA(n,Se,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:l0,useCacheRefresh:zA},nl=null,dc=0;function Hf(t){var e=dc;return dc+=1,nl===null&&(nl=[]),uA(nl,t,e)}function Pa(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Uf(t,e){throw e.$$typeof===p5?Error(C(525)):(t=Object.prototype.toString.call(e),Error(C(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Iw(t){var e=t._init;return e(t._payload)}function YA(t){function e(y,g){if(t){var v=y.deletions;v===null?(y.deletions=[g],y.flags|=16):v.push(g)}}function n(y,g){if(!t)return null;for(;g!==null;)e(y,g),g=g.sibling;return null}function i(y){for(var g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function r(y,g){return y=Ji(y,g),y.index=0,y.sibling=null,y}function s(y,g,v){return y.index=v,t?(v=y.alternate,v!==null?(v=v.index,v<g?(y.flags|=67108866,g):v):(y.flags|=67108866,g)):(y.flags|=1048576,g)}function o(y){return t&&y.alternate===null&&(y.flags|=67108866),y}function l(y,g,v,S){return g===null||g.tag!==6?(g=vg(v,y.mode,S),g.return=y,g):(g=r(g,v),g.return=y,g)}function a(y,g,v,S){var w=v.type;return w===Po?u(y,g,v.props.children,S,v.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Er&&Iw(w)===g.type)?(g=r(g,v.props),Pa(g,v),g.return=y,g):(g=Zf(v.type,v.key,v.props,null,y.mode,S),Pa(g,v),g.return=y,g)}function c(y,g,v,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=Sg(v,y.mode,S),g.return=y,g):(g=r(g,v.children||[]),g.return=y,g)}function u(y,g,v,S,w){return g===null||g.tag!==7?(g=Rs(v,y.mode,S,w),g.return=y,g):(g=r(g,v),g.return=y,g)}function f(y,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=vg(""+g,y.mode,v),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Nf:return v=Zf(g.type,g.key,g.props,null,y.mode,v),Pa(v,g),v.return=y,v;case ja:return g=Sg(g,y.mode,v),g.return=y,g;case Er:var S=g._init;return g=S(g._payload),f(y,g,v)}if(Va(g)||Ba(g))return g=Rs(g,y.mode,v,null),g.return=y,g;if(typeof g.then=="function")return f(y,Hf(g),v);if(g.$$typeof===Gi)return f(y,Pf(y,g),v);Uf(y,g)}return null}function h(y,g,v,S){var w=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:l(y,g,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Nf:return v.key===w?a(y,g,v,S):null;case ja:return v.key===w?c(y,g,v,S):null;case Er:return w=v._init,v=w(v._payload),h(y,g,v,S)}if(Va(v)||Ba(v))return w!==null?null:u(y,g,v,S,null);if(typeof v.then=="function")return h(y,g,Hf(v),S);if(v.$$typeof===Gi)return h(y,g,Pf(y,v),S);Uf(y,v)}return null}function d(y,g,v,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return y=y.get(v)||null,l(g,y,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Nf:return y=y.get(S.key===null?v:S.key)||null,a(g,y,S,w);case ja:return y=y.get(S.key===null?v:S.key)||null,c(g,y,S,w);case Er:var A=S._init;return S=A(S._payload),d(y,g,v,S,w)}if(Va(S)||Ba(S))return y=y.get(v)||null,u(g,y,S,w,null);if(typeof S.then=="function")return d(y,g,v,Hf(S),w);if(S.$$typeof===Gi)return d(y,g,v,Pf(g,S),w);Uf(g,S)}return null}function p(y,g,v,S){for(var w=null,A=null,k=g,O=g=0,M=null;k!==null&&O<v.length;O++){k.index>O?(M=k,k=null):M=k.sibling;var E=h(y,k,v[O],S);if(E===null){k===null&&(k=M);break}t&&k&&E.alternate===null&&e(y,k),g=s(E,g,O),A===null?w=E:A.sibling=E,A=E,k=M}if(O===v.length)return n(y,k),fe&&Ds(y,O),w;if(k===null){for(;O<v.length;O++)k=f(y,v[O],S),k!==null&&(g=s(k,g,O),A===null?w=k:A.sibling=k,A=k);return fe&&Ds(y,O),w}for(k=i(k);O<v.length;O++)M=d(k,y,O,v[O],S),M!==null&&(t&&M.alternate!==null&&k.delete(M.key===null?O:M.key),g=s(M,g,O),A===null?w=M:A.sibling=M,A=M);return t&&k.forEach(function(L){return e(y,L)}),fe&&Ds(y,O),w}function m(y,g,v,S){if(v==null)throw Error(C(151));for(var w=null,A=null,k=g,O=g=0,M=null,E=v.next();k!==null&&!E.done;O++,E=v.next()){k.index>O?(M=k,k=null):M=k.sibling;var L=h(y,k,E.value,S);if(L===null){k===null&&(k=M);break}t&&k&&L.alternate===null&&e(y,k),g=s(L,g,O),A===null?w=L:A.sibling=L,A=L,k=M}if(E.done)return n(y,k),fe&&Ds(y,O),w;if(k===null){for(;!E.done;O++,E=v.next())E=f(y,E.value,S),E!==null&&(g=s(E,g,O),A===null?w=E:A.sibling=E,A=E);return fe&&Ds(y,O),w}for(k=i(k);!E.done;O++,E=v.next())E=d(k,y,O,E.value,S),E!==null&&(t&&E.alternate!==null&&k.delete(E.key===null?O:E.key),g=s(E,g,O),A===null?w=E:A.sibling=E,A=E);return t&&k.forEach(function(R){return e(y,R)}),fe&&Ds(y,O),w}function b(y,g,v,S){if(typeof v=="object"&&v!==null&&v.type===Po&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Nf:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===Po){if(g.tag===7){n(y,g.sibling),S=r(g,v.props.children),S.return=y,y=S;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Er&&Iw(w)===g.type){n(y,g.sibling),S=r(g,v.props),Pa(S,v),S.return=y,y=S;break e}n(y,g);break}else e(y,g);g=g.sibling}v.type===Po?(S=Rs(v.props.children,y.mode,S,v.key),S.return=y,y=S):(S=Zf(v.type,v.key,v.props,null,y.mode,S),Pa(S,v),S.return=y,y=S)}return o(y);case ja:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(y,g.sibling),S=r(g,v.children||[]),S.return=y,y=S;break e}else{n(y,g);break}else e(y,g);g=g.sibling}S=Sg(v,y.mode,S),S.return=y,y=S}return o(y);case Er:return w=v._init,v=w(v._payload),b(y,g,v,S)}if(Va(v))return p(y,g,v,S);if(Ba(v)){if(w=Ba(v),typeof w!="function")throw Error(C(150));return v=w.call(v),m(y,g,v,S)}if(typeof v.then=="function")return b(y,g,Hf(v),S);if(v.$$typeof===Gi)return b(y,g,Pf(y,v),S);Uf(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(n(y,g.sibling),S=r(g,v),S.return=y,y=S):(n(y,g),S=vg(v,y.mode,S),S.return=y,y=S),o(y)):n(y,g)}return function(y,g,v,S){try{dc=0;var w=b(y,g,v,S);return nl=null,w}catch(k){if(k===Mc||k===jh)throw k;var A=on(29,k,null,y.mode);return A.lanes=S,A.return=y,A}}}var ul=YA(!0),KA=YA(!1),Mn=xi(null),Si=null;function Nr(t){var e=t.alternate;Be(nt,nt.current&1),Be(Mn,t),Si===null&&(e===null||al.current!==null||e.memoizedState!==null)&&(Si=t)}function QA(t){if(t.tag===22){if(Be(nt,nt.current),Be(Mn,t),Si===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Si=t)}}else Rr(t)}function Rr(){Be(nt,nt.current),Be(Mn,Mn.current)}function Zi(t){ht(Mn),Si===t&&(Si=null),ht(nt)}var nt=xi(0);function xh(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Dy(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function kg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:De({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var dy={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=cn(),r=zr(i);r.payload=e,n!=null&&(r.callback=n),e=Hr(t,r,i),e!==null&&(un(e,t,i),Za(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=cn(),r=zr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Hr(t,r,i),e!==null&&(un(e,t,i),Za(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=cn(),i=zr(n);i.tag=2,e!=null&&(i.callback=e),e=Hr(t,i,n),e!==null&&(un(e,t,n),Za(e,t,n))}};function qw(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!uc(n,i)||!uc(r,s):!0}function Pw(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&dy.enqueueReplaceState(e,e.state,null)}function Us(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=De({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var wh=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function GA(t){wh(t)}function $A(t){console.error(t)}function XA(t){wh(t)}function kh(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function zw(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function py(t,e,n){return n=zr(n),n.tag=3,n.payload={element:null},n.callback=function(){kh(t,e)},n}function WA(t){return t=zr(t),t.tag=3,t}function ZA(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){zw(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){zw(e,n,i),typeof r!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function zP(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Ec(e,n,r,!0),n=Mn.current,n!==null){switch(n.tag){case 13:return Si===null?wy():n.alternate===null&&Ue===0&&(Ue=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===oy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Lg(t,i,r)),!1;case 22:return n.flags|=65536,i===oy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Lg(t,i,r)),!1}throw Error(C(435,n.tag))}return Lg(t,i,r),wy(),!1}if(fe)return e=Mn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==ty&&(t=Error(C(422),{cause:i}),fc(En(t,n)))):(i!==ty&&(e=Error(C(423),{cause:i}),fc(En(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=En(i,n),r=py(t.stateNode,i,r),xg(t,r),Ue!==4&&(Ue=2)),!1;var s=Error(C(520),{cause:i});if(s=En(s,n),rc===null?rc=[s]:rc.push(s),Ue!==4&&(Ue=2),e===null)return!0;i=En(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=py(n.stateNode,i,t),xg(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Ur===null||!Ur.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=WA(r),ZA(r,t,n,i),xg(n,r),!1}n=n.return}while(n!==null);return!1}var JA=Error(C(461)),ft=!1;function mt(t,e,n,i){e.child=t===null?KA(e,null,n,i):ul(e,t.child,n,i)}function Hw(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return zs(e),i=n0(t,e,n,o,s,r),l=i0(),t!==null&&!ft?(r0(t,e,r),ir(t,e,r)):(fe&&l&&$y(e),e.flags|=1,mt(t,e,i,r),e.child)}function Uw(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Gy(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,eO(t,e,s,i,r)):(t=Zf(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!d0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:uc,n(o,i)&&t.ref===e.ref)return ir(t,e,r)}return e.flags|=1,t=Ji(s,i),t.ref=e.ref,t.return=e,e.child=t}function eO(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(uc(s,i)&&t.ref===e.ref)if(ft=!1,e.pendingProps=i=s,d0(t,r))(t.flags&131072)!==0&&(ft=!0);else return e.lanes=t.lanes,ir(t,e,r)}return my(t,e,n,i,r)}function tO(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return Fw(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Jf(e,s!==null?s.cachePool:null),s!==null?Dw(e,s):cy(),QA(e);else return e.lanes=e.childLanes=536870912,Fw(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(Jf(e,s.cachePool),Dw(e,s),Rr(e),e.memoizedState=null):(t!==null&&Jf(e,null),cy(),Rr(e));return mt(t,e,r,n),e.child}function Fw(t,e,n,i){var r=Zy();return r=r===null?null:{parent:tt._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&Jf(e,null),cy(),QA(e),t!==null&&Ec(t,e,i,!0),null}function nh(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(C(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function my(t,e,n,i,r){return zs(e),n=n0(t,e,n,i,void 0,r),i=i0(),t!==null&&!ft?(r0(t,e,r),ir(t,e,r)):(fe&&i&&$y(e),e.flags|=1,mt(t,e,n,r),e.child)}function jw(t,e,n,i,r,s){return zs(e),e.updateQueue=null,n=pA(e,i,n,r),dA(t),i=i0(),t!==null&&!ft?(r0(t,e,s),ir(t,e,s)):(fe&&i&&$y(e),e.flags|=1,mt(t,e,n,s),e.child)}function Vw(t,e,n,i,r){if(zs(e),e.stateNode===null){var s=Ko,o=n.contextType;typeof o=="object"&&o!==null&&(s=wt(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=dy,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},Jy(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?wt(o):Ko,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(kg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&dy.enqueueReplaceState(s,s.state,null),ec(e,i,s,r),Ja(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=Us(n,l);s.props=a;var c=s.context,u=n.contextType;o=Ko,typeof u=="object"&&u!==null&&(o=wt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&Pw(e,s,i,o),Dr=!1;var h=e.memoizedState;s.state=h,ec(e,i,s,r),Ja(),c=e.memoizedState,l||h!==c||Dr?(typeof f=="function"&&(kg(e,n,f,i),c=e.memoizedState),(a=Dr||qw(e,n,a,i,h,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,ly(t,e),o=e.memoizedProps,u=Us(n,o),s.props=u,f=e.pendingProps,h=s.context,c=n.contextType,a=Ko,typeof c=="object"&&c!==null&&(a=wt(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==a)&&Pw(e,s,i,a),Dr=!1,h=e.memoizedState,s.state=h,ec(e,i,s,r),Ja();var d=e.memoizedState;o!==f||h!==d||Dr||t!==null&&t.dependencies!==null&&gh(t.dependencies)?(typeof l=="function"&&(kg(e,n,l,i),d=e.memoizedState),(u=Dr||qw(e,n,u,i,h,d,a)||t!==null&&t.dependencies!==null&&gh(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,d,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,d,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),s.props=i,s.state=d,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,nh(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=ul(e,t.child,null,r),e.child=ul(e,null,n,r)):mt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=ir(t,e,r),t}function Yw(t,e,n,i){return Cc(),e.flags|=256,mt(t,e,n,i),e.child}var Ag={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Og(t){return{baseLanes:t,cachePool:aA()}}function Tg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Dn),t}function nO(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(nt.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(fe){if(r?Nr(e):Rr(e),fe){var l=He,a;if(a=l){e:{for(a=l,l=gi;a.nodeType!==8;){if(!l){l=null;break e}if(a=Qn(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:_s!==null?{id:$i,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},a=on(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,Lt=e,He=null,a=!0):a=!1}a||Ps(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Dy(l)?e.lanes=32:e.lanes=536870912,null;Zi(e)}return l=i.children,i=i.fallback,r?(Rr(e),r=e.mode,l=Ah({mode:"hidden",children:l},r),i=Rs(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Og(n),r.childLanes=Tg(t,o,n),e.memoizedState=Ag,i):(Nr(e),gy(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?(Nr(e),e.flags&=-257,e=Cg(t,e,n)):e.memoizedState!==null?(Rr(e),e.child=t.child,e.flags|=128,e=null):(Rr(e),r=i.fallback,l=e.mode,i=Ah({mode:"visible",children:i.children},l),r=Rs(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,ul(e,t.child,null,n),i=e.child,i.memoizedState=Og(n),i.childLanes=Tg(t,o,n),e.memoizedState=Ag,e=r);else if(Nr(e),Dy(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(C(419)),i.stack="",i.digest=o,fc({value:i,source:null,stack:null}),e=Cg(t,e,n)}else if(ft||Ec(t,e,n,!1),o=(n&t.childLanes)!==0,ft||o){if(o=Ae,o!==null&&(i=n&-n,i=(i&42)!==0?1:qy(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,yl(t,i),un(o,t,i),JA;l.data==="$?"||wy(),e=Cg(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,He=Qn(l.nextSibling),Lt=e,fe=!0,Ls=null,gi=!1,t!==null&&(On[Tn++]=$i,On[Tn++]=Xi,On[Tn++]=_s,$i=t.id,Xi=t.overflow,_s=e),e=gy(e,i.children),e.flags|=4096);return e}return r?(Rr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=Ji(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=Ji(c,r):(r=Rs(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Og(n):(a=l.cachePool,a!==null?(c=tt._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=aA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=Tg(t,o,n),e.memoizedState=Ag,i):(Nr(e),n=t.child,t=n.sibling,n=Ji(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function gy(t,e){return e=Ah({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Ah(t,e){return t=on(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Cg(t,e,n){return ul(e,t.child,null,n),t=gy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Kw(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),iy(t.return,e,n)}function Eg(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function iO(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(mt(t,e,i.children,n),i=nt.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Kw(t,n,e);else if(t.tag===19)Kw(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(Be(nt,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&xh(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Eg(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&xh(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Eg(e,!0,n,null,s);break;case"together":Eg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ir(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Gr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Ec(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(C(153));if(e.child!==null){for(t=e.child,n=Ji(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ji(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function d0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&gh(t)))}function HP(t,e,n){switch(e.tag){case 3:ah(e,e.stateNode.containerInfo),Mr(e,tt,t.memoizedState.cache),Cc();break;case 27:case 5:Yg(e);break;case 4:ah(e,e.stateNode.containerInfo);break;case 10:Mr(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(Nr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?nO(t,e,n):(Nr(e),t=ir(t,e,n),t!==null?t.sibling:null);Nr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Ec(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return iO(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Be(nt,nt.current),i)break;return null;case 22:case 23:return e.lanes=0,tO(t,e,n);case 24:Mr(e,tt,t.memoizedState.cache)}return ir(t,e,n)}function rO(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ft=!0;else{if(!d0(t,n)&&(e.flags&128)===0)return ft=!1,HP(t,e,n);ft=(t.flags&131072)!==0}else ft=!1,fe&&(e.flags&1048576)!==0&&oA(e,mh,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")Gy(i)?(t=Us(i,t),e.tag=1,e=Vw(null,e,i,t,n)):(e.tag=0,e=my(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===Ly){e.tag=11,e=Hw(null,e,i,t,n);break e}else if(r===By){e.tag=14,e=Uw(null,e,i,t,n);break e}}throw e=jg(i)||i,Error(C(306,e,""))}}return e;case 0:return my(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Us(i,e.pendingProps),Vw(t,e,i,r,n);case 3:e:{if(ah(e,e.stateNode.containerInfo),t===null)throw Error(C(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,ly(t,e),ec(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Mr(e,tt,i),i!==s.cache&&ry(e,[tt],n,!0),Ja(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Yw(t,e,i,n);break e}else if(i!==r){r=En(Error(C(424)),e),fc(r),e=Yw(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,He=Qn(t.firstChild),Lt=e,fe=!0,Ls=null,gi=!0,n=KA(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cc(),i===r){e=ir(t,e,n);break e}mt(t,e,i,n)}e=e.child}return e;case 26:return nh(t,e),t===null?(n=fk(e.type,null,e.pendingProps,null))?e.memoizedState=n:fe||(n=e.type,t=e.pendingProps,i=Nh(Pr.current).createElement(n),i[xt]=e,i[$t]=t,yt(i,n,t),ut(i),e.stateNode=i):e.memoizedState=fk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Yg(e),t===null&&fe&&(i=e.stateNode=VO(e.type,e.pendingProps,Pr.current),Lt=e,gi=!0,r=He,Xr(e.type)?(My=r,He=Qn(i.firstChild)):He=r),mt(t,e,e.pendingProps.children,n),nh(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&fe&&((r=i=He)&&(i=h6(i,e.type,e.pendingProps,gi),i!==null?(e.stateNode=i,Lt=e,He=Qn(i.firstChild),gi=!1,r=!0):r=!1),r||Ps(e)),Yg(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,Cy(r,s)?i=null:o!==null&&Cy(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=n0(t,e,RP,null,null,n),yc._currentValue=r),nh(t,e),mt(t,e,i,n),e.child;case 6:return t===null&&fe&&((t=n=He)&&(n=d6(n,e.pendingProps,gi),n!==null?(e.stateNode=n,Lt=e,He=null,t=!0):t=!1),t||Ps(e)),null;case 13:return nO(t,e,n);case 4:return ah(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=ul(e,null,i,n):mt(t,e,i,n),e.child;case 11:return Hw(t,e,e.type,e.pendingProps,n);case 7:return mt(t,e,e.pendingProps,n),e.child;case 8:return mt(t,e,e.pendingProps.children,n),e.child;case 12:return mt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Mr(e,e.type,i.value),mt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,zs(e),r=wt(r),i=i(r),e.flags|=1,mt(t,e,i,n),e.child;case 14:return Uw(t,e,e.type,e.pendingProps,n);case 15:return eO(t,e,e.type,e.pendingProps,n);case 19:return iO(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=Ah(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=Ji(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return tO(t,e,n);case 24:return zs(e),i=wt(tt),t===null?(r=Zy(),r===null&&(r=Ae,s=Wy(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},Jy(e),Mr(e,tt,r)):((t.lanes&n)!==0&&(ly(t,e),ec(e,null,null,n),Ja()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Mr(e,tt,i)):(i=s.cache,Mr(e,tt,i),i!==r.cache&&ry(e,[tt],n,!0))),mt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(C(156,e.tag))}function Yi(t){t.flags|=4}function Qw(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!QO(e)){if(e=Mn.current,e!==null&&((ae&4194048)===ae?Si!==null:(ae&62914560)!==ae&&(ae&536870912)===0||e!==Si))throw Wa=oy,cA;t.flags|=8192}}function Ff(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Mk():536870912,t.lanes|=e,fl|=e)}function za(t,e){if(!fe)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Pe(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function UP(t,e,n){var i=e.pendingProps;switch(Xy(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(e),null;case 1:return Pe(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),er(tt),rl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(qa(e)?Yi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,kw())),Pe(e),null;case 26:return n=e.memoizedState,t===null?(Yi(e),n!==null?(Pe(e),Qw(e,n)):(Pe(e),e.flags&=-16777217)):n?n!==t.memoizedState?(Yi(e),Pe(e),Qw(e,n)):(Pe(e),e.flags&=-16777217):(t.memoizedProps!==i&&Yi(e),Pe(e),e.flags&=-16777217),null;case 27:ch(e),n=Pr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Yi(e);else{if(!i){if(e.stateNode===null)throw Error(C(166));return Pe(e),null}t=bi.current,qa(e)?xw(e,t):(t=VO(r,i,n),e.stateNode=t,Yi(e))}return Pe(e),null;case 5:if(ch(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Yi(e);else{if(!i){if(e.stateNode===null)throw Error(C(166));return Pe(e),null}if(t=bi.current,qa(e))xw(e,t);else{switch(r=Nh(Pr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[xt]=e,t[$t]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(yt(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Yi(e)}}return Pe(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Yi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(C(166));if(t=Pr.current,qa(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Lt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[xt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||UO(t.nodeValue,n)),t||Ps(e)}else t=Nh(t).createTextNode(i),t[xt]=e,e.stateNode=t}return Pe(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=qa(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(C(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(C(317));r[xt]=e}else Cc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Pe(e),r=!1}else r=kw(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Zi(e),e):(Zi(e),null)}if(Zi(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),Ff(e,e.updateQueue),Pe(e),null;case 4:return rl(),t===null&&x0(e.stateNode.containerInfo),Pe(e),null;case 10:return er(e.type),Pe(e),null;case 19:if(ht(nt),r=e.memoizedState,r===null)return Pe(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)za(r,!1);else{if(Ue!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=xh(t),s!==null){for(e.flags|=128,za(r,!1),t=s.updateQueue,e.updateQueue=t,Ff(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)sA(n,t),n=n.sibling;return Be(nt,nt.current&1|2),e.child}t=t.sibling}r.tail!==null&&vi()>Th&&(e.flags|=128,i=!0,za(r,!1),e.lanes=4194304)}else{if(!i)if(t=xh(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,Ff(e,t),za(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!fe)return Pe(e),null}else 2*vi()-r.renderingStartTime>Th&&n!==536870912&&(e.flags|=128,i=!0,za(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=vi(),e.sibling=null,t=nt.current,Be(nt,i?t&1|2:t&1),e):(Pe(e),null);case 22:case 23:return Zi(e),e0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Pe(e),e.subtreeFlags&6&&(e.flags|=8192)):Pe(e),n=e.updateQueue,n!==null&&Ff(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ht(Bs),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),er(tt),Pe(e),null;case 25:return null;case 30:return null}throw Error(C(156,e.tag))}function FP(t,e){switch(Xy(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return er(tt),rl(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ch(e),null;case 13:if(Zi(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(C(340));Cc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(nt),null;case 4:return rl(),null;case 10:return er(e.type),null;case 22:case 23:return Zi(e),e0(),t!==null&&ht(Bs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return er(tt),null;case 25:return null;default:return null}}function sO(t,e){switch(Xy(e),e.tag){case 3:er(tt),rl();break;case 26:case 27:case 5:ch(e);break;case 4:rl();break;case 13:Zi(e);break;case 19:ht(nt);break;case 10:er(e.type);break;case 22:case 23:Zi(e),e0(),t!==null&&ht(Bs);break;case 24:er(tt)}}function _c(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){we(e,e.return,l)}}function Qr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){we(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){we(e,e.return,u)}}function oO(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{hA(e,n)}catch(i){we(t,t.return,i)}}}function lO(t,e,n){n.props=Us(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){we(t,e,i)}}function nc(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){we(t,e,r)}}function yi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){we(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){we(t,e,r)}else n.current=null}function aO(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){we(t,t.return,r)}}function Dg(t,e,n){try{var i=t.stateNode;l6(i,t.type,n,e),i[$t]=e}catch(r){we(t,t.return,r)}}function cO(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xr(t.type)||t.tag===4}function Mg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||cO(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.tag===27&&Xr(t.type)||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 yy(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Xh));else if(i!==4&&(i===27&&Xr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(yy(t,e,n),t=t.sibling;t!==null;)yy(t,e,n),t=t.sibling}function Oh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Xr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Oh(t,e,n),t=t.sibling;t!==null;)Oh(t,e,n),t=t.sibling}function uO(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);yt(e,i,n),e[xt]=t,e[$t]=n}catch(s){we(t,t.return,s)}}var Qi=!1,Ke=!1,Ng=!1,Gw=typeof WeakSet=="function"?WeakSet:Set,ct=null;function jP(t,e){if(t=t.containerInfo,Oy=Bh,t=Wk(t),Yy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(l=o),h===s&&++u===i&&(a=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ty={focusedElem:t,selectionRange:n},Bh=!1,ct=e;ct!==null;)if(e=ct,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ct=t;else for(;ct!==null;){switch(e=ct,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var p=Us(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(p,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(m){we(n,n.return,m)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ey(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ey(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(C(163))}if(t=e.sibling,t!==null){t.return=e.return,ct=t;break}ct=e.return}}function fO(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Tr(t,n),i&4&&_c(5,n);break;case 1:if(Tr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){we(n,n.return,o)}else{var r=Us(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){we(n,n.return,o)}}i&64&&oO(n),i&512&&nc(n,n.return);break;case 3:if(Tr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{hA(t,e)}catch(o){we(n,n.return,o)}}break;case 27:e===null&&i&4&&uO(n);case 26:case 5:Tr(t,n),e===null&&i&4&&aO(n),i&512&&nc(n,n.return);break;case 12:Tr(t,n);break;case 13:Tr(t,n),i&4&&pO(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=ZP.bind(null,n),p6(t,n))));break;case 22:if(i=n.memoizedState!==null||Qi,!i){e=e!==null&&e.memoizedState!==null||Ke,r=Qi;var s=Ke;Qi=i,(Ke=e)&&!s?Cr(t,n,(n.subtreeFlags&8772)!==0):Tr(t,n),Qi=r,Ke=s}break;case 30:break;default:Tr(t,n)}}function hO(t){var e=t.alternate;e!==null&&(t.alternate=null,hO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&zy(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Le=null,Qt=!1;function Ki(t,e,n){for(n=n.child;n!==null;)dO(t,e,n),n=n.sibling}function dO(t,e,n){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(wc,n)}catch{}switch(n.tag){case 26:Ke||yi(n,e),Ki(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||yi(n,e);var i=Le,r=Qt;Xr(n.type)&&(Le=n.stateNode,Qt=!1),Ki(t,e,n),oc(n.stateNode),Le=i,Qt=r;break;case 5:Ke||yi(n,e);case 6:if(i=Le,r=Qt,Le=null,Ki(t,e,n),Le=i,Qt=r,Le!==null)if(Qt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(s){we(n,e,s)}else try{Le.removeChild(n.stateNode)}catch(s){we(n,e,s)}break;case 18:Le!==null&&(Qt?(t=Le,ak(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Sc(t)):ak(Le,n.stateNode));break;case 4:i=Le,r=Qt,Le=n.stateNode.containerInfo,Qt=!0,Ki(t,e,n),Le=i,Qt=r;break;case 0:case 11:case 14:case 15:Ke||Qr(2,n,e),Ke||Qr(4,n,e),Ki(t,e,n);break;case 1:Ke||(yi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&lO(n,e,i)),Ki(t,e,n);break;case 21:Ki(t,e,n);break;case 22:Ke=(i=Ke)||n.memoizedState!==null,Ki(t,e,n),Ke=i;break;default:Ki(t,e,n)}}function pO(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Sc(t)}catch(n){we(e,e.return,n)}}function VP(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Gw),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Gw),e;default:throw Error(C(435,t.tag))}}function Rg(t,e){var n=VP(t);e.forEach(function(i){var r=JP.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function nn(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Xr(l.type)){Le=l.stateNode,Qt=!1;break e}break;case 5:Le=l.stateNode,Qt=!1;break e;case 3:case 4:Le=l.stateNode.containerInfo,Qt=!0;break e}l=l.return}if(Le===null)throw Error(C(160));dO(s,o,r),Le=null,Qt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)mO(e,t),e=e.sibling}var Kn=null;function mO(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:nn(e,t),rn(t),i&4&&(Qr(3,t,t.return),_c(3,t),Qr(5,t,t.return));break;case 1:nn(e,t),rn(t),i&512&&(Ke||n===null||yi(n,n.return)),i&64&&Qi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Kn;if(nn(e,t),rn(t),i&512&&(Ke||n===null||yi(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Oc]||s[xt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),yt(s,i,n),s[xt]=t,ut(s),i=s;break e;case"link":var o=dk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),yt(s,i,n),r.head.appendChild(s);break;case"meta":if(o=dk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),yt(s,i,n),r.head.appendChild(s);break;default:throw Error(C(468,i))}s[xt]=t,ut(s),i=s}t.stateNode=i}else pk(r,t.type,t.stateNode);else t.stateNode=hk(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?pk(r,t.type,t.stateNode):hk(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Dg(t,t.memoizedProps,n.memoizedProps)}break;case 27:nn(e,t),rn(t),i&512&&(Ke||n===null||yi(n,n.return)),n!==null&&i&4&&Dg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(nn(e,t),rn(t),i&512&&(Ke||n===null||yi(n,n.return)),t.flags&32){r=t.stateNode;try{ol(r,"")}catch(d){we(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Dg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Ng=!0);break;case 6:if(nn(e,t),rn(t),i&4){if(t.stateNode===null)throw Error(C(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){we(t,t.return,d)}}break;case 3:if(sh=null,r=Kn,Kn=Rh(e.containerInfo),nn(e,t),Kn=r,rn(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Sc(e.containerInfo)}catch(d){we(t,t.return,d)}Ng&&(Ng=!1,gO(t));break;case 4:i=Kn,Kn=Rh(t.stateNode.containerInfo),nn(e,t),rn(t),Kn=i;break;case 12:nn(e,t),rn(t);break;case 13:nn(e,t),rn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(b0=vi()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Rg(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=Qi,u=Ke;if(Qi=c||r,Ke=u||a,nn(e,t),Ke=u,Qi=c,rn(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||Qi||Ke||Ms(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){we(a,a.return,d)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(d){we(a,a.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Rg(t,n))));break;case 19:nn(e,t),rn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Rg(t,i)));break;case 30:break;case 21:break;default:nn(e,t),rn(t)}}function rn(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(cO(i)){n=i;break}i=i.return}if(n==null)throw Error(C(160));switch(n.tag){case 27:var r=n.stateNode,s=Mg(t);Oh(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(ol(o,""),n.flags&=-33);var l=Mg(t);Oh(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=Mg(t);yy(t,c,a);break;default:throw Error(C(161))}}catch(u){we(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function gO(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;gO(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Tr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)fO(t,e.alternate,e),e=e.sibling}function Ms(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Qr(4,e,e.return),Ms(e);break;case 1:yi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&lO(e,e.return,n),Ms(e);break;case 27:oc(e.stateNode);case 26:case 5:yi(e,e.return),Ms(e);break;case 22:e.memoizedState===null&&Ms(e);break;case 30:Ms(e);break;default:Ms(e)}t=t.sibling}}function Cr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:Cr(r,s,n),_c(4,s);break;case 1:if(Cr(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){we(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)fA(a[r],l)}catch(c){we(i,i.return,c)}}n&&o&64&&oO(s),nc(s,s.return);break;case 27:uO(s);case 26:case 5:Cr(r,s,n),n&&i===null&&o&4&&aO(s),nc(s,s.return);break;case 12:Cr(r,s,n);break;case 13:Cr(r,s,n),n&&o&4&&pO(r,s);break;case 22:s.memoizedState===null&&Cr(r,s,n),nc(s,s.return);break;case 30:break;default:Cr(r,s,n)}e=e.sibling}}function p0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Dc(n))}function m0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Dc(t))}function mi(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yO(t,e,n,i),e=e.sibling}function yO(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:mi(t,e,n,i),r&2048&&_c(9,e);break;case 1:mi(t,e,n,i);break;case 3:mi(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Dc(t)));break;case 12:if(r&2048){mi(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){we(e,e.return,a)}}else mi(t,e,n,i);break;case 13:mi(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?mi(t,e,n,i):ic(t,e):s._visibility&2?mi(t,e,n,i):(s._visibility|=2,Io(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&p0(o,e);break;case 24:mi(t,e,n,i),r&2048&&m0(e.alternate,e);break;default:mi(t,e,n,i)}}function Io(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:Io(s,o,l,a,r),_c(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?Io(s,o,l,a,r):ic(s,o):(u._visibility|=2,Io(s,o,l,a,r)),r&&c&2048&&p0(o.alternate,o);break;case 24:Io(s,o,l,a,r),r&&c&2048&&m0(o.alternate,o);break;default:Io(s,o,l,a,r)}e=e.sibling}}function ic(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ic(n,i),r&2048&&p0(i.alternate,i);break;case 24:ic(n,i),r&2048&&m0(i.alternate,i);break;default:ic(n,i)}e=e.sibling}}var Ka=8192;function _o(t){if(t.subtreeFlags&Ka)for(t=t.child;t!==null;)bO(t),t=t.sibling}function bO(t){switch(t.tag){case 26:_o(t),t.flags&Ka&&t.memoizedState!==null&&C6(Kn,t.memoizedState,t.memoizedProps);break;case 5:_o(t);break;case 3:case 4:var e=Kn;Kn=Rh(t.stateNode.containerInfo),_o(t),Kn=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Ka,Ka=16777216,_o(t),Ka=e):_o(t));break;default:_o(t)}}function vO(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ha(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ct=i,xO(i,t)}vO(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)SO(t),t=t.sibling}function SO(t){switch(t.tag){case 0:case 11:case 15:Ha(t),t.flags&2048&&Qr(9,t,t.return);break;case 3:Ha(t);break;case 12:Ha(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,ih(t)):Ha(t);break;default:Ha(t)}}function ih(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ct=i,xO(i,t)}vO(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Qr(8,e,e.return),ih(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,ih(e));break;default:ih(e)}t=t.sibling}}function xO(t,e){for(;ct!==null;){var n=ct;switch(n.tag){case 0:case 11:case 15:Qr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Dc(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ct=i;else e:for(n=t;ct!==null;){i=ct;var r=i.sibling,s=i.return;if(hO(i),i===n){ct=null;break e}if(r!==null){r.return=s,ct=r;break e}ct=s}}}var YP={getCacheForType:function(t){var e=wt(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},KP=typeof WeakMap=="function"?WeakMap:Map,ye=0,Ae=null,te=null,ae=0,ge=0,sn=null,Ir=!1,bl=!1,g0=!1,rr=0,Ue=0,Gr=0,Is=0,y0=0,Dn=0,fl=0,rc=null,Gt=null,by=!1,b0=0,Th=1/0,Ch=null,Ur=null,gt=0,Fr=null,hl=null,il=0,vy=0,Sy=null,wO=null,sc=0,xy=null;function cn(){if((ye&2)!==0&&ae!==0)return ae&-ae;if(F.T!==null){var t=ll;return t!==0?t:S0()}return _k()}function kO(){Dn===0&&(Dn=(ae&536870912)===0||fe?Dk():536870912);var t=Mn.current;return t!==null&&(t.flags|=32),Dn}function un(t,e,n){(t===Ae&&(ge===2||ge===9)||t.cancelPendingCommit!==null)&&(dl(t,0),qr(t,ae,Dn,!1)),Ac(t,n),((ye&2)===0||t!==Ae)&&(t===Ae&&((ye&2)===0&&(Is|=n),Ue===4&&qr(t,ae,Dn,!1)),wi(t))}function AO(t,e,n){if((ye&6)!==0)throw Error(C(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||kc(t,e),r=i?$P(t,e):_g(t,e,!0),s=i;do{if(r===0){bl&&!i&&qr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!QP(n)){r=_g(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=rc;var a=l.current.memoizedState.isDehydrated;if(a&&(dl(l,o).flags|=256),o=_g(l,o,!1),o!==2){if(g0&&!a){l.errorRecoveryDisabledLanes|=s,Is|=s,r=4;break e}s=Gt,Gt=r,s!==null&&(Gt===null?Gt=s:Gt.push.apply(Gt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){dl(t,0),qr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(C(345));case 4:if((e&4194048)!==e)break;case 6:qr(i,e,Dn,!Ir);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(C(329))}if((e&62914560)===e&&(r=b0+300-vi(),10<r)){if(qr(i,e,Dn,!Ir),qh(i,0,!0)!==0)break e;i.timeoutHandle=jO($w.bind(null,i,n,Gt,Ch,by,e,Dn,Is,fl,Ir,s,2,-0,0),r);break e}$w(i,n,Gt,Ch,by,e,Dn,Is,fl,Ir,s,0,-0,0)}}break}while(!0);wi(t)}function $w(t,e,n,i,r,s,o,l,a,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(gc={stylesheets:null,count:0,unsuspend:T6},bO(e),f=E6(),f!==null)){t.cancelPendingCommit=f(Ww.bind(null,t,e,s,n,i,r,o,l,a,u,1,h,d)),qr(t,s,o,!c);return}Ww(t,e,s,n,i,r,o,l,a)}function QP(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!fn(s(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function qr(t,e,n,i){e&=~y0,e&=~Is,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-an(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&Nk(t,n,e)}function Qh(){return(ye&6)===0?(Lc(0,!1),!1):!0}function v0(){if(te!==null){if(ge===0)var t=te.return;else t=te,Wi=Ys=null,s0(t),nl=null,dc=0,t=te;for(;t!==null;)sO(t.alternate,t),t=t.return;te=null}}function dl(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,c6(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),v0(),Ae=t,te=n=Ji(t.current,null),ae=e,ge=0,sn=null,Ir=!1,bl=kc(t,e),g0=!1,fl=Dn=y0=Is=Gr=Ue=0,Gt=rc=null,by=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-an(i),s=1<<r;e|=t[r],i&=~s}return rr=e,Uh(),n}function OO(t,e){X=null,F.H=Sh,e===Mc||e===jh?(e=Cw(),ge=3):e===cA?(e=Cw(),ge=4):ge=e===JA?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,sn=e,te===null&&(Ue=1,kh(t,En(e,t.current)))}function TO(){var t=F.H;return F.H=Sh,t===null?Sh:t}function CO(){var t=F.A;return F.A=YP,t}function wy(){Ue=4,Ir||(ae&4194048)!==ae&&Mn.current!==null||(bl=!0),(Gr&134217727)===0&&(Is&134217727)===0||Ae===null||qr(Ae,ae,Dn,!1)}function _g(t,e,n){var i=ye;ye|=2;var r=TO(),s=CO();(Ae!==t||ae!==e)&&(Ch=null,dl(t,e)),e=!1;var o=Ue;e:do try{if(ge!==0&&te!==null){var l=te,a=sn;switch(ge){case 8:v0(),o=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(e=!0);var c=ge;if(ge=0,sn=null,$o(t,l,a,c),n&&bl){o=0;break e}break;default:c=ge,ge=0,sn=null,$o(t,l,a,c)}}GP(),o=Ue;break}catch(u){OO(t,u)}while(!0);return e&&t.shellSuspendCounter++,Wi=Ys=null,ye=i,F.H=r,F.A=s,te===null&&(Ae=null,ae=0,Uh()),o}function GP(){for(;te!==null;)EO(te)}function $P(t,e){var n=ye;ye|=2;var i=TO(),r=CO();Ae!==t||ae!==e?(Ch=null,Th=vi()+500,dl(t,e)):bl=kc(t,e);e:do try{if(ge!==0&&te!==null){e=te;var s=sn;t:switch(ge){case 1:ge=0,sn=null,$o(t,e,s,1);break;case 2:case 9:if(Tw(s)){ge=0,sn=null,Xw(e);break}e=function(){ge!==2&&ge!==9||Ae!==t||(ge=7),wi(t)},s.then(e,e);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:Tw(s)?(ge=0,sn=null,Xw(e)):(ge=0,sn=null,$o(t,e,s,7));break;case 5:var o=null;switch(te.tag){case 26:o=te.memoizedState;case 5:case 27:var l=te;if(!o||QO(o)){ge=0,sn=null;var a=l.sibling;if(a!==null)te=a;else{var c=l.return;c!==null?(te=c,Gh(c)):te=null}break t}}ge=0,sn=null,$o(t,e,s,5);break;case 6:ge=0,sn=null,$o(t,e,s,6);break;case 8:v0(),Ue=6;break e;default:throw Error(C(462))}}XP();break}catch(u){OO(t,u)}while(!0);return Wi=Ys=null,F.H=i,F.A=r,ye=n,te!==null?0:(Ae=null,ae=0,Uh(),Ue)}function XP(){for(;te!==null&&!b5();)EO(te)}function EO(t){var e=rO(t.alternate,t,rr);t.memoizedProps=t.pendingProps,e===null?Gh(t):te=e}function Xw(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=jw(n,e,e.pendingProps,e.type,void 0,ae);break;case 11:e=jw(n,e,e.pendingProps,e.type.render,e.ref,ae);break;case 5:s0(e);default:sO(n,e),e=te=sA(e,rr),e=rO(n,e,rr)}t.memoizedProps=t.pendingProps,e===null?Gh(t):te=e}function $o(t,e,n,i){Wi=Ys=null,s0(e),nl=null,dc=0;var r=e.return;try{if(zP(t,r,e,n,ae)){Ue=1,kh(t,En(n,t.current)),te=null;return}}catch(s){if(r!==null)throw te=r,s;Ue=1,kh(t,En(n,t.current)),te=null;return}e.flags&32768?(fe||i===1?t=!0:bl||(ae&536870912)!==0?t=!1:(Ir=t=!0,(i===2||i===9||i===3||i===6)&&(i=Mn.current,i!==null&&i.tag===13&&(i.flags|=16384))),DO(e,t)):Gh(e)}function Gh(t){var e=t;do{if((e.flags&32768)!==0){DO(e,Ir);return}t=e.return;var n=UP(e.alternate,e,rr);if(n!==null){te=n;return}if(e=e.sibling,e!==null){te=e;return}te=e=t}while(e!==null);Ue===0&&(Ue=5)}function DO(t,e){do{var n=FP(t.alternate,t);if(n!==null){n.flags&=32767,te=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){te=t;return}te=t=n}while(t!==null);Ue=6,te=null}function Ww(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do $h();while(gt!==0);if((ye&6)!==0)throw Error(C(327));if(e!==null){if(e===t.current)throw Error(C(177));if(s=e.lanes|e.childLanes,s|=Ky,E5(t,n,s,o,l,a),t===Ae&&(te=Ae=null,ae=0),hl=e,Fr=t,il=n,vy=s,Sy=r,wO=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,e6(uh,function(){return LO(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=F.T,F.T=null,r=he.p,he.p=2,o=ye,ye|=4;try{jP(t,e,n)}finally{ye=o,he.p=r,F.T=i}}gt=1,MO(),NO(),RO()}}function MO(){if(gt===1){gt=0;var t=Fr,e=hl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=F.T,F.T=null;var i=he.p;he.p=2;var r=ye;ye|=4;try{mO(e,t);var s=Ty,o=Wk(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&Xk(l.ownerDocument.documentElement,l)){if(a!==null&&Yy(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),p=l.textContent.length,m=Math.min(a.start,p),b=a.end===void 0?m:Math.min(a.end,p);!d.extend&&m>b&&(o=b,b=m,m=o);var y=bw(l,m),g=bw(l,b);if(y&&g&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==g.node||d.focusOffset!==g.offset)){var v=f.createRange();v.setStart(y.node,y.offset),d.removeAllRanges(),m>b?(d.addRange(v),d.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),d.addRange(v))}}}}for(f=[],d=l;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Bh=!!Oy,Ty=Oy=null}finally{ye=r,he.p=i,F.T=n}}t.current=e,gt=2}}function NO(){if(gt===2){gt=0;var t=Fr,e=hl,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=F.T,F.T=null;var i=he.p;he.p=2;var r=ye;ye|=4;try{fO(t,e.alternate,e)}finally{ye=r,he.p=i,F.T=n}}gt=3}}function RO(){if(gt===4||gt===3){gt=0,v5();var t=Fr,e=hl,n=il,i=wO;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?gt=5:(gt=0,hl=Fr=null,_O(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Ur=null),Py(n),e=e.stateNode,ln&&typeof ln.onCommitFiberRoot=="function")try{ln.onCommitFiberRoot(wc,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=F.T,r=he.p,he.p=2,F.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{F.T=e,he.p=r}}(il&3)!==0&&$h(),wi(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===xy?sc++:(sc=0,xy=t):sc=0,Lc(0,!1)}}function _O(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Dc(e)))}function $h(t){return MO(),NO(),RO(),LO(t)}function LO(){if(gt!==5)return!1;var t=Fr,e=vy;vy=0;var n=Py(il),i=F.T,r=he.p;try{he.p=32>n?32:n,F.T=null,n=Sy,Sy=null;var s=Fr,o=il;if(gt=0,hl=Fr=null,il=0,(ye&6)!==0)throw Error(C(331));var l=ye;if(ye|=4,SO(s.current),yO(s,s.current,o,n),ye=l,Lc(0,!1),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(wc,s)}catch{}return!0}finally{he.p=r,F.T=i,_O(t,e)}}function Zw(t,e,n){e=En(n,e),e=py(t.stateNode,e,2),t=Hr(t,e,2),t!==null&&(Ac(t,2),wi(t))}function we(t,e,n){if(t.tag===3)Zw(t,t,n);else for(;e!==null;){if(e.tag===3){Zw(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ur===null||!Ur.has(i))){t=En(n,t),n=WA(2),i=Hr(e,n,2),i!==null&&(ZA(n,i,e,t),Ac(i,2),wi(i));break}}e=e.return}}function Lg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new KP;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(g0=!0,r.add(n),t=WP.bind(null,t,e,n),e.then(t,t))}function WP(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ae===t&&(ae&n)===n&&(Ue===4||Ue===3&&(ae&62914560)===ae&&300>vi()-b0?(ye&2)===0&&dl(t,0):y0|=n,fl===ae&&(fl=0)),wi(t)}function BO(t,e){e===0&&(e=Mk()),t=yl(t,e),t!==null&&(Ac(t,e),wi(t))}function ZP(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),BO(t,n)}function JP(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(C(314))}i!==null&&i.delete(e),BO(t,n)}function e6(t,e){return Iy(t,e)}var Eh=null,qo=null,ky=!1,Dh=!1,Bg=!1,qs=0;function wi(t){t!==qo&&t.next===null&&(qo===null?Eh=qo=t:qo=qo.next=t),Dh=!0,ky||(ky=!0,n6())}function Lc(t,e){if(!Bg&&Dh){Bg=!0;do for(var n=!1,i=Eh;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-an(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Jw(i,s))}else s=ae,s=qh(i,i===Ae?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||kc(i,s)||(n=!0,Jw(i,s));i=i.next}while(n);Bg=!1}}function t6(){IO()}function IO(){Dh=ky=!1;var t=0;qs!==0&&(a6()&&(t=qs),qs=0);for(var e=vi(),n=null,i=Eh;i!==null;){var r=i.next,s=qO(i,e);s===0?(i.next=null,n===null?Eh=r:n.next=r,r===null&&(qo=n)):(n=i,(t!==0||(s&3)!==0)&&(Dh=!0)),i=r}Lc(t,!1)}function qO(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-an(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=C5(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Ae,n=ae,n=qh(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ge===2||ge===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&ag(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||kc(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&ag(i),Py(n)){case 2:case 8:n=Ck;break;case 32:n=uh;break;case 268435456:n=Ek;break;default:n=uh}return i=PO.bind(null,t),n=Iy(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&ag(i),t.callbackPriority=2,t.callbackNode=null,2}function PO(t,e){if(gt!==0&&gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if($h(!0)&&t.callbackNode!==n)return null;var i=ae;return i=qh(t,t===Ae?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(AO(t,i,e),qO(t,vi()),t.callbackNode!=null&&t.callbackNode===n?PO.bind(null,t):null)}function Jw(t,e){if($h())return null;AO(t,e,!0)}function n6(){u6(function(){(ye&6)!==0?Iy(Tk,t6):IO()})}function S0(){return qs===0&&(qs=Dk()),qs}function ek(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$f(""+t)}function tk(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function i6(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=ek((r[$t]||null).action),o=i.submitter;o&&(e=(e=o[$t]||null)?ek(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new Ph("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(qs!==0){var a=o?tk(r,o):new FormData(r);hy(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?tk(r,o):new FormData(r),hy(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for(jf=0;jf<ey.length;jf++)Vf=ey[jf],nk=Vf.toLowerCase(),ik=Vf[0].toUpperCase()+Vf.slice(1),Gn(nk,"on"+ik);var Vf,nk,ik,jf;Gn(Jk,"onAnimationEnd");Gn(eA,"onAnimationIteration");Gn(tA,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(wP,"onTransitionRun");Gn(kP,"onTransitionStart");Gn(AP,"onTransitionCancel");Gn(nA,"onTransitionEnd");sl("onMouseEnter",["mouseout","mouseover"]);sl("onMouseLeave",["mouseout","mouseover"]);sl("onPointerEnter",["pointerout","pointerover"]);sl("onPointerLeave",["pointerout","pointerover"]);Fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pc));function zO(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){wh(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){wh(u)}r.currentTarget=null,s=a}}}}function ee(t,e){var n=e[Qg];n===void 0&&(n=e[Qg]=new Set);var i=t+"__bubble";n.has(i)||(HO(e,t,2,!1),n.add(i))}function Ig(t,e,n){var i=0;e&&(i|=4),HO(n,t,i,e)}var Yf="_reactListening"+Math.random().toString(36).slice(2);function x0(t){if(!t[Yf]){t[Yf]=!0,Lk.forEach(function(n){n!=="selectionchange"&&(r6.has(n)||Ig(n,!1,t),Ig(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Yf]||(e[Yf]=!0,Ig("selectionchange",!1,e))}}function HO(t,e,n,i){switch(ZO(e)){case 2:var r=N6;break;case 8:r=R6;break;default:r=O0}n=r.bind(null,e,n,t),r=void 0,!Wg||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function qg(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Ho(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}Fk(function(){var c=s,u=Uy(n),f=[];e:{var h=iA.get(t);if(h!==void 0){var d=Ph,p=t;switch(t){case"keypress":if(Wf(n)===0)break e;case"keydown":case"keyup":d=eP;break;case"focusin":p="focus",d=gg;break;case"focusout":p="blur",d=gg;break;case"beforeblur":case"afterblur":d=gg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=cw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=F5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=iP;break;case Jk:case eA:case tA:d=Y5;break;case nA:d=sP;break;case"scroll":case"scrollend":d=H5;break;case"wheel":d=lP;break;case"copy":case"cut":case"paste":d=Q5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=fw;break;case"toggle":case"beforetoggle":d=cP}var m=(e&4)!==0,b=!m&&(t==="scroll"||t==="scrollend"),y=m?h!==null?h+"Capture":null:h;m=[];for(var g=c,v;g!==null;){var S=g;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||y===null||(S=ac(g,y),S!=null&&m.push(mc(g,S,v))),b)break;g=g.return}0<m.length&&(h=new d(h,p,null,n,u),f.push({event:h,listeners:m}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==Xg&&(p=n.relatedTarget||n.fromElement)&&(Ho(p)||p[ml]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=c,p=p?Ho(p):null,p!==null&&(b=xc(p),m=p.tag,p!==b||m!==5&&m!==27&&m!==6)&&(p=null)):(d=null,p=c),d!==p)){if(m=cw,S="onMouseLeave",y="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(m=fw,S="onPointerLeave",y="onPointerEnter",g="pointer"),b=d==null?h:Ya(d),v=p==null?h:Ya(p),h=new m(S,g+"leave",d,n,u),h.target=b,h.relatedTarget=v,S=null,Ho(u)===c&&(m=new m(y,g+"enter",p,n,u),m.target=v,m.relatedTarget=b,S=m),b=S,d&&p)t:{for(m=d,y=p,g=0,v=m;v;v=Lo(v))g++;for(v=0,S=y;S;S=Lo(S))v++;for(;0<g-v;)m=Lo(m),g--;for(;0<v-g;)y=Lo(y),v--;for(;g--;){if(m===y||y!==null&&m===y.alternate)break t;m=Lo(m),y=Lo(y)}m=null}else m=null;d!==null&&rk(f,h,d,m,!1),p!==null&&b!==null&&rk(f,b,p,m,!0)}}e:{if(h=c?Ya(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=mw;else if(pw(h))if(Gk)w=vP;else{w=yP;var A=gP}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&Hy(c.elementType)&&(w=mw):w=bP;if(w&&(w=w(t,c))){Qk(f,w,n,u);break e}A&&A(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&$g(h,"number",h.value)}switch(A=c?Ya(c):window,t){case"focusin":(pw(A)||A.contentEditable==="true")&&(jo=A,Zg=c,$a=null);break;case"focusout":$a=Zg=jo=null;break;case"mousedown":Jg=!0;break;case"contextmenu":case"mouseup":case"dragend":Jg=!1,vw(f,n,u);break;case"selectionchange":if(xP)break;case"keydown":case"keyup":vw(f,n,u)}var k;if(Vy)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Fo?Yk(t,n)&&(O="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(Vk&&n.locale!=="ko"&&(Fo||O!=="onCompositionStart"?O==="onCompositionEnd"&&Fo&&(k=jk()):(Br=u,Fy="value"in Br?Br.value:Br.textContent,Fo=!0)),A=Mh(c,O),0<A.length&&(O=new uw(O,t,null,n,u),f.push({event:O,listeners:A}),k?O.data=k:(k=Kk(n),k!==null&&(O.data=k)))),(k=fP?hP(t,n):dP(t,n))&&(O=Mh(c,"onBeforeInput"),0<O.length&&(A=new uw("onBeforeInput","beforeinput",null,n,u),f.push({event:A,listeners:O}),A.data=k)),i6(f,t,c,n,u)}zO(f,e)})}function mc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Mh(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=ac(t,n),r!=null&&i.unshift(mc(t,r,s)),r=ac(t,e),r!=null&&i.push(mc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function Lo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function rk(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=ac(n,s),c!=null&&o.unshift(mc(n,c,a))):r||(c=ac(n,s),c!=null&&o.push(mc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var s6=/\r\n?/g,o6=/\u0000|\uFFFD/g;function sk(t){return(typeof t=="string"?t:""+t).replace(s6,`
9
- `).replace(o6,"")}function UO(t,e){return e=sk(e),sk(t)===e}function Xh(){}function ve(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||ol(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&ol(t,""+i);break;case"className":Lf(t,"class",i);break;case"tabIndex":Lf(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Lf(t,n,i);break;case"style":Uk(t,i,s);break;case"data":if(e!=="object"){Lf(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=$f(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&ve(t,e,"name",r.name,r,null),ve(t,e,"formEncType",r.formEncType,r,null),ve(t,e,"formMethod",r.formMethod,r,null),ve(t,e,"formTarget",r.formTarget,r,null)):(ve(t,e,"encType",r.encType,r,null),ve(t,e,"method",r.method,r,null),ve(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=$f(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Xh);break;case"onScroll":i!=null&&ee("scroll",t);break;case"onScrollEnd":i!=null&&ee("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(C(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(C(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=$f(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":ee("beforetoggle",t),ee("toggle",t),Gf(t,"popover",i);break;case"xlinkActuate":Vi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Vi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Vi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Vi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Vi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Vi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Vi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Vi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Vi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Gf(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=P5.get(n)||n,Gf(t,n,i))}}function Ay(t,e,n,i,r,s){switch(n){case"style":Uk(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(C(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(C(60));t.innerHTML=n}}break;case"children":typeof i=="string"?ol(t,i):(typeof i=="number"||typeof i=="bigint")&&ol(t,""+i);break;case"onScroll":i!=null&&ee("scroll",t);break;case"onScrollEnd":i!=null&&ee("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Xh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bk.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[$t]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Gf(t,n,i)}}}function yt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ee("error",t),ee("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(C(137,e));default:ve(t,e,s,o,n,null)}}r&&ve(t,e,"srcSet",n.srcSet,n,null),i&&ve(t,e,"src",n.src,n,null);return;case"input":ee("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(C(137,e));break;default:ve(t,e,i,u,n,null)}}Pk(t,s,l,a,c,o,r,!1),fh(t);return;case"select":ee("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:ve(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?Wo(t,!!i,e,!1):n!=null&&Wo(t,!!i,n,!0);return;case"textarea":ee("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(C(91));break;default:ve(t,e,o,l,n,null)}Hk(t,i,r,s),fh(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":ve(t,e,a,i,n,null));return;case"dialog":ee("beforetoggle",t),ee("toggle",t),ee("cancel",t),ee("close",t);break;case"iframe":case"object":ee("load",t);break;case"video":case"audio":for(i=0;i<pc.length;i++)ee(pc[i],t);break;case"image":ee("error",t),ee("load",t);break;case"details":ee("toggle",t);break;case"embed":case"source":case"link":ee("error",t),ee("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(C(137,e));default:ve(t,e,c,i,n,null)}return;default:if(Hy(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Ay(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&ve(t,e,l,i,n,null))}function l6(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(d)||ve(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":s=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(C(137,e));break;default:d!==f&&ve(t,e,h,d,i,f)}}Gg(t,o,l,a,c,u,s,r);return;case"select":d=o=l=h=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":d=a;default:i.hasOwnProperty(s)||ve(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":h=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&ve(t,e,r,s,i,a)}e=l,n=o,i=d,h!=null?Wo(t,!!n,h,!1):!!i!=!!n&&(e!=null?Wo(t,!!n,e,!0):Wo(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:ve(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(C(91));break;default:r!==s&&ve(t,e,o,r,i,s)}zk(t,h,d);return;case"option":for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&(p==="selected"?t.selected=!1:ve(t,e,p,null,i,h));for(a in i)h=i[a],d=n[a],i.hasOwnProperty(a)&&h!==d&&(h!=null||d!=null)&&(a==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":ve(t,e,a,h,i,d));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!i.hasOwnProperty(m)&&ve(t,e,m,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(C(137,e));break;default:ve(t,e,c,h,i,d)}return;default:if(Hy(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Ay(t,e,b,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||Ay(t,e,u,h,i,d);return}}for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!=null&&!i.hasOwnProperty(y)&&ve(t,e,y,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||ve(t,e,f,h,i,d)}var Oy=null,Ty=null;function Nh(t){return t.nodeType===9?t:t.ownerDocument}function ok(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function FO(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Cy(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Pg=null;function a6(){var t=window.event;return t&&t.type==="popstate"?t===Pg?!1:(Pg=t,!0):(Pg=null,!1)}var jO=typeof setTimeout=="function"?setTimeout:void 0,c6=typeof clearTimeout=="function"?clearTimeout:void 0,lk=typeof Promise=="function"?Promise:void 0,u6=typeof queueMicrotask=="function"?queueMicrotask:typeof lk<"u"?function(t){return lk.resolve(null).then(t).catch(f6)}:jO;function f6(t){setTimeout(function(){throw t})}function Xr(t){return t==="head"}function ak(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&oc(o.documentElement),n&2&&oc(o.body),n&4)for(n=o.head,oc(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[Oc]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),Sc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);Sc(e)}function Ey(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ey(n),zy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function h6(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Oc])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Qn(t.nextSibling),t===null)break}return null}function d6(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Qn(t.nextSibling),t===null))return null;return t}function Dy(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function p6(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Qn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var My=null;function ck(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function VO(t,e,n){switch(e=Nh(n),t){case"html":if(t=e.documentElement,!t)throw Error(C(452));return t;case"head":if(t=e.head,!t)throw Error(C(453));return t;case"body":if(t=e.body,!t)throw Error(C(454));return t;default:throw Error(C(451))}}function oc(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);zy(t)}var Nn=new Map,uk=new Set;function Rh(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var sr=he.d;he.d={f:m6,r:g6,D:y6,C:b6,L:v6,m:S6,X:w6,S:x6,M:k6};function m6(){var t=sr.f(),e=Qh();return t||e}function g6(t){var e=gl(t);e!==null&&e.tag===5&&e.type==="form"?qA(e):sr.r(t)}var vl=typeof document>"u"?null:document;function YO(t,e,n){var i=vl;if(i&&typeof e=="string"&&e){var r=Cn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),uk.has(r)||(uk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),yt(e,"link",t),ut(e),i.head.appendChild(e)))}}function y6(t){sr.D(t),YO("dns-prefetch",t,null)}function b6(t,e){sr.C(t,e),YO("preconnect",t,e)}function v6(t,e,n){sr.L(t,e,n);var i=vl;if(i&&t&&e){var r='link[rel="preload"][as="'+Cn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Cn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Cn(n.imageSizes)+'"]')):r+='[href="'+Cn(t)+'"]';var s=r;switch(e){case"style":s=pl(t);break;case"script":s=Sl(t)}Nn.has(s)||(t=De({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Nn.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Bc(s))||e==="script"&&i.querySelector(Ic(s))||(e=i.createElement("link"),yt(e,"link",t),ut(e),i.head.appendChild(e)))}}function S6(t,e){sr.m(t,e);var n=vl;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Cn(i)+'"][href="'+Cn(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Sl(t)}if(!Nn.has(s)&&(t=De({rel:"modulepreload",href:t},e),Nn.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ic(s)))return}i=n.createElement("link"),yt(i,"link",t),ut(i),n.head.appendChild(i)}}}function x6(t,e,n){sr.S(t,e,n);var i=vl;if(i&&t){var r=Xo(i).hoistableStyles,s=pl(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Bc(s)))l.loading=5;else{t=De({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Nn.get(s))&&w0(t,n);var a=o=i.createElement("link");ut(a),yt(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,rh(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function w6(t,e){sr.X(t,e);var n=vl;if(n&&t){var i=Xo(n).hoistableScripts,r=Sl(t),s=i.get(r);s||(s=n.querySelector(Ic(r)),s||(t=De({src:t,async:!0},e),(e=Nn.get(r))&&k0(t,e),s=n.createElement("script"),ut(s),yt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function k6(t,e){sr.M(t,e);var n=vl;if(n&&t){var i=Xo(n).hoistableScripts,r=Sl(t),s=i.get(r);s||(s=n.querySelector(Ic(r)),s||(t=De({src:t,async:!0,type:"module"},e),(e=Nn.get(r))&&k0(t,e),s=n.createElement("script"),ut(s),yt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function fk(t,e,n,i){var r=(r=Pr.current)?Rh(r):null;if(!r)throw Error(C(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=pl(n.href),n=Xo(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=pl(n.href);var s=Xo(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Bc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),Nn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nn.set(t,n),s||A6(r,t,n,o.state))),e&&i===null)throw Error(C(528,""));return o}if(e&&i!==null)throw Error(C(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Sl(n),n=Xo(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(C(444,t))}}function pl(t){return'href="'+Cn(t)+'"'}function Bc(t){return'link[rel="stylesheet"]['+t+"]"}function KO(t){return De({},t,{"data-precedence":t.precedence,precedence:null})}function A6(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),yt(e,"link",n),ut(e),t.head.appendChild(e))}function Sl(t){return'[src="'+Cn(t)+'"]'}function Ic(t){return"script[async]"+t}function hk(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+Cn(n.href)+'"]');if(i)return e.instance=i,ut(i),i;var r=De({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ut(i),yt(i,"style",r),rh(i,n.precedence,t),e.instance=i;case"stylesheet":r=pl(n.href);var s=t.querySelector(Bc(r));if(s)return e.state.loading|=4,e.instance=s,ut(s),s;i=KO(n),(r=Nn.get(r))&&w0(i,r),s=(t.ownerDocument||t).createElement("link"),ut(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),yt(s,"link",i),e.state.loading|=4,rh(s,n.precedence,t),e.instance=s;case"script":return s=Sl(n.src),(r=t.querySelector(Ic(s)))?(e.instance=r,ut(r),r):(i=n,(r=Nn.get(s))&&(i=De({},n),k0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ut(r),yt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(C(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,rh(i,n.precedence,t));return e.instance}function rh(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function w0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function k0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var sh=null;function dk(t,e,n){if(sh===null){var i=new Map,r=sh=new Map;r.set(n,i)}else r=sh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[Oc]||s[xt]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function pk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function O6(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function QO(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var gc=null;function T6(){}function C6(t,e,n){if(gc===null)throw Error(C(475));var i=gc;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=pl(n.href),s=t.querySelector(Bc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=_h.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,ut(s);return}s=t.ownerDocument||t,n=KO(n),(r=Nn.get(r))&&w0(n,r),s=s.createElement("link"),ut(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),yt(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=_h.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function E6(){if(gc===null)throw Error(C(475));var t=gc;return t.stylesheets&&t.count===0&&Ny(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Ny(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function _h(){if(this.count--,this.count===0){if(this.stylesheets)Ny(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lh=null;function Ny(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lh=new Map,e.forEach(D6,t),Lh=null,_h.call(t))}function D6(t,e){if(!(e.state.loading&4)){var n=Lh.get(t);if(n)var i=n.get(null);else{n=new Map,Lh.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=_h.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var yc={$$typeof:Gi,Provider:null,Consumer:null,_currentValue:Ns,_currentValue2:Ns,_threadCount:0};function M6(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=cg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cg(0),this.hiddenUpdates=cg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function GO(t,e,n,i,r,s,o,l,a,c,u,f){return t=new M6(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=on(3,null,null,e),t.current=s,s.stateNode=t,e=Wy(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},Jy(s),t}function $O(t){return t?(t=Ko,t):Ko}function XO(t,e,n,i,r,s){r=$O(r),i.context===null?i.context=r:i.pendingContext=r,i=zr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Hr(t,i,e),n!==null&&(un(n,t,e),Za(n,t,e))}function mk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function A0(t,e){mk(t,e),(t=t.alternate)&&mk(t,e)}function WO(t){if(t.tag===13){var e=yl(t,67108864);e!==null&&un(e,t,67108864),A0(t,67108864)}}var Bh=!0;function N6(t,e,n,i){var r=F.T;F.T=null;var s=he.p;try{he.p=2,O0(t,e,n,i)}finally{he.p=s,F.T=r}}function R6(t,e,n,i){var r=F.T;F.T=null;var s=he.p;try{he.p=8,O0(t,e,n,i)}finally{he.p=s,F.T=r}}function O0(t,e,n,i){if(Bh){var r=Ry(i);if(r===null)qg(t,e,i,Ih,n),gk(t,i);else if(L6(r,t,e,n,i))i.stopPropagation();else if(gk(t,i),e&4&&-1<_6.indexOf(t)){for(;r!==null;){var s=gl(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=Es(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-an(o);l.entanglements[1]|=a,o&=~a}wi(s),(ye&6)===0&&(Th=vi()+500,Lc(0,!1))}}break;case 13:l=yl(s,2),l!==null&&un(l,s,2),Qh(),A0(s,2)}if(s=Ry(i),s===null&&qg(t,e,i,Ih,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else qg(t,e,i,null,n)}}function Ry(t){return t=Uy(t),T0(t)}var Ih=null;function T0(t){if(Ih=null,t=Ho(t),t!==null){var e=xc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=wk(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Ih=t,null}function ZO(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(S5()){case Tk:return 2;case Ck:return 8;case uh:case x5:return 32;case Ek:return 268435456;default:return 32}default:return 32}}var _y=!1,jr=null,Vr=null,Yr=null,bc=new Map,vc=new Map,_r=[],_6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gk(t,e){switch(t){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":bc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(e.pointerId)}}function Ua(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=gl(e),e!==null&&WO(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function L6(t,e,n,i,r){switch(e){case"focusin":return jr=Ua(jr,t,e,n,i,r),!0;case"dragenter":return Vr=Ua(Vr,t,e,n,i,r),!0;case"mouseover":return Yr=Ua(Yr,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return bc.set(s,Ua(bc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,vc.set(s,Ua(vc.get(s)||null,t,e,n,i,r)),!0}return!1}function JO(t){var e=Ho(t.target);if(e!==null){var n=xc(e);if(n!==null){if(e=n.tag,e===13){if(e=wk(n),e!==null){t.blockedOn=e,D5(t.priority,function(){if(n.tag===13){var i=cn();i=qy(i);var r=yl(n,i);r!==null&&un(r,n,i),A0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function oh(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Ry(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Xg=i,n.target.dispatchEvent(i),Xg=null}else return e=gl(n),e!==null&&WO(e),t.blockedOn=n,!1;e.shift()}return!0}function yk(t,e,n){oh(t)&&n.delete(e)}function B6(){_y=!1,jr!==null&&oh(jr)&&(jr=null),Vr!==null&&oh(Vr)&&(Vr=null),Yr!==null&&oh(Yr)&&(Yr=null),bc.forEach(yk),vc.forEach(yk)}function Kf(t,e){t.blockedOn===e&&(t.blockedOn=null,_y||(_y=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,B6)))}var Qf=null;function bk(t){Qf!==t&&(Qf=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Qf===t&&(Qf=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(T0(i||n)===null)continue;break}var s=gl(n);s!==null&&(t.splice(e,3),e-=3,hy(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Sc(t){function e(a){return Kf(a,t)}jr!==null&&Kf(jr,t),Vr!==null&&Kf(Vr,t),Yr!==null&&Kf(Yr,t),bc.forEach(e),vc.forEach(e);for(var n=0;n<_r.length;n++){var i=_r[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<_r.length&&(n=_r[0],n.blockedOn===null);)JO(n),n.blockedOn===null&&_r.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[$t]||null;if(typeof s=="function")o||bk(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[$t]||null)l=o.formAction;else if(T0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),bk(n)}}}function C0(t){this._internalRoot=t}Wh.prototype.render=C0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(C(409));var n=e.current,i=cn();XO(n,i,t,e,null,null)};Wh.prototype.unmount=C0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;XO(t.current,2,null,t,null,null),Qh(),e[ml]=null}};function Wh(t){this._internalRoot=t}Wh.prototype.unstable_scheduleHydration=function(t){if(t){var e=_k();t={blockedOn:null,target:t,priority:e};for(var n=0;n<_r.length&&e!==0&&e<_r[n].priority;n++);_r.splice(n,0,t),n===0&&JO(t)}};var vk=Sk.version;if(vk!=="19.1.0")throw Error(C(527,vk,"19.1.0"));he.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(C(188)):(t=Object.keys(t).join(","),Error(C(268,t)));return t=d5(e),t=t!==null?kk(t):null,t=t===null?null:t.stateNode,t};var I6={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Fa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Fa.isDisabled&&Fa.supportsFiber))try{wc=Fa.inject(I6),ln=Fa}catch{}var Fa;Zh.createRoot=function(t,e){if(!xk(t))throw Error(C(299));var n=!1,i="",r=GA,s=$A,o=XA,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=GO(t,1,!1,null,null,n,i,r,s,o,l,null),t[ml]=e.current,x0(t),new C0(e)};Zh.hydrateRoot=function(t,e,n){if(!xk(t))throw Error(C(299));var i=!1,r="",s=GA,o=$A,l=XA,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=GO(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=$O(null),n=e.current,i=cn(),i=qy(i),r=zr(i),r.callback=null,Hr(n,r,i),n=i,e.current.lanes=n,Ac(e,n),wi(e),t[ml]=e.current,x0(t),new Wh(e)};Zh.version="19.1.0"});var iT=x((fse,nT)=>{"use strict";function tT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tT)}catch(t){console.error(t)}}tT(),nT.exports=eT()});var MC=x(Yd=>{"use strict";var KH=Symbol.for("react.transitional.element"),QH=Symbol.for("react.fragment");function DC(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:KH,type:t,key:i,ref:e!==void 0?e:null,props:n}}Yd.Fragment=QH;Yd.jsx=DC;Yd.jsxs=DC});var dn=x((Tfe,NC)=>{"use strict";NC.exports=MC()});var jN=x((_pe,FN)=>{"use strict";function aY(){this.__data__=[],this.size=0}FN.exports=aY});var mm=x((Lpe,VN)=>{"use strict";function cY(t,e){return t===e||t!==t&&e!==e}VN.exports=cY});var tf=x((Bpe,YN)=>{"use strict";var uY=mm();function fY(t,e){for(var n=t.length;n--;)if(uY(t[n][0],e))return n;return-1}YN.exports=fY});var QN=x((Ipe,KN)=>{"use strict";var hY=tf(),dY=Array.prototype,pY=dY.splice;function mY(t){var e=this.__data__,n=hY(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():pY.call(e,n,1),--this.size,!0}KN.exports=mY});var $N=x((qpe,GN)=>{"use strict";var gY=tf();function yY(t){var e=this.__data__,n=gY(e,t);return n<0?void 0:e[n][1]}GN.exports=yY});var WN=x((Ppe,XN)=>{"use strict";var bY=tf();function vY(t){return bY(this.__data__,t)>-1}XN.exports=vY});var JN=x((zpe,ZN)=>{"use strict";var SY=tf();function xY(t,e){var n=this.__data__,i=SY(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}ZN.exports=xY});var nf=x((Hpe,eR)=>{"use strict";var wY=jN(),kY=QN(),AY=$N(),OY=WN(),TY=JN();function ya(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ya.prototype.clear=wY;ya.prototype.delete=kY;ya.prototype.get=AY;ya.prototype.has=OY;ya.prototype.set=TY;eR.exports=ya});var nR=x((Upe,tR)=>{"use strict";var CY=nf();function EY(){this.__data__=new CY,this.size=0}tR.exports=EY});var rR=x((Fpe,iR)=>{"use strict";function DY(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}iR.exports=DY});var oR=x((jpe,sR)=>{"use strict";function MY(t){return this.__data__.get(t)}sR.exports=MY});var aR=x((Vpe,lR)=>{"use strict";function NY(t){return this.__data__.has(t)}lR.exports=NY});var CS=x((Ype,cR)=>{"use strict";var RY=typeof global=="object"&&global&&global.Object===Object&&global;cR.exports=RY});var hi=x((Kpe,uR)=>{"use strict";var _Y=CS(),LY=typeof self=="object"&&self&&self.Object===Object&&self,BY=_Y||LY||Function("return this")();uR.exports=BY});var xo=x((Qpe,fR)=>{"use strict";var IY=hi(),qY=IY.Symbol;fR.exports=qY});var mR=x((Gpe,pR)=>{"use strict";var hR=xo(),dR=Object.prototype,PY=dR.hasOwnProperty,zY=dR.toString,rf=hR?hR.toStringTag:void 0;function HY(t){var e=PY.call(t,rf),n=t[rf];try{t[rf]=void 0;var i=!0}catch{}var r=zY.call(t);return i&&(e?t[rf]=n:delete t[rf]),r}pR.exports=HY});var yR=x(($pe,gR)=>{"use strict";var UY=Object.prototype,FY=UY.toString;function jY(t){return FY.call(t)}gR.exports=jY});var wo=x((Xpe,SR)=>{"use strict";var bR=xo(),VY=mR(),YY=yR(),KY="[object Null]",QY="[object Undefined]",vR=bR?bR.toStringTag:void 0;function GY(t){return t==null?t===void 0?QY:KY:vR&&vR in Object(t)?VY(t):YY(t)}SR.exports=GY});var xs=x((Wpe,xR)=>{"use strict";function $Y(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}xR.exports=$Y});var sf=x((Zpe,wR)=>{"use strict";var XY=wo(),WY=xs(),ZY="[object AsyncFunction]",JY="[object Function]",eK="[object GeneratorFunction]",tK="[object Proxy]";function nK(t){if(!WY(t))return!1;var e=XY(t);return e==JY||e==eK||e==ZY||e==tK}wR.exports=nK});var AR=x((Jpe,kR)=>{"use strict";var iK=hi(),rK=iK["__core-js_shared__"];kR.exports=rK});var CR=x((eme,TR)=>{"use strict";var ES=AR(),OR=(function(){var t=/[^.]+$/.exec(ES&&ES.keys&&ES.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function sK(t){return!!OR&&OR in t}TR.exports=sK});var DS=x((tme,ER)=>{"use strict";var oK=Function.prototype,lK=oK.toString;function aK(t){if(t!=null){try{return lK.call(t)}catch{}try{return t+""}catch{}}return""}ER.exports=aK});var MR=x((nme,DR)=>{"use strict";var cK=sf(),uK=CR(),fK=xs(),hK=DS(),dK=/[\\^$.*+?()[\]{}|]/g,pK=/^\[object .+?Constructor\]$/,mK=Function.prototype,gK=Object.prototype,yK=mK.toString,bK=gK.hasOwnProperty,vK=RegExp("^"+yK.call(bK).replace(dK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function SK(t){if(!fK(t)||uK(t))return!1;var e=cK(t)?vK:pK;return e.test(hK(t))}DR.exports=SK});var RR=x((ime,NR)=>{"use strict";function xK(t,e){return t?.[e]}NR.exports=xK});var ws=x((rme,_R)=>{"use strict";var wK=MR(),kK=RR();function AK(t,e){var n=kK(t,e);return wK(n)?n:void 0}_R.exports=AK});var gm=x((sme,LR)=>{"use strict";var OK=ws(),TK=hi(),CK=OK(TK,"Map");LR.exports=CK});var of=x((ome,BR)=>{"use strict";var EK=ws(),DK=EK(Object,"create");BR.exports=DK});var PR=x((lme,qR)=>{"use strict";var IR=of();function MK(){this.__data__=IR?IR(null):{},this.size=0}qR.exports=MK});var HR=x((ame,zR)=>{"use strict";function NK(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}zR.exports=NK});var FR=x((cme,UR)=>{"use strict";var RK=of(),_K="__lodash_hash_undefined__",LK=Object.prototype,BK=LK.hasOwnProperty;function IK(t){var e=this.__data__;if(RK){var n=e[t];return n===_K?void 0:n}return BK.call(e,t)?e[t]:void 0}UR.exports=IK});var VR=x((ume,jR)=>{"use strict";var qK=of(),PK=Object.prototype,zK=PK.hasOwnProperty;function HK(t){var e=this.__data__;return qK?e[t]!==void 0:zK.call(e,t)}jR.exports=HK});var KR=x((fme,YR)=>{"use strict";var UK=of(),FK="__lodash_hash_undefined__";function jK(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=UK&&e===void 0?FK:e,this}YR.exports=jK});var GR=x((hme,QR)=>{"use strict";var VK=PR(),YK=HR(),KK=FR(),QK=VR(),GK=KR();function ba(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}ba.prototype.clear=VK;ba.prototype.delete=YK;ba.prototype.get=KK;ba.prototype.has=QK;ba.prototype.set=GK;QR.exports=ba});var WR=x((dme,XR)=>{"use strict";var $R=GR(),$K=nf(),XK=gm();function WK(){this.size=0,this.__data__={hash:new $R,map:new(XK||$K),string:new $R}}XR.exports=WK});var JR=x((pme,ZR)=>{"use strict";function ZK(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}ZR.exports=ZK});var lf=x((mme,e_)=>{"use strict";var JK=JR();function eQ(t,e){var n=t.__data__;return JK(e)?n[typeof e=="string"?"string":"hash"]:n.map}e_.exports=eQ});var n_=x((gme,t_)=>{"use strict";var tQ=lf();function nQ(t){var e=tQ(this,t).delete(t);return this.size-=e?1:0,e}t_.exports=nQ});var r_=x((yme,i_)=>{"use strict";var iQ=lf();function rQ(t){return iQ(this,t).get(t)}i_.exports=rQ});var o_=x((bme,s_)=>{"use strict";var sQ=lf();function oQ(t){return sQ(this,t).has(t)}s_.exports=oQ});var a_=x((vme,l_)=>{"use strict";var lQ=lf();function aQ(t,e){var n=lQ(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}l_.exports=aQ});var ym=x((Sme,c_)=>{"use strict";var cQ=WR(),uQ=n_(),fQ=r_(),hQ=o_(),dQ=a_();function va(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}va.prototype.clear=cQ;va.prototype.delete=uQ;va.prototype.get=fQ;va.prototype.has=hQ;va.prototype.set=dQ;c_.exports=va});var f_=x((xme,u_)=>{"use strict";var pQ=nf(),mQ=gm(),gQ=ym(),yQ=200;function bQ(t,e){var n=this.__data__;if(n instanceof pQ){var i=n.__data__;if(!mQ||i.length<yQ-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new gQ(i)}return n.set(t,e),this.size=n.size,this}u_.exports=bQ});var bm=x((wme,h_)=>{"use strict";var vQ=nf(),SQ=nR(),xQ=rR(),wQ=oR(),kQ=aR(),AQ=f_();function Sa(t){var e=this.__data__=new vQ(t);this.size=e.size}Sa.prototype.clear=SQ;Sa.prototype.delete=xQ;Sa.prototype.get=wQ;Sa.prototype.has=kQ;Sa.prototype.set=AQ;h_.exports=Sa});var vm=x((kme,d_)=>{"use strict";function OQ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}d_.exports=OQ});var MS=x((Ame,p_)=>{"use strict";var TQ=ws(),CQ=(function(){try{var t=TQ(Object,"defineProperty");return t({},"",{}),t}catch{}})();p_.exports=CQ});var NS=x((Ome,g_)=>{"use strict";var m_=MS();function EQ(t,e,n){e=="__proto__"&&m_?m_(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}g_.exports=EQ});var RS=x((Tme,y_)=>{"use strict";var DQ=NS(),MQ=mm(),NQ=Object.prototype,RQ=NQ.hasOwnProperty;function _Q(t,e,n){var i=t[e];(!(RQ.call(t,e)&&MQ(i,n))||n===void 0&&!(e in t))&&DQ(t,e,n)}y_.exports=_Q});var af=x((Cme,b_)=>{"use strict";var LQ=RS(),BQ=NS();function IQ(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?BQ(n,l,a):LQ(n,l,a)}return n}b_.exports=IQ});var S_=x((Eme,v_)=>{"use strict";function qQ(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}v_.exports=qQ});var zi=x((Dme,x_)=>{"use strict";function PQ(t){return t!=null&&typeof t=="object"}x_.exports=PQ});var k_=x((Mme,w_)=>{"use strict";var zQ=wo(),HQ=zi(),UQ="[object Arguments]";function FQ(t){return HQ(t)&&zQ(t)==UQ}w_.exports=FQ});var cf=x((Nme,T_)=>{"use strict";var A_=k_(),jQ=zi(),O_=Object.prototype,VQ=O_.hasOwnProperty,YQ=O_.propertyIsEnumerable,KQ=A_((function(){return arguments})())?A_:function(t){return jQ(t)&&VQ.call(t,"callee")&&!YQ.call(t,"callee")};T_.exports=KQ});var ot=x((Rme,C_)=>{"use strict";var QQ=Array.isArray;C_.exports=QQ});var D_=x((_me,E_)=>{"use strict";function GQ(){return!1}E_.exports=GQ});var wa=x((uf,xa)=>{"use strict";var $Q=hi(),XQ=D_(),R_=typeof uf=="object"&&uf&&!uf.nodeType&&uf,M_=R_&&typeof xa=="object"&&xa&&!xa.nodeType&&xa,WQ=M_&&M_.exports===R_,N_=WQ?$Q.Buffer:void 0,ZQ=N_?N_.isBuffer:void 0,JQ=ZQ||XQ;xa.exports=JQ});var _S=x((Lme,__)=>{"use strict";var eG=9007199254740991,tG=/^(?:0|[1-9]\d*)$/;function nG(t,e){var n=typeof t;return e=e??eG,!!e&&(n=="number"||n!="symbol"&&tG.test(t))&&t>-1&&t%1==0&&t<e}__.exports=nG});var Sm=x((Bme,L_)=>{"use strict";var iG=9007199254740991;function rG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=iG}L_.exports=rG});var I_=x((Ime,B_)=>{"use strict";var sG=wo(),oG=Sm(),lG=zi(),aG="[object Arguments]",cG="[object Array]",uG="[object Boolean]",fG="[object Date]",hG="[object Error]",dG="[object Function]",pG="[object Map]",mG="[object Number]",gG="[object Object]",yG="[object RegExp]",bG="[object Set]",vG="[object String]",SG="[object WeakMap]",xG="[object ArrayBuffer]",wG="[object DataView]",kG="[object Float32Array]",AG="[object Float64Array]",OG="[object Int8Array]",TG="[object Int16Array]",CG="[object Int32Array]",EG="[object Uint8Array]",DG="[object Uint8ClampedArray]",MG="[object Uint16Array]",NG="[object Uint32Array]",Ne={};Ne[kG]=Ne[AG]=Ne[OG]=Ne[TG]=Ne[CG]=Ne[EG]=Ne[DG]=Ne[MG]=Ne[NG]=!0;Ne[aG]=Ne[cG]=Ne[xG]=Ne[uG]=Ne[wG]=Ne[fG]=Ne[hG]=Ne[dG]=Ne[pG]=Ne[mG]=Ne[gG]=Ne[yG]=Ne[bG]=Ne[vG]=Ne[SG]=!1;function RG(t){return lG(t)&&oG(t.length)&&!!Ne[sG(t)]}B_.exports=RG});var xm=x((qme,q_)=>{"use strict";function _G(t){return function(e){return t(e)}}q_.exports=_G});var wm=x((ff,ka)=>{"use strict";var LG=CS(),P_=typeof ff=="object"&&ff&&!ff.nodeType&&ff,hf=P_&&typeof ka=="object"&&ka&&!ka.nodeType&&ka,BG=hf&&hf.exports===P_,LS=BG&&LG.process,IG=(function(){try{var t=hf&&hf.require&&hf.require("util").types;return t||LS&&LS.binding&&LS.binding("util")}catch{}})();ka.exports=IG});var df=x((Pme,U_)=>{"use strict";var qG=I_(),PG=xm(),z_=wm(),H_=z_&&z_.isTypedArray,zG=H_?PG(H_):qG;U_.exports=zG});var BS=x((zme,F_)=>{"use strict";var HG=S_(),UG=cf(),FG=ot(),jG=wa(),VG=_S(),YG=df(),KG=Object.prototype,QG=KG.hasOwnProperty;function GG(t,e){var n=FG(t),i=!n&&UG(t),r=!n&&!i&&jG(t),s=!n&&!i&&!r&&YG(t),o=n||i||r||s,l=o?HG(t.length,String):[],a=l.length;for(var c in t)(e||QG.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||VG(c,a)))&&l.push(c);return l}F_.exports=GG});var pf=x((Hme,j_)=>{"use strict";var $G=Object.prototype;function XG(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$G;return t===n}j_.exports=XG});var IS=x((Ume,V_)=>{"use strict";function WG(t,e){return function(n){return t(e(n))}}V_.exports=WG});var K_=x((Fme,Y_)=>{"use strict";var ZG=IS(),JG=ZG(Object.keys,Object);Y_.exports=JG});var km=x((jme,Q_)=>{"use strict";var e$=pf(),t$=K_(),n$=Object.prototype,i$=n$.hasOwnProperty;function r$(t){if(!e$(t))return t$(t);var e=[];for(var n in Object(t))i$.call(t,n)&&n!="constructor"&&e.push(n);return e}Q_.exports=r$});var ks=x((Vme,G_)=>{"use strict";var s$=sf(),o$=Sm();function l$(t){return t!=null&&o$(t.length)&&!s$(t)}G_.exports=l$});var As=x((Yme,$_)=>{"use strict";var a$=BS(),c$=km(),u$=ks();function f$(t){return u$(t)?a$(t):c$(t)}$_.exports=f$});var W_=x((Kme,X_)=>{"use strict";var h$=af(),d$=As();function p$(t,e){return t&&h$(e,d$(e),t)}X_.exports=p$});var J_=x((Qme,Z_)=>{"use strict";function m$(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}Z_.exports=m$});var tL=x((Gme,eL)=>{"use strict";var g$=xs(),y$=pf(),b$=J_(),v$=Object.prototype,S$=v$.hasOwnProperty;function x$(t){if(!g$(t))return b$(t);var e=y$(t),n=[];for(var i in t)i=="constructor"&&(e||!S$.call(t,i))||n.push(i);return n}eL.exports=x$});var Am=x(($me,nL)=>{"use strict";var w$=BS(),k$=tL(),A$=ks();function O$(t){return A$(t)?w$(t,!0):k$(t)}nL.exports=O$});var rL=x((Xme,iL)=>{"use strict";var T$=af(),C$=Am();function E$(t,e){return t&&T$(e,C$(e),t)}iL.exports=E$});var cL=x((mf,Aa)=>{"use strict";var D$=hi(),aL=typeof mf=="object"&&mf&&!mf.nodeType&&mf,sL=aL&&typeof Aa=="object"&&Aa&&!Aa.nodeType&&Aa,M$=sL&&sL.exports===aL,oL=M$?D$.Buffer:void 0,lL=oL?oL.allocUnsafe:void 0;function N$(t,e){if(e)return t.slice();var n=t.length,i=lL?lL(n):new t.constructor(n);return t.copy(i),i}Aa.exports=N$});var fL=x((Wme,uL)=>{"use strict";function R$(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}uL.exports=R$});var qS=x((Zme,hL)=>{"use strict";function _$(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}hL.exports=_$});var PS=x((Jme,dL)=>{"use strict";function L$(){return[]}dL.exports=L$});var Om=x((ege,mL)=>{"use strict";var B$=qS(),I$=PS(),q$=Object.prototype,P$=q$.propertyIsEnumerable,pL=Object.getOwnPropertySymbols,z$=pL?function(t){return t==null?[]:(t=Object(t),B$(pL(t),function(e){return P$.call(t,e)}))}:I$;mL.exports=z$});var yL=x((tge,gL)=>{"use strict";var H$=af(),U$=Om();function F$(t,e){return H$(t,U$(t),e)}gL.exports=F$});var Tm=x((nge,bL)=>{"use strict";function j$(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}bL.exports=j$});var Cm=x((ige,vL)=>{"use strict";var V$=IS(),Y$=V$(Object.getPrototypeOf,Object);vL.exports=Y$});var zS=x((rge,SL)=>{"use strict";var K$=Tm(),Q$=Cm(),G$=Om(),$$=PS(),X$=Object.getOwnPropertySymbols,W$=X$?function(t){for(var e=[];t;)K$(e,G$(t)),t=Q$(t);return e}:$$;SL.exports=W$});var wL=x((sge,xL)=>{"use strict";var Z$=af(),J$=zS();function eX(t,e){return Z$(t,J$(t),e)}xL.exports=eX});var HS=x((oge,kL)=>{"use strict";var tX=Tm(),nX=ot();function iX(t,e,n){var i=e(t);return nX(t)?i:tX(i,n(t))}kL.exports=iX});var US=x((lge,AL)=>{"use strict";var rX=HS(),sX=Om(),oX=As();function lX(t){return rX(t,oX,sX)}AL.exports=lX});var TL=x((age,OL)=>{"use strict";var aX=HS(),cX=zS(),uX=Am();function fX(t){return aX(t,uX,cX)}OL.exports=fX});var EL=x((cge,CL)=>{"use strict";var hX=ws(),dX=hi(),pX=hX(dX,"DataView");CL.exports=pX});var ML=x((uge,DL)=>{"use strict";var mX=ws(),gX=hi(),yX=mX(gX,"Promise");DL.exports=yX});var FS=x((fge,NL)=>{"use strict";var bX=ws(),vX=hi(),SX=bX(vX,"Set");NL.exports=SX});var _L=x((hge,RL)=>{"use strict";var xX=ws(),wX=hi(),kX=xX(wX,"WeakMap");RL.exports=kX});var Ao=x((dge,HL)=>{"use strict";var jS=EL(),VS=gm(),YS=ML(),KS=FS(),QS=_L(),zL=wo(),Oa=DS(),LL="[object Map]",AX="[object Object]",BL="[object Promise]",IL="[object Set]",qL="[object WeakMap]",PL="[object DataView]",OX=Oa(jS),TX=Oa(VS),CX=Oa(YS),EX=Oa(KS),DX=Oa(QS),ko=zL;(jS&&ko(new jS(new ArrayBuffer(1)))!=PL||VS&&ko(new VS)!=LL||YS&&ko(YS.resolve())!=BL||KS&&ko(new KS)!=IL||QS&&ko(new QS)!=qL)&&(ko=function(t){var e=zL(t),n=e==AX?t.constructor:void 0,i=n?Oa(n):"";if(i)switch(i){case OX:return PL;case TX:return LL;case CX:return BL;case EX:return IL;case DX:return qL}return e});HL.exports=ko});var FL=x((pge,UL)=>{"use strict";var MX=Object.prototype,NX=MX.hasOwnProperty;function RX(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&NX.call(t,"index")&&(n.index=t.index,n.input=t.input),n}UL.exports=RX});var GS=x((mge,jL)=>{"use strict";var _X=hi(),LX=_X.Uint8Array;jL.exports=LX});var Em=x((gge,YL)=>{"use strict";var VL=GS();function BX(t){var e=new t.constructor(t.byteLength);return new VL(e).set(new VL(t)),e}YL.exports=BX});var QL=x((yge,KL)=>{"use strict";var IX=Em();function qX(t,e){var n=e?IX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}KL.exports=qX});var $L=x((bge,GL)=>{"use strict";var PX=/\w*$/;function zX(t){var e=new t.constructor(t.source,PX.exec(t));return e.lastIndex=t.lastIndex,e}GL.exports=zX});var eB=x((vge,JL)=>{"use strict";var XL=xo(),WL=XL?XL.prototype:void 0,ZL=WL?WL.valueOf:void 0;function HX(t){return ZL?Object(ZL.call(t)):{}}JL.exports=HX});var nB=x((Sge,tB)=>{"use strict";var UX=Em();function FX(t,e){var n=e?UX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}tB.exports=FX});var rB=x((xge,iB)=>{"use strict";var jX=Em(),VX=QL(),YX=$L(),KX=eB(),QX=nB(),GX="[object Boolean]",$X="[object Date]",XX="[object Map]",WX="[object Number]",ZX="[object RegExp]",JX="[object Set]",eW="[object String]",tW="[object Symbol]",nW="[object ArrayBuffer]",iW="[object DataView]",rW="[object Float32Array]",sW="[object Float64Array]",oW="[object Int8Array]",lW="[object Int16Array]",aW="[object Int32Array]",cW="[object Uint8Array]",uW="[object Uint8ClampedArray]",fW="[object Uint16Array]",hW="[object Uint32Array]";function dW(t,e,n){var i=t.constructor;switch(e){case nW:return jX(t);case GX:case $X:return new i(+t);case iW:return VX(t,n);case rW:case sW:case oW:case lW:case aW:case cW:case uW:case fW:case hW:return QX(t,n);case XX:return new i;case WX:case eW:return new i(t);case ZX:return YX(t);case JX:return new i;case tW:return KX(t)}}iB.exports=dW});var $S=x((wge,oB)=>{"use strict";var pW=xs(),sB=Object.create,mW=(function(){function t(){}return function(e){if(!pW(e))return{};if(sB)return sB(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();oB.exports=mW});var aB=x((kge,lB)=>{"use strict";var gW=$S(),yW=Cm(),bW=pf();function vW(t){return typeof t.constructor=="function"&&!bW(t)?gW(yW(t)):{}}lB.exports=vW});var uB=x((Age,cB)=>{"use strict";var SW=Ao(),xW=zi(),wW="[object Map]";function kW(t){return xW(t)&&SW(t)==wW}cB.exports=kW});var pB=x((Oge,dB)=>{"use strict";var AW=uB(),OW=xm(),fB=wm(),hB=fB&&fB.isMap,TW=hB?OW(hB):AW;dB.exports=TW});var gB=x((Tge,mB)=>{"use strict";var CW=Ao(),EW=zi(),DW="[object Set]";function MW(t){return EW(t)&&CW(t)==DW}mB.exports=MW});var SB=x((Cge,vB)=>{"use strict";var NW=gB(),RW=xm(),yB=wm(),bB=yB&&yB.isSet,_W=bB?RW(bB):NW;vB.exports=_W});var OB=x((Ege,AB)=>{"use strict";var LW=bm(),BW=vm(),IW=RS(),qW=W_(),PW=rL(),zW=cL(),HW=fL(),UW=yL(),FW=wL(),jW=US(),VW=TL(),YW=Ao(),KW=FL(),QW=rB(),GW=aB(),$W=ot(),XW=wa(),WW=pB(),ZW=xs(),JW=SB(),eZ=As(),tZ=Am(),nZ=1,iZ=2,rZ=4,xB="[object Arguments]",sZ="[object Array]",oZ="[object Boolean]",lZ="[object Date]",aZ="[object Error]",wB="[object Function]",cZ="[object GeneratorFunction]",uZ="[object Map]",fZ="[object Number]",kB="[object Object]",hZ="[object RegExp]",dZ="[object Set]",pZ="[object String]",mZ="[object Symbol]",gZ="[object WeakMap]",yZ="[object ArrayBuffer]",bZ="[object DataView]",vZ="[object Float32Array]",SZ="[object Float64Array]",xZ="[object Int8Array]",wZ="[object Int16Array]",kZ="[object Int32Array]",AZ="[object Uint8Array]",OZ="[object Uint8ClampedArray]",TZ="[object Uint16Array]",CZ="[object Uint32Array]",Ce={};Ce[xB]=Ce[sZ]=Ce[yZ]=Ce[bZ]=Ce[oZ]=Ce[lZ]=Ce[vZ]=Ce[SZ]=Ce[xZ]=Ce[wZ]=Ce[kZ]=Ce[uZ]=Ce[fZ]=Ce[kB]=Ce[hZ]=Ce[dZ]=Ce[pZ]=Ce[mZ]=Ce[AZ]=Ce[OZ]=Ce[TZ]=Ce[CZ]=!0;Ce[aZ]=Ce[wB]=Ce[gZ]=!1;function Dm(t,e,n,i,r,s){var o,l=e&nZ,a=e&iZ,c=e&rZ;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!ZW(t))return t;var u=$W(t);if(u){if(o=KW(t),!l)return HW(t,o)}else{var f=YW(t),h=f==wB||f==cZ;if(XW(t))return zW(t,l);if(f==kB||f==xB||h&&!r){if(o=a||h?{}:GW(t),!l)return a?FW(t,PW(o,t)):UW(t,qW(o,t))}else{if(!Ce[f])return r?t:{};o=QW(t,f,l)}}s||(s=new LW);var d=s.get(t);if(d)return d;s.set(t,o),JW(t)?t.forEach(function(b){o.add(Dm(b,e,n,b,t,s))}):WW(t)&&t.forEach(function(b,y){o.set(y,Dm(b,e,n,y,t,s))});var p=c?a?VW:jW:a?tZ:eZ,m=u?void 0:p(t);return BW(m||t,function(b,y){m&&(y=b,b=t[y]),IW(o,y,Dm(b,e,n,y,t,s))}),o}AB.exports=Dm});var CB=x((Dge,TB)=>{"use strict";var EZ=OB(),DZ=4;function MZ(t){return EZ(t,DZ)}TB.exports=MZ});var XS=x((Mge,EB)=>{"use strict";function NZ(t){return function(){return t}}EB.exports=NZ});var MB=x((Nge,DB)=>{"use strict";function RZ(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}DB.exports=RZ});var RB=x((Rge,NB)=>{"use strict";var _Z=MB(),LZ=_Z();NB.exports=LZ});var WS=x((_ge,_B)=>{"use strict";var BZ=RB(),IZ=As();function qZ(t,e){return t&&BZ(t,e,IZ)}_B.exports=qZ});var BB=x((Lge,LB)=>{"use strict";var PZ=ks();function zZ(t,e){return function(n,i){if(n==null)return n;if(!PZ(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}LB.exports=zZ});var gf=x((Bge,IB)=>{"use strict";var HZ=WS(),UZ=BB(),FZ=UZ(HZ);IB.exports=FZ});var yf=x((Ige,qB)=>{"use strict";function jZ(t){return t}qB.exports=jZ});var zB=x((qge,PB)=>{"use strict";var VZ=yf();function YZ(t){return typeof t=="function"?t:VZ}PB.exports=YZ});var UB=x((Pge,HB)=>{"use strict";var KZ=vm(),QZ=gf(),GZ=zB(),$Z=ot();function XZ(t,e){var n=$Z(t)?KZ:QZ;return n(t,GZ(e))}HB.exports=XZ});var jB=x((zge,FB)=>{"use strict";FB.exports=UB()});var YB=x((Hge,VB)=>{"use strict";var WZ=gf();function ZZ(t,e){var n=[];return WZ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}VB.exports=ZZ});var QB=x((Uge,KB)=>{"use strict";var JZ="__lodash_hash_undefined__";function eJ(t){return this.__data__.set(t,JZ),this}KB.exports=eJ});var $B=x((Fge,GB)=>{"use strict";function tJ(t){return this.__data__.has(t)}GB.exports=tJ});var ZS=x((jge,XB)=>{"use strict";var nJ=ym(),iJ=QB(),rJ=$B();function Mm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new nJ;++e<n;)this.add(t[e])}Mm.prototype.add=Mm.prototype.push=iJ;Mm.prototype.has=rJ;XB.exports=Mm});var ZB=x((Vge,WB)=>{"use strict";function sJ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}WB.exports=sJ});var JS=x((Yge,JB)=>{"use strict";function oJ(t,e){return t.has(e)}JB.exports=oJ});var ex=x((Kge,eI)=>{"use strict";var lJ=ZS(),aJ=ZB(),cJ=JS(),uJ=1,fJ=2;function hJ(t,e,n,i,r,s){var o=n&uJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&fJ?new lJ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var p=t[f],m=e[f];if(i)var b=o?i(m,p,f,e,t,s):i(p,m,f,t,e,s);if(b!==void 0){if(b)continue;h=!1;break}if(d){if(!aJ(e,function(y,g){if(!cJ(d,g)&&(p===y||r(p,y,n,i,s)))return d.push(g)})){h=!1;break}}else if(!(p===m||r(p,m,n,i,s))){h=!1;break}}return s.delete(t),s.delete(e),h}eI.exports=hJ});var nI=x((Qge,tI)=>{"use strict";function dJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}tI.exports=dJ});var Nm=x((Gge,iI)=>{"use strict";function pJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}iI.exports=pJ});var aI=x(($ge,lI)=>{"use strict";var rI=xo(),sI=GS(),mJ=mm(),gJ=ex(),yJ=nI(),bJ=Nm(),vJ=1,SJ=2,xJ="[object Boolean]",wJ="[object Date]",kJ="[object Error]",AJ="[object Map]",OJ="[object Number]",TJ="[object RegExp]",CJ="[object Set]",EJ="[object String]",DJ="[object Symbol]",MJ="[object ArrayBuffer]",NJ="[object DataView]",oI=rI?rI.prototype:void 0,tx=oI?oI.valueOf:void 0;function RJ(t,e,n,i,r,s,o){switch(n){case NJ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case MJ:return!(t.byteLength!=e.byteLength||!s(new sI(t),new sI(e)));case xJ:case wJ:case OJ:return mJ(+t,+e);case kJ:return t.name==e.name&&t.message==e.message;case TJ:case EJ:return t==e+"";case AJ:var l=yJ;case CJ:var a=i&vJ;if(l||(l=bJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=SJ,o.set(t,e);var u=gJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case DJ:if(tx)return tx.call(t)==tx.call(e)}return!1}lI.exports=RJ});var fI=x((Xge,uI)=>{"use strict";var cI=US(),_J=1,LJ=Object.prototype,BJ=LJ.hasOwnProperty;function IJ(t,e,n,i,r,s){var o=n&_J,l=cI(t),a=l.length,c=cI(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var h=l[f];if(!(o?h in e:BJ.call(e,h)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){h=l[f];var y=t[h],g=e[h];if(i)var v=o?i(g,y,h,e,t,s):i(y,g,h,t,e,s);if(!(v===void 0?y===g||r(y,g,n,i,s):v)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var S=t.constructor,w=e.constructor;S!=w&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(m=!1)}return s.delete(t),s.delete(e),m}uI.exports=IJ});var vI=x((Wge,bI)=>{"use strict";var nx=bm(),qJ=ex(),PJ=aI(),zJ=fI(),hI=Ao(),dI=ot(),pI=wa(),HJ=df(),UJ=1,mI="[object Arguments]",gI="[object Array]",Rm="[object Object]",FJ=Object.prototype,yI=FJ.hasOwnProperty;function jJ(t,e,n,i,r,s){var o=dI(t),l=dI(e),a=o?gI:hI(t),c=l?gI:hI(e);a=a==mI?Rm:a,c=c==mI?Rm:c;var u=a==Rm,f=c==Rm,h=a==c;if(h&&pI(t)){if(!pI(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new nx),o||HJ(t)?qJ(t,e,n,i,r,s):PJ(t,e,a,n,i,r,s);if(!(n&UJ)){var d=u&&yI.call(t,"__wrapped__"),p=f&&yI.call(e,"__wrapped__");if(d||p){var m=d?t.value():t,b=p?e.value():e;return s||(s=new nx),r(m,b,n,i,s)}}return h?(s||(s=new nx),zJ(t,e,n,i,r,s)):!1}bI.exports=jJ});var ix=x((Zge,wI)=>{"use strict";var VJ=vI(),SI=zi();function xI(t,e,n,i,r){return t===e?!0:t==null||e==null||!SI(t)&&!SI(e)?t!==t&&e!==e:VJ(t,e,n,i,xI,r)}wI.exports=xI});var AI=x((Jge,kI)=>{"use strict";var YJ=bm(),KJ=ix(),QJ=1,GJ=2;function $J(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new YJ;if(i)var h=i(c,u,a,t,e,f);if(!(h===void 0?KJ(u,c,QJ|GJ,i,f):h))return!1}}return!0}kI.exports=$J});var rx=x((eye,OI)=>{"use strict";var XJ=xs();function WJ(t){return t===t&&!XJ(t)}OI.exports=WJ});var CI=x((tye,TI)=>{"use strict";var ZJ=rx(),JJ=As();function eee(t){for(var e=JJ(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,ZJ(r)]}return e}TI.exports=eee});var sx=x((nye,EI)=>{"use strict";function tee(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}EI.exports=tee});var MI=x((iye,DI)=>{"use strict";var nee=AI(),iee=CI(),ree=sx();function see(t){var e=iee(t);return e.length==1&&e[0][2]?ree(e[0][0],e[0][1]):function(n){return n===t||nee(n,t,e)}}DI.exports=see});var _m=x((rye,NI)=>{"use strict";var oee=wo(),lee=zi(),aee="[object Symbol]";function cee(t){return typeof t=="symbol"||lee(t)&&oee(t)==aee}NI.exports=cee});var Lm=x((sye,RI)=>{"use strict";var uee=ot(),fee=_m(),hee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dee=/^\w*$/;function pee(t,e){if(uee(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||fee(t)?!0:dee.test(t)||!hee.test(t)||e!=null&&t in Object(e)}RI.exports=pee});var BI=x((oye,LI)=>{"use strict";var _I=ym(),mee="Expected a function";function ox(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(mee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(ox.Cache||_I),n}ox.Cache=_I;LI.exports=ox});var qI=x((lye,II)=>{"use strict";var gee=BI(),yee=500;function bee(t){var e=gee(t,function(i){return n.size===yee&&n.clear(),i}),n=e.cache;return e}II.exports=bee});var zI=x((aye,PI)=>{"use strict";var vee=qI(),See=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xee=/\\(\\)?/g,wee=vee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(See,function(n,i,r,s){e.push(r?s.replace(xee,"$1"):i||n)}),e});PI.exports=wee});var Bm=x((cye,HI)=>{"use strict";function kee(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}HI.exports=kee});var KI=x((uye,YI)=>{"use strict";var UI=xo(),Aee=Bm(),Oee=ot(),Tee=_m(),Cee=1/0,FI=UI?UI.prototype:void 0,jI=FI?FI.toString:void 0;function VI(t){if(typeof t=="string")return t;if(Oee(t))return Aee(t,VI)+"";if(Tee(t))return jI?jI.call(t):"";var e=t+"";return e=="0"&&1/t==-Cee?"-0":e}YI.exports=VI});var GI=x((fye,QI)=>{"use strict";var Eee=KI();function Dee(t){return t==null?"":Eee(t)}QI.exports=Dee});var lx=x((hye,$I)=>{"use strict";var Mee=ot(),Nee=Lm(),Ree=zI(),_ee=GI();function Lee(t,e){return Mee(t)?t:Nee(t,e)?[t]:Ree(_ee(t))}$I.exports=Lee});var bf=x((dye,XI)=>{"use strict";var Bee=_m(),Iee=1/0;function qee(t){if(typeof t=="string"||Bee(t))return t;var e=t+"";return e=="0"&&1/t==-Iee?"-0":e}XI.exports=qee});var ax=x((pye,WI)=>{"use strict";var Pee=lx(),zee=bf();function Hee(t,e){e=Pee(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[zee(e[n++])];return n&&n==i?t:void 0}WI.exports=Hee});var JI=x((mye,ZI)=>{"use strict";var Uee=ax();function Fee(t,e,n){var i=t==null?void 0:Uee(t,e);return i===void 0?n:i}ZI.exports=Fee});var t3=x((gye,e3)=>{"use strict";function jee(t,e){return t!=null&&e in Object(t)}e3.exports=jee});var cx=x((yye,n3)=>{"use strict";var Vee=lx(),Yee=cf(),Kee=ot(),Qee=_S(),Gee=Sm(),$ee=bf();function Xee(t,e,n){e=Vee(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=$ee(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&Gee(r)&&Qee(o,r)&&(Kee(t)||Yee(t)))}n3.exports=Xee});var r3=x((bye,i3)=>{"use strict";var Wee=t3(),Zee=cx();function Jee(t,e){return t!=null&&Zee(t,e,Wee)}i3.exports=Jee});var o3=x((vye,s3)=>{"use strict";var ete=ix(),tte=JI(),nte=r3(),ite=Lm(),rte=rx(),ste=sx(),ote=bf(),lte=1,ate=2;function cte(t,e){return ite(t)&&rte(e)?ste(ote(t),e):function(n){var i=tte(n,t);return i===void 0&&i===e?nte(n,t):ete(e,i,lte|ate)}}s3.exports=cte});var ux=x((Sye,l3)=>{"use strict";function ute(t){return function(e){return e?.[t]}}l3.exports=ute});var c3=x((xye,a3)=>{"use strict";var fte=ax();function hte(t){return function(e){return fte(e,t)}}a3.exports=hte});var f3=x((wye,u3)=>{"use strict";var dte=ux(),pte=c3(),mte=Lm(),gte=bf();function yte(t){return mte(t)?dte(gte(t)):pte(t)}u3.exports=yte});var vf=x((kye,h3)=>{"use strict";var bte=MI(),vte=o3(),Ste=yf(),xte=ot(),wte=f3();function kte(t){return typeof t=="function"?t:t==null?Ste:typeof t=="object"?xte(t)?vte(t[0],t[1]):bte(t):wte(t)}h3.exports=kte});var p3=x((Aye,d3)=>{"use strict";var Ate=qS(),Ote=YB(),Tte=vf(),Cte=ot();function Ete(t,e){var n=Cte(t)?Ate:Ote;return n(t,Tte(e,3))}d3.exports=Ete});var g3=x((Oye,m3)=>{"use strict";var Dte=Object.prototype,Mte=Dte.hasOwnProperty;function Nte(t,e){return t!=null&&Mte.call(t,e)}m3.exports=Nte});var b3=x((Tye,y3)=>{"use strict";var Rte=g3(),_te=cx();function Lte(t,e){return t!=null&&_te(t,e,Rte)}y3.exports=Lte});var S3=x((Cye,v3)=>{"use strict";var Bte=km(),Ite=Ao(),qte=cf(),Pte=ot(),zte=ks(),Hte=wa(),Ute=pf(),Fte=df(),jte="[object Map]",Vte="[object Set]",Yte=Object.prototype,Kte=Yte.hasOwnProperty;function Qte(t){if(t==null)return!0;if(zte(t)&&(Pte(t)||typeof t=="string"||typeof t.splice=="function"||Hte(t)||Fte(t)||qte(t)))return!t.length;var e=Ite(t);if(e==jte||e==Vte)return!t.size;if(Ute(t))return!Bte(t).length;for(var n in t)if(Kte.call(t,n))return!1;return!0}v3.exports=Qte});var w3=x((Eye,x3)=>{"use strict";function Gte(t){return t===void 0}x3.exports=Gte});var A3=x((Dye,k3)=>{"use strict";var $te=gf(),Xte=ks();function Wte(t,e){var n=-1,i=Xte(t)?Array(t.length):[];return $te(t,function(r,s,o){i[++n]=e(r,s,o)}),i}k3.exports=Wte});var T3=x((Mye,O3)=>{"use strict";var Zte=Bm(),Jte=vf(),ene=A3(),tne=ot();function nne(t,e){var n=tne(t)?Zte:ene;return n(t,Jte(e,3))}O3.exports=nne});var E3=x((Nye,C3)=>{"use strict";function ine(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}C3.exports=ine});var M3=x((Rye,D3)=>{"use strict";function rne(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}D3.exports=rne});var R3=x((_ye,N3)=>{"use strict";var sne=E3(),one=gf(),lne=vf(),ane=M3(),cne=ot();function une(t,e,n){var i=cne(t)?sne:ane,r=arguments.length<3;return i(t,lne(e,4),n,r,one)}N3.exports=une});var L3=x((Lye,_3)=>{"use strict";var fne=wo(),hne=ot(),dne=zi(),pne="[object String]";function mne(t){return typeof t=="string"||!hne(t)&&dne(t)&&fne(t)==pne}_3.exports=mne});var I3=x((Bye,B3)=>{"use strict";var gne=ux(),yne=gne("length");B3.exports=yne});var P3=x((Iye,q3)=>{"use strict";var bne="\\ud800-\\udfff",vne="\\u0300-\\u036f",Sne="\\ufe20-\\ufe2f",xne="\\u20d0-\\u20ff",wne=vne+Sne+xne,kne="\\ufe0e\\ufe0f",Ane="\\u200d",One=RegExp("["+Ane+bne+wne+kne+"]");function Tne(t){return One.test(t)}q3.exports=Tne});var Q3=x((qye,K3)=>{"use strict";var H3="\\ud800-\\udfff",Cne="\\u0300-\\u036f",Ene="\\ufe20-\\ufe2f",Dne="\\u20d0-\\u20ff",Mne=Cne+Ene+Dne,Nne="\\ufe0e\\ufe0f",Rne="["+H3+"]",fx="["+Mne+"]",hx="\\ud83c[\\udffb-\\udfff]",_ne="(?:"+fx+"|"+hx+")",U3="[^"+H3+"]",F3="(?:\\ud83c[\\udde6-\\uddff]){2}",j3="[\\ud800-\\udbff][\\udc00-\\udfff]",Lne="\\u200d",V3=_ne+"?",Y3="["+Nne+"]?",Bne="(?:"+Lne+"(?:"+[U3,F3,j3].join("|")+")"+Y3+V3+")*",Ine=Y3+V3+Bne,qne="(?:"+[U3+fx+"?",fx,F3,j3,Rne].join("|")+")",z3=RegExp(hx+"(?="+hx+")|"+qne+Ine,"g");function Pne(t){for(var e=z3.lastIndex=0;z3.test(t);)++e;return e}K3.exports=Pne});var $3=x((Pye,G3)=>{"use strict";var zne=I3(),Hne=P3(),Une=Q3();function Fne(t){return Hne(t)?Une(t):zne(t)}G3.exports=Fne});var W3=x((zye,X3)=>{"use strict";var jne=km(),Vne=Ao(),Yne=ks(),Kne=L3(),Qne=$3(),Gne="[object Map]",$ne="[object Set]";function Xne(t){if(t==null)return 0;if(Yne(t))return Kne(t)?Qne(t):t.length;var e=Vne(t);return e==Gne||e==$ne?t.size:jne(t).length}X3.exports=Xne});var J3=x((Hye,Z3)=>{"use strict";var Wne=vm(),Zne=$S(),Jne=WS(),eie=vf(),tie=Cm(),nie=ot(),iie=wa(),rie=sf(),sie=xs(),oie=df();function lie(t,e,n){var i=nie(t),r=i||iie(t)||oie(t);if(e=eie(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:sie(t)?n=rie(s)?Zne(tie(t)):{}:n={}}return(r?Wne:Jne)(t,function(o,l,a){return e(n,o,l,a)}),n}Z3.exports=lie});var iq=x((Uye,nq)=>{"use strict";var eq=xo(),aie=cf(),cie=ot(),tq=eq?eq.isConcatSpreadable:void 0;function uie(t){return cie(t)||aie(t)||!!(tq&&t&&t[tq])}nq.exports=uie});var oq=x((Fye,sq)=>{"use strict";var fie=Tm(),hie=iq();function rq(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=hie),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?rq(l,e-1,n,i,r):fie(r,l):i||(r[r.length]=l)}return r}sq.exports=rq});var aq=x((jye,lq)=>{"use strict";function die(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}lq.exports=die});var fq=x((Vye,uq)=>{"use strict";var pie=aq(),cq=Math.max;function mie(t,e,n){return e=cq(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=cq(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),pie(t,this,l)}}uq.exports=mie});var pq=x((Yye,dq)=>{"use strict";var gie=XS(),hq=MS(),yie=yf(),bie=hq?function(t,e){return hq(t,"toString",{configurable:!0,enumerable:!1,value:gie(e),writable:!0})}:yie;dq.exports=bie});var gq=x((Kye,mq)=>{"use strict";var vie=800,Sie=16,xie=Date.now;function wie(t){var e=0,n=0;return function(){var i=xie(),r=Sie-(i-n);if(n=i,r>0){if(++e>=vie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}mq.exports=wie});var bq=x((Qye,yq)=>{"use strict";var kie=pq(),Aie=gq(),Oie=Aie(kie);yq.exports=Oie});var Sq=x((Gye,vq)=>{"use strict";var Tie=yf(),Cie=fq(),Eie=bq();function Die(t,e){return Eie(Cie(t,e,Tie),t+"")}vq.exports=Die});var wq=x(($ye,xq)=>{"use strict";function Mie(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}xq.exports=Mie});var Aq=x((Xye,kq)=>{"use strict";function Nie(t){return t!==t}kq.exports=Nie});var Tq=x((Wye,Oq)=>{"use strict";function Rie(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}Oq.exports=Rie});var Eq=x((Zye,Cq)=>{"use strict";var _ie=wq(),Lie=Aq(),Bie=Tq();function Iie(t,e,n){return e===e?Bie(t,e,n):_ie(t,Lie,n)}Cq.exports=Iie});var Mq=x((Jye,Dq)=>{"use strict";var qie=Eq();function Pie(t,e){var n=t==null?0:t.length;return!!n&&qie(t,e,0)>-1}Dq.exports=Pie});var Rq=x((e0e,Nq)=>{"use strict";function zie(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}Nq.exports=zie});var Lq=x((t0e,_q)=>{"use strict";function Hie(){}_q.exports=Hie});var Iq=x((n0e,Bq)=>{"use strict";var dx=FS(),Uie=Lq(),Fie=Nm(),jie=1/0,Vie=dx&&1/Fie(new dx([,-0]))[1]==jie?function(t){return new dx(t)}:Uie;Bq.exports=Vie});var Pq=x((i0e,qq)=>{"use strict";var Yie=ZS(),Kie=Mq(),Qie=Rq(),Gie=JS(),$ie=Iq(),Xie=Nm(),Wie=200;function Zie(t,e,n){var i=-1,r=Kie,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=Qie;else if(s>=Wie){var c=e?null:$ie(t);if(c)return Xie(c);o=!1,r=Gie,a=new Yie}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var h=a.length;h--;)if(a[h]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}qq.exports=Zie});var Hq=x((r0e,zq)=>{"use strict";var Jie=ks(),ere=zi();function tre(t){return ere(t)&&Jie(t)}zq.exports=tre});var Fq=x((s0e,Uq)=>{"use strict";var nre=oq(),ire=Sq(),rre=Pq(),sre=Hq(),ore=ire(function(t){return rre(nre(t,1,sre,!0))});Uq.exports=ore});var Vq=x((o0e,jq)=>{"use strict";var lre=Bm();function are(t,e){return lre(e,function(n){return t[n]})}jq.exports=are});var Kq=x((l0e,Yq)=>{"use strict";var cre=Vq(),ure=As();function fre(t){return t==null?[]:cre(t,ure(t))}Yq.exports=fre});var Sn=x((a0e,Qq)=>{"use strict";var Im;if(typeof xx=="function")try{Im={clone:CB(),constant:XS(),each:jB(),filter:p3(),has:b3(),isArray:ot(),isEmpty:S3(),isFunction:sf(),isUndefined:w3(),keys:As(),map:T3(),reduce:R3(),size:W3(),transform:J3(),union:Fq(),values:Kq()}}catch{}Im||(Im=window._);Qq.exports=Im});var qm=x((u0e,Wq)=>{"use strict";var G=Sn();Wq.exports=Z;var hre="\0",Oo="\0",Gq="";function Z(t){this._isDirected=G.has(t,"directed")?t.directed:!0,this._isMultigraph=G.has(t,"multigraph")?t.multigraph:!1,this._isCompound=G.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=G.constant(void 0),this._defaultEdgeLabelFn=G.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Oo]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}Z.prototype._nodeCount=0;Z.prototype._edgeCount=0;Z.prototype.isDirected=function(){return this._isDirected};Z.prototype.isMultigraph=function(){return this._isMultigraph};Z.prototype.isCompound=function(){return this._isCompound};Z.prototype.setGraph=function(t){return this._label=t,this};Z.prototype.graph=function(){return this._label};Z.prototype.setDefaultNodeLabel=function(t){return G.isFunction(t)||(t=G.constant(t)),this._defaultNodeLabelFn=t,this};Z.prototype.nodeCount=function(){return this._nodeCount};Z.prototype.nodes=function(){return G.keys(this._nodes)};Z.prototype.sources=function(){var t=this;return G.filter(this.nodes(),function(e){return G.isEmpty(t._in[e])})};Z.prototype.sinks=function(){var t=this;return G.filter(this.nodes(),function(e){return G.isEmpty(t._out[e])})};Z.prototype.setNodes=function(t,e){var n=arguments,i=this;return G.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};Z.prototype.setNode=function(t,e){return G.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Oo,this._children[t]={},this._children[Oo][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};Z.prototype.node=function(t){return this._nodes[t]};Z.prototype.hasNode=function(t){return G.has(this._nodes,t)};Z.prototype.removeNode=function(t){var e=this;if(G.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],G.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),G.each(G.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],G.each(G.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};Z.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(G.isUndefined(e))e=Oo;else{e+="";for(var n=e;!G.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};Z.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};Z.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Oo)return e}};Z.prototype.children=function(t){if(G.isUndefined(t)&&(t=Oo),this._isCompound){var e=this._children[t];if(e)return G.keys(e)}else{if(t===Oo)return this.nodes();if(this.hasNode(t))return[]}};Z.prototype.predecessors=function(t){var e=this._preds[t];if(e)return G.keys(e)};Z.prototype.successors=function(t){var e=this._sucs[t];if(e)return G.keys(e)};Z.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return G.union(e,this.successors(t))};Z.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};Z.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;G.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),G.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&G.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};Z.prototype.setDefaultEdgeLabel=function(t){return G.isFunction(t)||(t=G.constant(t)),this._defaultEdgeLabelFn=t,this};Z.prototype.edgeCount=function(){return this._edgeCount};Z.prototype.edges=function(){return G.values(this._edgeObjs)};Z.prototype.setPath=function(t,e){var n=this,i=arguments;return G.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};Z.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,G.isUndefined(n)||(n=""+n);var o=Sf(this._isDirected,t,e,n);if(G.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!G.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=dre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,$q(this._preds[e],t),$q(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};Z.prototype.edge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):Sf(this._isDirected,t,e,n);return this._edgeLabels[i]};Z.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):Sf(this._isDirected,t,e,n);return G.has(this._edgeLabels,i)};Z.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):Sf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Xq(this._preds[e],t),Xq(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};Z.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=G.values(n);return e?G.filter(i,function(r){return r.v===e}):i}};Z.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=G.values(n);return e?G.filter(i,function(r){return r.w===e}):i}};Z.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function $q(t,e){t[e]?t[e]++:t[e]=1}function Xq(t,e){--t[e]||delete t[e]}function Sf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+Gq+s+Gq+(G.isUndefined(i)?hre:i)}function dre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function px(t,e){return Sf(t,e.v,e.w,e.name)}});var Jq=x((f0e,Zq)=>{"use strict";Zq.exports="2.1.8"});var t4=x((h0e,e4)=>{"use strict";e4.exports={Graph:qm(),version:Jq()}});var i4=x((d0e,n4)=>{"use strict";var Hi=Sn(),pre=qm();n4.exports={write:mre,read:bre};function mre(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:gre(t),edges:yre(t)};return Hi.isUndefined(t.graph())||(e.value=Hi.clone(t.graph())),e}function gre(t){return Hi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Hi.isUndefined(n)||(r.value=n),Hi.isUndefined(i)||(r.parent=i),r})}function yre(t){return Hi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Hi.isUndefined(e.name)||(i.name=e.name),Hi.isUndefined(n)||(i.value=n),i})}function bre(t){var e=new pre(t.options).setGraph(t.value);return Hi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Hi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var s4=x((p0e,r4)=>{"use strict";var Pm=Sn();r4.exports=vre;function vre(t){var e={},n=[],i;function r(s){Pm.has(e,s)||(e[s]=!0,i.push(s),Pm.each(t.successors(s),r),Pm.each(t.predecessors(s),r))}return Pm.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var mx=x((m0e,l4)=>{"use strict";var o4=Sn();l4.exports=Fn;function Fn(){this._arr=[],this._keyIndices={}}Fn.prototype.size=function(){return this._arr.length};Fn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Fn.prototype.has=function(t){return o4.has(this._keyIndices,t)};Fn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Fn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Fn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!o4.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Fn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Fn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Fn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Fn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Fn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var gx=x((g0e,a4)=>{"use strict";var Sre=Sn(),xre=mx();a4.exports=kre;var wre=Sre.constant(1);function kre(t,e,n,i){return Are(t,String(e),n||wre,i||function(r){return t.outEdges(r)})}function Are(t,e,n,i){var r={},s=new xre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],h=n(c),d=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);d<f.distance&&(f.distance=d,f.predecessor=o,s.decrease(u,d))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var u4=x((y0e,c4)=>{"use strict";var Ore=gx(),Tre=Sn();c4.exports=Cre;function Cre(t,e,n){return Tre.transform(t.nodes(),function(i,r){i[r]=Ore(t,r,e,n)},{})}});var yx=x((b0e,h4)=>{"use strict";var f4=Sn();h4.exports=Ere;function Ere(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){f4.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){f4.has(i,o)||s(o)}),r}});var p4=x((v0e,d4)=>{"use strict";var Dre=Sn(),Mre=yx();d4.exports=Nre;function Nre(t){return Dre.filter(Mre(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var g4=x((S0e,m4)=>{"use strict";var Rre=Sn();m4.exports=Lre;var _re=Rre.constant(1);function Lre(t,e,n){return Bre(t,e||_re,n||function(i){return t.outEdges(i)})}function Bre(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],h=a[c],d=u.distance+f.distance;d<h.distance&&(h.distance=d,h.predecessor=f.predecessor)})})}),i}});var bx=x((x0e,b4)=>{"use strict";var xf=Sn();b4.exports=y4;y4.CycleException=zm;function y4(t){var e={},n={},i=[];function r(s){if(xf.has(n,s))throw new zm;xf.has(e,s)||(n[s]=!0,e[s]=!0,xf.each(t.predecessors(s),r),delete n[s],i.push(s))}if(xf.each(t.sinks(),r),xf.size(e)!==t.nodeCount())throw new zm;return i}function zm(){}zm.prototype=new Error});var x4=x((w0e,S4)=>{"use strict";var v4=bx();S4.exports=Ire;function Ire(t){try{v4(t)}catch(e){if(e instanceof v4.CycleException)return!1;throw e}return!0}});var vx=x((k0e,k4)=>{"use strict";var Hm=Sn();k4.exports=qre;function qre(t,e,n){Hm.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return Hm.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);w4(t,o,n==="post",s,i,r)}),r}function w4(t,e,n,i,r,s){Hm.has(i,e)||(i[e]=!0,n||s.push(e),Hm.each(r(e),function(o){w4(t,o,n,i,r,s)}),n&&s.push(e))}});var O4=x((A0e,A4)=>{"use strict";var Pre=vx();A4.exports=zre;function zre(t,e){return Pre(t,e,"post")}});var C4=x((O0e,T4)=>{"use strict";var Hre=vx();T4.exports=Ure;function Ure(t,e){return Hre(t,e,"pre")}});var M4=x((T0e,D4)=>{"use strict";var E4=Sn(),Fre=qm(),jre=mx();D4.exports=Vre;function Vre(t,e){var n=new Fre,i={},r=new jre,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;E4.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),E4.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var R4=x((C0e,N4)=>{"use strict";N4.exports={components:s4(),dijkstra:gx(),dijkstraAll:u4(),findCycles:p4(),floydWarshall:g4(),isAcyclic:x4(),postorder:O4(),preorder:C4(),prim:M4(),tarjan:yx(),topsort:bx()}});var B4=x((E0e,L4)=>{"use strict";var _4=t4();L4.exports={Graph:_4.Graph,json:i4(),alg:R4(),version:_4.version}});var nse={};Y4(nse,{mountSpecEditorDemo:()=>Sx});var Ta=Ve(di()),P4=Ve(iT());var oT="#000000";function Wr(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function V(t){return t==null?"":String(t)}function rT(t){return Array.isArray(t)?t.map(e=>V(e)).filter(e=>e.length>0):t==null||t===""?[]:[V(t)]}function Jh(t){return t==null||t===""}function E0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var lT=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],aT=["clockwise","counterclockwise"],cT=["horizontal","vertical"],D0=["solid","dashed","dotted"],q6=["small","normal","large"],qc=[{key:"size",kind:"enum",options:q6,label:"Size"},{key:"color",kind:"color",label:"Color"}],P6=["none","togroup","fromgroup"];function sT(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var z6=["hideDisconnected","hideDisconnectedBuiltIns"],H6={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:lT,help:"Where the target sits relative to the source."}],summary(t){let e=rT(t.directions),n=V(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=rT(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(E0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(E0("directions","Cannot be both left and right.")),e}},U6={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:aT,default:"clockwise"}],summary(t){let e=V(t.direction)||"clockwise",n=V(t.selector);return n?`${e} \xB7 ${n}`:e}},F6={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:cT,default:"horizontal"}],summary(t){let e=V(t.direction)||"horizontal",n=V(t.selector);return n?`${e} \xB7 ${n}`:e}},j6={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"addEdge",kind:"enum",label:"Add edge",options:P6,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=V(t.selector),n=V(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:V(t.selector)};Jh(t.name)||(e.name=V(t.name));let n=sT(t.addEdge);if(n!=="none"&&(e.addEdge=n),Wr(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!Wr(t))return null;let e=t.group;if(!Wr(e)||e.field!==void 0)return null;let n={selector:V(e.selector),addEdge:sT(e.addEdge)};return e.name!==void 0&&(n.name=V(e.name)),Wr(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),n}},V6={kind:"constraint",type:"groupfield",label:"Group (by field)",description:"Group elements based on a field. Deprecated \u2014 prefer Group (by selector).",deprecated:!0,deprecatedInFavorOf:"groupselector",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"groupOn",kind:"number",label:"Group on (index)",required:!0,default:0},{key:"addToGroup",kind:"number",label:"Add to group (index)",required:!0,default:1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.field),n=e?`group on "${e}"`:"group on field",i=V(t.selector);return i?`${n} \xB7 ${i}`:n},toYamlNode(t){let e={field:V(t.field),groupOn:typeof t.groupOn=="number"?t.groupOn:Number(t.groupOn??0),addToGroup:typeof t.addToGroup=="number"?t.addToGroup:Number(t.addToGroup??1)};return Jh(t.selector)||(e.selector=V(t.selector)),t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!Wr(t))return null;let e=t.group;if(!Wr(e)||e.field===void 0)return null;let n={field:V(e.field),groupOn:typeof e.groupOn=="number"?e.groupOn:Number(e.groupOn??0),addToGroup:typeof e.addToGroup=="number"?e.addToGroup:Number(e.addToGroup??1)};return e.selector!==void 0&&(n.selector=V(e.selector)),e.hold!==void 0&&(n.hold=e.hold),n}},Y6={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=Jh(t.width)?"?":V(t.width),n=Jh(t.height)?"?":V(t.height),i=V(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(E0(n,`${n} must be greater than 0.`))}return e}},K6={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=V(t.selector);return e?`hide \xB7 ${e}`:"hide"}},Q6={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:z6,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return V(t.flag)||"(no flag)"},toYamlNode(t){return{flag:V(t.flag)}},fromYamlNode(t){if(!Wr(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:Wr(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},G6={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:qc}],summary(t){let e=V(t.field),n=V(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},$6={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=V(t.field),n=V(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},X6={kind:"directive",type:"icon",label:"Icon",description:"Render matching atoms with an icon.",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.path),n=V(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},W6={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:oT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.value),n=V(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},uT=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:D0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],Z6=[{key:"color",kind:"color",label:"Color"}],J6=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],e8={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:uT},{key:"textStyle",kind:"group",label:"Text style",children:qc},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=V(t.field),n=t.lineStyle??{},i=V(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=V(t.selector);return s?`${r} \xB7 ${s}`:r}},t8={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:Z6},{key:"borderStyle",kind:"group",label:"Border style",children:J6},{key:"textStyle",kind:"group",label:"Text style",children:qc}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=V(e.color)||V(n.color),r=V(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},n8={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:oT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:D0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=V(t.field),n=V(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=V(t.selector);return r?`${i} \xB7 ${r}`:i}},i8={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:uT},{key:"textStyle",kind:"group",label:"Text style",children:qc}],summary(t){let e=V(t.name),n=V(t.selector),i=t.lineStyle??{},r=V(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},r8={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:qc}],summary(t){let e=V(t.name),n=V(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},M0=[H6,U6,F6,j6,V6,Y6,K6,Q6,G6,$6,X6,t8,W6,e8,n8,i8,r8],fT=new Map(M0.map(t=>[t.type,t])),s8={groupselector:"group",groupfield:"group"};function o8(t){return s8[t]??t}var hT=(()=>{let t=new Map;for(let e of M0){let n=o8(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function N0(t){return hT.get(t)??[]}function ed(t){return hT.has(t)}function Bt(t){return fT.get(t)}function R0(t,e={}){let n=e.includeDeprecated??!1;return M0.filter(i=>i.kind===t&&(n||!i.deprecated))}function _0(t){let e=fT.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function ET(t){return typeof t>"u"||t===null}function l8(t){return typeof t=="object"&&t!==null}function a8(t){return Array.isArray(t)?t:ET(t)?[]:[t]}function c8(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function u8(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function f8(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var h8=ET,d8=l8,p8=a8,m8=u8,g8=f8,y8=c8,rt={isNothing:h8,isObject:d8,toArray:p8,repeat:m8,isNegativeZero:g8,extend:y8};function DT(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
8
+ `+n.stack}}function Tn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function V5(t){var e=jk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function gh(t){t._valueTracker||(t._valueTracker=V5(t))}function Vk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=jk(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function yh(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}}var Y5=/[\n"\\]/g;function Dn(t){return t.replace(Y5,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Zg(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Tn(e)):t.value!==""+Tn(e)&&(t.value=""+Tn(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?Jg(t,o,Tn(e)):n!=null?Jg(t,o,Tn(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+Tn(l):t.removeAttribute("name")}function Yk(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+Tn(n):"",e=e!=null?""+Tn(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function Jg(t,e,n){e==="number"&&yh(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function rl(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+Tn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Kk(t,e,n){if(e!=null&&(e=""+Tn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+Tn(n):""}function Qk(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(C(92));if(Ga(i)){if(1<i.length)throw Error(C(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=Tn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function dl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var K5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dw(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||K5.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function $k(t,e,n){if(e!=null&&typeof e!="object")throw Error(C(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&dw(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&dw(t,s,e[s])}function Vy(t){if(t.indexOf("-")===-1)return!1;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 Q5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function eh(t){return $5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var ey=null;function Yy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var $o=null,sl=null;function pw(t){var e=kl(t);if(e&&(t=e.stateNode)){var n=t[Xt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Zg(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Dn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Xt]||null;if(!r)throw Error(C(90));Zg(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&Vk(i)}break e;case"textarea":Kk(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&rl(t,!!n.multiple,e,!1)}}}var yg=!1;function Gk(t,e,n){if(yg)return t(e,n);yg=!0;try{var i=t(e);return i}finally{if(yg=!1,($o!==null||sl!==null)&&(Zh(),$o&&(e=$o,t=sl,sl=$o=null,pw(e),t)))for(e=0;e<t.length;e++)pw(t[e])}}function dc(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Xt]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(C(231,e,typeof n));return n}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ty=!1;if(or)try{zo={},Object.defineProperty(zo,"passive",{get:function(){ty=!0}}),window.addEventListener("test",zo,zo),window.removeEventListener("test",zo,zo)}catch{ty=!1}var zo,Ur=null,Ky=null,th=null;function Xk(){if(th)return th;var t,e=Ky,n=e.length,i,r="value"in Ur?Ur.value:Ur.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return th=r.slice(t,1<i?1-i:void 0)}function nh(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Hf(){return!0}function mw(){return!1}function Wt(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Hf:mw,this.isPropagationStopped=mw,this}return De(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hf)},persist:function(){},isPersistent:Hf}),e}var $s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jh=Wt($s),Nc=De({},$s,{view:0,detail:0}),G5=Wt(Nc),bg,vg,Ua,Vh=De({},Nc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qy,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ua&&(Ua&&t.type==="mousemove"?(bg=t.screenX-Ua.screenX,vg=t.screenY-Ua.screenY):vg=bg=0,Ua=t),bg)},movementY:function(t){return"movementY"in t?t.movementY:vg}}),gw=Wt(Vh),X5=De({},Vh,{dataTransfer:0}),W5=Wt(X5),Z5=De({},Nc,{relatedTarget:0}),Sg=Wt(Z5),J5=De({},$s,{animationName:0,elapsedTime:0,pseudoElement:0}),eP=Wt(J5),tP=De({},$s,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),nP=Wt(tP),iP=De({},$s,{data:0}),yw=Wt(iP),rP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},oP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lP(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=oP[t])?!!e[t]:!1}function Qy(){return lP}var aP=De({},Nc,{key:function(t){if(t.key){var e=rP[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=nh(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?sP[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qy,charCode:function(t){return t.type==="keypress"?nh(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?nh(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),cP=Wt(aP),uP=De({},Vh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bw=Wt(uP),fP=De({},Nc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qy}),hP=Wt(fP),dP=De({},$s,{propertyName:0,elapsedTime:0,pseudoElement:0}),pP=Wt(dP),mP=De({},Vh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),gP=Wt(mP),yP=De({},$s,{newState:0,oldState:0}),bP=Wt(yP),vP=[9,13,27,32],$y=or&&"CompositionEvent"in window,Za=null;or&&"documentMode"in document&&(Za=document.documentMode);var SP=or&&"TextEvent"in window&&!Za,Wk=or&&(!$y||Za&&8<Za&&11>=Za),vw=" ",Sw=!1;function Zk(t,e){switch(t){case"keyup":return vP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Go=!1;function xP(t,e){switch(t){case"compositionend":return Jk(e);case"keypress":return e.which!==32?null:(Sw=!0,vw);case"textInput":return t=e.data,t===vw&&Sw?null:t;default:return null}}function wP(t,e){if(Go)return t==="compositionend"||!$y&&Zk(t,e)?(t=Xk(),th=Ky=Ur=null,Go=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Wk&&e.locale!=="ko"?null:e.data;default:return null}}var kP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!kP[t.type]:e==="textarea"}function eA(t,e,n,i){$o?sl?sl.push(i):sl=[i]:$o=i,e=Bh(e,"onChange"),0<e.length&&(n=new jh("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Ja=null,pc=null;function AP(t){KO(t,0)}function Yh(t){var e=Xa(t);if(Vk(e))return t}function ww(t,e){if(t==="change")return e}var tA=!1;or&&(or?(Ff="oninput"in document,Ff||(xg=document.createElement("div"),xg.setAttribute("oninput","return;"),Ff=typeof xg.oninput=="function"),Uf=Ff):Uf=!1,tA=Uf&&(!document.documentMode||9<document.documentMode));var Uf,Ff,xg;function kw(){Ja&&(Ja.detachEvent("onpropertychange",nA),pc=Ja=null)}function nA(t){if(t.propertyName==="value"&&Yh(pc)){var e=[];eA(e,pc,t,Yy(t)),Gk(AP,e)}}function OP(t,e,n){t==="focusin"?(kw(),Ja=e,pc=n,Ja.attachEvent("onpropertychange",nA)):t==="focusout"&&kw()}function TP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Yh(pc)}function CP(t,e){if(t==="click")return Yh(e)}function EP(t,e){if(t==="input"||t==="change")return Yh(e)}function DP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pn=typeof Object.is=="function"?Object.is:DP;function mc(t,e){if(pn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Xg.call(e,r)||!pn(t[r],e[r]))return!1}return!0}function Aw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ow(t,e){var n=Aw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Aw(n)}}function iA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?iA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function rA(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=yh(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=yh(t.document)}return e}function Gy(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")}var MP=or&&"documentMode"in document&&11>=document.documentMode,Xo=null,ny=null,ec=null,iy=!1;function Tw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;iy||Xo==null||Xo!==yh(i)||(i=Xo,"selectionStart"in i&&Gy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ec&&mc(ec,i)||(ec=i,i=Bh(ny,"onSelect"),0<i.length&&(e=new jh("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Xo)))}function Rs(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Wo={animationend:Rs("Animation","AnimationEnd"),animationiteration:Rs("Animation","AnimationIteration"),animationstart:Rs("Animation","AnimationStart"),transitionrun:Rs("Transition","TransitionRun"),transitionstart:Rs("Transition","TransitionStart"),transitioncancel:Rs("Transition","TransitionCancel"),transitionend:Rs("Transition","TransitionEnd")},wg={},sA={};or&&(sA=document.createElement("div").style,"AnimationEvent"in window||(delete Wo.animationend.animation,delete Wo.animationiteration.animation,delete Wo.animationstart.animation),"TransitionEvent"in window||delete Wo.transitionend.transition);function Gs(t){if(wg[t])return wg[t];if(!Wo[t])return t;var e=Wo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in sA)return wg[t]=e[n];return t}var oA=Gs("animationend"),lA=Gs("animationiteration"),aA=Gs("animationstart"),NP=Gs("transitionrun"),RP=Gs("transitionstart"),_P=Gs("transitioncancel"),cA=Gs("transitionend"),uA=new Map,ry="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ry.push("scrollEnd");function Xn(t,e){uA.set(t,e),Qs(e,[t])}var Cw=new WeakMap;function Mn(t,e){if(typeof t=="object"&&t!==null){var n=Cw.get(t);return n!==void 0?n:(e={value:t,source:e,stack:hw(e)},Cw.set(t,e),e)}return{value:t,source:e,stack:hw(e)}}var On=[],Zo=0,Xy=0;function Kh(){for(var t=Zo,e=Xy=Zo=0;e<t;){var n=On[e];On[e++]=null;var i=On[e];On[e++]=null;var r=On[e];On[e++]=null;var s=On[e];if(On[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&fA(n,r,s)}}function Qh(t,e,n,i){On[Zo++]=t,On[Zo++]=e,On[Zo++]=n,On[Zo++]=i,Xy|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Wy(t,e,n,i){return Qh(t,e,n,i),bh(t)}function Al(t,e){return Qh(t,null,null,e),bh(t)}function fA(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-fn(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function bh(t){if(50<uc)throw uc=0,Oy=null,Error(C(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Jo={};function LP(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,e,n,i){return new LP(t,e,n,i)}function Zy(t){return t=t.prototype,!(!t||!t.isReactComponent)}function rr(t,e){var n=t.alternate;return n===null?(n=cn(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&65011712,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.refCleanup=t.refCleanup,n}function hA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function ih(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")Zy(t)&&(o=1);else if(typeof t=="string")o=L6(t,n,wi.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Kg:return t=cn(31,n,e,r),t.elementType=Kg,t.lanes=s,t;case Yo:return qs(n.children,r,s,e);case Nk:o=8,r|=24;break;case jg:return t=cn(12,n,e,r|2),t.elementType=jg,t.lanes=s,t;case Vg:return t=cn(13,n,e,r),t.elementType=Vg,t.lanes=s,t;case Yg:return t=cn(19,n,e,r),t.elementType=Yg,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A5:case Ji:o=10;break e;case Rk:o=9;break e;case Py:o=11;break e;case zy:o=14;break e;case Lr:o=16,i=null;break e}o=29,n=Error(C(130,t===null?"null":typeof t,"")),i=null}return e=cn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function qs(t,e,n,i){return t=cn(7,t,i,e),t.lanes=n,t}function kg(t,e,n){return t=cn(6,t,null,e),t.lanes=n,t}function Ag(t,e,n){return e=cn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var el=[],tl=0,vh=null,Sh=0,Cn=[],En=0,Ps=null,er=1,tr="";function Ls(t,e){el[tl++]=Sh,el[tl++]=vh,vh=t,Sh=e}function dA(t,e,n){Cn[En++]=er,Cn[En++]=tr,Cn[En++]=Ps,Ps=t;var i=er;t=tr;var r=32-fn(i)-1;i&=~(1<<r),n+=1;var s=32-fn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,er=1<<32-fn(e)+r|n<<r|i,tr=s+t}else er=1<<s|n<<r|i,tr=t}function Jy(t){t.return!==null&&(Ls(t,1),dA(t,1,0))}function e0(t){for(;t===vh;)vh=el[--tl],el[tl]=null,Sh=el[--tl],el[tl]=null;for(;t===Ps;)Ps=Cn[--En],Cn[En]=null,tr=Cn[--En],Cn[En]=null,er=Cn[--En],Cn[En]=null}var Bt=null,Ue=null,he=!1,zs=null,Si=!1,sy=Error(C(519));function js(t){var e=Error(C(418,""));throw gc(Mn(e,t)),sy}function Ew(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[At]=t,e[Xt]=i,n){case"dialog":te("cancel",e),te("close",e);break;case"iframe":case"object":case"embed":te("load",e);break;case"video":case"audio":for(n=0;n<vc.length;n++)te(vc[n],e);break;case"source":te("error",e);break;case"img":case"image":case"link":te("error",e),te("load",e);break;case"details":te("toggle",e);break;case"input":te("invalid",e),Yk(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),gh(e);break;case"select":te("invalid",e);break;case"textarea":te("invalid",e),Qk(e,i.value,i.defaultValue,i.children),gh(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||$O(e.textContent,n)?(i.popover!=null&&(te("beforetoggle",e),te("toggle",e)),i.onScroll!=null&&te("scroll",e),i.onScrollEnd!=null&&te("scrollend",e),i.onClick!=null&&(e.onclick=td),e=!0):e=!1,e||js(t)}function Dw(t){for(Bt=t.return;Bt;)switch(Bt.tag){case 5:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:Bt=Bt.return}}function Fa(t){if(t!==Bt)return!1;if(!he)return Dw(t),he=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Ny(t.type,t.memoizedProps)),n=!n),n&&Ue&&js(t),Dw(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(C(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){Ue=Gn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}Ue=null}}else e===27?(e=Ue,ns(t.type)?(t=Ly,Ly=null,Ue=t):Ue=e):Ue=Bt?Gn(t.stateNode.nextSibling):null;return!0}function Rc(){Ue=Bt=null,he=!1}function Mw(){var t=zs;return t!==null&&(Gt===null?Gt=t:Gt.push.apply(Gt,t),zs=null),t}function gc(t){zs===null?zs=[t]:zs.push(t)}var oy=Oi(null),Xs=null,nr=null;function Ir(t,e,n){Be(oy,e._currentValue),e._currentValue=n}function sr(t){t._currentValue=oy.current,ut(oy)}function ly(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ay(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ly(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(C(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ly(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function _c(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(C(387));if(o=o.memoizedProps,o!==null){var l=r.type;pn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===hh.current){if(o=r.alternate,o===null)throw Error(C(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(wc):t=[wc])}r=r.return}t!==null&&ay(e,t,n,i),e.flags|=262144}function xh(t){for(t=t.firstContext;t!==null;){if(!pn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Vs(t){Xs=t,nr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ot(t){return pA(Xs,t)}function jf(t,e){return Xs===null&&Vs(t),pA(t,e)}function pA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},nr===null){if(t===null)throw Error(C(308));nr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else nr=nr.next=e;return n}var BP=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},IP=tt.unstable_scheduleCallback,qP=tt.unstable_NormalPriority,Je={$$typeof:Ji,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function t0(){return{controller:new BP,data:new Map,refCount:0}}function Lc(t){t.refCount--,t.refCount===0&&IP(qP,function(){t.controller.abort()})}var tc=null,cy=0,pl=0,ol=null;function PP(t,e){if(tc===null){var n=tc=[];cy=0,pl=A0(),ol={status:"pending",value:void 0,then:function(i){n.push(i)}}}return cy++,e.then(Nw,Nw),e}function Nw(){if(--cy===0&&tc!==null){ol!==null&&(ol.status="fulfilled");var t=tc;tc=null,pl=0,ol=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function zP(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var Rw=j.S;j.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&PP(t,e),Rw!==null&&Rw(t,e)};var Hs=Oi(null);function n0(){var t=Hs.current;return t!==null?t:Oe.pooledCache}function rh(t,e){e===null?Be(Hs,Hs.current):Be(Hs,e.pool)}function mA(){var t=n0();return t===null?null:{parent:Je._currentValue,pool:t}}var Bc=Error(C(460)),gA=Error(C(474)),$h=Error(C(542)),uy={then:function(){}};function _w(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Vf(){}function yA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Vf,Vf),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Bw(t),t;default:if(typeof e.status=="string")e.then(Vf,Vf);else{if(t=Oe,t!==null&&100<t.shellSuspendCounter)throw Error(C(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Bw(t),t}throw nc=e,Bc}}var nc=null;function Lw(){if(nc===null)throw Error(C(459));var t=nc;return nc=null,t}function Bw(t){if(t===Bc||t===$h)throw Error(C(483))}var Br=!1;function i0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fy(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Yr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ye&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=bh(t),fA(t,null,n),e}return Qh(t,i,e,n),bh(t)}function ic(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,zk(t,n)}}function Og(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var hy=!1;function rc(){if(hy){var t=ol;if(t!==null)throw t}}function sc(t,e,n,i){hy=!1;var r=t.updateQueue;Br=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var h=l.lane&-536870913,d=h!==l.lane;if(d?(ce&h)===h:(i&h)===h){h!==0&&h===pl&&(hy=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=t,g=l;h=e;var b=n;switch(g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(b,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(b,f,h):m,h==null)break e;f=De({},f,h);break e;case 2:Br=!0}}h=l.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=d,a=f):u=u.next=d,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;d=l,l=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),es|=o,t.lanes=o,t.memoizedState=f}}function bA(t,e){if(typeof t!="function")throw Error(C(191,t));t.call(e)}function vA(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)bA(n[t],e)}var ml=Oi(null),wh=Oi(0);function Iw(t,e){t=cr,Be(wh,t),Be(ml,e),cr=t|e.baseLanes}function dy(){Be(wh,cr),Be(ml,ml.current)}function r0(){cr=wh.current,ut(ml),ut(wh)}var Zr=0,X=null,Se=null,Ge=null,kh=!1,ll=!1,Ys=!1,Ah=0,yc=0,al=null,HP=0;function Ye(){throw Error(C(321))}function s0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!pn(t[n],e[n]))return!1;return!0}function o0(t,e,n,i,r,s){return Zr=s,X=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,j.H=t===null||t.memoizedState===null?XA:WA,Ys=!1,s=n(i,r),Ys=!1,ll&&(s=xA(e,n,i,r)),SA(t),s}function SA(t){j.H=Oh;var e=Se!==null&&Se.next!==null;if(Zr=0,Ge=Se=X=null,kh=!1,yc=0,al=null,e)throw Error(C(300));t===null||ct||(t=t.dependencies,t!==null&&xh(t)&&(ct=!0))}function xA(t,e,n,i){X=t;var r=0;do{if(ll&&(al=null),yc=0,ll=!1,25<=r)throw Error(C(301));if(r+=1,Ge=Se=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}j.H=QP,s=e(n,i)}while(ll);return s}function UP(){var t=j.H,e=t.useState()[0];return e=typeof e.then=="function"?Ic(e):e,t=t.useState()[0],(Se!==null?Se.memoizedState:null)!==t&&(X.flags|=1024),e}function l0(){var t=Ah!==0;return Ah=0,t}function a0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function c0(t){if(kh){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}kh=!1}Zr=0,Ge=Se=X=null,ll=!1,yc=Ah=0,al=null}function Qt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?X.memoizedState=Ge=t:Ge=Ge.next=t,Ge}function Xe(){if(Se===null){var t=X.alternate;t=t!==null?t.memoizedState:null}else t=Se.next;var e=Ge===null?X.memoizedState:Ge.next;if(e!==null)Ge=e,Se=t;else{if(t===null)throw X.alternate===null?Error(C(467)):Error(C(310));Se=t,t={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},Ge===null?X.memoizedState=Ge=t:Ge=Ge.next=t}return Ge}function u0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ic(t){var e=yc;return yc+=1,al===null&&(al=[]),t=yA(al,t,e),e=X,(Ge===null?e.memoizedState:Ge.next)===null&&(e=e.alternate,j.H=e===null||e.memoizedState===null?XA:WA),t}function Gh(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ic(t);if(t.$$typeof===Ji)return Ot(t)}throw Error(C(438,String(t)))}function f0(t){var e=null,n=X.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=X.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=u0(),X.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=O5;return e.index++,n}function lr(t,e){return typeof e=="function"?e(t):e}function sh(t){var e=Xe();return h0(e,Se,t)}function h0(t,e,n){var i=t.queue;if(i===null)throw Error(C(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(ce&f)===f:(Zr&f)===f){var h=c.revertLane;if(h===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===pl&&(u=!0);else if((Zr&h)===h){c=c.next,h===pl&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,X.lanes|=h,es|=h;f=c.action,Ys&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=h,o=s):a=a.next=h,X.lanes|=f,es|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!pn(s,t.memoizedState)&&(ct=!0,u&&(n=ol,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Tg(t){var e=Xe(),n=e.queue;if(n===null)throw Error(C(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);pn(s,e.memoizedState)||(ct=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function wA(t,e,n){var i=X,r=Xe(),s=he;if(s){if(n===void 0)throw Error(C(407));n=n()}else n=e();var o=!pn((Se||r).memoizedState,n);o&&(r.memoizedState=n,ct=!0),r=r.queue;var l=OA.bind(null,i,r,t);if(qc(2048,8,l,[t]),r.getSnapshot!==e||o||Ge!==null&&Ge.memoizedState.tag&1){if(i.flags|=2048,gl(9,Xh(),AA.bind(null,i,r,n,e),null),Oe===null)throw Error(C(349));s||(Zr&124)!==0||kA(i,e,n)}return n}function kA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=X.updateQueue,e===null?(e=u0(),X.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function AA(t,e,n,i){e.value=n,e.getSnapshot=i,TA(e)&&CA(t)}function OA(t,e,n){return n(function(){TA(e)&&CA(t)})}function TA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!pn(t,n)}catch{return!0}}function CA(t){var e=Al(t,2);e!==null&&dn(e,t,2)}function py(t){var e=Qt();if(typeof t=="function"){var n=t;if(t=n(),Ys){Hr(!0);try{n()}finally{Hr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:t},e}function EA(t,e,n,i){return t.baseState=n,h0(t,Se,typeof i=="function"?i:lr)}function FP(t,e,n,i,r){if(Wh(t))throw Error(C(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};j.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,DA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function DA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=j.T,o={};j.T=o;try{var l=n(r,i),a=j.S;a!==null&&a(o,l),qw(t,e,l)}catch(c){my(t,e,c)}finally{j.T=s}}else try{s=n(r,i),qw(t,e,s)}catch(c){my(t,e,c)}}function qw(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Pw(t,e,i)},function(i){return my(t,e,i)}):Pw(t,e,n)}function Pw(t,e,n){e.status="fulfilled",e.value=n,MA(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,DA(t,n)))}function my(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,MA(e),e=e.next;while(e!==i)}t.action=null}function MA(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function NA(t,e){return e}function zw(t,e){if(he){var n=Oe.formState;if(n!==null){e:{var i=X;if(he){if(Ue){t:{for(var r=Ue,s=Si;r.nodeType!==8;){if(!s){r=null;break t}if(r=Gn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){Ue=Gn(r.nextSibling),i=r.data==="F!";break e}}js(i)}i=!1}i&&(e=n[0])}}return n=Qt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:NA,lastRenderedState:e},n.queue=i,n=QA.bind(null,X,i),i.dispatch=n,i=py(!1),s=g0.bind(null,X,!1,i.queue),i=Qt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=FP.bind(null,X,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function Hw(t){var e=Xe();return RA(e,Se,t)}function RA(t,e,n){if(e=h0(t,e,NA)[0],t=sh(lr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Ic(e)}catch(o){throw o===Bc?$h:o}else i=e;e=Xe();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(X.flags|=2048,gl(9,Xh(),jP.bind(null,r,n),null)),[i,s,t]}function jP(t,e){t.action=e}function Uw(t){var e=Xe(),n=Se;if(n!==null)return RA(e,n,t);Xe(),e=e.memoizedState,n=Xe();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function gl(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=X.updateQueue,e===null&&(e=u0(),X.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Xh(){return{destroy:void 0,resource:void 0}}function _A(){return Xe().memoizedState}function oh(t,e,n,i){var r=Qt();i=i===void 0?null:i,X.flags|=t,r.memoizedState=gl(1|e,Xh(),n,i)}function qc(t,e,n,i){var r=Xe();i=i===void 0?null:i;var s=r.memoizedState.inst;Se!==null&&i!==null&&s0(i,Se.memoizedState.deps)?r.memoizedState=gl(e,s,n,i):(X.flags|=t,r.memoizedState=gl(1|e,s,n,i))}function Fw(t,e){oh(8390656,8,t,e)}function LA(t,e){qc(2048,8,t,e)}function BA(t,e){return qc(4,2,t,e)}function IA(t,e){return qc(4,4,t,e)}function qA(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function PA(t,e,n){n=n!=null?n.concat([t]):null,qc(4,4,qA.bind(null,e,t),n)}function d0(){}function zA(t,e){var n=Xe();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&s0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function HA(t,e){var n=Xe();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&s0(e,i[1]))return i[0];if(i=t(),Ys){Hr(!0);try{t()}finally{Hr(!1)}}return n.memoizedState=[i,e],i}function p0(t,e,n){return n===void 0||(Zr&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=MO(),X.lanes|=t,es|=t,n)}function UA(t,e,n,i){return pn(n,e)?n:ml.current!==null?(t=p0(t,n,i),pn(t,e)||(ct=!0),t):(Zr&42)===0?(ct=!0,t.memoizedState=n):(t=MO(),X.lanes|=t,es|=t,e)}function FA(t,e,n,i,r){var s=de.p;de.p=s!==0&&8>s?s:8;var o=j.T,l={};j.T=l,g0(t,!1,e,n);try{var a=r(),c=j.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=zP(a,i);oc(t,e,u,hn(t))}else oc(t,e,i,hn(t))}catch(f){oc(t,e,{then:function(){},status:"rejected",reason:f},hn())}finally{de.p=s,j.T=o}}function VP(){}function gy(t,e,n,i){if(t.tag!==5)throw Error(C(476));var r=jA(t).queue;FA(t,r,e,Is,n===null?VP:function(){return VA(t),n(i)})}function jA(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Is,baseState:Is,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:Is},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function VA(t){var e=jA(t).next.queue;oc(t,e,{},hn())}function m0(){return Ot(wc)}function YA(){return Xe().memoizedState}function KA(){return Xe().memoizedState}function YP(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=hn();t=Yr(n);var i=Kr(e,t,n);i!==null&&(dn(i,e,n),ic(i,e,n)),e={cache:t0()},t.payload=e;return}e=e.return}}function KP(t,e,n){var i=hn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Wh(t)?$A(e,n):(n=Wy(t,e,n,i),n!==null&&(dn(n,t,i),GA(n,e,i)))}function QA(t,e,n){var i=hn();oc(t,e,n,i)}function oc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wh(t))$A(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,pn(l,o))return Qh(t,e,r,0),Oe===null&&Kh(),!1}catch{}if(n=Wy(t,e,r,i),n!==null)return dn(n,t,i),GA(n,e,i),!0}return!1}function g0(t,e,n,i){if(i={lane:2,revertLane:A0(),action:i,hasEagerState:!1,eagerState:null,next:null},Wh(t)){if(e)throw Error(C(479))}else e=Wy(t,n,i,2),e!==null&&dn(e,t,2)}function Wh(t){var e=t.alternate;return t===X||e!==null&&e===X}function $A(t,e){ll=kh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function GA(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,zk(t,n)}}var Oh={readContext:Ot,use:Gh,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye},XA={readContext:Ot,use:Gh,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:Ot,useEffect:Fw,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,oh(4194308,4,qA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return oh(4194308,4,t,e)},useInsertionEffect:function(t,e){oh(4,2,t,e)},useMemo:function(t,e){var n=Qt();e=e===void 0?null:e;var i=t();if(Ys){Hr(!0);try{t()}finally{Hr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Qt();if(n!==void 0){var r=n(e);if(Ys){Hr(!0);try{n(e)}finally{Hr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=KP.bind(null,X,t),[i.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:function(t){t=py(t);var e=t.queue,n=QA.bind(null,X,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:d0,useDeferredValue:function(t,e){var n=Qt();return p0(n,t,e)},useTransition:function(){var t=py(!1);return t=FA.bind(null,X,t.queue,!0,!1),Qt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=X,r=Qt();if(he){if(n===void 0)throw Error(C(407));n=n()}else{if(n=e(),Oe===null)throw Error(C(349));(ce&124)!==0||kA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Fw(OA.bind(null,i,s,t),[t]),i.flags|=2048,gl(9,Xh(),AA.bind(null,i,s,n,e),null),n},useId:function(){var t=Qt(),e=Oe.identifierPrefix;if(he){var n=tr,i=er;n=(i&~(1<<32-fn(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=Ah++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=HP++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:m0,useFormState:zw,useActionState:zw,useOptimistic:function(t){var e=Qt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=g0.bind(null,X,!0,n),n.dispatch=e,[t,e]},useMemoCache:f0,useCacheRefresh:function(){return Qt().memoizedState=YP.bind(null,X)}},WA={readContext:Ot,use:Gh,useCallback:zA,useContext:Ot,useEffect:LA,useImperativeHandle:PA,useInsertionEffect:BA,useLayoutEffect:IA,useMemo:HA,useReducer:sh,useRef:_A,useState:function(){return sh(lr)},useDebugValue:d0,useDeferredValue:function(t,e){var n=Xe();return UA(n,Se.memoizedState,t,e)},useTransition:function(){var t=sh(lr)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:Ic(t),e]},useSyncExternalStore:wA,useId:YA,useHostTransitionStatus:m0,useFormState:Hw,useActionState:Hw,useOptimistic:function(t,e){var n=Xe();return EA(n,Se,t,e)},useMemoCache:f0,useCacheRefresh:KA},QP={readContext:Ot,use:Gh,useCallback:zA,useContext:Ot,useEffect:LA,useImperativeHandle:PA,useInsertionEffect:BA,useLayoutEffect:IA,useMemo:HA,useReducer:Tg,useRef:_A,useState:function(){return Tg(lr)},useDebugValue:d0,useDeferredValue:function(t,e){var n=Xe();return Se===null?p0(n,t,e):UA(n,Se.memoizedState,t,e)},useTransition:function(){var t=Tg(lr)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:Ic(t),e]},useSyncExternalStore:wA,useId:YA,useHostTransitionStatus:m0,useFormState:Uw,useActionState:Uw,useOptimistic:function(t,e){var n=Xe();return Se!==null?EA(n,Se,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:f0,useCacheRefresh:KA},cl=null,bc=0;function Yf(t){var e=bc;return bc+=1,cl===null&&(cl=[]),yA(cl,t,e)}function ja(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Kf(t,e){throw e.$$typeof===k5?Error(C(525)):(t=Object.prototype.toString.call(e),Error(C(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function jw(t){var e=t._init;return e(t._payload)}function ZA(t){function e(p,y){if(t){var v=p.deletions;v===null?(p.deletions=[y],p.flags|=16):v.push(y)}}function n(p,y){if(!t)return null;for(;y!==null;)e(p,y),y=y.sibling;return null}function i(p){for(var y=new Map;p!==null;)p.key!==null?y.set(p.key,p):y.set(p.index,p),p=p.sibling;return y}function r(p,y){return p=rr(p,y),p.index=0,p.sibling=null,p}function s(p,y,v){return p.index=v,t?(v=p.alternate,v!==null?(v=v.index,v<y?(p.flags|=67108866,y):v):(p.flags|=67108866,y)):(p.flags|=1048576,y)}function o(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function l(p,y,v,S){return y===null||y.tag!==6?(y=kg(v,p.mode,S),y.return=p,y):(y=r(y,v),y.return=p,y)}function a(p,y,v,S){var w=v.type;return w===Yo?u(p,y,v.props.children,S,v.key):y!==null&&(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Lr&&jw(w)===y.type)?(y=r(y,v.props),ja(y,v),y.return=p,y):(y=ih(v.type,v.key,v.props,null,p.mode,S),ja(y,v),y.return=p,y)}function c(p,y,v,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Ag(v,p.mode,S),y.return=p,y):(y=r(y,v.children||[]),y.return=p,y)}function u(p,y,v,S,w){return y===null||y.tag!==7?(y=qs(v,p.mode,S,w),y.return=p,y):(y=r(y,v),y.return=p,y)}function f(p,y,v){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=kg(""+y,p.mode,v),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case If:return v=ih(y.type,y.key,y.props,null,p.mode,v),ja(v,y),v.return=p,v;case $a:return y=Ag(y,p.mode,v),y.return=p,y;case Lr:var S=y._init;return y=S(y._payload),f(p,y,v)}if(Ga(y)||Ha(y))return y=qs(y,p.mode,v,null),y.return=p,y;if(typeof y.then=="function")return f(p,Yf(y),v);if(y.$$typeof===Ji)return f(p,jf(p,y),v);Kf(p,y)}return null}function h(p,y,v,S){var w=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:l(p,y,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case If:return v.key===w?a(p,y,v,S):null;case $a:return v.key===w?c(p,y,v,S):null;case Lr:return w=v._init,v=w(v._payload),h(p,y,v,S)}if(Ga(v)||Ha(v))return w!==null?null:u(p,y,v,S,null);if(typeof v.then=="function")return h(p,y,Yf(v),S);if(v.$$typeof===Ji)return h(p,y,jf(p,v),S);Kf(p,v)}return null}function d(p,y,v,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return p=p.get(v)||null,l(y,p,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case If:return p=p.get(S.key===null?v:S.key)||null,a(y,p,S,w);case $a:return p=p.get(S.key===null?v:S.key)||null,c(y,p,S,w);case Lr:var O=S._init;return S=O(S._payload),d(p,y,v,S,w)}if(Ga(S)||Ha(S))return p=p.get(v)||null,u(y,p,S,w,null);if(typeof S.then=="function")return d(p,y,v,Yf(S),w);if(S.$$typeof===Ji)return d(p,y,v,jf(y,S),w);Kf(y,S)}return null}function m(p,y,v,S){for(var w=null,O=null,k=y,A=y=0,D=null;k!==null&&A<v.length;A++){k.index>A?(D=k,k=null):D=k.sibling;var E=h(p,k,v[A],S);if(E===null){k===null&&(k=D);break}t&&k&&E.alternate===null&&e(p,k),y=s(E,y,A),O===null?w=E:O.sibling=E,O=E,k=D}if(A===v.length)return n(p,k),he&&Ls(p,A),w;if(k===null){for(;A<v.length;A++)k=f(p,v[A],S),k!==null&&(y=s(k,y,A),O===null?w=k:O.sibling=k,O=k);return he&&Ls(p,A),w}for(k=i(k);A<v.length;A++)D=d(k,p,A,v[A],S),D!==null&&(t&&D.alternate!==null&&k.delete(D.key===null?A:D.key),y=s(D,y,A),O===null?w=D:O.sibling=D,O=D);return t&&k.forEach(function(L){return e(p,L)}),he&&Ls(p,A),w}function g(p,y,v,S){if(v==null)throw Error(C(151));for(var w=null,O=null,k=y,A=y=0,D=null,E=v.next();k!==null&&!E.done;A++,E=v.next()){k.index>A?(D=k,k=null):D=k.sibling;var L=h(p,k,E.value,S);if(L===null){k===null&&(k=D);break}t&&k&&L.alternate===null&&e(p,k),y=s(L,y,A),O===null?w=L:O.sibling=L,O=L,k=D}if(E.done)return n(p,k),he&&Ls(p,A),w;if(k===null){for(;!E.done;A++,E=v.next())E=f(p,E.value,S),E!==null&&(y=s(E,y,A),O===null?w=E:O.sibling=E,O=E);return he&&Ls(p,A),w}for(k=i(k);!E.done;A++,E=v.next())E=d(k,p,A,E.value,S),E!==null&&(t&&E.alternate!==null&&k.delete(E.key===null?A:E.key),y=s(E,y,A),O===null?w=E:O.sibling=E,O=E);return t&&k.forEach(function(R){return e(p,R)}),he&&Ls(p,A),w}function b(p,y,v,S){if(typeof v=="object"&&v!==null&&v.type===Yo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case If:e:{for(var w=v.key;y!==null;){if(y.key===w){if(w=v.type,w===Yo){if(y.tag===7){n(p,y.sibling),S=r(y,v.props.children),S.return=p,p=S;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Lr&&jw(w)===y.type){n(p,y.sibling),S=r(y,v.props),ja(S,v),S.return=p,p=S;break e}n(p,y);break}else e(p,y);y=y.sibling}v.type===Yo?(S=qs(v.props.children,p.mode,S,v.key),S.return=p,p=S):(S=ih(v.type,v.key,v.props,null,p.mode,S),ja(S,v),S.return=p,p=S)}return o(p);case $a:e:{for(w=v.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(p,y.sibling),S=r(y,v.children||[]),S.return=p,p=S;break e}else{n(p,y);break}else e(p,y);y=y.sibling}S=Ag(v,p.mode,S),S.return=p,p=S}return o(p);case Lr:return w=v._init,v=w(v._payload),b(p,y,v,S)}if(Ga(v))return m(p,y,v,S);if(Ha(v)){if(w=Ha(v),typeof w!="function")throw Error(C(150));return v=w.call(v),g(p,y,v,S)}if(typeof v.then=="function")return b(p,y,Yf(v),S);if(v.$$typeof===Ji)return b(p,y,jf(p,v),S);Kf(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,y!==null&&y.tag===6?(n(p,y.sibling),S=r(y,v),S.return=p,p=S):(n(p,y),S=kg(v,p.mode,S),S.return=p,p=S),o(p)):n(p,y)}return function(p,y,v,S){try{bc=0;var w=b(p,y,v,S);return cl=null,w}catch(k){if(k===Bc||k===$h)throw k;var O=cn(29,k,null,p.mode);return O.lanes=S,O.return=p,O}}}var yl=ZA(!0),JA=ZA(!1),Rn=Oi(null),Ai=null;function qr(t){var e=t.alternate;Be(et,et.current&1),Be(Rn,t),Ai===null&&(e===null||ml.current!==null||e.memoizedState!==null)&&(Ai=t)}function eO(t){if(t.tag===22){if(Be(et,et.current),Be(Rn,t),Ai===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Ai=t)}}else Pr(t)}function Pr(){Be(et,et.current),Be(Rn,Rn.current)}function ir(t){ut(Rn),Ai===t&&(Ai=null),ut(et)}var et=Oi(0);function Th(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||_y(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Cg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:De({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var yy={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=hn(),r=Yr(i);r.payload=e,n!=null&&(r.callback=n),e=Kr(t,r,i),e!==null&&(dn(e,t,i),ic(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=hn(),r=Yr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Kr(t,r,i),e!==null&&(dn(e,t,i),ic(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=hn(),i=Yr(n);i.tag=2,e!=null&&(i.callback=e),e=Kr(t,i,n),e!==null&&(dn(e,t,n),ic(e,t,n))}};function Vw(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!mc(n,i)||!mc(r,s):!0}function Yw(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&yy.enqueueReplaceState(e,e.state,null)}function Ks(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=De({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var Ch=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function tO(t){Ch(t)}function nO(t){console.error(t)}function iO(t){Ch(t)}function Eh(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function Kw(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function by(t,e,n){return n=Yr(n),n.tag=3,n.payload={element:null},n.callback=function(){Eh(t,e)},n}function rO(t){return t=Yr(t),t.tag=3,t}function sO(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){Kw(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){Kw(e,n,i),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function $P(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&_c(e,n,r,!0),n=Rn.current,n!==null){switch(n.tag){case 13:return Ai===null?Ty():n.alternate===null&&Fe===0&&(Fe=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===uy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Pg(t,i,r)),!1;case 22:return n.flags|=65536,i===uy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Pg(t,i,r)),!1}throw Error(C(435,n.tag))}return Pg(t,i,r),Ty(),!1}if(he)return e=Rn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==sy&&(t=Error(C(422),{cause:i}),gc(Mn(t,n)))):(i!==sy&&(e=Error(C(423),{cause:i}),gc(Mn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Mn(i,n),r=by(t.stateNode,i,r),Og(t,r),Fe!==4&&(Fe=2)),!1;var s=Error(C(520),{cause:i});if(s=Mn(s,n),cc===null?cc=[s]:cc.push(s),Fe!==4&&(Fe=2),e===null)return!0;i=Mn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=by(n.stateNode,i,t),Og(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Qr===null||!Qr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=rO(r),sO(r,t,n,i),Og(n,r),!1}n=n.return}while(n!==null);return!1}var oO=Error(C(461)),ct=!1;function mt(t,e,n,i){e.child=t===null?JA(e,null,n,i):yl(e,t.child,n,i)}function Qw(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return Vs(e),i=o0(t,e,n,o,s,r),l=l0(),t!==null&&!ct?(a0(t,e,r),ar(t,e,r)):(he&&l&&Jy(e),e.flags|=1,mt(t,e,i,r),e.child)}function $w(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Zy(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,lO(t,e,s,i,r)):(t=ih(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!y0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:mc,n(o,i)&&t.ref===e.ref)return ar(t,e,r)}return e.flags|=1,t=rr(s,i),t.ref=e.ref,t.return=e,e.child=t}function lO(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(mc(s,i)&&t.ref===e.ref)if(ct=!1,e.pendingProps=i=s,y0(t,r))(t.flags&131072)!==0&&(ct=!0);else return e.lanes=t.lanes,ar(t,e,r)}return vy(t,e,n,i,r)}function aO(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return Gw(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&rh(e,s!==null?s.cachePool:null),s!==null?Iw(e,s):dy(),eO(e);else return e.lanes=e.childLanes=536870912,Gw(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(rh(e,s.cachePool),Iw(e,s),Pr(e),e.memoizedState=null):(t!==null&&rh(e,null),dy(),Pr(e));return mt(t,e,r,n),e.child}function Gw(t,e,n,i){var r=n0();return r=r===null?null:{parent:Je._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&rh(e,null),dy(),eO(e),t!==null&&_c(t,e,i,!0),null}function lh(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(C(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function vy(t,e,n,i,r){return Vs(e),n=o0(t,e,n,i,void 0,r),i=l0(),t!==null&&!ct?(a0(t,e,r),ar(t,e,r)):(he&&i&&Jy(e),e.flags|=1,mt(t,e,n,r),e.child)}function Xw(t,e,n,i,r,s){return Vs(e),e.updateQueue=null,n=xA(e,i,n,r),SA(t),i=l0(),t!==null&&!ct?(a0(t,e,s),ar(t,e,s)):(he&&i&&Jy(e),e.flags|=1,mt(t,e,n,s),e.child)}function Ww(t,e,n,i,r){if(Vs(e),e.stateNode===null){var s=Jo,o=n.contextType;typeof o=="object"&&o!==null&&(s=Ot(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=yy,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},i0(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?Ot(o):Jo,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Cg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&yy.enqueueReplaceState(s,s.state,null),sc(e,i,s,r),rc(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=Ks(n,l);s.props=a;var c=s.context,u=n.contextType;o=Jo,typeof u=="object"&&u!==null&&(o=Ot(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&Yw(e,s,i,o),Br=!1;var h=e.memoizedState;s.state=h,sc(e,i,s,r),rc(),c=e.memoizedState,l||h!==c||Br?(typeof f=="function"&&(Cg(e,n,f,i),c=e.memoizedState),(a=Br||Vw(e,n,a,i,h,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,fy(t,e),o=e.memoizedProps,u=Ks(n,o),s.props=u,f=e.pendingProps,h=s.context,c=n.contextType,a=Jo,typeof c=="object"&&c!==null&&(a=Ot(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==a)&&Yw(e,s,i,a),Br=!1,h=e.memoizedState,s.state=h,sc(e,i,s,r),rc();var d=e.memoizedState;o!==f||h!==d||Br||t!==null&&t.dependencies!==null&&xh(t.dependencies)?(typeof l=="function"&&(Cg(e,n,l,i),d=e.memoizedState),(u=Br||Vw(e,n,u,i,h,d,a)||t!==null&&t.dependencies!==null&&xh(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,d,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,d,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),s.props=i,s.state=d,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,lh(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=yl(e,t.child,null,r),e.child=yl(e,null,n,r)):mt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=ar(t,e,r),t}function Zw(t,e,n,i){return Rc(),e.flags|=256,mt(t,e,n,i),e.child}var Eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dg(t){return{baseLanes:t,cachePool:mA()}}function Mg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Nn),t}function cO(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(et.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(he){if(r?qr(e):Pr(e),he){var l=Ue,a;if(a=l){e:{for(a=l,l=Si;a.nodeType!==8;){if(!l){l=null;break e}if(a=Gn(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:Ps!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},a=cn(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,Bt=e,Ue=null,a=!0):a=!1}a||js(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return _y(l)?e.lanes=32:e.lanes=536870912,null;ir(e)}return l=i.children,i=i.fallback,r?(Pr(e),r=e.mode,l=Dh({mode:"hidden",children:l},r),i=qs(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Dg(n),r.childLanes=Mg(t,o,n),e.memoizedState=Eg,i):(qr(e),Sy(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?(qr(e),e.flags&=-257,e=Ng(t,e,n)):e.memoizedState!==null?(Pr(e),e.child=t.child,e.flags|=128,e=null):(Pr(e),r=i.fallback,l=e.mode,i=Dh({mode:"visible",children:i.children},l),r=qs(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,yl(e,t.child,null,n),i=e.child,i.memoizedState=Dg(n),i.childLanes=Mg(t,o,n),e.memoizedState=Eg,e=r);else if(qr(e),_y(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(C(419)),i.stack="",i.digest=o,gc({value:i,source:null,stack:null}),e=Ng(t,e,n)}else if(ct||_c(t,e,n,!1),o=(n&t.childLanes)!==0,ct||o){if(o=Oe,o!==null&&(i=n&-n,i=(i&42)!==0?1:Uy(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,Al(t,i),dn(o,t,i),oO;l.data==="$?"||Ty(),e=Ng(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,Ue=Gn(l.nextSibling),Bt=e,he=!0,zs=null,Si=!1,t!==null&&(Cn[En++]=er,Cn[En++]=tr,Cn[En++]=Ps,er=t.id,tr=t.overflow,Ps=e),e=Sy(e,i.children),e.flags|=4096);return e}return r?(Pr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=rr(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=rr(c,r):(r=qs(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Dg(n):(a=l.cachePool,a!==null?(c=Je._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=mA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=Mg(t,o,n),e.memoizedState=Eg,i):(qr(e),n=t.child,t=n.sibling,n=rr(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function Sy(t,e){return e=Dh({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Dh(t,e){return t=cn(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Ng(t,e,n){return yl(e,t.child,null,n),t=Sy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Jw(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),ly(t.return,e,n)}function Rg(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function uO(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(mt(t,e,i.children,n),i=et.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Jw(t,n,e);else if(t.tag===19)Jw(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(Be(et,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Th(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Rg(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Th(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Rg(e,!0,n,null,s);break;case"together":Rg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ar(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),es|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(_c(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(C(153));if(e.child!==null){for(t=e.child,n=rr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=rr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function y0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&xh(t)))}function GP(t,e,n){switch(e.tag){case 3:dh(e,e.stateNode.containerInfo),Ir(e,Je,t.memoizedState.cache),Rc();break;case 27:case 5:Gg(e);break;case 4:dh(e,e.stateNode.containerInfo);break;case 10:Ir(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(qr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?cO(t,e,n):(qr(e),t=ar(t,e,n),t!==null?t.sibling:null);qr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(_c(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return uO(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Be(et,et.current),i)break;return null;case 22:case 23:return e.lanes=0,aO(t,e,n);case 24:Ir(e,Je,t.memoizedState.cache)}return ar(t,e,n)}function fO(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ct=!0;else{if(!y0(t,n)&&(e.flags&128)===0)return ct=!1,GP(t,e,n);ct=(t.flags&131072)!==0}else ct=!1,he&&(e.flags&1048576)!==0&&dA(e,Sh,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")Zy(i)?(t=Ks(i,t),e.tag=1,e=Ww(null,e,i,t,n)):(e.tag=0,e=vy(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===Py){e.tag=11,e=Qw(null,e,i,t,n);break e}else if(r===zy){e.tag=14,e=$w(null,e,i,t,n);break e}}throw e=Qg(i)||i,Error(C(306,e,""))}}return e;case 0:return vy(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Ks(i,e.pendingProps),Ww(t,e,i,r,n);case 3:e:{if(dh(e,e.stateNode.containerInfo),t===null)throw Error(C(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,fy(t,e),sc(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Ir(e,Je,i),i!==s.cache&&ay(e,[Je],n,!0),rc(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Zw(t,e,i,n);break e}else if(i!==r){r=Mn(Error(C(424)),e),gc(r),e=Zw(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Ue=Gn(t.firstChild),Bt=e,he=!0,zs=null,Si=!0,n=JA(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Rc(),i===r){e=ar(t,e,n);break e}mt(t,e,i,n)}e=e.child}return e;case 26:return lh(t,e),t===null?(n=bk(e.type,null,e.pendingProps,null))?e.memoizedState=n:he||(n=e.type,t=e.pendingProps,i=Ih(Vr.current).createElement(n),i[At]=e,i[Xt]=t,yt(i,n,t),at(i),e.stateNode=i):e.memoizedState=bk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Gg(e),t===null&&he&&(i=e.stateNode=WO(e.type,e.pendingProps,Vr.current),Bt=e,Si=!0,r=Ue,ns(e.type)?(Ly=r,Ue=Gn(i.firstChild)):Ue=r),mt(t,e,e.pendingProps.children,n),lh(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&he&&((r=i=Ue)&&(i=x6(i,e.type,e.pendingProps,Si),i!==null?(e.stateNode=i,Bt=e,Ue=Gn(i.firstChild),Si=!1,r=!0):r=!1),r||js(e)),Gg(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,Ny(r,s)?i=null:o!==null&&Ny(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=o0(t,e,UP,null,null,n),wc._currentValue=r),lh(t,e),mt(t,e,i,n),e.child;case 6:return t===null&&he&&((t=n=Ue)&&(n=w6(n,e.pendingProps,Si),n!==null?(e.stateNode=n,Bt=e,Ue=null,t=!0):t=!1),t||js(e)),null;case 13:return cO(t,e,n);case 4:return dh(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=yl(e,null,i,n):mt(t,e,i,n),e.child;case 11:return Qw(t,e,e.type,e.pendingProps,n);case 7:return mt(t,e,e.pendingProps,n),e.child;case 8:return mt(t,e,e.pendingProps.children,n),e.child;case 12:return mt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Ir(e,e.type,i.value),mt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Vs(e),r=Ot(r),i=i(r),e.flags|=1,mt(t,e,i,n),e.child;case 14:return $w(t,e,e.type,e.pendingProps,n);case 15:return lO(t,e,e.type,e.pendingProps,n);case 19:return uO(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=Dh(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=rr(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return aO(t,e,n);case 24:return Vs(e),i=Ot(Je),t===null?(r=n0(),r===null&&(r=Oe,s=t0(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},i0(e),Ir(e,Je,r)):((t.lanes&n)!==0&&(fy(t,e),sc(e,null,null,n),rc()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Ir(e,Je,i)):(i=s.cache,Ir(e,Je,i),i!==r.cache&&ay(e,[Je],n,!0))),mt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(C(156,e.tag))}function Xi(t){t.flags|=4}function ek(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!eT(e)){if(e=Rn.current,e!==null&&((ce&4194048)===ce?Ai!==null:(ce&62914560)!==ce&&(ce&536870912)===0||e!==Ai))throw nc=uy,gA;t.flags|=8192}}function Qf(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?qk():536870912,t.lanes|=e,bl|=e)}function Va(t,e){if(!he)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ze(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function XP(t,e,n){var i=e.pendingProps;switch(e0(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(e),null;case 1:return ze(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),sr(Je),fl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Fa(e)?Xi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Mw())),ze(e),null;case 26:return n=e.memoizedState,t===null?(Xi(e),n!==null?(ze(e),ek(e,n)):(ze(e),e.flags&=-16777217)):n?n!==t.memoizedState?(Xi(e),ze(e),ek(e,n)):(ze(e),e.flags&=-16777217):(t.memoizedProps!==i&&Xi(e),ze(e),e.flags&=-16777217),null;case 27:ph(e),n=Vr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Xi(e);else{if(!i){if(e.stateNode===null)throw Error(C(166));return ze(e),null}t=wi.current,Fa(e)?Ew(e,t):(t=WO(r,i,n),e.stateNode=t,Xi(e))}return ze(e),null;case 5:if(ph(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Xi(e);else{if(!i){if(e.stateNode===null)throw Error(C(166));return ze(e),null}if(t=wi.current,Fa(e))Ew(e,t);else{switch(r=Ih(Vr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[At]=e,t[Xt]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(yt(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Xi(e)}}return ze(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Xi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(C(166));if(t=Vr.current,Fa(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Bt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[At]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||$O(t.nodeValue,n)),t||js(e)}else t=Ih(t).createTextNode(i),t[At]=e,e.stateNode=t}return ze(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Fa(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(C(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(C(317));r[At]=e}else Rc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ze(e),r=!1}else r=Mw(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(ir(e),e):(ir(e),null)}if(ir(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),Qf(e,e.updateQueue),ze(e),null;case 4:return fl(),t===null&&O0(e.stateNode.containerInfo),ze(e),null;case 10:return sr(e.type),ze(e),null;case 19:if(ut(et),r=e.memoizedState,r===null)return ze(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)Va(r,!1);else{if(Fe!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Th(t),s!==null){for(e.flags|=128,Va(r,!1),t=s.updateQueue,e.updateQueue=t,Qf(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)hA(n,t),n=n.sibling;return Be(et,et.current&1|2),e.child}t=t.sibling}r.tail!==null&&ki()>Nh&&(e.flags|=128,i=!0,Va(r,!1),e.lanes=4194304)}else{if(!i)if(t=Th(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,Qf(e,t),Va(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!he)return ze(e),null}else 2*ki()-r.renderingStartTime>Nh&&n!==536870912&&(e.flags|=128,i=!0,Va(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ki(),e.sibling=null,t=et.current,Be(et,i?t&1|2:t&1),e):(ze(e),null);case 22:case 23:return ir(e),r0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(ze(e),e.subtreeFlags&6&&(e.flags|=8192)):ze(e),n=e.updateQueue,n!==null&&Qf(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ut(Hs),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),sr(Je),ze(e),null;case 25:return null;case 30:return null}throw Error(C(156,e.tag))}function WP(t,e){switch(e0(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return sr(Je),fl(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ph(e),null;case 13:if(ir(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(C(340));Rc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ut(et),null;case 4:return fl(),null;case 10:return sr(e.type),null;case 22:case 23:return ir(e),r0(),t!==null&&ut(Hs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return sr(Je),null;case 25:return null;default:return null}}function hO(t,e){switch(e0(e),e.tag){case 3:sr(Je),fl();break;case 26:case 27:case 5:ph(e);break;case 4:fl();break;case 13:ir(e);break;case 19:ut(et);break;case 10:sr(e.type);break;case 22:case 23:ir(e),r0(),t!==null&&ut(Hs);break;case 24:sr(Je)}}function Pc(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){xe(e,e.return,l)}}function Jr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){xe(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){xe(e,e.return,u)}}function dO(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{vA(e,n)}catch(i){xe(t,t.return,i)}}}function pO(t,e,n){n.props=Ks(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){xe(t,e,i)}}function lc(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){xe(t,e,r)}}function xi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){xe(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){xe(t,e,r)}else n.current=null}function mO(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){xe(t,t.return,r)}}function _g(t,e,n){try{var i=t.stateNode;g6(i,t.type,n,e),i[Xt]=e}catch(r){xe(t,t.return,r)}}function gO(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ns(t.type)||t.tag===4}function Lg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gO(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.tag===27&&ns(t.type)||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 xy(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=td));else if(i!==4&&(i===27&&ns(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(xy(t,e,n),t=t.sibling;t!==null;)xy(t,e,n),t=t.sibling}function Mh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&ns(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Mh(t,e,n),t=t.sibling;t!==null;)Mh(t,e,n),t=t.sibling}function yO(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);yt(e,i,n),e[At]=t,e[Xt]=n}catch(s){xe(t,t.return,s)}}var Zi=!1,Ke=!1,Bg=!1,tk=typeof WeakSet=="function"?WeakSet:Set,lt=null;function ZP(t,e){if(t=t.containerInfo,Dy=Hh,t=rA(t),Gy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(l=o),h===s&&++u===i&&(a=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(My={focusedElem:t,selectionRange:n},Hh=!1,lt=e;lt!==null;)if(e=lt,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,lt=t;else for(;lt!==null;){switch(e=lt,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var m=Ks(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(m,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(g){xe(n,n.return,g)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ry(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ry(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(C(163))}if(t=e.sibling,t!==null){t.return=e.return,lt=t;break}lt=e.return}}function bO(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Rr(t,n),i&4&&Pc(5,n);break;case 1:if(Rr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){xe(n,n.return,o)}else{var r=Ks(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){xe(n,n.return,o)}}i&64&&dO(n),i&512&&lc(n,n.return);break;case 3:if(Rr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{vA(t,e)}catch(o){xe(n,n.return,o)}}break;case 27:e===null&&i&4&&yO(n);case 26:case 5:Rr(t,n),e===null&&i&4&&mO(n),i&512&&lc(n,n.return);break;case 12:Rr(t,n);break;case 13:Rr(t,n),i&4&&xO(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=l6.bind(null,n),k6(t,n))));break;case 22:if(i=n.memoizedState!==null||Zi,!i){e=e!==null&&e.memoizedState!==null||Ke,r=Zi;var s=Ke;Zi=i,(Ke=e)&&!s?_r(t,n,(n.subtreeFlags&8772)!==0):Rr(t,n),Zi=r,Ke=s}break;case 30:break;default:Rr(t,n)}}function vO(t){var e=t.alternate;e!==null&&(t.alternate=null,vO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&jy(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Le=null,$t=!1;function Wi(t,e,n){for(n=n.child;n!==null;)SO(t,e,n),n=n.sibling}function SO(t,e,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Cc,n)}catch{}switch(n.tag){case 26:Ke||xi(n,e),Wi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||xi(n,e);var i=Le,r=$t;ns(n.type)&&(Le=n.stateNode,$t=!1),Wi(t,e,n),fc(n.stateNode),Le=i,$t=r;break;case 5:Ke||xi(n,e);case 6:if(i=Le,r=$t,Le=null,Wi(t,e,n),Le=i,$t=r,Le!==null)if($t)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(s){xe(n,e,s)}else try{Le.removeChild(n.stateNode)}catch(s){xe(n,e,s)}break;case 18:Le!==null&&($t?(t=Le,mk(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Oc(t)):mk(Le,n.stateNode));break;case 4:i=Le,r=$t,Le=n.stateNode.containerInfo,$t=!0,Wi(t,e,n),Le=i,$t=r;break;case 0:case 11:case 14:case 15:Ke||Jr(2,n,e),Ke||Jr(4,n,e),Wi(t,e,n);break;case 1:Ke||(xi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&pO(n,e,i)),Wi(t,e,n);break;case 21:Wi(t,e,n);break;case 22:Ke=(i=Ke)||n.memoizedState!==null,Wi(t,e,n),Ke=i;break;default:Wi(t,e,n)}}function xO(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Oc(t)}catch(n){xe(e,e.return,n)}}function JP(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new tk),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new tk),e;default:throw Error(C(435,t.tag))}}function Ig(t,e){var n=JP(t);e.forEach(function(i){var r=a6.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function on(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(ns(l.type)){Le=l.stateNode,$t=!1;break e}break;case 5:Le=l.stateNode,$t=!1;break e;case 3:case 4:Le=l.stateNode.containerInfo,$t=!0;break e}l=l.return}if(Le===null)throw Error(C(160));SO(s,o,r),Le=null,$t=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)wO(e,t),e=e.sibling}var $n=null;function wO(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:on(e,t),ln(t),i&4&&(Jr(3,t,t.return),Pc(3,t),Jr(5,t,t.return));break;case 1:on(e,t),ln(t),i&512&&(Ke||n===null||xi(n,n.return)),i&64&&Zi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=$n;if(on(e,t),ln(t),i&512&&(Ke||n===null||xi(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Mc]||s[At]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),yt(s,i,n),s[At]=t,at(s),i=s;break e;case"link":var o=Sk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),yt(s,i,n),r.head.appendChild(s);break;case"meta":if(o=Sk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),yt(s,i,n),r.head.appendChild(s);break;default:throw Error(C(468,i))}s[At]=t,at(s),i=s}t.stateNode=i}else xk(r,t.type,t.stateNode);else t.stateNode=vk(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?xk(r,t.type,t.stateNode):vk(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&_g(t,t.memoizedProps,n.memoizedProps)}break;case 27:on(e,t),ln(t),i&512&&(Ke||n===null||xi(n,n.return)),n!==null&&i&4&&_g(t,t.memoizedProps,n.memoizedProps);break;case 5:if(on(e,t),ln(t),i&512&&(Ke||n===null||xi(n,n.return)),t.flags&32){r=t.stateNode;try{dl(r,"")}catch(d){xe(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,_g(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Bg=!0);break;case 6:if(on(e,t),ln(t),i&4){if(t.stateNode===null)throw Error(C(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){xe(t,t.return,d)}}break;case 3:if(uh=null,r=$n,$n=qh(e.containerInfo),on(e,t),$n=r,ln(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Oc(e.containerInfo)}catch(d){xe(t,t.return,d)}Bg&&(Bg=!1,kO(t));break;case 4:i=$n,$n=qh(t.stateNode.containerInfo),on(e,t),ln(t),$n=i;break;case 12:on(e,t),ln(t);break;case 13:on(e,t),ln(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(w0=ki()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Ig(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=Zi,u=Ke;if(Zi=c||r,Ke=u||a,on(e,t),Ke=u,Zi=c,ln(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||Zi||Ke||Bs(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){xe(a,a.return,d)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(d){xe(a,a.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Ig(t,n))));break;case 19:on(e,t),ln(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Ig(t,i)));break;case 30:break;case 21:break;default:on(e,t),ln(t)}}function ln(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(gO(i)){n=i;break}i=i.return}if(n==null)throw Error(C(160));switch(n.tag){case 27:var r=n.stateNode,s=Lg(t);Mh(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(dl(o,""),n.flags&=-33);var l=Lg(t);Mh(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=Lg(t);xy(t,c,a);break;default:throw Error(C(161))}}catch(u){xe(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function kO(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;kO(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Rr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)bO(t,e.alternate,e),e=e.sibling}function Bs(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Jr(4,e,e.return),Bs(e);break;case 1:xi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&pO(e,e.return,n),Bs(e);break;case 27:fc(e.stateNode);case 26:case 5:xi(e,e.return),Bs(e);break;case 22:e.memoizedState===null&&Bs(e);break;case 30:Bs(e);break;default:Bs(e)}t=t.sibling}}function _r(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:_r(r,s,n),Pc(4,s);break;case 1:if(_r(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){xe(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)bA(a[r],l)}catch(c){xe(i,i.return,c)}}n&&o&64&&dO(s),lc(s,s.return);break;case 27:yO(s);case 26:case 5:_r(r,s,n),n&&i===null&&o&4&&mO(s),lc(s,s.return);break;case 12:_r(r,s,n);break;case 13:_r(r,s,n),n&&o&4&&xO(r,s);break;case 22:s.memoizedState===null&&_r(r,s,n),lc(s,s.return);break;case 30:break;default:_r(r,s,n)}e=e.sibling}}function b0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Lc(n))}function v0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Lc(t))}function vi(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)AO(t,e,n,i),e=e.sibling}function AO(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:vi(t,e,n,i),r&2048&&Pc(9,e);break;case 1:vi(t,e,n,i);break;case 3:vi(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Lc(t)));break;case 12:if(r&2048){vi(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){xe(e,e.return,a)}}else vi(t,e,n,i);break;case 13:vi(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?vi(t,e,n,i):ac(t,e):s._visibility&2?vi(t,e,n,i):(s._visibility|=2,jo(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&b0(o,e);break;case 24:vi(t,e,n,i),r&2048&&v0(e.alternate,e);break;default:vi(t,e,n,i)}}function jo(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:jo(s,o,l,a,r),Pc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?jo(s,o,l,a,r):ac(s,o):(u._visibility|=2,jo(s,o,l,a,r)),r&&c&2048&&b0(o.alternate,o);break;case 24:jo(s,o,l,a,r),r&&c&2048&&v0(o.alternate,o);break;default:jo(s,o,l,a,r)}e=e.sibling}}function ac(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:ac(n,i),r&2048&&b0(i.alternate,i);break;case 24:ac(n,i),r&2048&&v0(i.alternate,i);break;default:ac(n,i)}e=e.sibling}}var Wa=8192;function Ho(t){if(t.subtreeFlags&Wa)for(t=t.child;t!==null;)OO(t),t=t.sibling}function OO(t){switch(t.tag){case 26:Ho(t),t.flags&Wa&&t.memoizedState!==null&&I6($n,t.memoizedState,t.memoizedProps);break;case 5:Ho(t);break;case 3:case 4:var e=$n;$n=qh(t.stateNode.containerInfo),Ho(t),$n=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Wa,Wa=16777216,Ho(t),Wa=e):Ho(t));break;default:Ho(t)}}function TO(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ya(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];lt=i,EO(i,t)}TO(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)CO(t),t=t.sibling}function CO(t){switch(t.tag){case 0:case 11:case 15:Ya(t),t.flags&2048&&Jr(9,t,t.return);break;case 3:Ya(t);break;case 12:Ya(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,ah(t)):Ya(t);break;default:Ya(t)}}function ah(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];lt=i,EO(i,t)}TO(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Jr(8,e,e.return),ah(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,ah(e));break;default:ah(e)}t=t.sibling}}function EO(t,e){for(;lt!==null;){var n=lt;switch(n.tag){case 0:case 11:case 15:Jr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Lc(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,lt=i;else e:for(n=t;lt!==null;){i=lt;var r=i.sibling,s=i.return;if(vO(i),i===n){lt=null;break e}if(r!==null){r.return=s,lt=r;break e}lt=s}}}var e6={getCacheForType:function(t){var e=Ot(Je),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},t6=typeof WeakMap=="function"?WeakMap:Map,ye=0,Oe=null,ne=null,ce=0,ge=0,an=null,Fr=!1,Ol=!1,S0=!1,cr=0,Fe=0,es=0,Us=0,x0=0,Nn=0,bl=0,cc=null,Gt=null,wy=!1,w0=0,Nh=1/0,Rh=null,Qr=null,gt=0,$r=null,vl=null,ul=0,ky=0,Ay=null,DO=null,uc=0,Oy=null;function hn(){if((ye&2)!==0&&ce!==0)return ce&-ce;if(j.T!==null){var t=pl;return t!==0?t:A0()}return Hk()}function MO(){Nn===0&&(Nn=(ce&536870912)===0||he?Ik():536870912);var t=Rn.current;return t!==null&&(t.flags|=32),Nn}function dn(t,e,n){(t===Oe&&(ge===2||ge===9)||t.cancelPendingCommit!==null)&&(Sl(t,0),jr(t,ce,Nn,!1)),Dc(t,n),((ye&2)===0||t!==Oe)&&(t===Oe&&((ye&2)===0&&(Us|=n),Fe===4&&jr(t,ce,Nn,!1)),Ti(t))}function NO(t,e,n){if((ye&6)!==0)throw Error(C(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||Ec(t,e),r=i?r6(t,e):qg(t,e,!0),s=i;do{if(r===0){Ol&&!i&&jr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!n6(n)){r=qg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=cc;var a=l.current.memoizedState.isDehydrated;if(a&&(Sl(l,o).flags|=256),o=qg(l,o,!1),o!==2){if(S0&&!a){l.errorRecoveryDisabledLanes|=s,Us|=s,r=4;break e}s=Gt,Gt=r,s!==null&&(Gt===null?Gt=s:Gt.push.apply(Gt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){Sl(t,0),jr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(C(345));case 4:if((e&4194048)!==e)break;case 6:jr(i,e,Nn,!Fr);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(C(329))}if((e&62914560)===e&&(r=w0+300-ki(),10<r)){if(jr(i,e,Nn,!Fr),Fh(i,0,!0)!==0)break e;i.timeoutHandle=XO(nk.bind(null,i,n,Gt,Rh,wy,e,Nn,Us,bl,Fr,s,2,-0,0),r);break e}nk(i,n,Gt,Rh,wy,e,Nn,Us,bl,Fr,s,0,-0,0)}}break}while(!0);Ti(t)}function nk(t,e,n,i,r,s,o,l,a,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(xc={stylesheets:null,count:0,unsuspend:B6},OO(e),f=q6(),f!==null)){t.cancelPendingCommit=f(rk.bind(null,t,e,s,n,i,r,o,l,a,u,1,h,d)),jr(t,s,o,!c);return}rk(t,e,s,n,i,r,o,l,a)}function n6(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!pn(s(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function jr(t,e,n,i){e&=~x0,e&=~Us,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-fn(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&Pk(t,n,e)}function Zh(){return(ye&6)===0?(zc(0,!1),!1):!0}function k0(){if(ne!==null){if(ge===0)var t=ne.return;else t=ne,nr=Xs=null,c0(t),cl=null,bc=0,t=ne;for(;t!==null;)hO(t.alternate,t),t=t.return;ne=null}}function Sl(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,b6(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),k0(),Oe=t,ne=n=rr(t.current,null),ce=e,ge=0,an=null,Fr=!1,Ol=Ec(t,e),S0=!1,bl=Nn=x0=Us=es=Fe=0,Gt=cc=null,wy=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-fn(i),s=1<<r;e|=t[r],i&=~s}return cr=e,Kh(),n}function RO(t,e){X=null,j.H=Oh,e===Bc||e===$h?(e=Lw(),ge=3):e===gA?(e=Lw(),ge=4):ge=e===oO?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,an=e,ne===null&&(Fe=1,Eh(t,Mn(e,t.current)))}function _O(){var t=j.H;return j.H=Oh,t===null?Oh:t}function LO(){var t=j.A;return j.A=e6,t}function Ty(){Fe=4,Fr||(ce&4194048)!==ce&&Rn.current!==null||(Ol=!0),(es&134217727)===0&&(Us&134217727)===0||Oe===null||jr(Oe,ce,Nn,!1)}function qg(t,e,n){var i=ye;ye|=2;var r=_O(),s=LO();(Oe!==t||ce!==e)&&(Rh=null,Sl(t,e)),e=!1;var o=Fe;e:do try{if(ge!==0&&ne!==null){var l=ne,a=an;switch(ge){case 8:k0(),o=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(e=!0);var c=ge;if(ge=0,an=null,nl(t,l,a,c),n&&Ol){o=0;break e}break;default:c=ge,ge=0,an=null,nl(t,l,a,c)}}i6(),o=Fe;break}catch(u){RO(t,u)}while(!0);return e&&t.shellSuspendCounter++,nr=Xs=null,ye=i,j.H=r,j.A=s,ne===null&&(Oe=null,ce=0,Kh()),o}function i6(){for(;ne!==null;)BO(ne)}function r6(t,e){var n=ye;ye|=2;var i=_O(),r=LO();Oe!==t||ce!==e?(Rh=null,Nh=ki()+500,Sl(t,e)):Ol=Ec(t,e);e:do try{if(ge!==0&&ne!==null){e=ne;var s=an;t:switch(ge){case 1:ge=0,an=null,nl(t,e,s,1);break;case 2:case 9:if(_w(s)){ge=0,an=null,ik(e);break}e=function(){ge!==2&&ge!==9||Oe!==t||(ge=7),Ti(t)},s.then(e,e);break e;case 3:ge=7;break e;case 4:ge=5;break e;case 7:_w(s)?(ge=0,an=null,ik(e)):(ge=0,an=null,nl(t,e,s,7));break;case 5:var o=null;switch(ne.tag){case 26:o=ne.memoizedState;case 5:case 27:var l=ne;if(!o||eT(o)){ge=0,an=null;var a=l.sibling;if(a!==null)ne=a;else{var c=l.return;c!==null?(ne=c,Jh(c)):ne=null}break t}}ge=0,an=null,nl(t,e,s,5);break;case 6:ge=0,an=null,nl(t,e,s,6);break;case 8:k0(),Fe=6;break e;default:throw Error(C(462))}}s6();break}catch(u){RO(t,u)}while(!0);return nr=Xs=null,j.H=i,j.A=r,ye=n,ne!==null?0:(Oe=null,ce=0,Kh(),Fe)}function s6(){for(;ne!==null&&!C5();)BO(ne)}function BO(t){var e=fO(t.alternate,t,cr);t.memoizedProps=t.pendingProps,e===null?Jh(t):ne=e}function ik(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=Xw(n,e,e.pendingProps,e.type,void 0,ce);break;case 11:e=Xw(n,e,e.pendingProps,e.type.render,e.ref,ce);break;case 5:c0(e);default:hO(n,e),e=ne=hA(e,cr),e=fO(n,e,cr)}t.memoizedProps=t.pendingProps,e===null?Jh(t):ne=e}function nl(t,e,n,i){nr=Xs=null,c0(e),cl=null,bc=0;var r=e.return;try{if($P(t,r,e,n,ce)){Fe=1,Eh(t,Mn(n,t.current)),ne=null;return}}catch(s){if(r!==null)throw ne=r,s;Fe=1,Eh(t,Mn(n,t.current)),ne=null;return}e.flags&32768?(he||i===1?t=!0:Ol||(ce&536870912)!==0?t=!1:(Fr=t=!0,(i===2||i===9||i===3||i===6)&&(i=Rn.current,i!==null&&i.tag===13&&(i.flags|=16384))),IO(e,t)):Jh(e)}function Jh(t){var e=t;do{if((e.flags&32768)!==0){IO(e,Fr);return}t=e.return;var n=XP(e.alternate,e,cr);if(n!==null){ne=n;return}if(e=e.sibling,e!==null){ne=e;return}ne=e=t}while(e!==null);Fe===0&&(Fe=5)}function IO(t,e){do{var n=WP(t.alternate,t);if(n!==null){n.flags&=32767,ne=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ne=t;return}ne=t=n}while(t!==null);Fe=6,ne=null}function rk(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do ed();while(gt!==0);if((ye&6)!==0)throw Error(C(327));if(e!==null){if(e===t.current)throw Error(C(177));if(s=e.lanes|e.childLanes,s|=Xy,q5(t,n,s,o,l,a),t===Oe&&(ne=Oe=null,ce=0),vl=e,$r=t,ul=n,ky=s,Ay=r,DO=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,c6(mh,function(){return UO(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=j.T,j.T=null,r=de.p,de.p=2,o=ye,ye|=4;try{ZP(t,e,n)}finally{ye=o,de.p=r,j.T=i}}gt=1,qO(),PO(),zO()}}function qO(){if(gt===1){gt=0;var t=$r,e=vl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=j.T,j.T=null;var i=de.p;de.p=2;var r=ye;ye|=4;try{wO(e,t);var s=My,o=rA(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&iA(l.ownerDocument.documentElement,l)){if(a!==null&&Gy(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),m=l.textContent.length,g=Math.min(a.start,m),b=a.end===void 0?g:Math.min(a.end,m);!d.extend&&g>b&&(o=b,b=g,g=o);var p=Ow(l,g),y=Ow(l,b);if(p&&y&&(d.rangeCount!==1||d.anchorNode!==p.node||d.anchorOffset!==p.offset||d.focusNode!==y.node||d.focusOffset!==y.offset)){var v=f.createRange();v.setStart(p.node,p.offset),d.removeAllRanges(),g>b?(d.addRange(v),d.extend(y.node,y.offset)):(v.setEnd(y.node,y.offset),d.addRange(v))}}}}for(f=[],d=l;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Hh=!!Dy,My=Dy=null}finally{ye=r,de.p=i,j.T=n}}t.current=e,gt=2}}function PO(){if(gt===2){gt=0;var t=$r,e=vl,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=j.T,j.T=null;var i=de.p;de.p=2;var r=ye;ye|=4;try{bO(t,e.alternate,e)}finally{ye=r,de.p=i,j.T=n}}gt=3}}function zO(){if(gt===4||gt===3){gt=0,E5();var t=$r,e=vl,n=ul,i=DO;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?gt=5:(gt=0,vl=$r=null,HO(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Qr=null),Fy(n),e=e.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(Cc,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=j.T,r=de.p,de.p=2,j.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{j.T=e,de.p=r}}(ul&3)!==0&&ed(),Ti(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===Oy?uc++:(uc=0,Oy=t):uc=0,zc(0,!1)}}function HO(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Lc(e)))}function ed(t){return qO(),PO(),zO(),UO(t)}function UO(){if(gt!==5)return!1;var t=$r,e=ky;ky=0;var n=Fy(ul),i=j.T,r=de.p;try{de.p=32>n?32:n,j.T=null,n=Ay,Ay=null;var s=$r,o=ul;if(gt=0,vl=$r=null,ul=0,(ye&6)!==0)throw Error(C(331));var l=ye;if(ye|=4,CO(s.current),AO(s,s.current,o,n),ye=l,zc(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Cc,s)}catch{}return!0}finally{de.p=r,j.T=i,HO(t,e)}}function sk(t,e,n){e=Mn(n,e),e=by(t.stateNode,e,2),t=Kr(t,e,2),t!==null&&(Dc(t,2),Ti(t))}function xe(t,e,n){if(t.tag===3)sk(t,t,n);else for(;e!==null;){if(e.tag===3){sk(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Qr===null||!Qr.has(i))){t=Mn(n,t),n=rO(2),i=Kr(e,n,2),i!==null&&(sO(n,i,e,t),Dc(i,2),Ti(i));break}}e=e.return}}function Pg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new t6;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(S0=!0,r.add(n),t=o6.bind(null,t,e,n),e.then(t,t))}function o6(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Oe===t&&(ce&n)===n&&(Fe===4||Fe===3&&(ce&62914560)===ce&&300>ki()-w0?(ye&2)===0&&Sl(t,0):x0|=n,bl===ce&&(bl=0)),Ti(t)}function FO(t,e){e===0&&(e=qk()),t=Al(t,e),t!==null&&(Dc(t,e),Ti(t))}function l6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),FO(t,n)}function a6(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(C(314))}i!==null&&i.delete(e),FO(t,n)}function c6(t,e){return Hy(t,e)}var _h=null,Vo=null,Cy=!1,Lh=!1,zg=!1,Fs=0;function Ti(t){t!==Vo&&t.next===null&&(Vo===null?_h=Vo=t:Vo=Vo.next=t),Lh=!0,Cy||(Cy=!0,f6())}function zc(t,e){if(!zg&&Lh){zg=!0;do for(var n=!1,i=_h;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-fn(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ok(i,s))}else s=ce,s=Fh(i,i===Oe?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||Ec(i,s)||(n=!0,ok(i,s));i=i.next}while(n);zg=!1}}function u6(){jO()}function jO(){Lh=Cy=!1;var t=0;Fs!==0&&(y6()&&(t=Fs),Fs=0);for(var e=ki(),n=null,i=_h;i!==null;){var r=i.next,s=VO(i,e);s===0?(i.next=null,n===null?_h=r:n.next=r,r===null&&(Vo=n)):(n=i,(t!==0||(s&3)!==0)&&(Lh=!0)),i=r}zc(t,!1)}function VO(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-fn(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=I5(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Oe,n=ce,n=Fh(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ge===2||ge===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&hg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Ec(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&hg(i),Fy(n)){case 2:case 8:n=Lk;break;case 32:n=mh;break;case 268435456:n=Bk;break;default:n=mh}return i=YO.bind(null,t),n=Hy(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&hg(i),t.callbackPriority=2,t.callbackNode=null,2}function YO(t,e){if(gt!==0&&gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(ed(!0)&&t.callbackNode!==n)return null;var i=ce;return i=Fh(t,t===Oe?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(NO(t,i,e),VO(t,ki()),t.callbackNode!=null&&t.callbackNode===n?YO.bind(null,t):null)}function ok(t,e){if(ed())return null;NO(t,e,!0)}function f6(){v6(function(){(ye&6)!==0?Hy(_k,u6):jO()})}function A0(){return Fs===0&&(Fs=Ik()),Fs}function lk(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:eh(""+t)}function ak(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function h6(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=lk((r[Xt]||null).action),o=i.submitter;o&&(e=(e=o[Xt]||null)?lk(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new jh("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Fs!==0){var a=o?ak(r,o):new FormData(r);gy(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?ak(r,o):new FormData(r),gy(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for($f=0;$f<ry.length;$f++)Gf=ry[$f],ck=Gf.toLowerCase(),uk=Gf[0].toUpperCase()+Gf.slice(1),Xn(ck,"on"+uk);var Gf,ck,uk,$f;Xn(oA,"onAnimationEnd");Xn(lA,"onAnimationIteration");Xn(aA,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(NP,"onTransitionRun");Xn(RP,"onTransitionStart");Xn(_P,"onTransitionCancel");Xn(cA,"onTransitionEnd");hl("onMouseEnter",["mouseout","mouseover"]);hl("onMouseLeave",["mouseout","mouseover"]);hl("onPointerEnter",["pointerout","pointerover"]);hl("onPointerLeave",["pointerout","pointerover"]);Qs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),d6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vc));function KO(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ch(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ch(u)}r.currentTarget=null,s=a}}}}function te(t,e){var n=e[Wg];n===void 0&&(n=e[Wg]=new Set);var i=t+"__bubble";n.has(i)||(QO(e,t,2,!1),n.add(i))}function Hg(t,e,n){var i=0;e&&(i|=4),QO(n,t,i,e)}var Xf="_reactListening"+Math.random().toString(36).slice(2);function O0(t){if(!t[Xf]){t[Xf]=!0,Uk.forEach(function(n){n!=="selectionchange"&&(d6.has(n)||Hg(n,!1,t),Hg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Xf]||(e[Xf]=!0,Hg("selectionchange",!1,e))}}function QO(t,e,n,i){switch(sT(e)){case 2:var r=H6;break;case 8:r=U6;break;default:r=D0}n=r.bind(null,e,n,t),r=void 0,!ty||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Ug(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Qo(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}Gk(function(){var c=s,u=Yy(n),f=[];e:{var h=uA.get(t);if(h!==void 0){var d=jh,m=t;switch(t){case"keypress":if(nh(n)===0)break e;case"keydown":case"keyup":d=cP;break;case"focusin":m="focus",d=Sg;break;case"focusout":m="blur",d=Sg;break;case"beforeblur":case"afterblur":d=Sg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=gw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=W5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=hP;break;case oA:case lA:case aA:d=eP;break;case cA:d=pP;break;case"scroll":case"scrollend":d=G5;break;case"wheel":d=gP;break;case"copy":case"cut":case"paste":d=nP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=bw;break;case"toggle":case"beforetoggle":d=bP}var g=(e&4)!==0,b=!g&&(t==="scroll"||t==="scrollend"),p=g?h!==null?h+"Capture":null:h;g=[];for(var y=c,v;y!==null;){var S=y;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||p===null||(S=dc(y,p),S!=null&&g.push(Sc(y,S,v))),b)break;y=y.return}0<g.length&&(h=new d(h,m,null,n,u),f.push({event:h,listeners:g}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==ey&&(m=n.relatedTarget||n.fromElement)&&(Qo(m)||m[wl]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(m=n.relatedTarget||n.toElement,d=c,m=m?Qo(m):null,m!==null&&(b=Tc(m),g=m.tag,m!==b||g!==5&&g!==27&&g!==6)&&(m=null)):(d=null,m=c),d!==m)){if(g=gw,S="onMouseLeave",p="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=bw,S="onPointerLeave",p="onPointerEnter",y="pointer"),b=d==null?h:Xa(d),v=m==null?h:Xa(m),h=new g(S,y+"leave",d,n,u),h.target=b,h.relatedTarget=v,S=null,Qo(u)===c&&(g=new g(p,y+"enter",m,n,u),g.target=v,g.relatedTarget=b,S=g),b=S,d&&m)t:{for(g=d,p=m,y=0,v=g;v;v=Uo(v))y++;for(v=0,S=p;S;S=Uo(S))v++;for(;0<y-v;)g=Uo(g),y--;for(;0<v-y;)p=Uo(p),v--;for(;y--;){if(g===p||p!==null&&g===p.alternate)break t;g=Uo(g),p=Uo(p)}g=null}else g=null;d!==null&&fk(f,h,d,g,!1),m!==null&&b!==null&&fk(f,b,m,g,!0)}}e:{if(h=c?Xa(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=ww;else if(xw(h))if(tA)w=EP;else{w=TP;var O=OP}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&Vy(c.elementType)&&(w=ww):w=CP;if(w&&(w=w(t,c))){eA(f,w,n,u);break e}O&&O(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&Jg(h,"number",h.value)}switch(O=c?Xa(c):window,t){case"focusin":(xw(O)||O.contentEditable==="true")&&(Xo=O,ny=c,ec=null);break;case"focusout":ec=ny=Xo=null;break;case"mousedown":iy=!0;break;case"contextmenu":case"mouseup":case"dragend":iy=!1,Tw(f,n,u);break;case"selectionchange":if(MP)break;case"keydown":case"keyup":Tw(f,n,u)}var k;if($y)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Go?Zk(t,n)&&(A="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Wk&&n.locale!=="ko"&&(Go||A!=="onCompositionStart"?A==="onCompositionEnd"&&Go&&(k=Xk()):(Ur=u,Ky="value"in Ur?Ur.value:Ur.textContent,Go=!0)),O=Bh(c,A),0<O.length&&(A=new yw(A,t,null,n,u),f.push({event:A,listeners:O}),k?A.data=k:(k=Jk(n),k!==null&&(A.data=k)))),(k=SP?xP(t,n):wP(t,n))&&(A=Bh(c,"onBeforeInput"),0<A.length&&(O=new yw("onBeforeInput","beforeinput",null,n,u),f.push({event:O,listeners:A}),O.data=k)),h6(f,t,c,n,u)}KO(f,e)})}function Sc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Bh(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=dc(t,n),r!=null&&i.unshift(Sc(t,r,s)),r=dc(t,e),r!=null&&i.push(Sc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function Uo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function fk(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=dc(n,s),c!=null&&o.unshift(Sc(n,c,a))):r||(c=dc(n,s),c!=null&&o.push(Sc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var p6=/\r\n?/g,m6=/\u0000|\uFFFD/g;function hk(t){return(typeof t=="string"?t:""+t).replace(p6,`
9
+ `).replace(m6,"")}function $O(t,e){return e=hk(e),hk(t)===e}function td(){}function ve(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||dl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&dl(t,""+i);break;case"className":zf(t,"class",i);break;case"tabIndex":zf(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":zf(t,n,i);break;case"style":$k(t,i,s);break;case"data":if(e!=="object"){zf(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=eh(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&ve(t,e,"name",r.name,r,null),ve(t,e,"formEncType",r.formEncType,r,null),ve(t,e,"formMethod",r.formMethod,r,null),ve(t,e,"formTarget",r.formTarget,r,null)):(ve(t,e,"encType",r.encType,r,null),ve(t,e,"method",r.method,r,null),ve(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=eh(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=td);break;case"onScroll":i!=null&&te("scroll",t);break;case"onScrollEnd":i!=null&&te("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(C(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(C(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=eh(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":te("beforetoggle",t),te("toggle",t),Jf(t,"popover",i);break;case"xlinkActuate":Gi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Gi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Gi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Gi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Gi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Gi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Jf(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Q5.get(n)||n,Jf(t,n,i))}}function Ey(t,e,n,i,r,s){switch(n){case"style":$k(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(C(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(C(60));t.innerHTML=n}}break;case"children":typeof i=="string"?dl(t,i):(typeof i=="number"||typeof i=="bigint")&&dl(t,""+i);break;case"onScroll":i!=null&&te("scroll",t);break;case"onScrollEnd":i!=null&&te("scrollend",t);break;case"onClick":i!=null&&(t.onclick=td);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fk.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[Xt]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Jf(t,n,i)}}}function yt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":te("error",t),te("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(C(137,e));default:ve(t,e,s,o,n,null)}}r&&ve(t,e,"srcSet",n.srcSet,n,null),i&&ve(t,e,"src",n.src,n,null);return;case"input":te("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(C(137,e));break;default:ve(t,e,i,u,n,null)}}Yk(t,s,l,a,c,o,r,!1),gh(t);return;case"select":te("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:ve(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?rl(t,!!i,e,!1):n!=null&&rl(t,!!i,n,!0);return;case"textarea":te("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(C(91));break;default:ve(t,e,o,l,n,null)}Qk(t,i,r,s),gh(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":ve(t,e,a,i,n,null));return;case"dialog":te("beforetoggle",t),te("toggle",t),te("cancel",t),te("close",t);break;case"iframe":case"object":te("load",t);break;case"video":case"audio":for(i=0;i<vc.length;i++)te(vc[i],t);break;case"image":te("error",t),te("load",t);break;case"details":te("toggle",t);break;case"embed":case"source":case"link":te("error",t),te("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(C(137,e));default:ve(t,e,c,i,n,null)}return;default:if(Vy(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Ey(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&ve(t,e,l,i,n,null))}function g6(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(d)||ve(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":s=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(C(137,e));break;default:d!==f&&ve(t,e,h,d,i,f)}}Zg(t,o,l,a,c,u,s,r);return;case"select":d=o=l=h=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":d=a;default:i.hasOwnProperty(s)||ve(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":h=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&ve(t,e,r,s,i,a)}e=l,n=o,i=d,h!=null?rl(t,!!n,h,!1):!!i!=!!n&&(e!=null?rl(t,!!n,e,!0):rl(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:ve(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(C(91));break;default:r!==s&&ve(t,e,o,r,i,s)}Kk(t,h,d);return;case"option":for(var m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!i.hasOwnProperty(m)&&(m==="selected"?t.selected=!1:ve(t,e,m,null,i,h));for(a in i)h=i[a],d=n[a],i.hasOwnProperty(a)&&h!==d&&(h!=null||d!=null)&&(a==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":ve(t,e,a,h,i,d));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!i.hasOwnProperty(g)&&ve(t,e,g,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(C(137,e));break;default:ve(t,e,c,h,i,d)}return;default:if(Vy(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Ey(t,e,b,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||Ey(t,e,u,h,i,d);return}}for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&ve(t,e,p,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||ve(t,e,f,h,i,d)}var Dy=null,My=null;function Ih(t){return t.nodeType===9?t:t.ownerDocument}function dk(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function GO(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Ny(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Fg=null;function y6(){var t=window.event;return t&&t.type==="popstate"?t===Fg?!1:(Fg=t,!0):(Fg=null,!1)}var XO=typeof setTimeout=="function"?setTimeout:void 0,b6=typeof clearTimeout=="function"?clearTimeout:void 0,pk=typeof Promise=="function"?Promise:void 0,v6=typeof queueMicrotask=="function"?queueMicrotask:typeof pk<"u"?function(t){return pk.resolve(null).then(t).catch(S6)}:XO;function S6(t){setTimeout(function(){throw t})}function ns(t){return t==="head"}function mk(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&fc(o.documentElement),n&2&&fc(o.body),n&4)for(n=o.head,fc(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[Mc]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),Oc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);Oc(e)}function Ry(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ry(n),jy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function x6(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Mc])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Gn(t.nextSibling),t===null)break}return null}function w6(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Gn(t.nextSibling),t===null))return null;return t}function _y(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function k6(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Gn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var Ly=null;function gk(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function WO(t,e,n){switch(e=Ih(n),t){case"html":if(t=e.documentElement,!t)throw Error(C(452));return t;case"head":if(t=e.head,!t)throw Error(C(453));return t;case"body":if(t=e.body,!t)throw Error(C(454));return t;default:throw Error(C(451))}}function fc(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);jy(t)}var _n=new Map,yk=new Set;function qh(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ur=de.d;de.d={f:A6,r:O6,D:T6,C:C6,L:E6,m:D6,X:N6,S:M6,M:R6};function A6(){var t=ur.f(),e=Zh();return t||e}function O6(t){var e=kl(t);e!==null&&e.tag===5&&e.type==="form"?VA(e):ur.r(t)}var Tl=typeof document>"u"?null:document;function ZO(t,e,n){var i=Tl;if(i&&typeof e=="string"&&e){var r=Dn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),yk.has(r)||(yk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),yt(e,"link",t),at(e),i.head.appendChild(e)))}}function T6(t){ur.D(t),ZO("dns-prefetch",t,null)}function C6(t,e){ur.C(t,e),ZO("preconnect",t,e)}function E6(t,e,n){ur.L(t,e,n);var i=Tl;if(i&&t&&e){var r='link[rel="preload"][as="'+Dn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Dn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Dn(n.imageSizes)+'"]')):r+='[href="'+Dn(t)+'"]';var s=r;switch(e){case"style":s=xl(t);break;case"script":s=Cl(t)}_n.has(s)||(t=De({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),_n.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Hc(s))||e==="script"&&i.querySelector(Uc(s))||(e=i.createElement("link"),yt(e,"link",t),at(e),i.head.appendChild(e)))}}function D6(t,e){ur.m(t,e);var n=Tl;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Dn(i)+'"][href="'+Dn(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Cl(t)}if(!_n.has(s)&&(t=De({rel:"modulepreload",href:t},e),_n.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Uc(s)))return}i=n.createElement("link"),yt(i,"link",t),at(i),n.head.appendChild(i)}}}function M6(t,e,n){ur.S(t,e,n);var i=Tl;if(i&&t){var r=il(i).hoistableStyles,s=xl(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Hc(s)))l.loading=5;else{t=De({rel:"stylesheet",href:t,"data-precedence":e},n),(n=_n.get(s))&&T0(t,n);var a=o=i.createElement("link");at(a),yt(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,ch(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function N6(t,e){ur.X(t,e);var n=Tl;if(n&&t){var i=il(n).hoistableScripts,r=Cl(t),s=i.get(r);s||(s=n.querySelector(Uc(r)),s||(t=De({src:t,async:!0},e),(e=_n.get(r))&&C0(t,e),s=n.createElement("script"),at(s),yt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function R6(t,e){ur.M(t,e);var n=Tl;if(n&&t){var i=il(n).hoistableScripts,r=Cl(t),s=i.get(r);s||(s=n.querySelector(Uc(r)),s||(t=De({src:t,async:!0,type:"module"},e),(e=_n.get(r))&&C0(t,e),s=n.createElement("script"),at(s),yt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function bk(t,e,n,i){var r=(r=Vr.current)?qh(r):null;if(!r)throw Error(C(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=xl(n.href),n=il(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=xl(n.href);var s=il(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Hc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),_n.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_n.set(t,n),s||_6(r,t,n,o.state))),e&&i===null)throw Error(C(528,""));return o}if(e&&i!==null)throw Error(C(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Cl(n),n=il(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(C(444,t))}}function xl(t){return'href="'+Dn(t)+'"'}function Hc(t){return'link[rel="stylesheet"]['+t+"]"}function JO(t){return De({},t,{"data-precedence":t.precedence,precedence:null})}function _6(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),yt(e,"link",n),at(e),t.head.appendChild(e))}function Cl(t){return'[src="'+Dn(t)+'"]'}function Uc(t){return"script[async]"+t}function vk(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+Dn(n.href)+'"]');if(i)return e.instance=i,at(i),i;var r=De({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),at(i),yt(i,"style",r),ch(i,n.precedence,t),e.instance=i;case"stylesheet":r=xl(n.href);var s=t.querySelector(Hc(r));if(s)return e.state.loading|=4,e.instance=s,at(s),s;i=JO(n),(r=_n.get(r))&&T0(i,r),s=(t.ownerDocument||t).createElement("link"),at(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),yt(s,"link",i),e.state.loading|=4,ch(s,n.precedence,t),e.instance=s;case"script":return s=Cl(n.src),(r=t.querySelector(Uc(s)))?(e.instance=r,at(r),r):(i=n,(r=_n.get(s))&&(i=De({},n),C0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),at(r),yt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(C(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,ch(i,n.precedence,t));return e.instance}function ch(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function T0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function C0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var uh=null;function Sk(t,e,n){if(uh===null){var i=new Map,r=uh=new Map;r.set(n,i)}else r=uh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[Mc]||s[At]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function xk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function L6(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function eT(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var xc=null;function B6(){}function I6(t,e,n){if(xc===null)throw Error(C(475));var i=xc;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=xl(n.href),s=t.querySelector(Hc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=Ph.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,at(s);return}s=t.ownerDocument||t,n=JO(n),(r=_n.get(r))&&T0(n,r),s=s.createElement("link"),at(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),yt(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=Ph.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function q6(){if(xc===null)throw Error(C(475));var t=xc;return t.stylesheets&&t.count===0&&By(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&By(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function Ph(){if(this.count--,this.count===0){if(this.stylesheets)By(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var zh=null;function By(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,zh=new Map,e.forEach(P6,t),zh=null,Ph.call(t))}function P6(t,e){if(!(e.state.loading&4)){var n=zh.get(t);if(n)var i=n.get(null);else{n=new Map,zh.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=Ph.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var wc={$$typeof:Ji,Provider:null,Consumer:null,_currentValue:Is,_currentValue2:Is,_threadCount:0};function z6(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dg(0),this.hiddenUpdates=dg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function tT(t,e,n,i,r,s,o,l,a,c,u,f){return t=new z6(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=cn(3,null,null,e),t.current=s,s.stateNode=t,e=t0(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},i0(s),t}function nT(t){return t?(t=Jo,t):Jo}function iT(t,e,n,i,r,s){r=nT(r),i.context===null?i.context=r:i.pendingContext=r,i=Yr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Kr(t,i,e),n!==null&&(dn(n,t,e),ic(n,t,e))}function wk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function E0(t,e){wk(t,e),(t=t.alternate)&&wk(t,e)}function rT(t){if(t.tag===13){var e=Al(t,67108864);e!==null&&dn(e,t,67108864),E0(t,67108864)}}var Hh=!0;function H6(t,e,n,i){var r=j.T;j.T=null;var s=de.p;try{de.p=2,D0(t,e,n,i)}finally{de.p=s,j.T=r}}function U6(t,e,n,i){var r=j.T;j.T=null;var s=de.p;try{de.p=8,D0(t,e,n,i)}finally{de.p=s,j.T=r}}function D0(t,e,n,i){if(Hh){var r=Iy(i);if(r===null)Ug(t,e,i,Uh,n),kk(t,i);else if(j6(r,t,e,n,i))i.stopPropagation();else if(kk(t,i),e&4&&-1<F6.indexOf(t)){for(;r!==null;){var s=kl(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=_s(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-fn(o);l.entanglements[1]|=a,o&=~a}Ti(s),(ye&6)===0&&(Nh=ki()+500,zc(0,!1))}}break;case 13:l=Al(s,2),l!==null&&dn(l,s,2),Zh(),E0(s,2)}if(s=Iy(i),s===null&&Ug(t,e,i,Uh,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else Ug(t,e,i,null,n)}}function Iy(t){return t=Yy(t),M0(t)}var Uh=null;function M0(t){if(Uh=null,t=Qo(t),t!==null){var e=Tc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Dk(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Uh=t,null}function sT(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(D5()){case _k:return 2;case Lk:return 8;case mh:case M5:return 32;case Bk:return 268435456;default:return 32}default:return 32}}var qy=!1,Gr=null,Xr=null,Wr=null,kc=new Map,Ac=new Map,zr=[],F6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function kk(t,e){switch(t){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":kc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ac.delete(e.pointerId)}}function Ka(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=kl(e),e!==null&&rT(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function j6(t,e,n,i,r){switch(e){case"focusin":return Gr=Ka(Gr,t,e,n,i,r),!0;case"dragenter":return Xr=Ka(Xr,t,e,n,i,r),!0;case"mouseover":return Wr=Ka(Wr,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return kc.set(s,Ka(kc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,Ac.set(s,Ka(Ac.get(s)||null,t,e,n,i,r)),!0}return!1}function oT(t){var e=Qo(t.target);if(e!==null){var n=Tc(e);if(n!==null){if(e=n.tag,e===13){if(e=Dk(n),e!==null){t.blockedOn=e,P5(t.priority,function(){if(n.tag===13){var i=hn();i=Uy(i);var r=Al(n,i);r!==null&&dn(r,n,i),E0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function fh(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Iy(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);ey=i,n.target.dispatchEvent(i),ey=null}else return e=kl(n),e!==null&&rT(e),t.blockedOn=n,!1;e.shift()}return!0}function Ak(t,e,n){fh(t)&&n.delete(e)}function V6(){qy=!1,Gr!==null&&fh(Gr)&&(Gr=null),Xr!==null&&fh(Xr)&&(Xr=null),Wr!==null&&fh(Wr)&&(Wr=null),kc.forEach(Ak),Ac.forEach(Ak)}function Wf(t,e){t.blockedOn===e&&(t.blockedOn=null,qy||(qy=!0,tt.unstable_scheduleCallback(tt.unstable_NormalPriority,V6)))}var Zf=null;function Ok(t){Zf!==t&&(Zf=t,tt.unstable_scheduleCallback(tt.unstable_NormalPriority,function(){Zf===t&&(Zf=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(M0(i||n)===null)continue;break}var s=kl(n);s!==null&&(t.splice(e,3),e-=3,gy(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Oc(t){function e(a){return Wf(a,t)}Gr!==null&&Wf(Gr,t),Xr!==null&&Wf(Xr,t),Wr!==null&&Wf(Wr,t),kc.forEach(e),Ac.forEach(e);for(var n=0;n<zr.length;n++){var i=zr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)oT(n),n.blockedOn===null&&zr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[Xt]||null;if(typeof s=="function")o||Ok(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[Xt]||null)l=o.formAction;else if(M0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),Ok(n)}}}function N0(t){this._internalRoot=t}nd.prototype.render=N0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(C(409));var n=e.current,i=hn();iT(n,i,t,e,null,null)};nd.prototype.unmount=N0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;iT(t.current,2,null,t,null,null),Zh(),e[wl]=null}};function nd(t){this._internalRoot=t}nd.prototype.unstable_scheduleHydration=function(t){if(t){var e=Hk();t={blockedOn:null,target:t,priority:e};for(var n=0;n<zr.length&&e!==0&&e<zr[n].priority;n++);zr.splice(n,0,t),n===0&&oT(t)}};var Tk=Ck.version;if(Tk!=="19.1.0")throw Error(C(527,Tk,"19.1.0"));de.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(C(188)):(t=Object.keys(t).join(","),Error(C(268,t)));return t=w5(e),t=t!==null?Mk(t):null,t=t===null?null:t.stateNode,t};var Y6={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Qa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Qa.isDisabled&&Qa.supportsFiber))try{Cc=Qa.inject(Y6),un=Qa}catch{}var Qa;id.createRoot=function(t,e){if(!Ek(t))throw Error(C(299));var n=!1,i="",r=tO,s=nO,o=iO,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=tT(t,1,!1,null,null,n,i,r,s,o,l,null),t[wl]=e.current,O0(t),new N0(e)};id.hydrateRoot=function(t,e,n){if(!Ek(t))throw Error(C(299));var i=!1,r="",s=tO,o=nO,l=iO,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=tT(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=nT(null),n=e.current,i=hn(),i=Uy(i),r=Yr(i),r.callback=null,Kr(n,r,i),n=i,e.current.lanes=n,Dc(e,n),Ti(e),t[wl]=e.current,O0(t),new nd(e)};id.version="19.1.0"});var uT=x((xse,cT)=>{"use strict";function aT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aT)}catch(t){console.error(t)}}aT(),cT.exports=lT()});var qC=x(Xd=>{"use strict";var tU=Symbol.for("react.transitional.element"),nU=Symbol.for("react.fragment");function IC(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:tU,type:t,key:i,ref:e!==void 0?e:null,props:n}}Xd.Fragment=nU;Xd.jsx=IC;Xd.jsxs=IC});var Ut=x((Ife,PC)=>{"use strict";PC.exports=qC()});var XN=x((Kpe,GN)=>{"use strict";function bY(){this.__data__=[],this.size=0}GN.exports=bY});var Sm=x((Qpe,WN)=>{"use strict";function vY(t,e){return t===e||t!==t&&e!==e}WN.exports=vY});var lf=x(($pe,ZN)=>{"use strict";var SY=Sm();function xY(t,e){for(var n=t.length;n--;)if(SY(t[n][0],e))return n;return-1}ZN.exports=xY});var eR=x((Gpe,JN)=>{"use strict";var wY=lf(),kY=Array.prototype,AY=kY.splice;function OY(t){var e=this.__data__,n=wY(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():AY.call(e,n,1),--this.size,!0}JN.exports=OY});var nR=x((Xpe,tR)=>{"use strict";var TY=lf();function CY(t){var e=this.__data__,n=TY(e,t);return n<0?void 0:e[n][1]}tR.exports=CY});var rR=x((Wpe,iR)=>{"use strict";var EY=lf();function DY(t){return EY(this.__data__,t)>-1}iR.exports=DY});var oR=x((Zpe,sR)=>{"use strict";var MY=lf();function NY(t,e){var n=this.__data__,i=MY(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}sR.exports=NY});var af=x((Jpe,lR)=>{"use strict";var RY=XN(),_Y=eR(),LY=nR(),BY=rR(),IY=oR();function Aa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Aa.prototype.clear=RY;Aa.prototype.delete=_Y;Aa.prototype.get=LY;Aa.prototype.has=BY;Aa.prototype.set=IY;lR.exports=Aa});var cR=x((eme,aR)=>{"use strict";var qY=af();function PY(){this.__data__=new qY,this.size=0}aR.exports=PY});var fR=x((tme,uR)=>{"use strict";function zY(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}uR.exports=zY});var dR=x((nme,hR)=>{"use strict";function HY(t){return this.__data__.get(t)}hR.exports=HY});var mR=x((ime,pR)=>{"use strict";function UY(t){return this.__data__.has(t)}pR.exports=UY});var RS=x((rme,gR)=>{"use strict";var FY=typeof global=="object"&&global&&global.Object===Object&&global;gR.exports=FY});var pi=x((sme,yR)=>{"use strict";var jY=RS(),VY=typeof self=="object"&&self&&self.Object===Object&&self,YY=jY||VY||Function("return this")();yR.exports=YY});var To=x((ome,bR)=>{"use strict";var KY=pi(),QY=KY.Symbol;bR.exports=QY});var wR=x((lme,xR)=>{"use strict";var vR=To(),SR=Object.prototype,$Y=SR.hasOwnProperty,GY=SR.toString,cf=vR?vR.toStringTag:void 0;function XY(t){var e=$Y.call(t,cf),n=t[cf];try{t[cf]=void 0;var i=!0}catch{}var r=GY.call(t);return i&&(e?t[cf]=n:delete t[cf]),r}xR.exports=XY});var AR=x((ame,kR)=>{"use strict";var WY=Object.prototype,ZY=WY.toString;function JY(t){return ZY.call(t)}kR.exports=JY});var Co=x((cme,CR)=>{"use strict";var OR=To(),eK=wR(),tK=AR(),nK="[object Null]",iK="[object Undefined]",TR=OR?OR.toStringTag:void 0;function rK(t){return t==null?t===void 0?iK:nK:TR&&TR in Object(t)?eK(t):tK(t)}CR.exports=rK});var Cs=x((ume,ER)=>{"use strict";function sK(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}ER.exports=sK});var uf=x((fme,DR)=>{"use strict";var oK=Co(),lK=Cs(),aK="[object AsyncFunction]",cK="[object Function]",uK="[object GeneratorFunction]",fK="[object Proxy]";function hK(t){if(!lK(t))return!1;var e=oK(t);return e==cK||e==uK||e==aK||e==fK}DR.exports=hK});var NR=x((hme,MR)=>{"use strict";var dK=pi(),pK=dK["__core-js_shared__"];MR.exports=pK});var LR=x((dme,_R)=>{"use strict";var _S=NR(),RR=(function(){var t=/[^.]+$/.exec(_S&&_S.keys&&_S.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function mK(t){return!!RR&&RR in t}_R.exports=mK});var LS=x((pme,BR)=>{"use strict";var gK=Function.prototype,yK=gK.toString;function bK(t){if(t!=null){try{return yK.call(t)}catch{}try{return t+""}catch{}}return""}BR.exports=bK});var qR=x((mme,IR)=>{"use strict";var vK=uf(),SK=LR(),xK=Cs(),wK=LS(),kK=/[\\^$.*+?()[\]{}|]/g,AK=/^\[object .+?Constructor\]$/,OK=Function.prototype,TK=Object.prototype,CK=OK.toString,EK=TK.hasOwnProperty,DK=RegExp("^"+CK.call(EK).replace(kK,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MK(t){if(!xK(t)||SK(t))return!1;var e=vK(t)?DK:AK;return e.test(wK(t))}IR.exports=MK});var zR=x((gme,PR)=>{"use strict";function NK(t,e){return t?.[e]}PR.exports=NK});var Es=x((yme,HR)=>{"use strict";var RK=qR(),_K=zR();function LK(t,e){var n=_K(t,e);return RK(n)?n:void 0}HR.exports=LK});var xm=x((bme,UR)=>{"use strict";var BK=Es(),IK=pi(),qK=BK(IK,"Map");UR.exports=qK});var ff=x((vme,FR)=>{"use strict";var PK=Es(),zK=PK(Object,"create");FR.exports=zK});var YR=x((Sme,VR)=>{"use strict";var jR=ff();function HK(){this.__data__=jR?jR(null):{},this.size=0}VR.exports=HK});var QR=x((xme,KR)=>{"use strict";function UK(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}KR.exports=UK});var GR=x((wme,$R)=>{"use strict";var FK=ff(),jK="__lodash_hash_undefined__",VK=Object.prototype,YK=VK.hasOwnProperty;function KK(t){var e=this.__data__;if(FK){var n=e[t];return n===jK?void 0:n}return YK.call(e,t)?e[t]:void 0}$R.exports=KK});var WR=x((kme,XR)=>{"use strict";var QK=ff(),$K=Object.prototype,GK=$K.hasOwnProperty;function XK(t){var e=this.__data__;return QK?e[t]!==void 0:GK.call(e,t)}XR.exports=XK});var JR=x((Ame,ZR)=>{"use strict";var WK=ff(),ZK="__lodash_hash_undefined__";function JK(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=WK&&e===void 0?ZK:e,this}ZR.exports=JK});var t_=x((Ome,e_)=>{"use strict";var eQ=YR(),tQ=QR(),nQ=GR(),iQ=WR(),rQ=JR();function Oa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Oa.prototype.clear=eQ;Oa.prototype.delete=tQ;Oa.prototype.get=nQ;Oa.prototype.has=iQ;Oa.prototype.set=rQ;e_.exports=Oa});var r_=x((Tme,i_)=>{"use strict";var n_=t_(),sQ=af(),oQ=xm();function lQ(){this.size=0,this.__data__={hash:new n_,map:new(oQ||sQ),string:new n_}}i_.exports=lQ});var o_=x((Cme,s_)=>{"use strict";function aQ(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}s_.exports=aQ});var hf=x((Eme,l_)=>{"use strict";var cQ=o_();function uQ(t,e){var n=t.__data__;return cQ(e)?n[typeof e=="string"?"string":"hash"]:n.map}l_.exports=uQ});var c_=x((Dme,a_)=>{"use strict";var fQ=hf();function hQ(t){var e=fQ(this,t).delete(t);return this.size-=e?1:0,e}a_.exports=hQ});var f_=x((Mme,u_)=>{"use strict";var dQ=hf();function pQ(t){return dQ(this,t).get(t)}u_.exports=pQ});var d_=x((Nme,h_)=>{"use strict";var mQ=hf();function gQ(t){return mQ(this,t).has(t)}h_.exports=gQ});var m_=x((Rme,p_)=>{"use strict";var yQ=hf();function bQ(t,e){var n=yQ(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}p_.exports=bQ});var wm=x((_me,g_)=>{"use strict";var vQ=r_(),SQ=c_(),xQ=f_(),wQ=d_(),kQ=m_();function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ta.prototype.clear=vQ;Ta.prototype.delete=SQ;Ta.prototype.get=xQ;Ta.prototype.has=wQ;Ta.prototype.set=kQ;g_.exports=Ta});var b_=x((Lme,y_)=>{"use strict";var AQ=af(),OQ=xm(),TQ=wm(),CQ=200;function EQ(t,e){var n=this.__data__;if(n instanceof AQ){var i=n.__data__;if(!OQ||i.length<CQ-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new TQ(i)}return n.set(t,e),this.size=n.size,this}y_.exports=EQ});var km=x((Bme,v_)=>{"use strict";var DQ=af(),MQ=cR(),NQ=fR(),RQ=dR(),_Q=mR(),LQ=b_();function Ca(t){var e=this.__data__=new DQ(t);this.size=e.size}Ca.prototype.clear=MQ;Ca.prototype.delete=NQ;Ca.prototype.get=RQ;Ca.prototype.has=_Q;Ca.prototype.set=LQ;v_.exports=Ca});var Am=x((Ime,S_)=>{"use strict";function BQ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}S_.exports=BQ});var BS=x((qme,x_)=>{"use strict";var IQ=Es(),qQ=(function(){try{var t=IQ(Object,"defineProperty");return t({},"",{}),t}catch{}})();x_.exports=qQ});var IS=x((Pme,k_)=>{"use strict";var w_=BS();function PQ(t,e,n){e=="__proto__"&&w_?w_(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}k_.exports=PQ});var qS=x((zme,A_)=>{"use strict";var zQ=IS(),HQ=Sm(),UQ=Object.prototype,FQ=UQ.hasOwnProperty;function jQ(t,e,n){var i=t[e];(!(FQ.call(t,e)&&HQ(i,n))||n===void 0&&!(e in t))&&zQ(t,e,n)}A_.exports=jQ});var df=x((Hme,O_)=>{"use strict";var VQ=qS(),YQ=IS();function KQ(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?YQ(n,l,a):VQ(n,l,a)}return n}O_.exports=KQ});var C_=x((Ume,T_)=>{"use strict";function QQ(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}T_.exports=QQ});var ji=x((Fme,E_)=>{"use strict";function $Q(t){return t!=null&&typeof t=="object"}E_.exports=$Q});var M_=x((jme,D_)=>{"use strict";var GQ=Co(),XQ=ji(),WQ="[object Arguments]";function ZQ(t){return XQ(t)&&GQ(t)==WQ}D_.exports=ZQ});var pf=x((Vme,__)=>{"use strict";var N_=M_(),JQ=ji(),R_=Object.prototype,e$=R_.hasOwnProperty,t$=R_.propertyIsEnumerable,n$=N_((function(){return arguments})())?N_:function(t){return JQ(t)&&e$.call(t,"callee")&&!t$.call(t,"callee")};__.exports=n$});var rt=x((Yme,L_)=>{"use strict";var i$=Array.isArray;L_.exports=i$});var I_=x((Kme,B_)=>{"use strict";function r$(){return!1}B_.exports=r$});var Da=x((mf,Ea)=>{"use strict";var s$=pi(),o$=I_(),z_=typeof mf=="object"&&mf&&!mf.nodeType&&mf,q_=z_&&typeof Ea=="object"&&Ea&&!Ea.nodeType&&Ea,l$=q_&&q_.exports===z_,P_=l$?s$.Buffer:void 0,a$=P_?P_.isBuffer:void 0,c$=a$||o$;Ea.exports=c$});var PS=x((Qme,H_)=>{"use strict";var u$=9007199254740991,f$=/^(?:0|[1-9]\d*)$/;function h$(t,e){var n=typeof t;return e=e??u$,!!e&&(n=="number"||n!="symbol"&&f$.test(t))&&t>-1&&t%1==0&&t<e}H_.exports=h$});var Om=x(($me,U_)=>{"use strict";var d$=9007199254740991;function p$(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=d$}U_.exports=p$});var j_=x((Gme,F_)=>{"use strict";var m$=Co(),g$=Om(),y$=ji(),b$="[object Arguments]",v$="[object Array]",S$="[object Boolean]",x$="[object Date]",w$="[object Error]",k$="[object Function]",A$="[object Map]",O$="[object Number]",T$="[object Object]",C$="[object RegExp]",E$="[object Set]",D$="[object String]",M$="[object WeakMap]",N$="[object ArrayBuffer]",R$="[object DataView]",_$="[object Float32Array]",L$="[object Float64Array]",B$="[object Int8Array]",I$="[object Int16Array]",q$="[object Int32Array]",P$="[object Uint8Array]",z$="[object Uint8ClampedArray]",H$="[object Uint16Array]",U$="[object Uint32Array]",Ne={};Ne[_$]=Ne[L$]=Ne[B$]=Ne[I$]=Ne[q$]=Ne[P$]=Ne[z$]=Ne[H$]=Ne[U$]=!0;Ne[b$]=Ne[v$]=Ne[N$]=Ne[S$]=Ne[R$]=Ne[x$]=Ne[w$]=Ne[k$]=Ne[A$]=Ne[O$]=Ne[T$]=Ne[C$]=Ne[E$]=Ne[D$]=Ne[M$]=!1;function F$(t){return y$(t)&&g$(t.length)&&!!Ne[m$(t)]}F_.exports=F$});var Tm=x((Xme,V_)=>{"use strict";function j$(t){return function(e){return t(e)}}V_.exports=j$});var Cm=x((gf,Ma)=>{"use strict";var V$=RS(),Y_=typeof gf=="object"&&gf&&!gf.nodeType&&gf,yf=Y_&&typeof Ma=="object"&&Ma&&!Ma.nodeType&&Ma,Y$=yf&&yf.exports===Y_,zS=Y$&&V$.process,K$=(function(){try{var t=yf&&yf.require&&yf.require("util").types;return t||zS&&zS.binding&&zS.binding("util")}catch{}})();Ma.exports=K$});var bf=x((Wme,$_)=>{"use strict";var Q$=j_(),$$=Tm(),K_=Cm(),Q_=K_&&K_.isTypedArray,G$=Q_?$$(Q_):Q$;$_.exports=G$});var HS=x((Zme,G_)=>{"use strict";var X$=C_(),W$=pf(),Z$=rt(),J$=Da(),eG=PS(),tG=bf(),nG=Object.prototype,iG=nG.hasOwnProperty;function rG(t,e){var n=Z$(t),i=!n&&W$(t),r=!n&&!i&&J$(t),s=!n&&!i&&!r&&tG(t),o=n||i||r||s,l=o?X$(t.length,String):[],a=l.length;for(var c in t)(e||iG.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eG(c,a)))&&l.push(c);return l}G_.exports=rG});var vf=x((Jme,X_)=>{"use strict";var sG=Object.prototype;function oG(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||sG;return t===n}X_.exports=oG});var US=x((ege,W_)=>{"use strict";function lG(t,e){return function(n){return t(e(n))}}W_.exports=lG});var J_=x((tge,Z_)=>{"use strict";var aG=US(),cG=aG(Object.keys,Object);Z_.exports=cG});var Em=x((nge,eL)=>{"use strict";var uG=vf(),fG=J_(),hG=Object.prototype,dG=hG.hasOwnProperty;function pG(t){if(!uG(t))return fG(t);var e=[];for(var n in Object(t))dG.call(t,n)&&n!="constructor"&&e.push(n);return e}eL.exports=pG});var Ds=x((ige,tL)=>{"use strict";var mG=uf(),gG=Om();function yG(t){return t!=null&&gG(t.length)&&!mG(t)}tL.exports=yG});var Ms=x((rge,nL)=>{"use strict";var bG=HS(),vG=Em(),SG=Ds();function xG(t){return SG(t)?bG(t):vG(t)}nL.exports=xG});var rL=x((sge,iL)=>{"use strict";var wG=df(),kG=Ms();function AG(t,e){return t&&wG(e,kG(e),t)}iL.exports=AG});var oL=x((oge,sL)=>{"use strict";function OG(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}sL.exports=OG});var aL=x((lge,lL)=>{"use strict";var TG=Cs(),CG=vf(),EG=oL(),DG=Object.prototype,MG=DG.hasOwnProperty;function NG(t){if(!TG(t))return EG(t);var e=CG(t),n=[];for(var i in t)i=="constructor"&&(e||!MG.call(t,i))||n.push(i);return n}lL.exports=NG});var Dm=x((age,cL)=>{"use strict";var RG=HS(),_G=aL(),LG=Ds();function BG(t){return LG(t)?RG(t,!0):_G(t)}cL.exports=BG});var fL=x((cge,uL)=>{"use strict";var IG=df(),qG=Dm();function PG(t,e){return t&&IG(e,qG(e),t)}uL.exports=PG});var gL=x((Sf,Na)=>{"use strict";var zG=pi(),mL=typeof Sf=="object"&&Sf&&!Sf.nodeType&&Sf,hL=mL&&typeof Na=="object"&&Na&&!Na.nodeType&&Na,HG=hL&&hL.exports===mL,dL=HG?zG.Buffer:void 0,pL=dL?dL.allocUnsafe:void 0;function UG(t,e){if(e)return t.slice();var n=t.length,i=pL?pL(n):new t.constructor(n);return t.copy(i),i}Na.exports=UG});var bL=x((uge,yL)=>{"use strict";function FG(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}yL.exports=FG});var FS=x((fge,vL)=>{"use strict";function jG(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}vL.exports=jG});var jS=x((hge,SL)=>{"use strict";function VG(){return[]}SL.exports=VG});var Mm=x((dge,wL)=>{"use strict";var YG=FS(),KG=jS(),QG=Object.prototype,$G=QG.propertyIsEnumerable,xL=Object.getOwnPropertySymbols,GG=xL?function(t){return t==null?[]:(t=Object(t),YG(xL(t),function(e){return $G.call(t,e)}))}:KG;wL.exports=GG});var AL=x((pge,kL)=>{"use strict";var XG=df(),WG=Mm();function ZG(t,e){return XG(t,WG(t),e)}kL.exports=ZG});var Nm=x((mge,OL)=>{"use strict";function JG(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}OL.exports=JG});var Rm=x((gge,TL)=>{"use strict";var eX=US(),tX=eX(Object.getPrototypeOf,Object);TL.exports=tX});var VS=x((yge,CL)=>{"use strict";var nX=Nm(),iX=Rm(),rX=Mm(),sX=jS(),oX=Object.getOwnPropertySymbols,lX=oX?function(t){for(var e=[];t;)nX(e,rX(t)),t=iX(t);return e}:sX;CL.exports=lX});var DL=x((bge,EL)=>{"use strict";var aX=df(),cX=VS();function uX(t,e){return aX(t,cX(t),e)}EL.exports=uX});var YS=x((vge,ML)=>{"use strict";var fX=Nm(),hX=rt();function dX(t,e,n){var i=e(t);return hX(t)?i:fX(i,n(t))}ML.exports=dX});var KS=x((Sge,NL)=>{"use strict";var pX=YS(),mX=Mm(),gX=Ms();function yX(t){return pX(t,gX,mX)}NL.exports=yX});var _L=x((xge,RL)=>{"use strict";var bX=YS(),vX=VS(),SX=Dm();function xX(t){return bX(t,SX,vX)}RL.exports=xX});var BL=x((wge,LL)=>{"use strict";var wX=Es(),kX=pi(),AX=wX(kX,"DataView");LL.exports=AX});var qL=x((kge,IL)=>{"use strict";var OX=Es(),TX=pi(),CX=OX(TX,"Promise");IL.exports=CX});var QS=x((Age,PL)=>{"use strict";var EX=Es(),DX=pi(),MX=EX(DX,"Set");PL.exports=MX});var HL=x((Oge,zL)=>{"use strict";var NX=Es(),RX=pi(),_X=NX(RX,"WeakMap");zL.exports=_X});var Do=x((Tge,QL)=>{"use strict";var $S=BL(),GS=xm(),XS=qL(),WS=QS(),ZS=HL(),KL=Co(),Ra=LS(),UL="[object Map]",LX="[object Object]",FL="[object Promise]",jL="[object Set]",VL="[object WeakMap]",YL="[object DataView]",BX=Ra($S),IX=Ra(GS),qX=Ra(XS),PX=Ra(WS),zX=Ra(ZS),Eo=KL;($S&&Eo(new $S(new ArrayBuffer(1)))!=YL||GS&&Eo(new GS)!=UL||XS&&Eo(XS.resolve())!=FL||WS&&Eo(new WS)!=jL||ZS&&Eo(new ZS)!=VL)&&(Eo=function(t){var e=KL(t),n=e==LX?t.constructor:void 0,i=n?Ra(n):"";if(i)switch(i){case BX:return YL;case IX:return UL;case qX:return FL;case PX:return jL;case zX:return VL}return e});QL.exports=Eo});var GL=x((Cge,$L)=>{"use strict";var HX=Object.prototype,UX=HX.hasOwnProperty;function FX(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&UX.call(t,"index")&&(n.index=t.index,n.input=t.input),n}$L.exports=FX});var JS=x((Ege,XL)=>{"use strict";var jX=pi(),VX=jX.Uint8Array;XL.exports=VX});var _m=x((Dge,ZL)=>{"use strict";var WL=JS();function YX(t){var e=new t.constructor(t.byteLength);return new WL(e).set(new WL(t)),e}ZL.exports=YX});var eB=x((Mge,JL)=>{"use strict";var KX=_m();function QX(t,e){var n=e?KX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}JL.exports=QX});var nB=x((Nge,tB)=>{"use strict";var $X=/\w*$/;function GX(t){var e=new t.constructor(t.source,$X.exec(t));return e.lastIndex=t.lastIndex,e}tB.exports=GX});var lB=x((Rge,oB)=>{"use strict";var iB=To(),rB=iB?iB.prototype:void 0,sB=rB?rB.valueOf:void 0;function XX(t){return sB?Object(sB.call(t)):{}}oB.exports=XX});var cB=x((_ge,aB)=>{"use strict";var WX=_m();function ZX(t,e){var n=e?WX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}aB.exports=ZX});var fB=x((Lge,uB)=>{"use strict";var JX=_m(),eW=eB(),tW=nB(),nW=lB(),iW=cB(),rW="[object Boolean]",sW="[object Date]",oW="[object Map]",lW="[object Number]",aW="[object RegExp]",cW="[object Set]",uW="[object String]",fW="[object Symbol]",hW="[object ArrayBuffer]",dW="[object DataView]",pW="[object Float32Array]",mW="[object Float64Array]",gW="[object Int8Array]",yW="[object Int16Array]",bW="[object Int32Array]",vW="[object Uint8Array]",SW="[object Uint8ClampedArray]",xW="[object Uint16Array]",wW="[object Uint32Array]";function kW(t,e,n){var i=t.constructor;switch(e){case hW:return JX(t);case rW:case sW:return new i(+t);case dW:return eW(t,n);case pW:case mW:case gW:case yW:case bW:case vW:case SW:case xW:case wW:return iW(t,n);case oW:return new i;case lW:case uW:return new i(t);case aW:return tW(t);case cW:return new i;case fW:return nW(t)}}uB.exports=kW});var ex=x((Bge,dB)=>{"use strict";var AW=Cs(),hB=Object.create,OW=(function(){function t(){}return function(e){if(!AW(e))return{};if(hB)return hB(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();dB.exports=OW});var mB=x((Ige,pB)=>{"use strict";var TW=ex(),CW=Rm(),EW=vf();function DW(t){return typeof t.constructor=="function"&&!EW(t)?TW(CW(t)):{}}pB.exports=DW});var yB=x((qge,gB)=>{"use strict";var MW=Do(),NW=ji(),RW="[object Map]";function _W(t){return NW(t)&&MW(t)==RW}gB.exports=_W});var xB=x((Pge,SB)=>{"use strict";var LW=yB(),BW=Tm(),bB=Cm(),vB=bB&&bB.isMap,IW=vB?BW(vB):LW;SB.exports=IW});var kB=x((zge,wB)=>{"use strict";var qW=Do(),PW=ji(),zW="[object Set]";function HW(t){return PW(t)&&qW(t)==zW}wB.exports=HW});var CB=x((Hge,TB)=>{"use strict";var UW=kB(),FW=Tm(),AB=Cm(),OB=AB&&AB.isSet,jW=OB?FW(OB):UW;TB.exports=jW});var RB=x((Uge,NB)=>{"use strict";var VW=km(),YW=Am(),KW=qS(),QW=rL(),$W=fL(),GW=gL(),XW=bL(),WW=AL(),ZW=DL(),JW=KS(),eZ=_L(),tZ=Do(),nZ=GL(),iZ=fB(),rZ=mB(),sZ=rt(),oZ=Da(),lZ=xB(),aZ=Cs(),cZ=CB(),uZ=Ms(),fZ=Dm(),hZ=1,dZ=2,pZ=4,EB="[object Arguments]",mZ="[object Array]",gZ="[object Boolean]",yZ="[object Date]",bZ="[object Error]",DB="[object Function]",vZ="[object GeneratorFunction]",SZ="[object Map]",xZ="[object Number]",MB="[object Object]",wZ="[object RegExp]",kZ="[object Set]",AZ="[object String]",OZ="[object Symbol]",TZ="[object WeakMap]",CZ="[object ArrayBuffer]",EZ="[object DataView]",DZ="[object Float32Array]",MZ="[object Float64Array]",NZ="[object Int8Array]",RZ="[object Int16Array]",_Z="[object Int32Array]",LZ="[object Uint8Array]",BZ="[object Uint8ClampedArray]",IZ="[object Uint16Array]",qZ="[object Uint32Array]",Ee={};Ee[EB]=Ee[mZ]=Ee[CZ]=Ee[EZ]=Ee[gZ]=Ee[yZ]=Ee[DZ]=Ee[MZ]=Ee[NZ]=Ee[RZ]=Ee[_Z]=Ee[SZ]=Ee[xZ]=Ee[MB]=Ee[wZ]=Ee[kZ]=Ee[AZ]=Ee[OZ]=Ee[LZ]=Ee[BZ]=Ee[IZ]=Ee[qZ]=!0;Ee[bZ]=Ee[DB]=Ee[TZ]=!1;function Lm(t,e,n,i,r,s){var o,l=e&hZ,a=e&dZ,c=e&pZ;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!aZ(t))return t;var u=sZ(t);if(u){if(o=nZ(t),!l)return XW(t,o)}else{var f=tZ(t),h=f==DB||f==vZ;if(oZ(t))return GW(t,l);if(f==MB||f==EB||h&&!r){if(o=a||h?{}:rZ(t),!l)return a?ZW(t,$W(o,t)):WW(t,QW(o,t))}else{if(!Ee[f])return r?t:{};o=iZ(t,f,l)}}s||(s=new VW);var d=s.get(t);if(d)return d;s.set(t,o),cZ(t)?t.forEach(function(b){o.add(Lm(b,e,n,b,t,s))}):lZ(t)&&t.forEach(function(b,p){o.set(p,Lm(b,e,n,p,t,s))});var m=c?a?eZ:JW:a?fZ:uZ,g=u?void 0:m(t);return YW(g||t,function(b,p){g&&(p=b,b=t[p]),KW(o,p,Lm(b,e,n,p,t,s))}),o}NB.exports=Lm});var LB=x((Fge,_B)=>{"use strict";var PZ=RB(),zZ=4;function HZ(t){return PZ(t,zZ)}_B.exports=HZ});var tx=x((jge,BB)=>{"use strict";function UZ(t){return function(){return t}}BB.exports=UZ});var qB=x((Vge,IB)=>{"use strict";function FZ(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}IB.exports=FZ});var zB=x((Yge,PB)=>{"use strict";var jZ=qB(),VZ=jZ();PB.exports=VZ});var nx=x((Kge,HB)=>{"use strict";var YZ=zB(),KZ=Ms();function QZ(t,e){return t&&YZ(t,e,KZ)}HB.exports=QZ});var FB=x((Qge,UB)=>{"use strict";var $Z=Ds();function GZ(t,e){return function(n,i){if(n==null)return n;if(!$Z(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}UB.exports=GZ});var xf=x(($ge,jB)=>{"use strict";var XZ=nx(),WZ=FB(),ZZ=WZ(XZ);jB.exports=ZZ});var wf=x((Gge,VB)=>{"use strict";function JZ(t){return t}VB.exports=JZ});var KB=x((Xge,YB)=>{"use strict";var eJ=wf();function tJ(t){return typeof t=="function"?t:eJ}YB.exports=tJ});var $B=x((Wge,QB)=>{"use strict";var nJ=Am(),iJ=xf(),rJ=KB(),sJ=rt();function oJ(t,e){var n=sJ(t)?nJ:iJ;return n(t,rJ(e))}QB.exports=oJ});var XB=x((Zge,GB)=>{"use strict";GB.exports=$B()});var ZB=x((Jge,WB)=>{"use strict";var lJ=xf();function aJ(t,e){var n=[];return lJ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}WB.exports=aJ});var e3=x((eye,JB)=>{"use strict";var cJ="__lodash_hash_undefined__";function uJ(t){return this.__data__.set(t,cJ),this}JB.exports=uJ});var n3=x((tye,t3)=>{"use strict";function fJ(t){return this.__data__.has(t)}t3.exports=fJ});var ix=x((nye,i3)=>{"use strict";var hJ=wm(),dJ=e3(),pJ=n3();function Bm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new hJ;++e<n;)this.add(t[e])}Bm.prototype.add=Bm.prototype.push=dJ;Bm.prototype.has=pJ;i3.exports=Bm});var s3=x((iye,r3)=>{"use strict";function mJ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}r3.exports=mJ});var rx=x((rye,o3)=>{"use strict";function gJ(t,e){return t.has(e)}o3.exports=gJ});var sx=x((sye,l3)=>{"use strict";var yJ=ix(),bJ=s3(),vJ=rx(),SJ=1,xJ=2;function wJ(t,e,n,i,r,s){var o=n&SJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&xJ?new yJ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var m=t[f],g=e[f];if(i)var b=o?i(g,m,f,e,t,s):i(m,g,f,t,e,s);if(b!==void 0){if(b)continue;h=!1;break}if(d){if(!bJ(e,function(p,y){if(!vJ(d,y)&&(m===p||r(m,p,n,i,s)))return d.push(y)})){h=!1;break}}else if(!(m===g||r(m,g,n,i,s))){h=!1;break}}return s.delete(t),s.delete(e),h}l3.exports=wJ});var c3=x((oye,a3)=>{"use strict";function kJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}a3.exports=kJ});var Im=x((lye,u3)=>{"use strict";function AJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}u3.exports=AJ});var m3=x((aye,p3)=>{"use strict";var f3=To(),h3=JS(),OJ=Sm(),TJ=sx(),CJ=c3(),EJ=Im(),DJ=1,MJ=2,NJ="[object Boolean]",RJ="[object Date]",_J="[object Error]",LJ="[object Map]",BJ="[object Number]",IJ="[object RegExp]",qJ="[object Set]",PJ="[object String]",zJ="[object Symbol]",HJ="[object ArrayBuffer]",UJ="[object DataView]",d3=f3?f3.prototype:void 0,ox=d3?d3.valueOf:void 0;function FJ(t,e,n,i,r,s,o){switch(n){case UJ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case HJ:return!(t.byteLength!=e.byteLength||!s(new h3(t),new h3(e)));case NJ:case RJ:case BJ:return OJ(+t,+e);case _J:return t.name==e.name&&t.message==e.message;case IJ:case PJ:return t==e+"";case LJ:var l=CJ;case qJ:var a=i&DJ;if(l||(l=EJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=MJ,o.set(t,e);var u=TJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case zJ:if(ox)return ox.call(t)==ox.call(e)}return!1}p3.exports=FJ});var b3=x((cye,y3)=>{"use strict";var g3=KS(),jJ=1,VJ=Object.prototype,YJ=VJ.hasOwnProperty;function KJ(t,e,n,i,r,s){var o=n&jJ,l=g3(t),a=l.length,c=g3(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var h=l[f];if(!(o?h in e:YJ.call(e,h)))return!1}var d=s.get(t),m=s.get(e);if(d&&m)return d==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){h=l[f];var p=t[h],y=e[h];if(i)var v=o?i(y,p,h,e,t,s):i(p,y,h,t,e,s);if(!(v===void 0?p===y||r(p,y,n,i,s):v)){g=!1;break}b||(b=h=="constructor")}if(g&&!b){var S=t.constructor,w=e.constructor;S!=w&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(e),g}y3.exports=KJ});var T3=x((uye,O3)=>{"use strict";var lx=km(),QJ=sx(),$J=m3(),GJ=b3(),v3=Do(),S3=rt(),x3=Da(),XJ=bf(),WJ=1,w3="[object Arguments]",k3="[object Array]",qm="[object Object]",ZJ=Object.prototype,A3=ZJ.hasOwnProperty;function JJ(t,e,n,i,r,s){var o=S3(t),l=S3(e),a=o?k3:v3(t),c=l?k3:v3(e);a=a==w3?qm:a,c=c==w3?qm:c;var u=a==qm,f=c==qm,h=a==c;if(h&&x3(t)){if(!x3(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new lx),o||XJ(t)?QJ(t,e,n,i,r,s):$J(t,e,a,n,i,r,s);if(!(n&WJ)){var d=u&&A3.call(t,"__wrapped__"),m=f&&A3.call(e,"__wrapped__");if(d||m){var g=d?t.value():t,b=m?e.value():e;return s||(s=new lx),r(g,b,n,i,s)}}return h?(s||(s=new lx),GJ(t,e,n,i,r,s)):!1}O3.exports=JJ});var ax=x((fye,D3)=>{"use strict";var eee=T3(),C3=ji();function E3(t,e,n,i,r){return t===e?!0:t==null||e==null||!C3(t)&&!C3(e)?t!==t&&e!==e:eee(t,e,n,i,E3,r)}D3.exports=E3});var N3=x((hye,M3)=>{"use strict";var tee=km(),nee=ax(),iee=1,ree=2;function see(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new tee;if(i)var h=i(c,u,a,t,e,f);if(!(h===void 0?nee(u,c,iee|ree,i,f):h))return!1}}return!0}M3.exports=see});var cx=x((dye,R3)=>{"use strict";var oee=Cs();function lee(t){return t===t&&!oee(t)}R3.exports=lee});var L3=x((pye,_3)=>{"use strict";var aee=cx(),cee=Ms();function uee(t){for(var e=cee(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,aee(r)]}return e}_3.exports=uee});var ux=x((mye,B3)=>{"use strict";function fee(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}B3.exports=fee});var q3=x((gye,I3)=>{"use strict";var hee=N3(),dee=L3(),pee=ux();function mee(t){var e=dee(t);return e.length==1&&e[0][2]?pee(e[0][0],e[0][1]):function(n){return n===t||hee(n,t,e)}}I3.exports=mee});var Pm=x((yye,P3)=>{"use strict";var gee=Co(),yee=ji(),bee="[object Symbol]";function vee(t){return typeof t=="symbol"||yee(t)&&gee(t)==bee}P3.exports=vee});var zm=x((bye,z3)=>{"use strict";var See=rt(),xee=Pm(),wee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kee=/^\w*$/;function Aee(t,e){if(See(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||xee(t)?!0:kee.test(t)||!wee.test(t)||e!=null&&t in Object(e)}z3.exports=Aee});var F3=x((vye,U3)=>{"use strict";var H3=wm(),Oee="Expected a function";function fx(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Oee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(fx.Cache||H3),n}fx.Cache=H3;U3.exports=fx});var V3=x((Sye,j3)=>{"use strict";var Tee=F3(),Cee=500;function Eee(t){var e=Tee(t,function(i){return n.size===Cee&&n.clear(),i}),n=e.cache;return e}j3.exports=Eee});var K3=x((xye,Y3)=>{"use strict";var Dee=V3(),Mee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nee=/\\(\\)?/g,Ree=Dee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Mee,function(n,i,r,s){e.push(r?s.replace(Nee,"$1"):i||n)}),e});Y3.exports=Ree});var Hm=x((wye,Q3)=>{"use strict";function _ee(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}Q3.exports=_ee});var J3=x((kye,Z3)=>{"use strict";var $3=To(),Lee=Hm(),Bee=rt(),Iee=Pm(),qee=1/0,G3=$3?$3.prototype:void 0,X3=G3?G3.toString:void 0;function W3(t){if(typeof t=="string")return t;if(Bee(t))return Lee(t,W3)+"";if(Iee(t))return X3?X3.call(t):"";var e=t+"";return e=="0"&&1/t==-qee?"-0":e}Z3.exports=W3});var tI=x((Aye,eI)=>{"use strict";var Pee=J3();function zee(t){return t==null?"":Pee(t)}eI.exports=zee});var hx=x((Oye,nI)=>{"use strict";var Hee=rt(),Uee=zm(),Fee=K3(),jee=tI();function Vee(t,e){return Hee(t)?t:Uee(t,e)?[t]:Fee(jee(t))}nI.exports=Vee});var kf=x((Tye,iI)=>{"use strict";var Yee=Pm(),Kee=1/0;function Qee(t){if(typeof t=="string"||Yee(t))return t;var e=t+"";return e=="0"&&1/t==-Kee?"-0":e}iI.exports=Qee});var dx=x((Cye,rI)=>{"use strict";var $ee=hx(),Gee=kf();function Xee(t,e){e=$ee(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[Gee(e[n++])];return n&&n==i?t:void 0}rI.exports=Xee});var oI=x((Eye,sI)=>{"use strict";var Wee=dx();function Zee(t,e,n){var i=t==null?void 0:Wee(t,e);return i===void 0?n:i}sI.exports=Zee});var aI=x((Dye,lI)=>{"use strict";function Jee(t,e){return t!=null&&e in Object(t)}lI.exports=Jee});var px=x((Mye,cI)=>{"use strict";var ete=hx(),tte=pf(),nte=rt(),ite=PS(),rte=Om(),ste=kf();function ote(t,e,n){e=ete(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=ste(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&rte(r)&&ite(o,r)&&(nte(t)||tte(t)))}cI.exports=ote});var fI=x((Nye,uI)=>{"use strict";var lte=aI(),ate=px();function cte(t,e){return t!=null&&ate(t,e,lte)}uI.exports=cte});var dI=x((Rye,hI)=>{"use strict";var ute=ax(),fte=oI(),hte=fI(),dte=zm(),pte=cx(),mte=ux(),gte=kf(),yte=1,bte=2;function vte(t,e){return dte(t)&&pte(e)?mte(gte(t),e):function(n){var i=fte(n,t);return i===void 0&&i===e?hte(n,t):ute(e,i,yte|bte)}}hI.exports=vte});var mx=x((_ye,pI)=>{"use strict";function Ste(t){return function(e){return e?.[t]}}pI.exports=Ste});var gI=x((Lye,mI)=>{"use strict";var xte=dx();function wte(t){return function(e){return xte(e,t)}}mI.exports=wte});var bI=x((Bye,yI)=>{"use strict";var kte=mx(),Ate=gI(),Ote=zm(),Tte=kf();function Cte(t){return Ote(t)?kte(Tte(t)):Ate(t)}yI.exports=Cte});var Af=x((Iye,vI)=>{"use strict";var Ete=q3(),Dte=dI(),Mte=wf(),Nte=rt(),Rte=bI();function _te(t){return typeof t=="function"?t:t==null?Mte:typeof t=="object"?Nte(t)?Dte(t[0],t[1]):Ete(t):Rte(t)}vI.exports=_te});var xI=x((qye,SI)=>{"use strict";var Lte=FS(),Bte=ZB(),Ite=Af(),qte=rt();function Pte(t,e){var n=qte(t)?Lte:Bte;return n(t,Ite(e,3))}SI.exports=Pte});var kI=x((Pye,wI)=>{"use strict";var zte=Object.prototype,Hte=zte.hasOwnProperty;function Ute(t,e){return t!=null&&Hte.call(t,e)}wI.exports=Ute});var OI=x((zye,AI)=>{"use strict";var Fte=kI(),jte=px();function Vte(t,e){return t!=null&&jte(t,e,Fte)}AI.exports=Vte});var CI=x((Hye,TI)=>{"use strict";var Yte=Em(),Kte=Do(),Qte=pf(),$te=rt(),Gte=Ds(),Xte=Da(),Wte=vf(),Zte=bf(),Jte="[object Map]",ene="[object Set]",tne=Object.prototype,nne=tne.hasOwnProperty;function ine(t){if(t==null)return!0;if(Gte(t)&&($te(t)||typeof t=="string"||typeof t.splice=="function"||Xte(t)||Zte(t)||Qte(t)))return!t.length;var e=Kte(t);if(e==Jte||e==ene)return!t.size;if(Wte(t))return!Yte(t).length;for(var n in t)if(nne.call(t,n))return!1;return!0}TI.exports=ine});var DI=x((Uye,EI)=>{"use strict";function rne(t){return t===void 0}EI.exports=rne});var NI=x((Fye,MI)=>{"use strict";var sne=xf(),one=Ds();function lne(t,e){var n=-1,i=one(t)?Array(t.length):[];return sne(t,function(r,s,o){i[++n]=e(r,s,o)}),i}MI.exports=lne});var _I=x((jye,RI)=>{"use strict";var ane=Hm(),cne=Af(),une=NI(),fne=rt();function hne(t,e){var n=fne(t)?ane:une;return n(t,cne(e,3))}RI.exports=hne});var BI=x((Vye,LI)=>{"use strict";function dne(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}LI.exports=dne});var qI=x((Yye,II)=>{"use strict";function pne(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}II.exports=pne});var zI=x((Kye,PI)=>{"use strict";var mne=BI(),gne=xf(),yne=Af(),bne=qI(),vne=rt();function Sne(t,e,n){var i=vne(t)?mne:bne,r=arguments.length<3;return i(t,yne(e,4),n,r,gne)}PI.exports=Sne});var UI=x((Qye,HI)=>{"use strict";var xne=Co(),wne=rt(),kne=ji(),Ane="[object String]";function One(t){return typeof t=="string"||!wne(t)&&kne(t)&&xne(t)==Ane}HI.exports=One});var jI=x(($ye,FI)=>{"use strict";var Tne=mx(),Cne=Tne("length");FI.exports=Cne});var YI=x((Gye,VI)=>{"use strict";var Ene="\\ud800-\\udfff",Dne="\\u0300-\\u036f",Mne="\\ufe20-\\ufe2f",Nne="\\u20d0-\\u20ff",Rne=Dne+Mne+Nne,_ne="\\ufe0e\\ufe0f",Lne="\\u200d",Bne=RegExp("["+Lne+Ene+Rne+_ne+"]");function Ine(t){return Bne.test(t)}VI.exports=Ine});var eq=x((Xye,JI)=>{"use strict";var QI="\\ud800-\\udfff",qne="\\u0300-\\u036f",Pne="\\ufe20-\\ufe2f",zne="\\u20d0-\\u20ff",Hne=qne+Pne+zne,Une="\\ufe0e\\ufe0f",Fne="["+QI+"]",gx="["+Hne+"]",yx="\\ud83c[\\udffb-\\udfff]",jne="(?:"+gx+"|"+yx+")",$I="[^"+QI+"]",GI="(?:\\ud83c[\\udde6-\\uddff]){2}",XI="[\\ud800-\\udbff][\\udc00-\\udfff]",Vne="\\u200d",WI=jne+"?",ZI="["+Une+"]?",Yne="(?:"+Vne+"(?:"+[$I,GI,XI].join("|")+")"+ZI+WI+")*",Kne=ZI+WI+Yne,Qne="(?:"+[$I+gx+"?",gx,GI,XI,Fne].join("|")+")",KI=RegExp(yx+"(?="+yx+")|"+Qne+Kne,"g");function $ne(t){for(var e=KI.lastIndex=0;KI.test(t);)++e;return e}JI.exports=$ne});var nq=x((Wye,tq)=>{"use strict";var Gne=jI(),Xne=YI(),Wne=eq();function Zne(t){return Xne(t)?Wne(t):Gne(t)}tq.exports=Zne});var rq=x((Zye,iq)=>{"use strict";var Jne=Em(),eie=Do(),tie=Ds(),nie=UI(),iie=nq(),rie="[object Map]",sie="[object Set]";function oie(t){if(t==null)return 0;if(tie(t))return nie(t)?iie(t):t.length;var e=eie(t);return e==rie||e==sie?t.size:Jne(t).length}iq.exports=oie});var oq=x((Jye,sq)=>{"use strict";var lie=Am(),aie=ex(),cie=nx(),uie=Af(),fie=Rm(),hie=rt(),die=Da(),pie=uf(),mie=Cs(),gie=bf();function yie(t,e,n){var i=hie(t),r=i||die(t)||gie(t);if(e=uie(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:mie(t)?n=pie(s)?aie(fie(t)):{}:n={}}return(r?lie:cie)(t,function(o,l,a){return e(n,o,l,a)}),n}sq.exports=yie});var uq=x((e0e,cq)=>{"use strict";var lq=To(),bie=pf(),vie=rt(),aq=lq?lq.isConcatSpreadable:void 0;function Sie(t){return vie(t)||bie(t)||!!(aq&&t&&t[aq])}cq.exports=Sie});var dq=x((t0e,hq)=>{"use strict";var xie=Nm(),wie=uq();function fq(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=wie),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?fq(l,e-1,n,i,r):xie(r,l):i||(r[r.length]=l)}return r}hq.exports=fq});var mq=x((n0e,pq)=>{"use strict";function kie(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}pq.exports=kie});var bq=x((i0e,yq)=>{"use strict";var Aie=mq(),gq=Math.max;function Oie(t,e,n){return e=gq(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=gq(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),Aie(t,this,l)}}yq.exports=Oie});var xq=x((r0e,Sq)=>{"use strict";var Tie=tx(),vq=BS(),Cie=wf(),Eie=vq?function(t,e){return vq(t,"toString",{configurable:!0,enumerable:!1,value:Tie(e),writable:!0})}:Cie;Sq.exports=Eie});var kq=x((s0e,wq)=>{"use strict";var Die=800,Mie=16,Nie=Date.now;function Rie(t){var e=0,n=0;return function(){var i=Nie(),r=Mie-(i-n);if(n=i,r>0){if(++e>=Die)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}wq.exports=Rie});var Oq=x((o0e,Aq)=>{"use strict";var _ie=xq(),Lie=kq(),Bie=Lie(_ie);Aq.exports=Bie});var Cq=x((l0e,Tq)=>{"use strict";var Iie=wf(),qie=bq(),Pie=Oq();function zie(t,e){return Pie(qie(t,e,Iie),t+"")}Tq.exports=zie});var Dq=x((a0e,Eq)=>{"use strict";function Hie(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}Eq.exports=Hie});var Nq=x((c0e,Mq)=>{"use strict";function Uie(t){return t!==t}Mq.exports=Uie});var _q=x((u0e,Rq)=>{"use strict";function Fie(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}Rq.exports=Fie});var Bq=x((f0e,Lq)=>{"use strict";var jie=Dq(),Vie=Nq(),Yie=_q();function Kie(t,e,n){return e===e?Yie(t,e,n):jie(t,Vie,n)}Lq.exports=Kie});var qq=x((h0e,Iq)=>{"use strict";var Qie=Bq();function $ie(t,e){var n=t==null?0:t.length;return!!n&&Qie(t,e,0)>-1}Iq.exports=$ie});var zq=x((d0e,Pq)=>{"use strict";function Gie(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}Pq.exports=Gie});var Uq=x((p0e,Hq)=>{"use strict";function Xie(){}Hq.exports=Xie});var jq=x((m0e,Fq)=>{"use strict";var bx=QS(),Wie=Uq(),Zie=Im(),Jie=1/0,ere=bx&&1/Zie(new bx([,-0]))[1]==Jie?function(t){return new bx(t)}:Wie;Fq.exports=ere});var Yq=x((g0e,Vq)=>{"use strict";var tre=ix(),nre=qq(),ire=zq(),rre=rx(),sre=jq(),ore=Im(),lre=200;function are(t,e,n){var i=-1,r=nre,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=ire;else if(s>=lre){var c=e?null:sre(t);if(c)return ore(c);o=!1,r=rre,a=new tre}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var h=a.length;h--;)if(a[h]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}Vq.exports=are});var Qq=x((y0e,Kq)=>{"use strict";var cre=Ds(),ure=ji();function fre(t){return ure(t)&&cre(t)}Kq.exports=fre});var Gq=x((b0e,$q)=>{"use strict";var hre=dq(),dre=Cq(),pre=Yq(),mre=Qq(),gre=dre(function(t){return pre(hre(t,1,mre,!0))});$q.exports=gre});var Wq=x((v0e,Xq)=>{"use strict";var yre=Hm();function bre(t,e){return yre(e,function(n){return t[n]})}Xq.exports=bre});var Jq=x((S0e,Zq)=>{"use strict";var vre=Wq(),Sre=Ms();function xre(t){return t==null?[]:vre(t,Sre(t))}Zq.exports=xre});var wn=x((x0e,e4)=>{"use strict";var Um;if(typeof Ex=="function")try{Um={clone:LB(),constant:tx(),each:XB(),filter:xI(),has:OI(),isArray:rt(),isEmpty:CI(),isFunction:uf(),isUndefined:DI(),keys:Ms(),map:_I(),reduce:zI(),size:rq(),transform:oq(),union:Gq(),values:Jq()}}catch{}Um||(Um=window._);e4.exports=Um});var Fm=x((k0e,r4)=>{"use strict";var Q=wn();r4.exports=J;var wre="\0",Mo="\0",t4="";function J(t){this._isDirected=Q.has(t,"directed")?t.directed:!0,this._isMultigraph=Q.has(t,"multigraph")?t.multigraph:!1,this._isCompound=Q.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Q.constant(void 0),this._defaultEdgeLabelFn=Q.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Mo]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}J.prototype._nodeCount=0;J.prototype._edgeCount=0;J.prototype.isDirected=function(){return this._isDirected};J.prototype.isMultigraph=function(){return this._isMultigraph};J.prototype.isCompound=function(){return this._isCompound};J.prototype.setGraph=function(t){return this._label=t,this};J.prototype.graph=function(){return this._label};J.prototype.setDefaultNodeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultNodeLabelFn=t,this};J.prototype.nodeCount=function(){return this._nodeCount};J.prototype.nodes=function(){return Q.keys(this._nodes)};J.prototype.sources=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._in[e])})};J.prototype.sinks=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._out[e])})};J.prototype.setNodes=function(t,e){var n=arguments,i=this;return Q.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};J.prototype.setNode=function(t,e){return Q.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Mo,this._children[t]={},this._children[Mo][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};J.prototype.node=function(t){return this._nodes[t]};J.prototype.hasNode=function(t){return Q.has(this._nodes,t)};J.prototype.removeNode=function(t){var e=this;if(Q.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Q.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),Q.each(Q.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Q.each(Q.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};J.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Q.isUndefined(e))e=Mo;else{e+="";for(var n=e;!Q.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};J.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};J.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Mo)return e}};J.prototype.children=function(t){if(Q.isUndefined(t)&&(t=Mo),this._isCompound){var e=this._children[t];if(e)return Q.keys(e)}else{if(t===Mo)return this.nodes();if(this.hasNode(t))return[]}};J.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Q.keys(e)};J.prototype.successors=function(t){var e=this._sucs[t];if(e)return Q.keys(e)};J.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Q.union(e,this.successors(t))};J.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};J.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Q.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),Q.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&Q.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};J.prototype.setDefaultEdgeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultEdgeLabelFn=t,this};J.prototype.edgeCount=function(){return this._edgeCount};J.prototype.edges=function(){return Q.values(this._edgeObjs)};J.prototype.setPath=function(t,e){var n=this,i=arguments;return Q.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};J.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,Q.isUndefined(n)||(n=""+n);var o=Of(this._isDirected,t,e,n);if(Q.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!Q.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=kre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,n4(this._preds[e],t),n4(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};J.prototype.edge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Of(this._isDirected,t,e,n);return this._edgeLabels[i]};J.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Of(this._isDirected,t,e,n);return Q.has(this._edgeLabels,i)};J.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Of(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],i4(this._preds[e],t),i4(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};J.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.v===e}):i}};J.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.w===e}):i}};J.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function n4(t,e){t[e]?t[e]++:t[e]=1}function i4(t,e){--t[e]||delete t[e]}function Of(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+t4+s+t4+(Q.isUndefined(i)?wre:i)}function kre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function vx(t,e){return Of(t,e.v,e.w,e.name)}});var o4=x((A0e,s4)=>{"use strict";s4.exports="2.1.8"});var a4=x((O0e,l4)=>{"use strict";l4.exports={Graph:Fm(),version:o4()}});var u4=x((T0e,c4)=>{"use strict";var Vi=wn(),Are=Fm();c4.exports={write:Ore,read:Ere};function Ore(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Tre(t),edges:Cre(t)};return Vi.isUndefined(t.graph())||(e.value=Vi.clone(t.graph())),e}function Tre(t){return Vi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Vi.isUndefined(n)||(r.value=n),Vi.isUndefined(i)||(r.parent=i),r})}function Cre(t){return Vi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Vi.isUndefined(e.name)||(i.name=e.name),Vi.isUndefined(n)||(i.value=n),i})}function Ere(t){var e=new Are(t.options).setGraph(t.value);return Vi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Vi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var h4=x((C0e,f4)=>{"use strict";var jm=wn();f4.exports=Dre;function Dre(t){var e={},n=[],i;function r(s){jm.has(e,s)||(e[s]=!0,i.push(s),jm.each(t.successors(s),r),jm.each(t.predecessors(s),r))}return jm.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var Sx=x((E0e,p4)=>{"use strict";var d4=wn();p4.exports=Vn;function Vn(){this._arr=[],this._keyIndices={}}Vn.prototype.size=function(){return this._arr.length};Vn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Vn.prototype.has=function(t){return d4.has(this._keyIndices,t)};Vn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Vn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Vn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!d4.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Vn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Vn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Vn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Vn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Vn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var xx=x((D0e,m4)=>{"use strict";var Mre=wn(),Nre=Sx();m4.exports=_re;var Rre=Mre.constant(1);function _re(t,e,n,i){return Lre(t,String(e),n||Rre,i||function(r){return t.outEdges(r)})}function Lre(t,e,n,i){var r={},s=new Nre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],h=n(c),d=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);d<f.distance&&(f.distance=d,f.predecessor=o,s.decrease(u,d))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var y4=x((M0e,g4)=>{"use strict";var Bre=xx(),Ire=wn();g4.exports=qre;function qre(t,e,n){return Ire.transform(t.nodes(),function(i,r){i[r]=Bre(t,r,e,n)},{})}});var wx=x((N0e,v4)=>{"use strict";var b4=wn();v4.exports=Pre;function Pre(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){b4.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){b4.has(i,o)||s(o)}),r}});var x4=x((R0e,S4)=>{"use strict";var zre=wn(),Hre=wx();S4.exports=Ure;function Ure(t){return zre.filter(Hre(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var k4=x((_0e,w4)=>{"use strict";var Fre=wn();w4.exports=Vre;var jre=Fre.constant(1);function Vre(t,e,n){return Yre(t,e||jre,n||function(i){return t.outEdges(i)})}function Yre(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],h=a[c],d=u.distance+f.distance;d<h.distance&&(h.distance=d,h.predecessor=f.predecessor)})})}),i}});var kx=x((L0e,O4)=>{"use strict";var Tf=wn();O4.exports=A4;A4.CycleException=Vm;function A4(t){var e={},n={},i=[];function r(s){if(Tf.has(n,s))throw new Vm;Tf.has(e,s)||(n[s]=!0,e[s]=!0,Tf.each(t.predecessors(s),r),delete n[s],i.push(s))}if(Tf.each(t.sinks(),r),Tf.size(e)!==t.nodeCount())throw new Vm;return i}function Vm(){}Vm.prototype=new Error});var E4=x((B0e,C4)=>{"use strict";var T4=kx();C4.exports=Kre;function Kre(t){try{T4(t)}catch(e){if(e instanceof T4.CycleException)return!1;throw e}return!0}});var Ax=x((I0e,M4)=>{"use strict";var Ym=wn();M4.exports=Qre;function Qre(t,e,n){Ym.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return Ym.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);D4(t,o,n==="post",s,i,r)}),r}function D4(t,e,n,i,r,s){Ym.has(i,e)||(i[e]=!0,n||s.push(e),Ym.each(r(e),function(o){D4(t,o,n,i,r,s)}),n&&s.push(e))}});var R4=x((q0e,N4)=>{"use strict";var $re=Ax();N4.exports=Gre;function Gre(t,e){return $re(t,e,"post")}});var L4=x((P0e,_4)=>{"use strict";var Xre=Ax();_4.exports=Wre;function Wre(t,e){return Xre(t,e,"pre")}});var q4=x((z0e,I4)=>{"use strict";var B4=wn(),Zre=Fm(),Jre=Sx();I4.exports=ese;function ese(t,e){var n=new Zre,i={},r=new Jre,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;B4.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),B4.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var z4=x((H0e,P4)=>{"use strict";P4.exports={components:h4(),dijkstra:xx(),dijkstraAll:y4(),findCycles:x4(),floydWarshall:k4(),isAcyclic:E4(),postorder:R4(),preorder:L4(),prim:q4(),tarjan:wx(),topsort:kx()}});var F4=x((U0e,U4)=>{"use strict";var H4=a4();U4.exports={Graph:H4.Graph,json:u4(),alg:z4(),version:H4.version}});var hse={};e5(hse,{mountSpecEditorDemo:()=>Ox});var _a=Pe(yi()),Y4=Pe(uT());var dT="#000000";function is(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function V(t){return t==null?"":String(t)}function fT(t){return Array.isArray(t)?t.map(e=>V(e)).filter(e=>e.length>0):t==null||t===""?[]:[V(t)]}function rd(t){return t==null||t===""}function R0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var pT=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],mT=["clockwise","counterclockwise"],gT=["horizontal","vertical"],_0=["solid","dashed","dotted"],K6=["small","normal","large"],Fc=[{key:"size",kind:"enum",options:K6,label:"Size"},{key:"color",kind:"color",label:"Color"}],Q6=["none","togroup","fromgroup"];function hT(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var $6=["hideDisconnected","hideDisconnectedBuiltIns"],G6={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:pT,help:"Where the target sits relative to the source."}],summary(t){let e=fT(t.directions),n=V(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=fT(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(R0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(R0("directions","Cannot be both left and right.")),e}},X6={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:mT,default:"clockwise"}],summary(t){let e=V(t.direction)||"clockwise",n=V(t.selector);return n?`${e} \xB7 ${n}`:e}},W6={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:gT,default:"horizontal"}],summary(t){let e=V(t.direction)||"horizontal",n=V(t.selector);return n?`${e} \xB7 ${n}`:e}},Z6={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"addEdge",kind:"enum",label:"Add edge",options:Q6,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=V(t.selector),n=V(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:V(t.selector)};rd(t.name)||(e.name=V(t.name));let n=hT(t.addEdge);if(n!=="none"&&(e.addEdge=n),is(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!is(t))return null;let e=t.group;if(!is(e)||e.field!==void 0)return null;let n={selector:V(e.selector),addEdge:hT(e.addEdge)};return e.name!==void 0&&(n.name=V(e.name)),is(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),n}},J6={kind:"constraint",type:"groupfield",label:"Group (by field)",description:"Group elements based on a field. Deprecated \u2014 prefer Group (by selector).",deprecated:!0,deprecatedInFavorOf:"groupselector",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"groupOn",kind:"number",label:"Group on (index)",required:!0,default:0},{key:"addToGroup",kind:"number",label:"Add to group (index)",required:!0,default:1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.field),n=e?`group on "${e}"`:"group on field",i=V(t.selector);return i?`${n} \xB7 ${i}`:n},toYamlNode(t){let e={field:V(t.field),groupOn:typeof t.groupOn=="number"?t.groupOn:Number(t.groupOn??0),addToGroup:typeof t.addToGroup=="number"?t.addToGroup:Number(t.addToGroup??1)};return rd(t.selector)||(e.selector=V(t.selector)),t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!is(t))return null;let e=t.group;if(!is(e)||e.field===void 0)return null;let n={field:V(e.field),groupOn:typeof e.groupOn=="number"?e.groupOn:Number(e.groupOn??0),addToGroup:typeof e.addToGroup=="number"?e.addToGroup:Number(e.addToGroup??1)};return e.selector!==void 0&&(n.selector=V(e.selector)),e.hold!==void 0&&(n.hold=e.hold),n}},e8={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=rd(t.width)?"?":V(t.width),n=rd(t.height)?"?":V(t.height),i=V(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(R0(n,`${n} must be greater than 0.`))}return e}},t8={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=V(t.selector);return e?`hide \xB7 ${e}`:"hide"}},n8={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:$6,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return V(t.flag)||"(no flag)"},toYamlNode(t){return{flag:V(t.flag)}},fromYamlNode(t){if(!is(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:is(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},i8={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:Fc}],summary(t){let e=V(t.field),n=V(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},r8={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=V(t.field),n=V(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},s8={kind:"directive",type:"icon",label:"Icon",description:"Render matching atoms with an icon.",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.path),n=V(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},o8={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:dT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=V(t.value),n=V(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},yT=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:_0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],l8=[{key:"color",kind:"color",label:"Color"}],a8=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],c8={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:yT},{key:"textStyle",kind:"group",label:"Text style",children:Fc},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=V(t.field),n=t.lineStyle??{},i=V(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=V(t.selector);return s?`${r} \xB7 ${s}`:r}},u8={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:l8},{key:"borderStyle",kind:"group",label:"Border style",children:a8},{key:"textStyle",kind:"group",label:"Text style",children:Fc}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=V(e.color)||V(n.color),r=V(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},f8={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:dT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:_0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=V(t.field),n=V(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=V(t.selector);return r?`${i} \xB7 ${r}`:i}},h8={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:yT},{key:"textStyle",kind:"group",label:"Text style",children:Fc}],summary(t){let e=V(t.name),n=V(t.selector),i=t.lineStyle??{},r=V(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},d8={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:Fc}],summary(t){let e=V(t.name),n=V(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},L0=[G6,X6,W6,Z6,J6,e8,t8,n8,i8,r8,s8,u8,o8,c8,f8,h8,d8],bT=new Map(L0.map(t=>[t.type,t])),p8={groupselector:"group",groupfield:"group"};function m8(t){return p8[t]??t}var vT=(()=>{let t=new Map;for(let e of L0){let n=m8(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function B0(t){return vT.get(t)??[]}function sd(t){return vT.has(t)}function It(t){return bT.get(t)}function I0(t,e={}){let n=e.includeDeprecated??!1;return L0.filter(i=>i.kind===t&&(n||!i.deprecated))}function q0(t){let e=bT.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function BT(t){return typeof t>"u"||t===null}function g8(t){return typeof t=="object"&&t!==null}function y8(t){return Array.isArray(t)?t:BT(t)?[]:[t]}function b8(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function v8(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function S8(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var x8=BT,w8=g8,k8=y8,A8=v8,O8=S8,T8=b8,nt={isNothing:x8,isObject:w8,toArray:k8,repeat:A8,isNegativeZero:O8,extend:T8};function IT(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
10
10
 
11
- `+t.mark.snippet),i+" "+n):i}function zc(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=DT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}zc.prototype=Object.create(Error.prototype);zc.prototype.constructor=zc;zc.prototype.toString=function(e){return this.name+": "+DT(this,e)};var It=zc;function L0(t,e,n,i,r){var s="",o="",l=Math.floor(r/2)-1;return i-e>l&&(s=" ... ",e=i-l+s.length),n-i>l&&(o=" ...",n=i+l-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:i-e+s.length}}function B0(t,e){return rt.repeat(" ",e-t.length)+t}function b8(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(t.buffer);)r.push(s.index),i.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var l="",a,c,u=Math.min(t.line+e.linesAfter,r.length).toString().length,f=e.maxLength-(e.indent+u+3);for(a=1;a<=e.linesBefore&&!(o-a<0);a++)c=L0(t.buffer,i[o-a],r[o-a],t.position-(i[o]-i[o-a]),f),l=rt.repeat(" ",e.indent)+B0((t.line-a+1).toString(),u)+" | "+c.str+`
12
- `+l;for(c=L0(t.buffer,i[o],r[o],t.position,f),l+=rt.repeat(" ",e.indent)+B0((t.line+1).toString(),u)+" | "+c.str+`
13
- `,l+=rt.repeat("-",e.indent+u+3+c.pos)+`^
14
- `,a=1;a<=e.linesAfter&&!(o+a>=r.length);a++)c=L0(t.buffer,i[o+a],r[o+a],t.position-(i[o]-i[o+a]),f),l+=rt.repeat(" ",e.indent)+B0((t.line+a+1).toString(),u)+" | "+c.str+`
15
- `;return l.replace(/\n$/,"")}var v8=b8,S8=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],x8=["scalar","sequence","mapping"];function w8(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(i){e[String(i)]=n})}),e}function k8(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(S8.indexOf(n)===-1)throw new It('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=w8(e.styleAliases||null),x8.indexOf(this.kind)===-1)throw new It('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var bt=k8;function dT(t,e){var n=[];return t[e].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function A8(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function i(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(i);return t}function q0(t){return this.extend(t)}q0.prototype.extend=function(e){var n=[],i=[];if(e instanceof bt)i.push(e);else if(Array.isArray(e))i=i.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit));else throw new It("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof bt))throw new It("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new It("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new It("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof bt))throw new It("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(q0.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=dT(r,"implicit"),r.compiledExplicit=dT(r,"explicit"),r.compiledTypeMap=A8(r.compiledImplicit,r.compiledExplicit),r};var MT=q0,NT=new bt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),RT=new bt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),_T=new bt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),LT=new MT({explicit:[NT,RT,_T]});function O8(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function T8(){return null}function C8(t){return t===null}var BT=new bt("tag:yaml.org,2002:null",{kind:"scalar",resolve:O8,construct:T8,predicate:C8,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function E8(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function D8(t){return t==="true"||t==="True"||t==="TRUE"}function M8(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var IT=new bt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:E8,construct:D8,predicate:M8,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function N8(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function R8(t){return 48<=t&&t<=55}function _8(t){return 48<=t&&t<=57}function L8(t){if(t===null)return!1;var e=t.length,n=0,i=!1,r;if(!e)return!1;if(r=t[n],(r==="-"||r==="+")&&(r=t[++n]),r==="0"){if(n+1===e)return!0;if(r=t[++n],r==="b"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!N8(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!R8(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<e;n++)if(r=t[n],r!=="_"){if(!_8(t.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function B8(t){var e=t,n=1,i;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),i=e[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),e=e.slice(1),i=e[0]),e==="0")return 0;if(i==="0"){if(e[1]==="b")return n*parseInt(e.slice(2),2);if(e[1]==="x")return n*parseInt(e.slice(2),16);if(e[1]==="o")return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)}function I8(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!rt.isNegativeZero(t)}var qT=new bt("tag:yaml.org,2002:int",{kind:"scalar",resolve:L8,construct:B8,predicate:I8,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),q8=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function P8(t){return!(t===null||!q8.test(t)||t[t.length-1]==="_")}function z8(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var H8=/^[-+]?[0-9]+e/;function U8(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(rt.isNegativeZero(t))return"-0.0";return n=t.toString(10),H8.test(n)?n.replace("e",".e"):n}function F8(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||rt.isNegativeZero(t))}var PT=new bt("tag:yaml.org,2002:float",{kind:"scalar",resolve:P8,construct:z8,predicate:F8,represent:U8,defaultStyle:"lowercase"}),zT=LT.extend({implicit:[BT,IT,qT,PT]}),HT=zT,UT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),FT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function j8(t){return t===null?!1:UT.exec(t)!==null||FT.exec(t)!==null}function V8(t){var e,n,i,r,s,o,l,a=0,c=null,u,f,h;if(e=UT.exec(t),e===null&&(e=FT.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(s=+e[4],o=+e[5],l=+e[6],e[7]){for(a=e[7].slice(0,3);a.length<3;)a+="0";a=+a}return e[9]&&(u=+e[10],f=+(e[11]||0),c=(u*60+f)*6e4,e[9]==="-"&&(c=-c)),h=new Date(Date.UTC(n,i,r,s,o,l,a)),c&&h.setTime(h.getTime()-c),h}function Y8(t){return t.toISOString()}var jT=new bt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:j8,construct:V8,instanceOf:Date,represent:Y8});function K8(t){return t==="<<"||t===null}var VT=new bt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:K8}),F0=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
16
- \r`;function Q8(t){if(t===null)return!1;var e,n,i=0,r=t.length,s=F0;for(n=0;n<r;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function G8(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=F0,o=0,l=[];for(e=0;e<r;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return n=r%4*6,n===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):n===18?(l.push(o>>10&255),l.push(o>>2&255)):n===12&&l.push(o>>4&255),new Uint8Array(l)}function $8(t){var e="",n=0,i,r,s=t.length,o=F0;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[i];return r=s%3,r===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):r===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):r===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function X8(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var YT=new bt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Q8,construct:G8,predicate:X8,represent:$8}),W8=Object.prototype.hasOwnProperty,Z8=Object.prototype.toString;function J8(t){if(t===null)return!0;var e=[],n,i,r,s,o,l=t;for(n=0,i=l.length;n<i;n+=1){if(r=l[n],o=!1,Z8.call(r)!=="[object Object]")return!1;for(s in r)if(W8.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function ez(t){return t!==null?t:[]}var KT=new bt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:J8,construct:ez}),tz=Object.prototype.toString;function nz(t){if(t===null)return!0;var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(i=o[e],tz.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[e]=[r[0],i[r[0]]]}return!0}function iz(t){if(t===null)return[];var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)i=o[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}var QT=new bt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:nz,construct:iz}),rz=Object.prototype.hasOwnProperty;function sz(t){if(t===null)return!0;var e,n=t;for(e in n)if(rz.call(n,e)&&n[e]!==null)return!1;return!0}function oz(t){return t!==null?t:{}}var GT=new bt("tag:yaml.org,2002:set",{kind:"mapping",resolve:sz,construct:oz}),j0=HT.extend({implicit:[jT,VT],explicit:[YT,KT,QT,GT]}),Jr=Object.prototype.hasOwnProperty,td=1,$T=2,XT=3,nd=4,I0=1,lz=2,pT=3,az=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,cz=/[\x85\u2028\u2029]/,uz=/[,\[\]\{\}]/,WT=/^(?:!|!!|![a-z\-]+!)$/i,ZT=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function mT(t){return Object.prototype.toString.call(t)}function ki(t){return t===10||t===13}function Qs(t){return t===9||t===32}function Wt(t){return t===9||t===32||t===10||t===13}function wl(t){return t===44||t===91||t===93||t===123||t===125}function fz(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function hz(t){return t===120?2:t===117?4:t===85?8:0}function dz(t){return 48<=t&&t<=57?t-48:-1}function gT(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
17
- `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function pz(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function JT(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var e2=new Array(256),t2=new Array(256);for(Ks=0;Ks<256;Ks++)e2[Ks]=gT(Ks)?1:0,t2[Ks]=gT(Ks);var Ks;function mz(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||j0,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function n2(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=v8(n),new It(e,n)}function U(t,e){throw n2(t,e)}function id(t,e){t.onWarning&&t.onWarning.call(null,n2(t,e))}var yT={YAML:function(e,n,i){var r,s,o;e.version!==null&&U(e,"duplication of %YAML directive"),i.length!==1&&U(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&U(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&U(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&id(e,"unsupported YAML version of the document")},TAG:function(e,n,i){var r,s;i.length!==2&&U(e,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],WT.test(r)||U(e,"ill-formed tag handle (first argument) of the TAG directive"),Jr.call(e.tagMap,r)&&U(e,'there is a previously declared suffix for "'+r+'" tag handle'),ZT.test(s)||U(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{U(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function Zr(t,e,n,i){var r,s,o,l;if(e<n){if(l=t.input.slice(e,n),i)for(r=0,s=l.length;r<s;r+=1)o=l.charCodeAt(r),o===9||32<=o&&o<=1114111||U(t,"expected valid JSON character");else az.test(l)&&U(t,"the stream contains non-printable characters");t.result+=l}}function bT(t,e,n,i){var r,s,o,l;for(rt.isObject(n)||U(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,l=r.length;o<l;o+=1)s=r[o],Jr.call(e,s)||(JT(e,s,n[s]),i[s]=!0)}function kl(t,e,n,i,r,s,o,l,a){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&U(t,"nested arrays are not supported inside keys"),typeof r=="object"&&mT(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&mT(r)==="[object Object]"&&(r="[object Object]"),r=String(r),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)bT(t,e,s[c],n);else bT(t,e,s,n);else!t.json&&!Jr.call(n,r)&&Jr.call(e,r)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=a||t.position,U(t,"duplicated mapping key")),JT(e,r,s),delete n[r];return e}function V0(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):U(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Xe(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);r!==0;){for(;Qs(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(ki(r))for(V0(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return n!==-1&&i!==0&&t.lineIndent<n&&id(t,"deficient indentation"),i}function od(t){var e=t.position,n;return n=t.input.charCodeAt(e),!!((n===45||n===46)&&n===t.input.charCodeAt(e+1)&&n===t.input.charCodeAt(e+2)&&(e+=3,n=t.input.charCodeAt(e),n===0||Wt(n)))}function Y0(t,e){e===1?t.result+=" ":e>1&&(t.result+=rt.repeat(`
18
- `,e-1))}function gz(t,e,n){var i,r,s,o,l,a,c,u,f=t.kind,h=t.result,d;if(d=t.input.charCodeAt(t.position),Wt(d)||wl(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=t.input.charCodeAt(t.position+1),Wt(r)||n&&wl(r)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;d!==0;){if(d===58){if(r=t.input.charCodeAt(t.position+1),Wt(r)||n&&wl(r))break}else if(d===35){if(i=t.input.charCodeAt(t.position-1),Wt(i))break}else{if(t.position===t.lineStart&&od(t)||n&&wl(d))break;if(ki(d))if(a=t.line,c=t.lineStart,u=t.lineIndent,Xe(t,!1,-1),t.lineIndent>=e){l=!0,d=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=a,t.lineStart=c,t.lineIndent=u;break}}l&&(Zr(t,s,o,!1),Y0(t,t.line-a),s=o=t.position,l=!1),Qs(d)||(o=t.position+1),d=t.input.charCodeAt(++t.position)}return Zr(t,s,o,!1),t.result?!0:(t.kind=f,t.result=h,!1)}function yz(t,e){var n,i,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(Zr(t,i,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)i=t.position,t.position++,r=t.position;else return!0;else ki(n)?(Zr(t,i,r,!0),Y0(t,Xe(t,!1,e)),i=r=t.position):t.position===t.lineStart&&od(t)?U(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);U(t,"unexpected end of the stream within a single quoted scalar")}function bz(t,e){var n,i,r,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return Zr(t,n,t.position,!0),t.position++,!0;if(l===92){if(Zr(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),ki(l))Xe(t,!1,e);else if(l<256&&e2[l])t.result+=t2[l],t.position++;else if((o=hz(l))>0){for(r=o,s=0;r>0;r--)l=t.input.charCodeAt(++t.position),(o=fz(l))>=0?s=(s<<4)+o:U(t,"expected hexadecimal character");t.result+=pz(s),t.position++}else U(t,"unknown escape sequence");n=i=t.position}else ki(l)?(Zr(t,n,i,!0),Y0(t,Xe(t,!1,e)),n=i=t.position):t.position===t.lineStart&&od(t)?U(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}U(t,"unexpected end of the stream within a double quoted scalar")}function vz(t,e){var n=!0,i,r,s,o=t.tag,l,a=t.anchor,c,u,f,h,d,p=Object.create(null),m,b,y,g;if(g=t.input.charCodeAt(t.position),g===91)u=93,d=!1,l=[];else if(g===123)u=125,d=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),g=t.input.charCodeAt(++t.position);g!==0;){if(Xe(t,!0,e),g=t.input.charCodeAt(t.position),g===u)return t.position++,t.tag=o,t.anchor=a,t.kind=d?"mapping":"sequence",t.result=l,!0;n?g===44&&U(t,"expected the node content, but found ','"):U(t,"missed comma between flow collection entries"),b=m=y=null,f=h=!1,g===63&&(c=t.input.charCodeAt(t.position+1),Wt(c)&&(f=h=!0,t.position++,Xe(t,!0,e))),i=t.line,r=t.lineStart,s=t.position,Al(t,e,td,!1,!0),b=t.tag,m=t.result,Xe(t,!0,e),g=t.input.charCodeAt(t.position),(h||t.line===i)&&g===58&&(f=!0,g=t.input.charCodeAt(++t.position),Xe(t,!0,e),Al(t,e,td,!1,!0),y=t.result),d?kl(t,l,p,b,m,y,i,r,s):f?l.push(kl(t,null,p,b,m,y,i,r,s)):l.push(m),Xe(t,!0,e),g=t.input.charCodeAt(t.position),g===44?(n=!0,g=t.input.charCodeAt(++t.position)):n=!1}U(t,"unexpected end of the stream within a flow collection")}function Sz(t,e){var n,i,r=I0,s=!1,o=!1,l=e,a=0,c=!1,u,f;if(f=t.input.charCodeAt(t.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)I0===r?r=f===43?pT:lz:U(t,"repeat of a chomping mode identifier");else if((u=dz(f))>=0)u===0?U(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(t,"repeat of an indentation width identifier"):(l=e+u-1,o=!0);else break;if(Qs(f)){do f=t.input.charCodeAt(++t.position);while(Qs(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!ki(f)&&f!==0)}for(;f!==0;){for(V0(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndent<l)&&f===32;)t.lineIndent++,f=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>l&&(l=t.lineIndent),ki(f)){a++;continue}if(t.lineIndent<l){r===pT?t.result+=rt.repeat(`
19
- `,s?1+a:a):r===I0&&s&&(t.result+=`
20
- `);break}for(i?Qs(f)?(c=!0,t.result+=rt.repeat(`
21
- `,s?1+a:a)):c?(c=!1,t.result+=rt.repeat(`
22
- `,a+1)):a===0?s&&(t.result+=" "):t.result+=rt.repeat(`
23
- `,a):t.result+=rt.repeat(`
24
- `,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!ki(f)&&f!==0;)f=t.input.charCodeAt(++t.position);Zr(t,n,t.position,!1)}return!0}function vT(t,e){var n,i=t.tag,r=t.anchor,s=[],o,l=!1,a;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),a=t.input.charCodeAt(t.position);a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,U(t,"tab characters must not be used in indentation")),!(a!==45||(o=t.input.charCodeAt(t.position+1),!Wt(o))));){if(l=!0,t.position++,Xe(t,!0,-1)&&t.lineIndent<=e){s.push(null),a=t.input.charCodeAt(t.position);continue}if(n=t.line,Al(t,e,XT,!1,!0),s.push(t.result),Xe(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&a!==0)U(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=i,t.anchor=r,t.kind="sequence",t.result=s,!0):!1}function xz(t,e,n){var i,r,s,o,l,a,c=t.tag,u=t.anchor,f={},h=Object.create(null),d=null,p=null,m=null,b=!1,y=!1,g;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=f),g=t.input.charCodeAt(t.position);g!==0;){if(!b&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,U(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,(g===63||g===58)&&Wt(i))g===63?(b&&(kl(t,f,h,d,p,null,o,l,a),d=p=m=null),y=!0,b=!0,r=!0):b?(b=!1,r=!0):U(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,g=i;else{if(o=t.line,l=t.lineStart,a=t.position,!Al(t,n,$T,!1,!0))break;if(t.line===s){for(g=t.input.charCodeAt(t.position);Qs(g);)g=t.input.charCodeAt(++t.position);if(g===58)g=t.input.charCodeAt(++t.position),Wt(g)||U(t,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(kl(t,f,h,d,p,null,o,l,a),d=p=m=null),y=!0,b=!1,r=!1,d=t.tag,p=t.result;else if(y)U(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=u,!0}else if(y)U(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=u,!0}if((t.line===s||t.lineIndent>e)&&(b&&(o=t.line,l=t.lineStart,a=t.position),Al(t,e,nd,!0,r)&&(b?p=t.result:m=t.result),b||(kl(t,f,h,d,p,m,o,l,a),d=p=m=null),Xe(t,!0,-1),g=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&g!==0)U(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return b&&kl(t,f,h,d,p,null,o,l,a),y&&(t.tag=c,t.anchor=u,t.kind="mapping",t.result=f),y}function wz(t){var e,n=!1,i=!1,r,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&U(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(n=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,r="!!",o=t.input.charCodeAt(++t.position)):r="!",e=t.position,n){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):U(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Wt(o);)o===33&&(i?U(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),WT.test(r)||U(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),uz.test(s)&&U(t,"tag suffix cannot contain flow indicator characters")}s&&!ZT.test(s)&&U(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{U(t,"tag name is malformed: "+s)}return n?t.tag=s:Jr.call(t.tagMap,r)?t.tag=t.tagMap[r]+s:r==="!"?t.tag="!"+s:r==="!!"?t.tag="tag:yaml.org,2002:"+s:U(t,'undeclared tag handle "'+r+'"'),!0}function kz(t){var e,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&U(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Wt(n)&&!wl(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&U(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function Az(t){var e,n,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!Wt(i)&&!wl(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&U(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),Jr.call(t.anchorMap,n)||U(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Xe(t,!0,-1),!0}function Al(t,e,n,i,r){var s,o,l,a=1,c=!1,u=!1,f,h,d,p,m,b;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=l=nd===n||XT===n,i&&Xe(t,!0,-1)&&(c=!0,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)),a===1)for(;wz(t)||kz(t);)Xe(t,!0,-1)?(c=!0,l=s,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)):l=!1;if(l&&(l=c||r),(a===1||nd===n)&&(td===n||$T===n?m=e:m=e+1,b=t.position-t.lineStart,a===1?l&&(vT(t,b)||xz(t,b,m))||vz(t,m)?u=!0:(o&&Sz(t,m)||yz(t,m)||bz(t,m)?u=!0:Az(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&U(t,"alias node should not have any properties")):gz(t,m,td===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):a===0&&(u=l&&vT(t,b))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&U(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),f=0,h=t.implicitTypes.length;f<h;f+=1)if(p=t.implicitTypes[f],p.resolve(t.result)){t.result=p.construct(t.result),t.tag=p.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(Jr.call(t.typeMap[t.kind||"fallback"],t.tag))p=t.typeMap[t.kind||"fallback"][t.tag];else for(p=null,d=t.typeMap.multi[t.kind||"fallback"],f=0,h=d.length;f<h;f+=1)if(t.tag.slice(0,d[f].tag.length)===d[f].tag){p=d[f];break}p||U(t,"unknown tag !<"+t.tag+">"),t.result!==null&&p.kind!==t.kind&&U(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):U(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function Oz(t){var e=t.position,n,i,r,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(Xe(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!Wt(o);)o=t.input.charCodeAt(++t.position);for(i=t.input.slice(n,t.position),r=[],i.length<1&&U(t,"directive name must not be less than one character in length");o!==0;){for(;Qs(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!ki(o));break}if(ki(o))break;for(n=t.position;o!==0&&!Wt(o);)o=t.input.charCodeAt(++t.position);r.push(t.input.slice(n,t.position))}o!==0&&V0(t),Jr.call(yT,i)?yT[i](t,i,r):id(t,'unknown document directive "'+i+'"')}if(Xe(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Xe(t,!0,-1)):s&&U(t,"directives end mark is expected"),Al(t,t.lineIndent-1,nd,!1,!0),Xe(t,!0,-1),t.checkLineBreaks&&cz.test(t.input.slice(e,t.position))&&id(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&od(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Xe(t,!0,-1));return}if(t.position<t.length-1)U(t,"end of the stream or a document separator is expected");else return}function i2(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
25
- `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new mz(t,e),i=t.indexOf("\0");for(i!==-1&&(n.position=i,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Oz(n);return n.documents}function Tz(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var i=i2(t,n);if(typeof e!="function")return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])}function Cz(t,e){var n=i2(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new It("expected a single document in the stream, but found more")}}var Ez=Tz,Dz=Cz,r2={loadAll:Ez,load:Dz},s2=Object.prototype.toString,o2=Object.prototype.hasOwnProperty,K0=65279,Mz=9,Hc=10,Nz=13,Rz=32,_z=33,Lz=34,P0=35,Bz=37,Iz=38,qz=39,Pz=42,l2=44,zz=45,rd=58,Hz=61,Uz=62,Fz=63,jz=64,a2=91,c2=93,Vz=96,u2=123,Yz=124,f2=125,kt={};kt[0]="\\0";kt[7]="\\a";kt[8]="\\b";kt[9]="\\t";kt[10]="\\n";kt[11]="\\v";kt[12]="\\f";kt[13]="\\r";kt[27]="\\e";kt[34]='\\"';kt[92]="\\\\";kt[133]="\\N";kt[160]="\\_";kt[8232]="\\L";kt[8233]="\\P";var Kz=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qz=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Gz(t,e){var n,i,r,s,o,l,a;if(e===null)return{};for(n={},i=Object.keys(e),r=0,s=i.length;r<s;r+=1)o=i[r],l=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=t.compiledTypeMap.fallback[o],a&&o2.call(a.styleAliases,l)&&(l=a.styleAliases[l]),n[o]=l;return n}function $z(t){var e,n,i;if(e=t.toString(16).toUpperCase(),t<=255)n="x",i=2;else if(t<=65535)n="u",i=4;else if(t<=4294967295)n="U",i=8;else throw new It("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+rt.repeat("0",i-e.length)+e}var Xz=1,Uc=2;function Wz(t){this.schema=t.schema||j0,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=rt.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Gz(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Uc:Xz,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ST(t,e){for(var n=rt.repeat(" ",e),i=0,r=-1,s="",o,l=t.length;i<l;)r=t.indexOf(`
11
+ `+t.mark.snippet),i+" "+n):i}function Vc(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=IT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Vc.prototype=Object.create(Error.prototype);Vc.prototype.constructor=Vc;Vc.prototype.toString=function(e){return this.name+": "+IT(this,e)};var qt=Vc;function P0(t,e,n,i,r){var s="",o="",l=Math.floor(r/2)-1;return i-e>l&&(s=" ... ",e=i-l+s.length),n-i>l&&(o=" ...",n=i+l-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:i-e+s.length}}function z0(t,e){return nt.repeat(" ",e-t.length)+t}function C8(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(t.buffer);)r.push(s.index),i.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var l="",a,c,u=Math.min(t.line+e.linesAfter,r.length).toString().length,f=e.maxLength-(e.indent+u+3);for(a=1;a<=e.linesBefore&&!(o-a<0);a++)c=P0(t.buffer,i[o-a],r[o-a],t.position-(i[o]-i[o-a]),f),l=nt.repeat(" ",e.indent)+z0((t.line-a+1).toString(),u)+" | "+c.str+`
12
+ `+l;for(c=P0(t.buffer,i[o],r[o],t.position,f),l+=nt.repeat(" ",e.indent)+z0((t.line+1).toString(),u)+" | "+c.str+`
13
+ `,l+=nt.repeat("-",e.indent+u+3+c.pos)+`^
14
+ `,a=1;a<=e.linesAfter&&!(o+a>=r.length);a++)c=P0(t.buffer,i[o+a],r[o+a],t.position-(i[o]-i[o+a]),f),l+=nt.repeat(" ",e.indent)+z0((t.line+a+1).toString(),u)+" | "+c.str+`
15
+ `;return l.replace(/\n$/,"")}var E8=C8,D8=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],M8=["scalar","sequence","mapping"];function N8(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(i){e[String(i)]=n})}),e}function R8(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(D8.indexOf(n)===-1)throw new qt('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=N8(e.styleAliases||null),M8.indexOf(this.kind)===-1)throw new qt('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var bt=R8;function ST(t,e){var n=[];return t[e].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function _8(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function i(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(i);return t}function U0(t){return this.extend(t)}U0.prototype.extend=function(e){var n=[],i=[];if(e instanceof bt)i.push(e);else if(Array.isArray(e))i=i.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit));else throw new qt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof bt))throw new qt("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new qt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new qt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof bt))throw new qt("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(U0.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=ST(r,"implicit"),r.compiledExplicit=ST(r,"explicit"),r.compiledTypeMap=_8(r.compiledImplicit,r.compiledExplicit),r};var qT=U0,PT=new bt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),zT=new bt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),HT=new bt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),UT=new qT({explicit:[PT,zT,HT]});function L8(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function B8(){return null}function I8(t){return t===null}var FT=new bt("tag:yaml.org,2002:null",{kind:"scalar",resolve:L8,construct:B8,predicate:I8,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function q8(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function P8(t){return t==="true"||t==="True"||t==="TRUE"}function z8(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var jT=new bt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:q8,construct:P8,predicate:z8,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function H8(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function U8(t){return 48<=t&&t<=55}function F8(t){return 48<=t&&t<=57}function j8(t){if(t===null)return!1;var e=t.length,n=0,i=!1,r;if(!e)return!1;if(r=t[n],(r==="-"||r==="+")&&(r=t[++n]),r==="0"){if(n+1===e)return!0;if(r=t[++n],r==="b"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!H8(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!U8(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<e;n++)if(r=t[n],r!=="_"){if(!F8(t.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function V8(t){var e=t,n=1,i;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),i=e[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),e=e.slice(1),i=e[0]),e==="0")return 0;if(i==="0"){if(e[1]==="b")return n*parseInt(e.slice(2),2);if(e[1]==="x")return n*parseInt(e.slice(2),16);if(e[1]==="o")return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)}function Y8(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!nt.isNegativeZero(t)}var VT=new bt("tag:yaml.org,2002:int",{kind:"scalar",resolve:j8,construct:V8,predicate:Y8,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),K8=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Q8(t){return!(t===null||!K8.test(t)||t[t.length-1]==="_")}function $8(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var G8=/^[-+]?[0-9]+e/;function X8(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(nt.isNegativeZero(t))return"-0.0";return n=t.toString(10),G8.test(n)?n.replace("e",".e"):n}function W8(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||nt.isNegativeZero(t))}var YT=new bt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Q8,construct:$8,predicate:W8,represent:X8,defaultStyle:"lowercase"}),KT=UT.extend({implicit:[FT,jT,VT,YT]}),QT=KT,$T=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),GT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Z8(t){return t===null?!1:$T.exec(t)!==null||GT.exec(t)!==null}function J8(t){var e,n,i,r,s,o,l,a=0,c=null,u,f,h;if(e=$T.exec(t),e===null&&(e=GT.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(s=+e[4],o=+e[5],l=+e[6],e[7]){for(a=e[7].slice(0,3);a.length<3;)a+="0";a=+a}return e[9]&&(u=+e[10],f=+(e[11]||0),c=(u*60+f)*6e4,e[9]==="-"&&(c=-c)),h=new Date(Date.UTC(n,i,r,s,o,l,a)),c&&h.setTime(h.getTime()-c),h}function ez(t){return t.toISOString()}var XT=new bt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Z8,construct:J8,instanceOf:Date,represent:ez});function tz(t){return t==="<<"||t===null}var WT=new bt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:tz}),K0=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
16
+ \r`;function nz(t){if(t===null)return!1;var e,n,i=0,r=t.length,s=K0;for(n=0;n<r;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function iz(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=K0,o=0,l=[];for(e=0;e<r;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return n=r%4*6,n===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):n===18?(l.push(o>>10&255),l.push(o>>2&255)):n===12&&l.push(o>>4&255),new Uint8Array(l)}function rz(t){var e="",n=0,i,r,s=t.length,o=K0;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[i];return r=s%3,r===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):r===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):r===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function sz(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var ZT=new bt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:nz,construct:iz,predicate:sz,represent:rz}),oz=Object.prototype.hasOwnProperty,lz=Object.prototype.toString;function az(t){if(t===null)return!0;var e=[],n,i,r,s,o,l=t;for(n=0,i=l.length;n<i;n+=1){if(r=l[n],o=!1,lz.call(r)!=="[object Object]")return!1;for(s in r)if(oz.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function cz(t){return t!==null?t:[]}var JT=new bt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:az,construct:cz}),uz=Object.prototype.toString;function fz(t){if(t===null)return!0;var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(i=o[e],uz.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[e]=[r[0],i[r[0]]]}return!0}function hz(t){if(t===null)return[];var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)i=o[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}var e2=new bt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:fz,construct:hz}),dz=Object.prototype.hasOwnProperty;function pz(t){if(t===null)return!0;var e,n=t;for(e in n)if(dz.call(n,e)&&n[e]!==null)return!1;return!0}function mz(t){return t!==null?t:{}}var t2=new bt("tag:yaml.org,2002:set",{kind:"mapping",resolve:pz,construct:mz}),Q0=QT.extend({implicit:[XT,WT],explicit:[ZT,JT,e2,t2]}),ss=Object.prototype.hasOwnProperty,od=1,n2=2,i2=3,ld=4,H0=1,gz=2,xT=3,yz=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,bz=/[\x85\u2028\u2029]/,vz=/[,\[\]\{\}]/,r2=/^(?:!|!!|![a-z\-]+!)$/i,s2=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function wT(t){return Object.prototype.toString.call(t)}function Ci(t){return t===10||t===13}function Zs(t){return t===9||t===32}function Zt(t){return t===9||t===32||t===10||t===13}function Dl(t){return t===44||t===91||t===93||t===123||t===125}function Sz(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function xz(t){return t===120?2:t===117?4:t===85?8:0}function wz(t){return 48<=t&&t<=57?t-48:-1}function kT(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
17
+ `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function kz(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function o2(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var l2=new Array(256),a2=new Array(256);for(Ws=0;Ws<256;Ws++)l2[Ws]=kT(Ws)?1:0,a2[Ws]=kT(Ws);var Ws;function Az(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Q0,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function c2(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=E8(n),new qt(e,n)}function H(t,e){throw c2(t,e)}function ad(t,e){t.onWarning&&t.onWarning.call(null,c2(t,e))}var AT={YAML:function(e,n,i){var r,s,o;e.version!==null&&H(e,"duplication of %YAML directive"),i.length!==1&&H(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&H(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&H(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&ad(e,"unsupported YAML version of the document")},TAG:function(e,n,i){var r,s;i.length!==2&&H(e,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],r2.test(r)||H(e,"ill-formed tag handle (first argument) of the TAG directive"),ss.call(e.tagMap,r)&&H(e,'there is a previously declared suffix for "'+r+'" tag handle'),s2.test(s)||H(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{H(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function rs(t,e,n,i){var r,s,o,l;if(e<n){if(l=t.input.slice(e,n),i)for(r=0,s=l.length;r<s;r+=1)o=l.charCodeAt(r),o===9||32<=o&&o<=1114111||H(t,"expected valid JSON character");else yz.test(l)&&H(t,"the stream contains non-printable characters");t.result+=l}}function OT(t,e,n,i){var r,s,o,l;for(nt.isObject(n)||H(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,l=r.length;o<l;o+=1)s=r[o],ss.call(e,s)||(o2(e,s,n[s]),i[s]=!0)}function Ml(t,e,n,i,r,s,o,l,a){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&H(t,"nested arrays are not supported inside keys"),typeof r=="object"&&wT(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&wT(r)==="[object Object]"&&(r="[object Object]"),r=String(r),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)OT(t,e,s[c],n);else OT(t,e,s,n);else!t.json&&!ss.call(n,r)&&ss.call(e,r)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=a||t.position,H(t,"duplicated mapping key")),o2(e,r,s),delete n[r];return e}function $0(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):H(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function We(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);r!==0;){for(;Zs(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(Ci(r))for($0(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return n!==-1&&i!==0&&t.lineIndent<n&&ad(t,"deficient indentation"),i}function fd(t){var e=t.position,n;return n=t.input.charCodeAt(e),!!((n===45||n===46)&&n===t.input.charCodeAt(e+1)&&n===t.input.charCodeAt(e+2)&&(e+=3,n=t.input.charCodeAt(e),n===0||Zt(n)))}function G0(t,e){e===1?t.result+=" ":e>1&&(t.result+=nt.repeat(`
18
+ `,e-1))}function Oz(t,e,n){var i,r,s,o,l,a,c,u,f=t.kind,h=t.result,d;if(d=t.input.charCodeAt(t.position),Zt(d)||Dl(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=t.input.charCodeAt(t.position+1),Zt(r)||n&&Dl(r)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;d!==0;){if(d===58){if(r=t.input.charCodeAt(t.position+1),Zt(r)||n&&Dl(r))break}else if(d===35){if(i=t.input.charCodeAt(t.position-1),Zt(i))break}else{if(t.position===t.lineStart&&fd(t)||n&&Dl(d))break;if(Ci(d))if(a=t.line,c=t.lineStart,u=t.lineIndent,We(t,!1,-1),t.lineIndent>=e){l=!0,d=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=a,t.lineStart=c,t.lineIndent=u;break}}l&&(rs(t,s,o,!1),G0(t,t.line-a),s=o=t.position,l=!1),Zs(d)||(o=t.position+1),d=t.input.charCodeAt(++t.position)}return rs(t,s,o,!1),t.result?!0:(t.kind=f,t.result=h,!1)}function Tz(t,e){var n,i,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(rs(t,i,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)i=t.position,t.position++,r=t.position;else return!0;else Ci(n)?(rs(t,i,r,!0),G0(t,We(t,!1,e)),i=r=t.position):t.position===t.lineStart&&fd(t)?H(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);H(t,"unexpected end of the stream within a single quoted scalar")}function Cz(t,e){var n,i,r,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return rs(t,n,t.position,!0),t.position++,!0;if(l===92){if(rs(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),Ci(l))We(t,!1,e);else if(l<256&&l2[l])t.result+=a2[l],t.position++;else if((o=xz(l))>0){for(r=o,s=0;r>0;r--)l=t.input.charCodeAt(++t.position),(o=Sz(l))>=0?s=(s<<4)+o:H(t,"expected hexadecimal character");t.result+=kz(s),t.position++}else H(t,"unknown escape sequence");n=i=t.position}else Ci(l)?(rs(t,n,i,!0),G0(t,We(t,!1,e)),n=i=t.position):t.position===t.lineStart&&fd(t)?H(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}H(t,"unexpected end of the stream within a double quoted scalar")}function Ez(t,e){var n=!0,i,r,s,o=t.tag,l,a=t.anchor,c,u,f,h,d,m=Object.create(null),g,b,p,y;if(y=t.input.charCodeAt(t.position),y===91)u=93,d=!1,l=[];else if(y===123)u=125,d=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),y=t.input.charCodeAt(++t.position);y!==0;){if(We(t,!0,e),y=t.input.charCodeAt(t.position),y===u)return t.position++,t.tag=o,t.anchor=a,t.kind=d?"mapping":"sequence",t.result=l,!0;n?y===44&&H(t,"expected the node content, but found ','"):H(t,"missed comma between flow collection entries"),b=g=p=null,f=h=!1,y===63&&(c=t.input.charCodeAt(t.position+1),Zt(c)&&(f=h=!0,t.position++,We(t,!0,e))),i=t.line,r=t.lineStart,s=t.position,Nl(t,e,od,!1,!0),b=t.tag,g=t.result,We(t,!0,e),y=t.input.charCodeAt(t.position),(h||t.line===i)&&y===58&&(f=!0,y=t.input.charCodeAt(++t.position),We(t,!0,e),Nl(t,e,od,!1,!0),p=t.result),d?Ml(t,l,m,b,g,p,i,r,s):f?l.push(Ml(t,null,m,b,g,p,i,r,s)):l.push(g),We(t,!0,e),y=t.input.charCodeAt(t.position),y===44?(n=!0,y=t.input.charCodeAt(++t.position)):n=!1}H(t,"unexpected end of the stream within a flow collection")}function Dz(t,e){var n,i,r=H0,s=!1,o=!1,l=e,a=0,c=!1,u,f;if(f=t.input.charCodeAt(t.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)H0===r?r=f===43?xT:gz:H(t,"repeat of a chomping mode identifier");else if((u=wz(f))>=0)u===0?H(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?H(t,"repeat of an indentation width identifier"):(l=e+u-1,o=!0);else break;if(Zs(f)){do f=t.input.charCodeAt(++t.position);while(Zs(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!Ci(f)&&f!==0)}for(;f!==0;){for($0(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndent<l)&&f===32;)t.lineIndent++,f=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>l&&(l=t.lineIndent),Ci(f)){a++;continue}if(t.lineIndent<l){r===xT?t.result+=nt.repeat(`
19
+ `,s?1+a:a):r===H0&&s&&(t.result+=`
20
+ `);break}for(i?Zs(f)?(c=!0,t.result+=nt.repeat(`
21
+ `,s?1+a:a)):c?(c=!1,t.result+=nt.repeat(`
22
+ `,a+1)):a===0?s&&(t.result+=" "):t.result+=nt.repeat(`
23
+ `,a):t.result+=nt.repeat(`
24
+ `,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!Ci(f)&&f!==0;)f=t.input.charCodeAt(++t.position);rs(t,n,t.position,!1)}return!0}function TT(t,e){var n,i=t.tag,r=t.anchor,s=[],o,l=!1,a;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),a=t.input.charCodeAt(t.position);a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,H(t,"tab characters must not be used in indentation")),!(a!==45||(o=t.input.charCodeAt(t.position+1),!Zt(o))));){if(l=!0,t.position++,We(t,!0,-1)&&t.lineIndent<=e){s.push(null),a=t.input.charCodeAt(t.position);continue}if(n=t.line,Nl(t,e,i2,!1,!0),s.push(t.result),We(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&a!==0)H(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=i,t.anchor=r,t.kind="sequence",t.result=s,!0):!1}function Mz(t,e,n){var i,r,s,o,l,a,c=t.tag,u=t.anchor,f={},h=Object.create(null),d=null,m=null,g=null,b=!1,p=!1,y;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=f),y=t.input.charCodeAt(t.position);y!==0;){if(!b&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,H(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,(y===63||y===58)&&Zt(i))y===63?(b&&(Ml(t,f,h,d,m,null,o,l,a),d=m=g=null),p=!0,b=!0,r=!0):b?(b=!1,r=!0):H(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,y=i;else{if(o=t.line,l=t.lineStart,a=t.position,!Nl(t,n,n2,!1,!0))break;if(t.line===s){for(y=t.input.charCodeAt(t.position);Zs(y);)y=t.input.charCodeAt(++t.position);if(y===58)y=t.input.charCodeAt(++t.position),Zt(y)||H(t,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Ml(t,f,h,d,m,null,o,l,a),d=m=g=null),p=!0,b=!1,r=!1,d=t.tag,m=t.result;else if(p)H(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=u,!0}else if(p)H(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=u,!0}if((t.line===s||t.lineIndent>e)&&(b&&(o=t.line,l=t.lineStart,a=t.position),Nl(t,e,ld,!0,r)&&(b?m=t.result:g=t.result),b||(Ml(t,f,h,d,m,g,o,l,a),d=m=g=null),We(t,!0,-1),y=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&y!==0)H(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return b&&Ml(t,f,h,d,m,null,o,l,a),p&&(t.tag=c,t.anchor=u,t.kind="mapping",t.result=f),p}function Nz(t){var e,n=!1,i=!1,r,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&H(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(n=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,r="!!",o=t.input.charCodeAt(++t.position)):r="!",e=t.position,n){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):H(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Zt(o);)o===33&&(i?H(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),r2.test(r)||H(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),vz.test(s)&&H(t,"tag suffix cannot contain flow indicator characters")}s&&!s2.test(s)&&H(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{H(t,"tag name is malformed: "+s)}return n?t.tag=s:ss.call(t.tagMap,r)?t.tag=t.tagMap[r]+s:r==="!"?t.tag="!"+s:r==="!!"?t.tag="tag:yaml.org,2002:"+s:H(t,'undeclared tag handle "'+r+'"'),!0}function Rz(t){var e,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&H(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Zt(n)&&!Dl(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&H(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function _z(t){var e,n,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!Zt(i)&&!Dl(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&H(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),ss.call(t.anchorMap,n)||H(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],We(t,!0,-1),!0}function Nl(t,e,n,i,r){var s,o,l,a=1,c=!1,u=!1,f,h,d,m,g,b;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=l=ld===n||i2===n,i&&We(t,!0,-1)&&(c=!0,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)),a===1)for(;Nz(t)||Rz(t);)We(t,!0,-1)?(c=!0,l=s,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)):l=!1;if(l&&(l=c||r),(a===1||ld===n)&&(od===n||n2===n?g=e:g=e+1,b=t.position-t.lineStart,a===1?l&&(TT(t,b)||Mz(t,b,g))||Ez(t,g)?u=!0:(o&&Dz(t,g)||Tz(t,g)||Cz(t,g)?u=!0:_z(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&H(t,"alias node should not have any properties")):Oz(t,g,od===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):a===0&&(u=l&&TT(t,b))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&H(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),f=0,h=t.implicitTypes.length;f<h;f+=1)if(m=t.implicitTypes[f],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(ss.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else for(m=null,d=t.typeMap.multi[t.kind||"fallback"],f=0,h=d.length;f<h;f+=1)if(t.tag.slice(0,d[f].tag.length)===d[f].tag){m=d[f];break}m||H(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&H(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):H(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function Lz(t){var e=t.position,n,i,r,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(We(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!Zt(o);)o=t.input.charCodeAt(++t.position);for(i=t.input.slice(n,t.position),r=[],i.length<1&&H(t,"directive name must not be less than one character in length");o!==0;){for(;Zs(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!Ci(o));break}if(Ci(o))break;for(n=t.position;o!==0&&!Zt(o);)o=t.input.charCodeAt(++t.position);r.push(t.input.slice(n,t.position))}o!==0&&$0(t),ss.call(AT,i)?AT[i](t,i,r):ad(t,'unknown document directive "'+i+'"')}if(We(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,We(t,!0,-1)):s&&H(t,"directives end mark is expected"),Nl(t,t.lineIndent-1,ld,!1,!0),We(t,!0,-1),t.checkLineBreaks&&bz.test(t.input.slice(e,t.position))&&ad(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&fd(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,We(t,!0,-1));return}if(t.position<t.length-1)H(t,"end of the stream or a document separator is expected");else return}function u2(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
25
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new Az(t,e),i=t.indexOf("\0");for(i!==-1&&(n.position=i,H(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Lz(n);return n.documents}function Bz(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var i=u2(t,n);if(typeof e!="function")return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])}function Iz(t,e){var n=u2(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new qt("expected a single document in the stream, but found more")}}var qz=Bz,Pz=Iz,f2={loadAll:qz,load:Pz},h2=Object.prototype.toString,d2=Object.prototype.hasOwnProperty,X0=65279,zz=9,Yc=10,Hz=13,Uz=32,Fz=33,jz=34,F0=35,Vz=37,Yz=38,Kz=39,Qz=42,p2=44,$z=45,cd=58,Gz=61,Xz=62,Wz=63,Zz=64,m2=91,g2=93,Jz=96,y2=123,e9=124,b2=125,Tt={};Tt[0]="\\0";Tt[7]="\\a";Tt[8]="\\b";Tt[9]="\\t";Tt[10]="\\n";Tt[11]="\\v";Tt[12]="\\f";Tt[13]="\\r";Tt[27]="\\e";Tt[34]='\\"';Tt[92]="\\\\";Tt[133]="\\N";Tt[160]="\\_";Tt[8232]="\\L";Tt[8233]="\\P";var t9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],n9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function i9(t,e){var n,i,r,s,o,l,a;if(e===null)return{};for(n={},i=Object.keys(e),r=0,s=i.length;r<s;r+=1)o=i[r],l=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=t.compiledTypeMap.fallback[o],a&&d2.call(a.styleAliases,l)&&(l=a.styleAliases[l]),n[o]=l;return n}function r9(t){var e,n,i;if(e=t.toString(16).toUpperCase(),t<=255)n="x",i=2;else if(t<=65535)n="u",i=4;else if(t<=4294967295)n="U",i=8;else throw new qt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+nt.repeat("0",i-e.length)+e}var s9=1,Kc=2;function o9(t){this.schema=t.schema||Q0,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=nt.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=i9(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Kc:s9,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function CT(t,e){for(var n=nt.repeat(" ",e),i=0,r=-1,s="",o,l=t.length;i<l;)r=t.indexOf(`
26
26
  `,i),r===-1?(o=t.slice(i),i=l):(o=t.slice(i,r+1),i=r+1),o.length&&o!==`
27
- `&&(s+=n),s+=o;return s}function z0(t,e){return`
28
- `+rt.repeat(" ",t.indent*e)}function Zz(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;n<i;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function sd(t){return t===Rz||t===Mz}function Fc(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==K0||65536<=t&&t<=1114111}function xT(t){return Fc(t)&&t!==K0&&t!==Nz&&t!==Hc}function wT(t,e,n){var i=xT(t),r=i&&!sd(t);return(n?i:i&&t!==l2&&t!==a2&&t!==c2&&t!==u2&&t!==f2)&&t!==P0&&!(e===rd&&!r)||xT(e)&&!sd(e)&&t===P0||e===rd&&r}function Jz(t){return Fc(t)&&t!==K0&&!sd(t)&&t!==zz&&t!==Fz&&t!==rd&&t!==l2&&t!==a2&&t!==c2&&t!==u2&&t!==f2&&t!==P0&&t!==Iz&&t!==Pz&&t!==_z&&t!==Yz&&t!==Hz&&t!==Uz&&t!==qz&&t!==Lz&&t!==Bz&&t!==jz&&t!==Vz}function e9(t){return!sd(t)&&t!==rd}function Pc(t,e){var n=t.charCodeAt(e),i;return n>=55296&&n<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function h2(t){var e=/^\n* /;return e.test(t)}var d2=1,H0=2,p2=3,m2=4,xl=5;function t9(t,e,n,i,r,s,o,l){var a,c=0,u=null,f=!1,h=!1,d=i!==-1,p=-1,m=Jz(Pc(t,0))&&e9(Pc(t,t.length-1));if(e||o)for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=Pc(t,a),!Fc(c))return xl;m=m&&wT(c,u,l),u=c}else{for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=Pc(t,a),c===Hc)f=!0,d&&(h=h||a-p-1>i&&t[p+1]!==" ",p=a);else if(!Fc(c))return xl;m=m&&wT(c,u,l),u=c}h=h||d&&a-p-1>i&&t[p+1]!==" "}return!f&&!h?m&&!o&&!r(t)?d2:s===Uc?xl:H0:n>9&&h2(t)?xl:o?s===Uc?xl:H0:h?m2:p2}function n9(t,e,n,i,r){t.dump=(function(){if(e.length===0)return t.quotingType===Uc?'""':"''";if(!t.noCompatMode&&(Kz.indexOf(e)!==-1||Qz.test(e)))return t.quotingType===Uc?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=i||t.flowLevel>-1&&n>=t.flowLevel;function a(c){return Zz(t,c)}switch(t9(e,l,t.indent,o,a,t.quotingType,t.forceQuotes&&!i,r)){case d2:return e;case H0:return"'"+e.replace(/'/g,"''")+"'";case p2:return"|"+kT(e,t.indent)+AT(ST(e,s));case m2:return">"+kT(e,t.indent)+AT(ST(i9(e,o),s));case xl:return'"'+r9(e)+'"';default:throw new It("impossible error: invalid scalar style")}})()}function kT(t,e){var n=h2(t)?String(e):"",i=t[t.length-1]===`
27
+ `&&(s+=n),s+=o;return s}function j0(t,e){return`
28
+ `+nt.repeat(" ",t.indent*e)}function l9(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;n<i;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function ud(t){return t===Uz||t===zz}function Qc(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==X0||65536<=t&&t<=1114111}function ET(t){return Qc(t)&&t!==X0&&t!==Hz&&t!==Yc}function DT(t,e,n){var i=ET(t),r=i&&!ud(t);return(n?i:i&&t!==p2&&t!==m2&&t!==g2&&t!==y2&&t!==b2)&&t!==F0&&!(e===cd&&!r)||ET(e)&&!ud(e)&&t===F0||e===cd&&r}function a9(t){return Qc(t)&&t!==X0&&!ud(t)&&t!==$z&&t!==Wz&&t!==cd&&t!==p2&&t!==m2&&t!==g2&&t!==y2&&t!==b2&&t!==F0&&t!==Yz&&t!==Qz&&t!==Fz&&t!==e9&&t!==Gz&&t!==Xz&&t!==Kz&&t!==jz&&t!==Vz&&t!==Zz&&t!==Jz}function c9(t){return!ud(t)&&t!==cd}function jc(t,e){var n=t.charCodeAt(e),i;return n>=55296&&n<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function v2(t){var e=/^\n* /;return e.test(t)}var S2=1,V0=2,x2=3,w2=4,El=5;function u9(t,e,n,i,r,s,o,l){var a,c=0,u=null,f=!1,h=!1,d=i!==-1,m=-1,g=a9(jc(t,0))&&c9(jc(t,t.length-1));if(e||o)for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=jc(t,a),!Qc(c))return El;g=g&&DT(c,u,l),u=c}else{for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=jc(t,a),c===Yc)f=!0,d&&(h=h||a-m-1>i&&t[m+1]!==" ",m=a);else if(!Qc(c))return El;g=g&&DT(c,u,l),u=c}h=h||d&&a-m-1>i&&t[m+1]!==" "}return!f&&!h?g&&!o&&!r(t)?S2:s===Kc?El:V0:n>9&&v2(t)?El:o?s===Kc?El:V0:h?w2:x2}function f9(t,e,n,i,r){t.dump=(function(){if(e.length===0)return t.quotingType===Kc?'""':"''";if(!t.noCompatMode&&(t9.indexOf(e)!==-1||n9.test(e)))return t.quotingType===Kc?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=i||t.flowLevel>-1&&n>=t.flowLevel;function a(c){return l9(t,c)}switch(u9(e,l,t.indent,o,a,t.quotingType,t.forceQuotes&&!i,r)){case S2:return e;case V0:return"'"+e.replace(/'/g,"''")+"'";case x2:return"|"+MT(e,t.indent)+NT(CT(e,s));case w2:return">"+MT(e,t.indent)+NT(CT(h9(e,o),s));case El:return'"'+d9(e)+'"';default:throw new qt("impossible error: invalid scalar style")}})()}function MT(t,e){var n=v2(t)?String(e):"",i=t[t.length-1]===`
29
29
  `,r=i&&(t[t.length-2]===`
30
30
  `||t===`
31
31
  `),s=r?"+":i?"":"-";return n+s+`
32
- `}function AT(t){return t[t.length-1]===`
33
- `?t.slice(0,-1):t}function i9(t,e){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=t.indexOf(`
34
- `);return c=c!==-1?c:t.length,n.lastIndex=c,OT(t.slice(0,c),e)})(),r=t[0]===`
32
+ `}function NT(t){return t[t.length-1]===`
33
+ `?t.slice(0,-1):t}function h9(t,e){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=t.indexOf(`
34
+ `);return c=c!==-1?c:t.length,n.lastIndex=c,RT(t.slice(0,c),e)})(),r=t[0]===`
35
35
  `||t[0]===" ",s,o;o=n.exec(t);){var l=o[1],a=o[2];s=a[0]===" ",i+=l+(!r&&!s&&a!==""?`
36
- `:"")+OT(a,e),r=s}return i}function OT(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,i,r=0,s,o=0,l=0,a="";i=n.exec(t);)l=i.index,l-r>e&&(s=o>r?o:l,a+=`
36
+ `:"")+RT(a,e),r=s}return i}function RT(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,i,r=0,s,o=0,l=0,a="";i=n.exec(t);)l=i.index,l-r>e&&(s=o>r?o:l,a+=`
37
37
  `+t.slice(r,s),r=s+1),o=l;return a+=`
38
38
  `,t.length-r>e&&o>r?a+=t.slice(r,o)+`
39
- `+t.slice(o+1):a+=t.slice(r),a.slice(1)}function r9(t){for(var e="",n=0,i,r=0;r<t.length;n>=65536?r+=2:r++)n=Pc(t,r),i=kt[n],!i&&Fc(n)?(e+=t[r],n>=65536&&(e+=t[r+1])):e+=i||$z(n);return e}function s9(t,e,n){var i="",r=t.tag,s,o,l;for(s=0,o=n.length;s<o;s+=1)l=n[s],t.replacer&&(l=t.replacer.call(n,String(s),l)),(or(t,e,l,!1,!1)||typeof l>"u"&&or(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=r,t.dump="["+i+"]"}function TT(t,e,n,i){var r="",s=t.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],t.replacer&&(a=t.replacer.call(n,String(o),a)),(or(t,e+1,a,!0,!0,!1,!0)||typeof a>"u"&&or(t,e+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=z0(t,e)),t.dump&&Hc===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=s,t.dump=r||"[]"}function o9(t,e,n){var i="",r=t.tag,s=Object.keys(n),o,l,a,c,u;for(o=0,l=s.length;o<l;o+=1)u="",i!==""&&(u+=", "),t.condenseFlow&&(u+='"'),a=s[o],c=n[a],t.replacer&&(c=t.replacer.call(n,a,c)),or(t,e,a,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),or(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=r,t.dump="{"+i+"}"}function l9(t,e,n,i){var r="",s=t.tag,o=Object.keys(n),l,a,c,u,f,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new It("sortKeys must be a boolean or a function");for(l=0,a=o.length;l<a;l+=1)h="",(!i||r!=="")&&(h+=z0(t,e)),c=o[l],u=n[c],t.replacer&&(u=t.replacer.call(n,c,u)),or(t,e+1,c,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&Hc===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=z0(t,e)),or(t,e+1,u,!0,f)&&(t.dump&&Hc===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,r+=h));t.tag=s,t.dump=r||"{}"}function CT(t,e,n){var i,r,s,o,l,a;for(r=n?t.explicitTypes:t.implicitTypes,s=0,o=r.length;s<o;s+=1)if(l=r[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof e=="object"&&e instanceof l.instanceOf)&&(!l.predicate||l.predicate(e))){if(n?l.multi&&l.representName?t.tag=l.representName(e):t.tag=l.tag:t.tag="?",l.represent){if(a=t.styleMap[l.tag]||l.defaultStyle,s2.call(l.represent)==="[object Function]")i=l.represent(e,a);else if(o2.call(l.represent,a))i=l.represent[a](e,a);else throw new It("!<"+l.tag+'> tag resolver accepts not "'+a+'" style');t.dump=i}return!0}return!1}function or(t,e,n,i,r,s,o){t.tag=null,t.dump=n,CT(t,n,!1)||CT(t,n,!0);var l=s2.call(t.dump),a=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=l==="[object Object]"||l==="[object Array]",f,h;if(u&&(f=t.duplicates.indexOf(n),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(r=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(u&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),l==="[object Object]")i&&Object.keys(t.dump).length!==0?(l9(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(o9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?TT(t,e-1,t.dump,r):TT(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(s9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&n9(t,t.dump,e,s,a);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new It("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function a9(t,e){var n=[],i=[],r,s;for(U0(t,n,i),r=0,s=i.length;r<s;r+=1)e.duplicates.push(n[i[r]]);e.usedDuplicates=new Array(s)}function U0(t,e,n){var i,r,s;if(t!==null&&typeof t=="object")if(r=e.indexOf(t),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(e.push(t),Array.isArray(t))for(r=0,s=t.length;r<s;r+=1)U0(t[r],e,n);else for(i=Object.keys(t),r=0,s=i.length;r<s;r+=1)U0(t[i[r]],e,n)}function c9(t,e){e=e||{};var n=new Wz(e);n.noRefs||a9(t,n);var i=t;return n.replacer&&(i=n.replacer.call({"":i},"",i)),or(n,0,i,!0,!0)?n.dump+`
40
- `:""}var u9=c9,f9={dump:u9};function Q0(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var h9=bt,d9=MT,p9=LT,m9=zT,g9=HT,y9=j0,b9=r2.load,v9=r2.loadAll,S9=f9.dump,x9=It,w9={binary:YT,float:PT,map:_T,null:BT,pairs:QT,set:GT,timestamp:jT,bool:IT,int:qT,merge:VT,omap:KT,seq:RT,str:NT},k9=Q0("safeLoad","load"),A9=Q0("safeLoadAll","loadAll"),O9=Q0("safeDump","dump"),Ol={Type:h9,Schema:d9,FAILSAFE_SCHEMA:p9,JSON_SCHEMA:m9,CORE_SCHEMA:g9,DEFAULT_SCHEMA:y9,load:b9,loadAll:v9,dump:S9,YAMLException:x9,types:w9,safeLoad:k9,safeLoadAll:A9,safeDump:O9};function lr(){let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=Date.now().toString(36),n=Math.random().toString(36).slice(2,12),i=Math.random().toString(36).slice(2,12);return`${e}-${n}-${i}`}var es=class t extends Error{constructor(e,n,i){super(e),this.name="SpecParseError",this.line=n,this.column=i,Object.setPrototypeOf(this,t.prototype)}};function Tl(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function g2(t){return Array.isArray(t)?t:Tl(t)?Object.entries(t).map(([e,n])=>({[e]:n})):[]}function T9(t){if(typeof t=="string"||!Tl(t))return;let e=Object.keys(t);return e.length>0?e[0]:void 0}function y2(t,e){let n=new Map,i=t.split(`
39
+ `+t.slice(o+1):a+=t.slice(r),a.slice(1)}function d9(t){for(var e="",n=0,i,r=0;r<t.length;n>=65536?r+=2:r++)n=jc(t,r),i=Tt[n],!i&&Qc(n)?(e+=t[r],n>=65536&&(e+=t[r+1])):e+=i||r9(n);return e}function p9(t,e,n){var i="",r=t.tag,s,o,l;for(s=0,o=n.length;s<o;s+=1)l=n[s],t.replacer&&(l=t.replacer.call(n,String(s),l)),(fr(t,e,l,!1,!1)||typeof l>"u"&&fr(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=r,t.dump="["+i+"]"}function _T(t,e,n,i){var r="",s=t.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],t.replacer&&(a=t.replacer.call(n,String(o),a)),(fr(t,e+1,a,!0,!0,!1,!0)||typeof a>"u"&&fr(t,e+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=j0(t,e)),t.dump&&Yc===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=s,t.dump=r||"[]"}function m9(t,e,n){var i="",r=t.tag,s=Object.keys(n),o,l,a,c,u;for(o=0,l=s.length;o<l;o+=1)u="",i!==""&&(u+=", "),t.condenseFlow&&(u+='"'),a=s[o],c=n[a],t.replacer&&(c=t.replacer.call(n,a,c)),fr(t,e,a,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),fr(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=r,t.dump="{"+i+"}"}function g9(t,e,n,i){var r="",s=t.tag,o=Object.keys(n),l,a,c,u,f,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new qt("sortKeys must be a boolean or a function");for(l=0,a=o.length;l<a;l+=1)h="",(!i||r!=="")&&(h+=j0(t,e)),c=o[l],u=n[c],t.replacer&&(u=t.replacer.call(n,c,u)),fr(t,e+1,c,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&Yc===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=j0(t,e)),fr(t,e+1,u,!0,f)&&(t.dump&&Yc===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,r+=h));t.tag=s,t.dump=r||"{}"}function LT(t,e,n){var i,r,s,o,l,a;for(r=n?t.explicitTypes:t.implicitTypes,s=0,o=r.length;s<o;s+=1)if(l=r[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof e=="object"&&e instanceof l.instanceOf)&&(!l.predicate||l.predicate(e))){if(n?l.multi&&l.representName?t.tag=l.representName(e):t.tag=l.tag:t.tag="?",l.represent){if(a=t.styleMap[l.tag]||l.defaultStyle,h2.call(l.represent)==="[object Function]")i=l.represent(e,a);else if(d2.call(l.represent,a))i=l.represent[a](e,a);else throw new qt("!<"+l.tag+'> tag resolver accepts not "'+a+'" style');t.dump=i}return!0}return!1}function fr(t,e,n,i,r,s,o){t.tag=null,t.dump=n,LT(t,n,!1)||LT(t,n,!0);var l=h2.call(t.dump),a=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=l==="[object Object]"||l==="[object Array]",f,h;if(u&&(f=t.duplicates.indexOf(n),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(r=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(u&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),l==="[object Object]")i&&Object.keys(t.dump).length!==0?(g9(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(m9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?_T(t,e-1,t.dump,r):_T(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(p9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&f9(t,t.dump,e,s,a);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new qt("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function y9(t,e){var n=[],i=[],r,s;for(Y0(t,n,i),r=0,s=i.length;r<s;r+=1)e.duplicates.push(n[i[r]]);e.usedDuplicates=new Array(s)}function Y0(t,e,n){var i,r,s;if(t!==null&&typeof t=="object")if(r=e.indexOf(t),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(e.push(t),Array.isArray(t))for(r=0,s=t.length;r<s;r+=1)Y0(t[r],e,n);else for(i=Object.keys(t),r=0,s=i.length;r<s;r+=1)Y0(t[i[r]],e,n)}function b9(t,e){e=e||{};var n=new o9(e);n.noRefs||y9(t,n);var i=t;return n.replacer&&(i=n.replacer.call({"":i},"",i)),fr(n,0,i,!0,!0)?n.dump+`
40
+ `:""}var v9=b9,S9={dump:v9};function W0(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var x9=bt,w9=qT,k9=UT,A9=KT,O9=QT,T9=Q0,C9=f2.load,E9=f2.loadAll,D9=S9.dump,M9=qt,N9={binary:ZT,float:YT,map:HT,null:FT,pairs:e2,set:t2,timestamp:XT,bool:jT,int:VT,merge:WT,omap:JT,seq:zT,str:PT},R9=W0("safeLoad","load"),_9=W0("safeLoadAll","loadAll"),L9=W0("safeDump","dump"),Rl={Type:x9,Schema:w9,FAILSAFE_SCHEMA:k9,JSON_SCHEMA:A9,CORE_SCHEMA:O9,DEFAULT_SCHEMA:T9,load:C9,loadAll:E9,dump:D9,YAMLException:M9,types:N9,safeLoad:R9,safeLoadAll:_9,safeDump:L9};function hr(){let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=Date.now().toString(36),n=Math.random().toString(36).slice(2,12),i=Math.random().toString(36).slice(2,12);return`${e}-${n}-${i}`}var os=class t extends Error{constructor(e,n,i){super(e),this.name="SpecParseError",this.line=n,this.column=i,Object.setPrototypeOf(this,t.prototype)}};function _l(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function k2(t){return Array.isArray(t)?t:_l(t)?Object.entries(t).map(([e,n])=>({[e]:n})):[]}function B9(t){if(typeof t=="string"||!_l(t))return;let e=Object.keys(t);return e.length>0?e[0]:void 0}function A2(t,e){let n=new Map,i=t.split(`
41
41
  `),r=!1,s="",o=-1,l=a=>{s&&(n.set(a,s),s="")};for(let a of i){let c=a.trim();if(!r){c===`${e}:`&&(r=!0);continue}if(c.length>0&&!c.startsWith("#")&&!c.startsWith("-")&&/^[A-Za-z_]/.test(a)&&c.endsWith(":"))break;if(c.startsWith("#")){let u=c.slice(1).trim();s=s?`${s}
42
- ${u}`:u;continue}if(c.startsWith("-")){o+=1,l(o);let u=C9(a);if(u){let f=n.get(o);n.set(o,f?`${f}
43
- ${u}`:u)}}}return n}function C9(t){let e=0,n=!0;for(;e<t.length;){let i=t[e];if(i===" "||i===" "){e+=1;continue}if((i==="'"||i==='"')&&n){e=E9(t,e,i),n=!1;continue}if(i==="#"){if(e===0||/\s/.test(t[e-1]))return t.slice(e+1).trim();e+=1;continue}n=i===":"||i===","||i==="["||i==="{",e+=1}}function E9(t,e,n){let i=e+1;for(;i<t.length;){let r=t[i];if(n==="'"){if(r==="'"){if(t[i+1]==="'"){i+=2;continue}return i+1}}else{if(r==="\\"){i+=2;continue}if(r==='"')return i+1}i+=1}return i}function D9(t){let e=t.split(`
42
+ ${u}`:u;continue}if(c.startsWith("-")){o+=1,l(o);let u=I9(a);if(u){let f=n.get(o);n.set(o,f?`${f}
43
+ ${u}`:u)}}}return n}function I9(t){let e=0,n=!0;for(;e<t.length;){let i=t[e];if(i===" "||i===" "){e+=1;continue}if((i==="'"||i==='"')&&n){e=q9(t,e,i),n=!1;continue}if(i==="#"){if(e===0||/\s/.test(t[e-1]))return t.slice(e+1).trim();e+=1;continue}n=i===":"||i===","||i==="["||i==="{",e+=1}}function q9(t,e,n){let i=e+1;for(;i<t.length;){let r=t[i];if(n==="'"){if(r==="'"){if(t[i+1]==="'"){i+=2;continue}return i+1}}else{if(r==="\\"){i+=2;continue}if(r==='"')return i+1}i+=1}return i}function P9(t){let e=t.split(`
44
44
  `),n=[];for(let i of e){let r=i.trim();if(r!==""){if(r.startsWith("#")){n.push(r.slice(1).trim());continue}break}}return n.length>0?n.join(`
45
- `):void 0}function b2(t,e){let n=T9(t);if(n===void 0)return null;if(!ed(n))return{id:lr(),kind:e,type:n,params:{},raw:t};let i=N0(n);for(let o of i){if(!o.fromYamlNode)continue;let l=o.fromYamlNode(t);if(l!==null){let a={id:lr(),kind:e,type:o.type,params:l},c=t[n];return Tl(c)&&(a.sourceBody=c),a}}let r=i.find(o=>!o.fromYamlNode);if(r){let o=t[n],l=Tl(o)?{...o}:{};return{id:lr(),kind:e,type:r.type,params:l}}let s=i[0]?.type??n;return{id:lr(),kind:e,type:s,params:{},raw:t}}function Cl(t){let e;try{e=t.trim()===""?{}:Ol.load(t)}catch(h){if(h instanceof Ol.YAMLException){let d=h.mark?.line!==void 0?h.mark.line+1:void 0,p=h.mark?.column!==void 0?h.mark.column+1:void 0;throw new es(h.reason||h.message,d,p)}throw new es(h.message)}let n=Tl(e)?e:{},i=g2(n.constraints),r=g2(n.directives),s=y2(t,"constraints"),o=y2(t,"directives"),l=[];i.forEach((h,d)=>{let p=b2(h,"constraint");if(!p)return;let m=s.get(d);m&&(p.comment=m),l.push(p)});let a=[];r.forEach((h,d)=>{let p=b2(h,"directive");if(!p)return;let m=o.get(d);m&&(p.comment=m),a.push(p)});let c={constraints:l,directives:a},u=D9(t);u&&(c.headerComment=u);let f=Object.entries(n).filter(([h])=>h!=="constraints"&&h!=="directives").map(([h,d])=>({key:h,value:d}));return f.length>0&&(c.otherSections=f),c}function M9(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function x2(t){let e={};for(let[n,i]of Object.entries(t))if(i!==void 0)if(M9(i)){let r=x2(i);Object.keys(r).length>0&&(e[n]=r)}else e[n]=i;return e}function N9(t){if(t.raw!==void 0)return t.raw;let e=Bt(t.type);return e?.toYamlNode?e.toYamlNode(t.params):{[t.type]:x2(t.params)}}var R9=/^[A-Za-z0-9_.-]+$/;function _9(t){if(!R9.test(t))return!1;try{return Ol.load(t)===t}catch{return!1}}function v2(t){let e=N9(t);return t.type==="flag"&&Tl(e)&&typeof e.flag=="string"&&_9(e.flag)?[` - flag: ${e.flag}`]:Ol.dump([e],{flowLevel:2,lineWidth:-1,sortKeys:!1}).trimEnd().split(`
46
- `).map(i=>` ${i}`)}function S2(t){return t.split(`
47
- `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>` # ${e}`)}function G0(t){let e=[];if(t.headerComment){let n=t.headerComment.split(`
48
- `).map(i=>i.trim()).filter(i=>i.length>0);for(let i of n)e.push(`# ${i}`);n.length>0&&e.push("")}if(t.constraints.length>0){e.push("constraints:");for(let n of t.constraints)n.comment&&e.push(...S2(n.comment)),e.push(...v2(n))}if(t.directives.length>0){t.constraints.length>0&&e.push(""),e.push("directives:");for(let n of t.directives)n.comment&&e.push(...S2(n.comment)),e.push(...v2(n))}for(let n of t.otherSections??[]){e.length>0&&e.push("");let i=Ol.dump({[n.key]:n.value},{lineWidth:-1,sortKeys:!1}).trimEnd();e.push(...i.split(`
45
+ `):void 0}function O2(t,e){let n=B9(t);if(n===void 0)return null;if(!sd(n))return{id:hr(),kind:e,type:n,params:{},raw:t};let i=B0(n);for(let o of i){if(!o.fromYamlNode)continue;let l=o.fromYamlNode(t);if(l!==null){let a={id:hr(),kind:e,type:o.type,params:l},c=t[n];return _l(c)&&(a.sourceBody=c),a}}let r=i.find(o=>!o.fromYamlNode);if(r){let o=t[n],l=_l(o)?{...o}:{};return{id:hr(),kind:e,type:r.type,params:l}}let s=i[0]?.type??n;return{id:hr(),kind:e,type:s,params:{},raw:t}}function Ll(t){let e;try{e=t.trim()===""?{}:Rl.load(t)}catch(h){if(h instanceof Rl.YAMLException){let d=h.mark?.line!==void 0?h.mark.line+1:void 0,m=h.mark?.column!==void 0?h.mark.column+1:void 0;throw new os(h.reason||h.message,d,m)}throw new os(h.message)}let n=_l(e)?e:{},i=k2(n.constraints),r=k2(n.directives),s=A2(t,"constraints"),o=A2(t,"directives"),l=[];i.forEach((h,d)=>{let m=O2(h,"constraint");if(!m)return;let g=s.get(d);g&&(m.comment=g),l.push(m)});let a=[];r.forEach((h,d)=>{let m=O2(h,"directive");if(!m)return;let g=o.get(d);g&&(m.comment=g),a.push(m)});let c={constraints:l,directives:a},u=P9(t);u&&(c.headerComment=u);let f=Object.entries(n).filter(([h])=>h!=="constraints"&&h!=="directives").map(([h,d])=>({key:h,value:d}));return f.length>0&&(c.otherSections=f),c}function z9(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function E2(t){let e={};for(let[n,i]of Object.entries(t))if(i!==void 0)if(z9(i)){let r=E2(i);Object.keys(r).length>0&&(e[n]=r)}else e[n]=i;return e}function H9(t){if(t.raw!==void 0)return t.raw;let e=It(t.type);return e?.toYamlNode?e.toYamlNode(t.params):{[t.type]:E2(t.params)}}var U9=/^[A-Za-z0-9_.-]+$/;function F9(t){if(!U9.test(t))return!1;try{return Rl.load(t)===t}catch{return!1}}function T2(t){let e=H9(t);return t.type==="flag"&&_l(e)&&typeof e.flag=="string"&&F9(e.flag)?[` - flag: ${e.flag}`]:Rl.dump([e],{flowLevel:2,lineWidth:-1,sortKeys:!1}).trimEnd().split(`
46
+ `).map(i=>` ${i}`)}function C2(t){return t.split(`
47
+ `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>` # ${e}`)}function Z0(t){let e=[];if(t.headerComment){let n=t.headerComment.split(`
48
+ `).map(i=>i.trim()).filter(i=>i.length>0);for(let i of n)e.push(`# ${i}`);n.length>0&&e.push("")}if(t.constraints.length>0){e.push("constraints:");for(let n of t.constraints)n.comment&&e.push(...C2(n.comment)),e.push(...T2(n))}if(t.directives.length>0){t.constraints.length>0&&e.push(""),e.push("directives:");for(let n of t.directives)n.comment&&e.push(...C2(n.comment)),e.push(...T2(n))}for(let n of t.otherSections??[]){e.length>0&&e.push("");let i=Rl.dump({[n.key]:n.value},{lineWidth:-1,sortKeys:!1}).trimEnd();e.push(...i.split(`
49
49
  `))}return e.length>0?`${e.join(`
50
50
  `)}
51
- `:""}var A2=new Set(["univ","iden","none","Int","seq/Int","String","this","true","false","all","some","no","one","lone","set","sum","let","disj","two","in","and","or","not","implies","iff","else","ni"]),L9=new Set(["all","some","no","one","lone","set","sum","let","disj"]),w2=/[A-Za-z_][A-Za-z0-9_/]*/g,B9=/^-?\d+$/;function I9(t){let e="",n=0,i=t.length;for(;n<i;){let r=t[n];if(r==="/"&&t[n+1]==="/"||r==="-"&&t[n+1]==="-"){for(;n<i&&t[n]!==`
52
- `;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function q9(t){let e=new Set;for(let n=0;n<t.length;n+=1){let i=t[n];if(!(i.kind!=="word"||!L9.has(i.value)))for(let r=n+1;r<t.length;r+=1){let s=t[r];if(s.kind==="delim"&&(s.value===":"||s.value==="|"||s.value==="="))break;s.kind==="word"&&!A2.has(s.value)&&e.add(s.value)}}return e}function P9(t){let e=I9(t),n=[],i=0,r=e.length;for(;i<r;){let s=e[i];if(/[A-Za-z_]/.test(s)){w2.lastIndex=i;let o=w2.exec(e);if(o&&o.index===i){n.push({kind:"word",value:o[0]}),i+=o[0].length;continue}}if(s===":"||s==="|"||s==="="){n.push({kind:"delim",value:s}),i+=1;continue}n.push({kind:"other",value:s}),i+=1}return n}function O2(t){if(typeof t!="string"||t.trim().length===0)return[];let e=P9(t),n=q9(e),i=[],r=new Set;for(let s of e){if(s.kind!=="word")continue;let o=s.value;A2.has(o)||B9.test(o)||n.has(o)||r.has(o)||(r.add(o),i.push(o))}return i}function z9(t){let e=new Set,n=new Set,i=new Set;for(let r of t.types){e.add(r.name);for(let s of r.atoms)i.add(s)}for(let r of t.relations)n.add(r.name);return{types:e,relations:n,atoms:i}}function H9(t,e){return t.types.has(e)||t.relations.has(e)||t.atoms.has(e)}function $0(t,e,n){let i={severity:"warning",message:t,itemId:e,source:"domain"};return n!==void 0&&(i.fieldKey=n),i}function X0(t,e){let n=t.params[e.key];if(typeof n!="string")return;let i=n.trim();return i.length>0?i:void 0}function k2(t,e){let n=Bt(t.type);if(!n)return[];let i=[];for(let r of n.fields)if(r.kind==="relationName"){let s=X0(t,r);s!==void 0&&!e.relations.has(s)&&i.push($0(`Relation "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="typeName"){let s=X0(t,r);s!==void 0&&!e.types.has(s)&&i.push($0(`Type "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="selector"){let s=X0(t,r);if(s!==void 0)for(let o of O2(s))H9(e,o)||i.push($0(`"${o}" is not a type, relation, or atom in this instance.`,t.id,r.key))}return i}function W0(t,e){let n=z9(e),i=[];for(let r of t.constraints)i.push(...k2(r,n));for(let r of t.directives)i.push(...k2(r,n));return i}function T2(t){return t==null?!0:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.length===0:!1}function C2(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}var U9=["hold"],F9={inferredEdge:["color","style","weight","highlight"],edgeColor:["highlight","showLabel","hidden","filter"]};function j9(t,e){let n=t.length,i=e.length,r=new Array(i+1),s=new Array(i+1);for(let o=0;o<=i;o++)r[o]=o;for(let o=1;o<=n;o++){s[0]=o;for(let l=1;l<=i;l++){let a=t[o-1]===e[l-1]?0:1;s[l]=Math.min(r[l]+1,s[l-1]+1,r[l-1]+a)}for(let l=0;l<=i;l++)r[l]=s[l]}return r[i]}function V9(t,e){let n,i=1/0,r=t.toLowerCase();for(let s of e){let o=j9(r,s.toLowerCase());o<i&&(i=o,n=s)}return n!==void 0&&i<=2&&i<t.length?n:void 0}function E2(t,e,n,i,r=t){let s=V9(t,e),o=s?` Did you mean "${s}"?`:e.length>0?` Known fields: ${e.join(", ")}.`:"";return{severity:"warning",code:"unknown-key",message:`Unknown field "${t}" in ${n}.${o}`,itemId:i,fieldKey:r,source:"structure"}}function Y9(t,e){let n=[],i=e.fields.map(o=>o.key),r=new Set(i);if(t.kind==="constraint")for(let o of U9)r.add(o);for(let o of F9[t.type]??[])r.add(o);let s=C2(t.sourceBody)?t.sourceBody:t.params;for(let o of Object.keys(s))r.has(o)||n.push(E2(o,i,e.label,t.id));for(let o of e.fields){if(o.kind!=="group"||!o.children)continue;let l=t.params[o.key];if(!C2(l))continue;let a=o.children.map(u=>u.key),c=new Set(a);for(let u of Object.keys(l))c.has(u)||n.push(E2(u,a,o.label,t.id,`${o.key}.${u}`))}return n}function Z0(t){let e=[];if(t.raw!==void 0&&Bt(t.type)===void 0)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}". It is preserved as-is but the builder cannot edit it.`,itemId:t.id,source:"structure"}),e;let n=Bt(t.type);if(!n)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}".`,itemId:t.id,source:"structure"}),e;if(n.deprecated){let i=n.deprecatedInFavorOf?` Use "${n.deprecatedInFavorOf}" instead.`:"";e.push({severity:"warning",code:"deprecated",message:`"${n.label}" is deprecated.${i}`,itemId:t.id,source:"structure"})}for(let i of n.fields){let r=t.params[i.key];if(i.required&&T2(r)){e.push({severity:"error",code:"missing-required",message:`Missing required field "${i.label}".`,itemId:t.id,fieldKey:i.key,source:"structure"});continue}if(i.kind==="enum"&&i.options&&!T2(r)){let s=new Set(i.options),o=i.multiple?Array.isArray(r)?r.map(l=>String(l)):[String(r)]:[String(r)];for(let l of o)s.has(l)||e.push({severity:"error",code:"invalid-value",message:`Invalid value "${l}" for "${i.label}". Allowed: ${i.options.join(", ")}.`,itemId:t.id,fieldKey:i.key,source:"structure"})}}if(e.push(...Y9(t,n)),n.validate)for(let i of n.validate(t.params))e.push(i.itemId?i:{...i,itemId:t.id});return e}function K9(t){let e=[],n=new Map;for(let i of t){if(i.type!=="cyclic")continue;let r=String(i.params.selector??""),s=String(i.params.direction??"");if(!r||!s)continue;let o=n.get(r);o&&o.direction!==s?e.push({severity:"error",message:`Inconsistent cyclic directions for selector "${r}" (${o.direction} vs ${s}) \u2014 the layout engine rejects this spec.`,itemId:i.id,fieldKey:"direction",source:"structure"}):o||n.set(r,{direction:s,itemId:i.id})}return e}function jc(t,e){let n=[];for(let i of t.constraints)n.push(...Z0(i));for(let i of t.directives)n.push(...Z0(i));return n.push(...K9(t.constraints)),e&&n.push(...W0(t,e)),n}function Q9(t){if(t===void 0)return;let e=t.split(`
51
+ `:""}var N2=new Set(["univ","iden","none","Int","seq/Int","String","this","true","false","all","some","no","one","lone","set","sum","let","disj","two","in","and","or","not","implies","iff","else","ni"]),j9=new Set(["all","some","no","one","lone","set","sum","let","disj"]),D2=/[A-Za-z_][A-Za-z0-9_/]*/g,V9=/^-?\d+$/;function Y9(t){let e="",n=0,i=t.length;for(;n<i;){let r=t[n];if(r==="/"&&t[n+1]==="/"||r==="-"&&t[n+1]==="-"){for(;n<i&&t[n]!==`
52
+ `;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function K9(t){let e=new Set;for(let n=0;n<t.length;n+=1){let i=t[n];if(!(i.kind!=="word"||!j9.has(i.value)))for(let r=n+1;r<t.length;r+=1){let s=t[r];if(s.kind==="delim"&&(s.value===":"||s.value==="|"||s.value==="="))break;s.kind==="word"&&!N2.has(s.value)&&e.add(s.value)}}return e}function Q9(t){let e=Y9(t),n=[],i=0,r=e.length;for(;i<r;){let s=e[i];if(/[A-Za-z_]/.test(s)){D2.lastIndex=i;let o=D2.exec(e);if(o&&o.index===i){n.push({kind:"word",value:o[0]}),i+=o[0].length;continue}}if(s===":"||s==="|"||s==="="){n.push({kind:"delim",value:s}),i+=1;continue}n.push({kind:"other",value:s}),i+=1}return n}function R2(t){if(typeof t!="string"||t.trim().length===0)return[];let e=Q9(t),n=K9(e),i=[],r=new Set;for(let s of e){if(s.kind!=="word")continue;let o=s.value;N2.has(o)||V9.test(o)||n.has(o)||r.has(o)||(r.add(o),i.push(o))}return i}function $9(t){let e=new Set,n=new Set,i=new Set;for(let r of t.types){e.add(r.name);for(let s of r.atoms)i.add(s)}for(let r of t.relations)n.add(r.name);return{types:e,relations:n,atoms:i}}function G9(t,e){return t.types.has(e)||t.relations.has(e)||t.atoms.has(e)}function J0(t,e,n){let i={severity:"warning",message:t,itemId:e,source:"domain"};return n!==void 0&&(i.fieldKey=n),i}function eb(t,e){let n=t.params[e.key];if(typeof n!="string")return;let i=n.trim();return i.length>0?i:void 0}function M2(t,e){let n=It(t.type);if(!n)return[];let i=[];for(let r of n.fields)if(r.kind==="relationName"){let s=eb(t,r);s!==void 0&&!e.relations.has(s)&&i.push(J0(`Relation "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="typeName"){let s=eb(t,r);s!==void 0&&!e.types.has(s)&&i.push(J0(`Type "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="selector"){let s=eb(t,r);if(s!==void 0)for(let o of R2(s))G9(e,o)||i.push(J0(`"${o}" is not a type, relation, or atom in this instance.`,t.id,r.key))}return i}function tb(t,e){let n=$9(e),i=[];for(let r of t.constraints)i.push(...M2(r,n));for(let r of t.directives)i.push(...M2(r,n));return i}function _2(t){return t==null?!0:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.length===0:!1}function L2(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}var X9=["hold"],W9={inferredEdge:["color","style","weight","highlight"],edgeColor:["highlight","showLabel","hidden","filter"]};function Z9(t,e){let n=t.length,i=e.length,r=new Array(i+1),s=new Array(i+1);for(let o=0;o<=i;o++)r[o]=o;for(let o=1;o<=n;o++){s[0]=o;for(let l=1;l<=i;l++){let a=t[o-1]===e[l-1]?0:1;s[l]=Math.min(r[l]+1,s[l-1]+1,r[l-1]+a)}for(let l=0;l<=i;l++)r[l]=s[l]}return r[i]}function J9(t,e){let n,i=1/0,r=t.toLowerCase();for(let s of e){let o=Z9(r,s.toLowerCase());o<i&&(i=o,n=s)}return n!==void 0&&i<=2&&i<t.length?n:void 0}function B2(t,e,n,i,r=t){let s=J9(t,e),o=s?` Did you mean "${s}"?`:e.length>0?` Known fields: ${e.join(", ")}.`:"";return{severity:"warning",code:"unknown-key",message:`Unknown field "${t}" in ${n}.${o}`,itemId:i,fieldKey:r,source:"structure"}}function eH(t,e){let n=[],i=e.fields.map(o=>o.key),r=new Set(i);if(t.kind==="constraint")for(let o of X9)r.add(o);for(let o of W9[t.type]??[])r.add(o);let s=L2(t.sourceBody)?t.sourceBody:t.params;for(let o of Object.keys(s))r.has(o)||n.push(B2(o,i,e.label,t.id));for(let o of e.fields){if(o.kind!=="group"||!o.children)continue;let l=t.params[o.key];if(!L2(l))continue;let a=o.children.map(u=>u.key),c=new Set(a);for(let u of Object.keys(l))c.has(u)||n.push(B2(u,a,o.label,t.id,`${o.key}.${u}`))}return n}function nb(t){let e=[];if(t.raw!==void 0&&It(t.type)===void 0)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}". It is preserved as-is but the builder cannot edit it.`,itemId:t.id,source:"structure"}),e;let n=It(t.type);if(!n)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}".`,itemId:t.id,source:"structure"}),e;if(n.deprecated){let i=n.deprecatedInFavorOf?` Use "${n.deprecatedInFavorOf}" instead.`:"";e.push({severity:"warning",code:"deprecated",message:`"${n.label}" is deprecated.${i}`,itemId:t.id,source:"structure"})}for(let i of n.fields){let r=t.params[i.key];if(i.required&&_2(r)){e.push({severity:"error",code:"missing-required",message:`Missing required field "${i.label}".`,itemId:t.id,fieldKey:i.key,source:"structure"});continue}if(i.kind==="enum"&&i.options&&!_2(r)){let s=new Set(i.options),o=i.multiple?Array.isArray(r)?r.map(l=>String(l)):[String(r)]:[String(r)];for(let l of o)s.has(l)||e.push({severity:"error",code:"invalid-value",message:`Invalid value "${l}" for "${i.label}". Allowed: ${i.options.join(", ")}.`,itemId:t.id,fieldKey:i.key,source:"structure"})}}if(e.push(...eH(t,n)),n.validate)for(let i of n.validate(t.params))e.push(i.itemId?i:{...i,itemId:t.id});return e}function tH(t){let e=[],n=new Map;for(let i of t){if(i.type!=="cyclic")continue;let r=String(i.params.selector??""),s=String(i.params.direction??"");if(!r||!s)continue;let o=n.get(r);o&&o.direction!==s?e.push({severity:"error",message:`Inconsistent cyclic directions for selector "${r}" (${o.direction} vs ${s}) \u2014 the layout engine rejects this spec.`,itemId:i.id,fieldKey:"direction",source:"structure"}):o||n.set(r,{direction:s,itemId:i.id})}return e}function $c(t,e){let n=[];for(let i of t.constraints)n.push(...nb(i));for(let i of t.directives)n.push(...nb(i));return n.push(...tH(t.constraints)),e&&n.push(...tb(t,e)),n}function nH(t){if(t===void 0)return;let e=t.split(`
53
53
  `).map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e.join(`
54
- `):void 0}function Yc(t){return{id:t.id,kind:t.kind,type:t.type,params:Kc(t.params),...t.comment!==void 0?{comment:t.comment}:{},...t.raw!==void 0?{raw:Kc(t.raw)}:{}}}function Kc(t){if(Array.isArray(t))return t.map(e=>Kc(e));if(t!==null&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))e[n]=Kc(i);return e}return t}function Vc(t){return{constraints:t.constraints.map(Yc),directives:t.directives.map(Yc),...t.headerComment!==void 0?{headerComment:t.headerComment}:{},...t.otherSections!==void 0?{otherSections:t.otherSections.map(e=>({key:e.key,value:Kc(e.value)}))}:{}}}function G9(t){return t.constraints.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),t.directives.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),Object.freeze(t.constraints),Object.freeze(t.directives),t.otherSections!==void 0&&(t.otherSections.forEach(e=>Object.freeze(e)),Object.freeze(t.otherSections)),Object.freeze(t)}var El=class t{constructor(e){this.undoStack=[];this.redoStack=[];this.listeners=new Set;this.state=e?Vc(e):{constraints:[],directives:[]}}static fromYaml(e){let n=Cl(e);return new t(n)}toYaml(){return G0(this.state)}getState(){return this.frozen||(this.frozen=G9(Vc(this.state))),this.frozen}addItem(e,n){let i=Bt(n);if(!i)throw new Error(`Cannot add unknown ${e} type "${n}".`);if(i.kind!==e)throw new Error(`Type "${n}" is a ${i.kind}, not a ${e}.`);this.pushUndo();let r={id:lr(),kind:e,type:n,params:_0(n)};return e==="constraint"?this.state.constraints.push(r):this.state.directives.push(r),this.commit(),Yc(r)}updateItem(e,n){let i=this.find(e);if(!i)return;this.pushUndo();let{item:r}=i;if(n.type!==void 0&&(r.type=n.type),n.params!==void 0){let s={...r.params};for(let[o,l]of Object.entries(n.params))l===void 0?delete s[o]:s[o]=l;r.params=s}if("comment"in n){let s=Q9(n.comment);s===void 0?delete r.comment:r.comment=s}this.commit()}duplicateItem(e){let n=this.find(e);if(!n)return null;this.pushUndo();let i={...Yc(n.item),id:lr()};return(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index+1,0,i),this.commit(),Yc(i)}removeItem(e){let n=this.find(e);if(!n)return;this.pushUndo(),(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index,1),this.commit()}moveItem(e,n){let i=this.find(e);if(!i)return;let r=i.kind==="constraint"?this.state.constraints:this.state.directives,s=Math.max(0,Math.min(n,r.length-1));if(s===i.index)return;this.pushUndo();let[o]=r.splice(i.index,1);r.splice(s,0,o),this.commit()}replaceFromYaml(e){let n=Cl(e);this.pushUndo(),this.state=n,this.commit()}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){let e=this.undoStack.pop();e&&(this.redoStack.push(Vc(this.state)),this.state=e,this.commit())}redo(){let e=this.redoStack.pop();e&&(this.undoStack.push(Vc(this.state)),this.state=e,this.commit())}validate(e){return jc(this.state,e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}pushUndo(){this.undoStack.push(Vc(this.state)),this.redoStack.length=0}commit(){this.frozen=void 0;let e=this.getState();for(let n of this.listeners)n(e)}find(e){let n=this.state.constraints.findIndex(r=>r.id===e);if(n!==-1)return{item:this.state.constraints[n],index:n,kind:"constraint"};let i=this.state.directives.findIndex(r=>r.id===e);if(i!==-1)return{item:this.state.directives[i],index:i,kind:"directive"}}};var ld=Symbol.for("yaml.alias"),ad=Symbol.for("yaml.document"),$n=Symbol.for("yaml.map"),J0=Symbol.for("yaml.pair"),hn=Symbol.for("yaml.scalar"),ar=Symbol.for("yaml.seq"),qt=Symbol.for("yaml.node.type"),Xn=t=>!!t&&typeof t=="object"&&t[qt]===ld,Ai=t=>!!t&&typeof t=="object"&&t[qt]===ad,Pt=t=>!!t&&typeof t=="object"&&t[qt]===$n,re=t=>!!t&&typeof t=="object"&&t[qt]===J0,K=t=>!!t&&typeof t=="object"&&t[qt]===hn,zt=t=>!!t&&typeof t=="object"&&t[qt]===ar;function de(t){if(t&&typeof t=="object")switch(t[qt]){case $n:case ar:return!0}return!1}function se(t){if(t&&typeof t=="object")switch(t[qt]){case ld:case $n:case hn:case ar:return!0}return!1}var cd=t=>(K(t)||de(t))&&!!t.anchor;var Zt=Symbol("break visit"),D2=Symbol("skip children"),Oi=Symbol("remove node");function Ti(t,e){let n=M2(e);Ai(t)?Dl(null,t.contents,n,Object.freeze([t]))===Oi&&(t.contents=null):Dl(null,t,n,Object.freeze([]))}Ti.BREAK=Zt;Ti.SKIP=D2;Ti.REMOVE=Oi;function Dl(t,e,n,i){let r=N2(t,e,n,i);if(se(r)||re(r))return R2(t,i,r),Dl(t,r,n,i);if(typeof r!="symbol"){if(de(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Dl(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===Zt)return Zt;o===Oi&&(e.items.splice(s,1),s-=1)}}}else if(re(e)){i=Object.freeze(i.concat(e));let s=Dl("key",e.key,n,i);if(s===Zt)return Zt;s===Oi&&(e.key=null);let o=Dl("value",e.value,n,i);if(o===Zt)return Zt;o===Oi&&(e.value=null)}}return r}async function ud(t,e){let n=M2(e);Ai(t)?await Ml(null,t.contents,n,Object.freeze([t]))===Oi&&(t.contents=null):await Ml(null,t,n,Object.freeze([]))}ud.BREAK=Zt;ud.SKIP=D2;ud.REMOVE=Oi;async function Ml(t,e,n,i){let r=await N2(t,e,n,i);if(se(r)||re(r))return R2(t,i,r),Ml(t,r,n,i);if(typeof r!="symbol"){if(de(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await Ml(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===Zt)return Zt;o===Oi&&(e.items.splice(s,1),s-=1)}}}else if(re(e)){i=Object.freeze(i.concat(e));let s=await Ml("key",e.key,n,i);if(s===Zt)return Zt;s===Oi&&(e.key=null);let o=await Ml("value",e.value,n,i);if(o===Zt)return Zt;o===Oi&&(e.value=null)}}return r}function M2(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function N2(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(Pt(e))return n.Map?.(t,e,i);if(zt(e))return n.Seq?.(t,e,i);if(re(e))return n.Pair?.(t,e,i);if(K(e))return n.Scalar?.(t,e,i);if(Xn(e))return n.Alias?.(t,e,i)}function R2(t,e,n){let i=e[e.length-1];if(de(i))i.items[t]=n;else if(re(i))t==="key"?i.key=n:i.value=n;else if(Ai(i))i.contents=n;else{let r=Xn(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var $9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},X9=t=>t.replace(/[!,[\]{}]/g,e=>$9[e]),Ci=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+X9(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&se(e.contents)){let s={};Ti(e.contents,(o,l)=>{se(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
55
- `)}};Ci.defaultYaml={explicit:!1,version:"1.2"};Ci.defaultTags={"!!":"tag:yaml.org,2002:"};function fd(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function eb(t){let e=new Set;return Ti(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function tb(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function _2(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=eb(t));let o=tb(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(K(o.node)||de(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function ts(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],l=ts(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=ts(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=ts(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=ts(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function st(t,e,n){if(Array.isArray(t))return t.map((i,r)=>st(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!cd(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var ns=class{constructor(e){Object.defineProperty(this,qt,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Ai(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=st(this,"",o);if(typeof r=="function")for(let{count:a,res:c}of o.anchors.values())r(c,a);return typeof s=="function"?ts(s,{"":l},"",l):l}};var cr=class extends ns{constructor(e){super(ld),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Ti(e,{Node:(s,o)=>{(Xn(o)||cd(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=i.get(o);if(l||(st(o,null,n),l=i.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=hd(r,o,i)),l.count*l.aliasCount>s)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(fd(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function hd(t,e,n){if(Xn(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(de(e)){let i=0;for(let r of e.items){let s=hd(t,r,n);s>i&&(i=s)}return i}else if(re(e)){let i=hd(t,e.key,n),r=hd(t,e.value,n);return Math.max(i,r)}return 1}var dd=t=>!t||typeof t!="function"&&typeof t!="object",q=class extends ns{constructor(e){super(hn),this.value=e}toJSON(e,n){return n?.keep?this.value:st(this.value,e,n)}toString(){return String(this.value)}};q.BLOCK_FOLDED="BLOCK_FOLDED";q.BLOCK_LITERAL="BLOCK_LITERAL";q.PLAIN="PLAIN";q.QUOTE_DOUBLE="QUOTE_DOUBLE";q.QUOTE_SINGLE="QUOTE_SINGLE";var W9="tag:yaml.org,2002:";function Z9(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function ur(t,e,n){if(Ai(t)&&(t=t.contents),se(t))return t;if(re(t)){let f=n.schema[$n].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n,a;if(i&&t&&typeof t=="object"){if(a=l.get(t),a)return a.anchor??(a.anchor=r(t)),new cr(a.anchor);a={anchor:null,node:null},l.set(t,a)}e?.startsWith("!!")&&(e=W9+e.slice(2));let c=Z9(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new q(t);return a&&(a.node=f),f}c=t instanceof Map?o[$n]:Symbol.iterator in Object(t)?o[ar]:o[$n]}s&&(s(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new q(t);return e?u.tag=e:c.default||(u.tag=c.tag),a&&(a.node=u),u}function Qc(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return ur(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Rl=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Nl=class extends ns{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>se(i)||re(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Rl(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(de(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,Qc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(de(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&K(s)?s.value:s:de(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!re(n))return!1;let i=n.value;return i==null||e&&K(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return de(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(de(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,Qc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};var L2=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Rn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Ei=(t,e,n)=>t.endsWith(`
56
- `)?Rn(n,e):n.includes(`
54
+ `):void 0}function Xc(t){return{id:t.id,kind:t.kind,type:t.type,params:Wc(t.params),...t.comment!==void 0?{comment:t.comment}:{},...t.raw!==void 0?{raw:Wc(t.raw)}:{}}}function Wc(t){if(Array.isArray(t))return t.map(e=>Wc(e));if(t!==null&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))e[n]=Wc(i);return e}return t}function Gc(t){return{constraints:t.constraints.map(Xc),directives:t.directives.map(Xc),...t.headerComment!==void 0?{headerComment:t.headerComment}:{},...t.otherSections!==void 0?{otherSections:t.otherSections.map(e=>({key:e.key,value:Wc(e.value)}))}:{}}}function iH(t){return t.constraints.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),t.directives.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),Object.freeze(t.constraints),Object.freeze(t.directives),t.otherSections!==void 0&&(t.otherSections.forEach(e=>Object.freeze(e)),Object.freeze(t.otherSections)),Object.freeze(t)}var Bl=class t{constructor(e){this.undoStack=[];this.redoStack=[];this.listeners=new Set;this.state=e?Gc(e):{constraints:[],directives:[]}}static fromYaml(e){let n=Ll(e);return new t(n)}toYaml(){return Z0(this.state)}getState(){return this.frozen||(this.frozen=iH(Gc(this.state))),this.frozen}addItem(e,n){let i=It(n);if(!i)throw new Error(`Cannot add unknown ${e} type "${n}".`);if(i.kind!==e)throw new Error(`Type "${n}" is a ${i.kind}, not a ${e}.`);this.pushUndo();let r={id:hr(),kind:e,type:n,params:q0(n)};return e==="constraint"?this.state.constraints.push(r):this.state.directives.push(r),this.commit(),Xc(r)}updateItem(e,n){let i=this.find(e);if(!i)return;this.pushUndo();let{item:r}=i;if(n.type!==void 0&&(r.type=n.type),n.params!==void 0){let s={...r.params};for(let[o,l]of Object.entries(n.params))l===void 0?delete s[o]:s[o]=l;r.params=s}if("comment"in n){let s=nH(n.comment);s===void 0?delete r.comment:r.comment=s}this.commit()}duplicateItem(e){let n=this.find(e);if(!n)return null;this.pushUndo();let i={...Xc(n.item),id:hr()};return(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index+1,0,i),this.commit(),Xc(i)}removeItem(e){let n=this.find(e);if(!n)return;this.pushUndo(),(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index,1),this.commit()}moveItem(e,n){let i=this.find(e);if(!i)return;let r=i.kind==="constraint"?this.state.constraints:this.state.directives,s=Math.max(0,Math.min(n,r.length-1));if(s===i.index)return;this.pushUndo();let[o]=r.splice(i.index,1);r.splice(s,0,o),this.commit()}replaceFromYaml(e){let n=Ll(e);this.pushUndo(),this.state=n,this.commit()}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){let e=this.undoStack.pop();e&&(this.redoStack.push(Gc(this.state)),this.state=e,this.commit())}redo(){let e=this.redoStack.pop();e&&(this.undoStack.push(Gc(this.state)),this.state=e,this.commit())}validate(e){return $c(this.state,e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}pushUndo(){this.undoStack.push(Gc(this.state)),this.redoStack.length=0}commit(){this.frozen=void 0;let e=this.getState();for(let n of this.listeners)n(e)}find(e){let n=this.state.constraints.findIndex(r=>r.id===e);if(n!==-1)return{item:this.state.constraints[n],index:n,kind:"constraint"};let i=this.state.directives.findIndex(r=>r.id===e);if(i!==-1)return{item:this.state.directives[i],index:i,kind:"directive"}}};var hd=Symbol.for("yaml.alias"),dd=Symbol.for("yaml.document"),Wn=Symbol.for("yaml.map"),ib=Symbol.for("yaml.pair"),mn=Symbol.for("yaml.scalar"),dr=Symbol.for("yaml.seq"),Pt=Symbol.for("yaml.node.type"),Zn=t=>!!t&&typeof t=="object"&&t[Pt]===hd,Ei=t=>!!t&&typeof t=="object"&&t[Pt]===dd,zt=t=>!!t&&typeof t=="object"&&t[Pt]===Wn,se=t=>!!t&&typeof t=="object"&&t[Pt]===ib,Y=t=>!!t&&typeof t=="object"&&t[Pt]===mn,Ht=t=>!!t&&typeof t=="object"&&t[Pt]===dr;function pe(t){if(t&&typeof t=="object")switch(t[Pt]){case Wn:case dr:return!0}return!1}function oe(t){if(t&&typeof t=="object")switch(t[Pt]){case hd:case Wn:case mn:case dr:return!0}return!1}var pd=t=>(Y(t)||pe(t))&&!!t.anchor;var Jt=Symbol("break visit"),I2=Symbol("skip children"),Di=Symbol("remove node");function Mi(t,e){let n=q2(e);Ei(t)?Il(null,t.contents,n,Object.freeze([t]))===Di&&(t.contents=null):Il(null,t,n,Object.freeze([]))}Mi.BREAK=Jt;Mi.SKIP=I2;Mi.REMOVE=Di;function Il(t,e,n,i){let r=P2(t,e,n,i);if(oe(r)||se(r))return z2(t,i,r),Il(t,r,n,i);if(typeof r!="symbol"){if(pe(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Il(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===Di&&(e.items.splice(s,1),s-=1)}}}else if(se(e)){i=Object.freeze(i.concat(e));let s=Il("key",e.key,n,i);if(s===Jt)return Jt;s===Di&&(e.key=null);let o=Il("value",e.value,n,i);if(o===Jt)return Jt;o===Di&&(e.value=null)}}return r}async function md(t,e){let n=q2(e);Ei(t)?await ql(null,t.contents,n,Object.freeze([t]))===Di&&(t.contents=null):await ql(null,t,n,Object.freeze([]))}md.BREAK=Jt;md.SKIP=I2;md.REMOVE=Di;async function ql(t,e,n,i){let r=await P2(t,e,n,i);if(oe(r)||se(r))return z2(t,i,r),ql(t,r,n,i);if(typeof r!="symbol"){if(pe(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await ql(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===Jt)return Jt;o===Di&&(e.items.splice(s,1),s-=1)}}}else if(se(e)){i=Object.freeze(i.concat(e));let s=await ql("key",e.key,n,i);if(s===Jt)return Jt;s===Di&&(e.key=null);let o=await ql("value",e.value,n,i);if(o===Jt)return Jt;o===Di&&(e.value=null)}}return r}function q2(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function P2(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(zt(e))return n.Map?.(t,e,i);if(Ht(e))return n.Seq?.(t,e,i);if(se(e))return n.Pair?.(t,e,i);if(Y(e))return n.Scalar?.(t,e,i);if(Zn(e))return n.Alias?.(t,e,i)}function z2(t,e,n){let i=e[e.length-1];if(pe(i))i.items[t]=n;else if(se(i))t==="key"?i.key=n:i.value=n;else if(Ei(i))i.contents=n;else{let r=Zn(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var rH={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sH=t=>t.replace(/[!,[\]{}]/g,e=>rH[e]),Ni=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+sH(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&oe(e.contents)){let s={};Mi(e.contents,(o,l)=>{oe(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
55
+ `)}};Ni.defaultYaml={explicit:!1,version:"1.2"};Ni.defaultTags={"!!":"tag:yaml.org,2002:"};function gd(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function rb(t){let e=new Set;return Mi(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function sb(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function H2(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=rb(t));let o=sb(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(Y(o.node)||pe(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function ls(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],l=ls(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=ls(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=ls(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=ls(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function it(t,e,n){if(Array.isArray(t))return t.map((i,r)=>it(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!pd(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var as=class{constructor(e){Object.defineProperty(this,Pt,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Ei(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=it(this,"",o);if(typeof r=="function")for(let{count:a,res:c}of o.anchors.values())r(c,a);return typeof s=="function"?ls(s,{"":l},"",l):l}};var pr=class extends as{constructor(e){super(hd),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Mi(e,{Node:(s,o)=>{(Zn(o)||pd(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=i.get(o);if(l||(it(o,null,n),l=i.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=yd(r,o,i)),l.count*l.aliasCount>s)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(gd(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function yd(t,e,n){if(Zn(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(pe(e)){let i=0;for(let r of e.items){let s=yd(t,r,n);s>i&&(i=s)}return i}else if(se(e)){let i=yd(t,e.key,n),r=yd(t,e.value,n);return Math.max(i,r)}return 1}var bd=t=>!t||typeof t!="function"&&typeof t!="object",I=class extends as{constructor(e){super(mn),this.value=e}toJSON(e,n){return n?.keep?this.value:it(this.value,e,n)}toString(){return String(this.value)}};I.BLOCK_FOLDED="BLOCK_FOLDED";I.BLOCK_LITERAL="BLOCK_LITERAL";I.PLAIN="PLAIN";I.QUOTE_DOUBLE="QUOTE_DOUBLE";I.QUOTE_SINGLE="QUOTE_SINGLE";var oH="tag:yaml.org,2002:";function lH(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function mr(t,e,n){if(Ei(t)&&(t=t.contents),oe(t))return t;if(se(t)){let f=n.schema[Wn].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n,a;if(i&&t&&typeof t=="object"){if(a=l.get(t),a)return a.anchor??(a.anchor=r(t)),new pr(a.anchor);a={anchor:null,node:null},l.set(t,a)}e?.startsWith("!!")&&(e=oH+e.slice(2));let c=lH(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new I(t);return a&&(a.node=f),f}c=t instanceof Map?o[Wn]:Symbol.iterator in Object(t)?o[dr]:o[Wn]}s&&(s(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new I(t);return e?u.tag=e:c.default||(u.tag=c.tag),a&&(a.node=u),u}function Zc(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return mr(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var zl=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Pl=class extends as{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>oe(i)||se(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(zl(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(pe(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,Zc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(pe(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&Y(s)?s.value:s:pe(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!se(n))return!1;let i=n.value;return i==null||e&&Y(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return pe(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(pe(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,Zc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};var U2=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Ln(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Ri=(t,e,n)=>t.endsWith(`
56
+ `)?Ln(n,e):n.includes(`
57
57
  `)?`
58
- `+Rn(n,e):(t.endsWith(" ")?"":" ")+n;var nb="flow",pd="block",Gc="quoted";function $c(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return t;r<s&&(s=0);let a=Math.max(1+s,1+r-e.length);if(t.length<=a)return t;let c=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?c.push(0):f=r-i);let h,d,p=!1,m=-1,b=-1,y=-1;n===pd&&(m=B2(t,m,e.length),m!==-1&&(f=m+a));for(let v;v=t[m+=1];){if(n===Gc&&v==="\\"){switch(b=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(v===`
59
- `)n===pd&&(m=B2(t,m,e.length)),f=m+e.length+a,h=void 0;else{if(v===" "&&d&&d!==" "&&d!==`
60
- `&&d!==" "){let S=t[m+1];S&&S!==" "&&S!==`
61
- `&&S!==" "&&(h=m)}if(m>=f)if(h)c.push(h),f=h+a,h=void 0;else if(n===Gc){for(;d===" "||d===" ";)d=v,v=t[m+=1],p=!0;let S=m>y+1?m-2:b-1;if(u[S])return t;c.push(S),u[S]=!0,f=S+a,h=void 0}else p=!0}d=v}if(p&&l&&l(),c.length===0)return t;o&&o();let g=t.slice(0,c[0]);for(let v=0;v<c.length;++v){let S=c[v],w=c[v+1]||t.length;S===0?g=`
62
- ${e}${t.slice(0,w)}`:(n===Gc&&u[S]&&(g+=`${t[S]}\\`),g+=`
63
- ${e}${t.slice(S+1,w)}`)}return g}function B2(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
64
- `);i=e,r=e+1,s=t[r]}return i}var gd=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),yd=t=>/^(%|---|\.\.\.)/m.test(t);function J9(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
65
- `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Xc(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(yd(t)?" ":""),o="",l=0;for(let a=0,c=n[a];c;c=n[++a])if(c===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(o+=n.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(n[a+1]){case"u":{o+=n.slice(l,a);let u=n.substr(a+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(a,6)}a+=5,l=a+1}break;case"n":if(i||n[a+2]==='"'||n.length<r)a+=1;else{for(o+=n.slice(l,a)+`
58
+ `+Ln(n,e):(t.endsWith(" ")?"":" ")+n;var ob="flow",vd="block",Jc="quoted";function eu(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return t;r<s&&(s=0);let a=Math.max(1+s,1+r-e.length);if(t.length<=a)return t;let c=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?c.push(0):f=r-i);let h,d,m=!1,g=-1,b=-1,p=-1;n===vd&&(g=F2(t,g,e.length),g!==-1&&(f=g+a));for(let v;v=t[g+=1];){if(n===Jc&&v==="\\"){switch(b=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}p=g}if(v===`
59
+ `)n===vd&&(g=F2(t,g,e.length)),f=g+e.length+a,h=void 0;else{if(v===" "&&d&&d!==" "&&d!==`
60
+ `&&d!==" "){let S=t[g+1];S&&S!==" "&&S!==`
61
+ `&&S!==" "&&(h=g)}if(g>=f)if(h)c.push(h),f=h+a,h=void 0;else if(n===Jc){for(;d===" "||d===" ";)d=v,v=t[g+=1],m=!0;let S=g>p+1?g-2:b-1;if(u[S])return t;c.push(S),u[S]=!0,f=S+a,h=void 0}else m=!0}d=v}if(m&&l&&l(),c.length===0)return t;o&&o();let y=t.slice(0,c[0]);for(let v=0;v<c.length;++v){let S=c[v],w=c[v+1]||t.length;S===0?y=`
62
+ ${e}${t.slice(0,w)}`:(n===Jc&&u[S]&&(y+=`${t[S]}\\`),y+=`
63
+ ${e}${t.slice(S+1,w)}`)}return y}function F2(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
64
+ `);i=e,r=e+1,s=t[r]}return i}var xd=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),wd=t=>/^(%|---|\.\.\.)/m.test(t);function aH(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
65
+ `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function tu(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(wd(t)?" ":""),o="",l=0;for(let a=0,c=n[a];c;c=n[++a])if(c===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(o+=n.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(n[a+1]){case"u":{o+=n.slice(l,a);let u=n.substr(a+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(a,6)}a+=5,l=a+1}break;case"n":if(i||n[a+2]==='"'||n.length<r)a+=1;else{for(o+=n.slice(l,a)+`
66
66
 
67
67
  `;n[a+2]==="\\"&&n[a+3]==="n"&&n[a+4]!=='"';)o+=`
68
- `,a+=2;o+=s,n[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+n.slice(l):n,i?o:$c(o,s,Gc,gd(e,!1))}function ib(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
69
- `)||/[ \t]\n|\n[ \t]/.test(t))return Xc(t,e);let n=e.indent||(yd(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
70
- ${n}`)+"'";return e.implicitKey?i:$c(i,n,nb,gd(e,!1))}function _l(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=Xc;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=ib:s&&!r?i=Xc:i=n?ib:Xc}return i(t,e)}var rb;try{rb=new RegExp(`(^|(?<!
68
+ `,a+=2;o+=s,n[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+n.slice(l):n,i?o:eu(o,s,Jc,xd(e,!1))}function lb(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
69
+ `)||/[ \t]\n|\n[ \t]/.test(t))return tu(t,e);let n=e.indent||(wd(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
70
+ ${n}`)+"'";return e.implicitKey?i:eu(i,n,ob,xd(e,!1))}function Hl(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=tu;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=lb:s&&!r?i=tu:i=n?lb:tu}return i(t,e)}var ab;try{ab=new RegExp(`(^|(?<!
71
71
  ))
72
72
  +(?!
73
- |$)`,"g")}catch{rb=/\n+(?!\n|$)/g}function md({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:l,lineWidth:a}=i.options;if(!o||/\n[\t ]+$/.test(n))return _l(n,i);let c=i.indent||(i.forceBlockIndent||yd(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===q.BLOCK_FOLDED?!1:e===q.BLOCK_LITERAL?!0:!J9(n,a,c.length);if(!n)return u?`|
73
+ |$)`,"g")}catch{ab=/\n+(?!\n|$)/g}function Sd({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:l,lineWidth:a}=i.options;if(!o||/\n[\t ]+$/.test(n))return Hl(n,i);let c=i.indent||(i.forceBlockIndent||wd(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===I.BLOCK_FOLDED?!1:e===I.BLOCK_LITERAL?!0:!aH(n,a,c.length);if(!n)return u?`|
74
74
  `:`>
75
75
  `;let f,h;for(h=n.length;h>0;--h){let w=n[h-1];if(w!==`
76
- `&&w!==" "&&w!==" ")break}let d=n.substring(h),p=d.indexOf(`
77
- `);p===-1?f="-":n===d||p!==d.length-1?(f="+",s&&s()):f="",d&&(n=n.slice(0,-d.length),d[d.length-1]===`
78
- `&&(d=d.slice(0,-1)),d=d.replace(rb,`$&${c}`));let m=!1,b,y=-1;for(b=0;b<n.length;++b){let w=n[b];if(w===" ")m=!0;else if(w===`
79
- `)y=b;else break}let g=n.substring(0,y<b?y+1:b);g&&(n=n.substring(g.length),g=g.replace(/\n+/g,`$&${c}`));let S=(m?c?"2":"1":"")+f;if(t&&(S+=" "+l(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let w=n.replace(/\n+/g,`
80
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,k=gd(i,!0);o!=="folded"&&e!==q.BLOCK_FOLDED&&(k.onOverflow=()=>{A=!0});let O=$c(`${g}${w}${d}`,c,pd,k);if(!A)return`>${S}
81
- ${c}${O}`}return n=n.replace(/\n+/g,`$&${c}`),`|${S}
82
- ${c}${g}${n}${d}`}function eH(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:u}=e;if(l&&s.includes(`
83
- `)||u&&/[[\]{},]/.test(s))return _l(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||u||!s.includes(`
84
- `)?_l(s,e):md(t,e,n,i);if(!l&&!u&&r!==q.PLAIN&&s.includes(`
85
- `))return md(t,e,n,i);if(yd(s)){if(a==="")return e.forceBlockIndent=!0,md(t,e,n,i);if(l&&a===c)return _l(s,e)}let f=s.replace(/\n+/g,`$&
86
- ${a}`);if(o){let h=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:d,tags:p}=e.doc.schema;if(p.some(h)||d?.some(h))return _l(s,e)}return l?f:$c(f,a,nb,gd(e,!1))}function Gs(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==q.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=q.QUOTE_DOUBLE);let a=u=>{switch(u){case q.BLOCK_FOLDED:case q.BLOCK_LITERAL:return r||s?_l(o.value,e):md(o,e,n,i);case q.QUOTE_DOUBLE:return Xc(o.value,e);case q.QUOTE_SINGLE:return ib(o.value,e);case q.PLAIN:return eH(o,e,n,i);default:return null}},c=a(l);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=r&&u||f;if(c=a(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function bd(t,e){let n=Object.assign({blockQuote:!0,commentString:L2,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function tH(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(K(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function nH(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(K(t)||de(t))&&t.anchor;s&&fd(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function fr(t,e,n,i){if(re(t))return t.toString(e,n,i);if(Xn(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=se(t)?t:e.doc.createNode(t,{onTagObj:a=>r=a});r??(r=tH(e.doc.schema.tags,s));let o=nH(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof r.stringify=="function"?r.stringify(s,e,n,i):K(s)?Gs(s,e,n,i):s.toString(e,n,i);return o?K(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
87
- ${e.indent}${l}`:l}function I2({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,h=se(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(de(t)||!se(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let d=!f&&(!t||h&&e==null&&!n.inFlow||de(t)||(K(t)?t.type===q.BLOCK_FOLDED||t.type===q.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(f||!s),indent:l+a});let p=!1,m=!1,b=fr(t,n,()=>p=!0,()=>m=!0);if(!d&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(s||e==null)return p&&i&&i(),b===""?"?":d?`? ${b}`:b}else if(s&&!f||e==null&&d)return b=`? ${b}`,h&&!p?b+=Ei(b,n.indent,c(h)):m&&r&&r(),b;p&&(h=null),d?(h&&(b+=Ei(b,n.indent,c(h))),b=`? ${b}
88
- ${l}:`):(b=`${b}:`,h&&(b+=Ei(b,n.indent,c(h))));let y,g,v;se(e)?(y=!!e.spaceBefore,g=e.commentBefore,v=e.comment):(y=!1,g=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!d&&!h&&K(e)&&(n.indentAtStart=b.length+1),m=!1,!u&&a.length>=2&&!n.inFlow&&!d&&zt(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,w=fr(e,n,()=>S=!0,()=>m=!0),A=" ";if(h||y||g){if(A=y?`
89
- `:"",g){let k=c(g);A+=`
90
- ${Rn(k,n.indent)}`}w===""&&!n.inFlow?A===`
91
- `&&v&&(A=`
76
+ `&&w!==" "&&w!==" ")break}let d=n.substring(h),m=d.indexOf(`
77
+ `);m===-1?f="-":n===d||m!==d.length-1?(f="+",s&&s()):f="",d&&(n=n.slice(0,-d.length),d[d.length-1]===`
78
+ `&&(d=d.slice(0,-1)),d=d.replace(ab,`$&${c}`));let g=!1,b,p=-1;for(b=0;b<n.length;++b){let w=n[b];if(w===" ")g=!0;else if(w===`
79
+ `)p=b;else break}let y=n.substring(0,p<b?p+1:b);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${c}`));let S=(g?c?"2":"1":"")+f;if(t&&(S+=" "+l(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let w=n.replace(/\n+/g,`
80
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),O=!1,k=xd(i,!0);o!=="folded"&&e!==I.BLOCK_FOLDED&&(k.onOverflow=()=>{O=!0});let A=eu(`${y}${w}${d}`,c,vd,k);if(!O)return`>${S}
81
+ ${c}${A}`}return n=n.replace(/\n+/g,`$&${c}`),`|${S}
82
+ ${c}${y}${n}${d}`}function cH(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:u}=e;if(l&&s.includes(`
83
+ `)||u&&/[[\]{},]/.test(s))return Hl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||u||!s.includes(`
84
+ `)?Hl(s,e):Sd(t,e,n,i);if(!l&&!u&&r!==I.PLAIN&&s.includes(`
85
+ `))return Sd(t,e,n,i);if(wd(s)){if(a==="")return e.forceBlockIndent=!0,Sd(t,e,n,i);if(l&&a===c)return Hl(s,e)}let f=s.replace(/\n+/g,`$&
86
+ ${a}`);if(o){let h=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:d,tags:m}=e.doc.schema;if(m.some(h)||d?.some(h))return Hl(s,e)}return l?f:eu(f,a,ob,xd(e,!1))}function Js(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==I.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=I.QUOTE_DOUBLE);let a=u=>{switch(u){case I.BLOCK_FOLDED:case I.BLOCK_LITERAL:return r||s?Hl(o.value,e):Sd(o,e,n,i);case I.QUOTE_DOUBLE:return tu(o.value,e);case I.QUOTE_SINGLE:return lb(o.value,e);case I.PLAIN:return cH(o,e,n,i);default:return null}},c=a(l);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=r&&u||f;if(c=a(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function kd(t,e){let n=Object.assign({blockQuote:!0,commentString:U2,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function uH(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(Y(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function fH(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(Y(t)||pe(t))&&t.anchor;s&&gd(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function gr(t,e,n,i){if(se(t))return t.toString(e,n,i);if(Zn(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=oe(t)?t:e.doc.createNode(t,{onTagObj:a=>r=a});r??(r=uH(e.doc.schema.tags,s));let o=fH(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof r.stringify=="function"?r.stringify(s,e,n,i):Y(s)?Js(s,e,n,i):s.toString(e,n,i);return o?Y(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
87
+ ${e.indent}${l}`:l}function j2({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,h=oe(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(pe(t)||!oe(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let d=!f&&(!t||h&&e==null&&!n.inFlow||pe(t)||(Y(t)?t.type===I.BLOCK_FOLDED||t.type===I.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(f||!s),indent:l+a});let m=!1,g=!1,b=gr(t,n,()=>m=!0,()=>g=!0);if(!d&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(s||e==null)return m&&i&&i(),b===""?"?":d?`? ${b}`:b}else if(s&&!f||e==null&&d)return b=`? ${b}`,h&&!m?b+=Ri(b,n.indent,c(h)):g&&r&&r(),b;m&&(h=null),d?(h&&(b+=Ri(b,n.indent,c(h))),b=`? ${b}
88
+ ${l}:`):(b=`${b}:`,h&&(b+=Ri(b,n.indent,c(h))));let p,y,v;oe(e)?(p=!!e.spaceBefore,y=e.commentBefore,v=e.comment):(p=!1,y=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!d&&!h&&Y(e)&&(n.indentAtStart=b.length+1),g=!1,!u&&a.length>=2&&!n.inFlow&&!d&&Ht(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,w=gr(e,n,()=>S=!0,()=>g=!0),O=" ";if(h||p||y){if(O=p?`
89
+ `:"",y){let k=c(y);O+=`
90
+ ${Ln(k,n.indent)}`}w===""&&!n.inFlow?O===`
91
+ `&&v&&(O=`
92
92
 
93
- `):A+=`
94
- ${n.indent}`}else if(!d&&de(e)){let k=w[0],O=w.indexOf(`
95
- `),M=O!==-1,E=n.inFlow??e.flow??e.items.length===0;if(M||!E){let L=!1;if(M&&(k==="&"||k==="!")){let R=w.indexOf(" ");k==="&"&&R!==-1&&R<O&&w[R+1]==="!"&&(R=w.indexOf(" ",R+1)),(R===-1||O<R)&&(L=!0)}L||(A=`
93
+ `):O+=`
94
+ ${n.indent}`}else if(!d&&pe(e)){let k=w[0],A=w.indexOf(`
95
+ `),D=A!==-1,E=n.inFlow??e.flow??e.items.length===0;if(D||!E){let L=!1;if(D&&(k==="&"||k==="!")){let R=w.indexOf(" ");k==="&"&&R!==-1&&R<A&&w[R+1]==="!"&&(R=w.indexOf(" ",R+1)),(R===-1||A<R)&&(L=!0)}L||(O=`
96
96
  ${n.indent}`)}}else(w===""||w[0]===`
97
- `)&&(A="");return b+=A+w,n.inFlow?S&&i&&i():v&&!S?b+=Ei(b,n.indent,c(v)):m&&r&&r(),b}function sb(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var vd="<<",Wn={identify:t=>t===vd||typeof t=="symbol"&&t.description===vd,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new q(Symbol(vd)),{addToJSMap:lb}),stringify:()=>vd},q2=(t,e)=>(Wn.identify(e)||K(e)&&(!e.type||e.type===q.PLAIN)&&Wn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Wn.tag&&n.default);function lb(t,e,n){let i=P2(t,n);if(zt(i))for(let r of i.items)ob(t,e,r);else if(Array.isArray(i))for(let r of i)ob(t,e,r);else ob(t,e,i)}function ob(t,e,n){let i=P2(t,n);if(!Pt(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function P2(t,e){return t&&Xn(e)?e.resolve(t.doc,t):e}function Sd(t,e,{key:n,value:i}){if(se(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(q2(t,n))lb(t,e,i);else{let r=st(n,"",t);if(e instanceof Map)e.set(r,st(i,r,t));else if(e instanceof Set)e.add(r);else{let s=iH(n,r,t),o=st(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function iH(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(se(t)&&n?.doc){let i=bd(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),sb(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function Ll(t,e,n){let i=ur(t,void 0,n),r=ur(e,void 0,n);return new Fe(i,r)}var Fe=class t{constructor(e,n=null){Object.defineProperty(this,qt,{value:J0}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return se(n)&&(n=n.clone(e)),se(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Sd(n,i,this)}toString(e,n,i){return e?.doc?I2(this,e,n,i):JSON.stringify(this)}};function wd(t,e,n){return(e.inFlow??t.flow?sH:rH)(t,e,n)}function rH({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:a,options:{commentString:c}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,h=[];for(let p=0;p<e.length;++p){let m=e[p],b=null;if(se(m))!f&&m.spaceBefore&&h.push(""),xd(n,h,m.commentBefore,f),m.comment&&(b=m.comment);else if(re(m)){let g=se(m.key)?m.key:null;g&&(!f&&g.spaceBefore&&h.push(""),xd(n,h,g.commentBefore,f))}f=!1;let y=fr(m,u,()=>b=null,()=>f=!0);b&&(y+=Ei(y,s,c(b))),f&&b&&(f=!1),h.push(i+y)}let d;if(h.length===0)d=r.start+r.end;else{d=h[0];for(let p=1;p<h.length;++p){let m=h[p];d+=m?`
98
- ${a}${m}`:`
97
+ `)&&(O="");return b+=O+w,n.inFlow?S&&i&&i():v&&!S?b+=Ri(b,n.indent,c(v)):g&&r&&r(),b}function cb(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var Ad="<<",Jn={identify:t=>t===Ad||typeof t=="symbol"&&t.description===Ad,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new I(Symbol(Ad)),{addToJSMap:fb}),stringify:()=>Ad},V2=(t,e)=>(Jn.identify(e)||Y(e)&&(!e.type||e.type===I.PLAIN)&&Jn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Jn.tag&&n.default);function fb(t,e,n){let i=Y2(t,n);if(Ht(i))for(let r of i.items)ub(t,e,r);else if(Array.isArray(i))for(let r of i)ub(t,e,r);else ub(t,e,i)}function ub(t,e,n){let i=Y2(t,n);if(!zt(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Y2(t,e){return t&&Zn(e)?e.resolve(t.doc,t):e}function Od(t,e,{key:n,value:i}){if(oe(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(V2(t,n))fb(t,e,i);else{let r=it(n,"",t);if(e instanceof Map)e.set(r,it(i,r,t));else if(e instanceof Set)e.add(r);else{let s=hH(n,r,t),o=it(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function hH(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(oe(t)&&n?.doc){let i=kd(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),cb(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function Ul(t,e,n){let i=mr(t,void 0,n),r=mr(e,void 0,n);return new je(i,r)}var je=class t{constructor(e,n=null){Object.defineProperty(this,Pt,{value:ib}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return oe(n)&&(n=n.clone(e)),oe(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Od(n,i,this)}toString(e,n,i){return e?.doc?j2(this,e,n,i):JSON.stringify(this)}};function Cd(t,e,n){return(e.inFlow??t.flow?pH:dH)(t,e,n)}function dH({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:a,options:{commentString:c}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,h=[];for(let m=0;m<e.length;++m){let g=e[m],b=null;if(oe(g))!f&&g.spaceBefore&&h.push(""),Td(n,h,g.commentBefore,f),g.comment&&(b=g.comment);else if(se(g)){let y=oe(g.key)?g.key:null;y&&(!f&&y.spaceBefore&&h.push(""),Td(n,h,y.commentBefore,f))}f=!1;let p=gr(g,u,()=>b=null,()=>f=!0);b&&(p+=Ri(p,s,c(b))),f&&b&&(f=!1),h.push(i+p)}let d;if(h.length===0)d=r.start+r.end;else{d=h[0];for(let m=1;m<h.length;++m){let g=h[m];d+=g?`
98
+ ${a}${g}`:`
99
99
  `}}return t?(d+=`
100
- `+Rn(c(t),a),l&&l()):f&&o&&o(),d}function sH({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;i+=s;let a=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let p=0;p<t.length;++p){let m=t[p],b=null;if(se(m))m.spaceBefore&&f.push(""),xd(e,f,m.commentBefore,!1),m.comment&&(b=m.comment);else if(re(m)){let g=se(m.key)?m.key:null;g&&(g.spaceBefore&&f.push(""),xd(e,f,g.commentBefore,!1),g.comment&&(c=!0));let v=se(m.value)?m.value:null;v?(v.comment&&(b=v.comment),v.commentBefore&&(c=!0)):m.value==null&&g?.comment&&(b=g.comment)}b&&(c=!0);let y=fr(m,a,()=>b=null);c||(c=f.length>u||y.includes(`
101
- `)),p<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((g,v)=>g+v.length+2,2)+(y.length+2)>e.options.lineWidth)),c&&(y+=",")),b&&(y+=Ei(y,i,l(b))),f.push(y),u=f.length}let{start:h,end:d}=n;if(f.length===0)return h+d;if(!c){let p=f.reduce((m,b)=>m+b.length+2,2);c=e.options.lineWidth>0&&p>e.options.lineWidth}if(c){let p=h;for(let m of f)p+=m?`
102
- ${s}${r}${m}`:`
103
- `;return`${p}
104
- ${r}${d}`}else return`${h}${o}${f.join(" ")}${o}${d}`}function xd({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Rn(e(i),t);n.push(s.trimStart())}}function is(t,e){let n=K(e)?e.value:e;for(let i of t)if(re(i)&&(i.key===e||i.key===n||K(i.key)&&i.key.value===n))return i}var Qe=class extends Nl{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super($n,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),l=(a,c)=>{if(typeof s=="function")c=s.call(n,a,c);else if(Array.isArray(s)&&!s.includes(a))return;(c!==void 0||r)&&o.items.push(Ll(a,c,i))};if(n instanceof Map)for(let[a,c]of n)l(a,c);else if(n&&typeof n=="object")for(let a of Object.keys(n))l(a,n[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;re(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Fe(e,e?.value):i=new Fe(e.key,e.value);let r=is(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);K(r.value)&&dd(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(l=>s(i,l)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=is(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=is(this.items,e)?.value;return(!n&&K(r)?r.value:r)??void 0}has(e){return!!is(this.items,e)}set(e,n){this.add(new Fe(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)Sd(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!re(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),wd(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};var Zn={collection:"map",default:!0,nodeClass:Qe,tag:"tag:yaml.org,2002:map",resolve(t,e){return Pt(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Qe.from(t,e,n)};var At=class extends Nl{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ar,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=kd(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=kd(e);if(typeof i!="number")return;let r=this.items[i];return!n&&K(r)?r.value:r}has(e){let n=kd(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=kd(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];K(r)&&dd(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(st(s,String(r++),n));return i}toString(e,n,i){return e?wd(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){let a=n instanceof Set?l:String(o++);l=r.call(n,a,l)}s.items.push(ur(l,void 0,i))}}return s}};function kd(t){let e=K(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var Jn={collection:"seq",default:!0,nodeClass:At,tag:"tag:yaml.org,2002:seq",resolve(t,e){return zt(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>At.from(t,e,n)};var rs={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),Gs(t,e,n,i)}};var $s={identify:t=>t==null,createNode:()=>new q(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new q(null),stringify:({source:t},e)=>typeof t=="string"&&$s.test.test(t)?t:e.options.nullStr};var Wc={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new q(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Wc.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function Ot({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}var Ad={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ot},Od={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Ot(t)}},Td={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new q(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Ot};var Cd=t=>typeof t=="bigint"||Number.isInteger(t),ab=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function z2(t,e,n){let{value:i}=t;return Cd(i)&&i>=0?n+i.toString(e):Ot(t)}var Ed={identify:t=>Cd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>ab(t,2,8,n),stringify:t=>z2(t,8,"0o")},Dd={identify:Cd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>ab(t,0,10,n),stringify:Ot},Md={identify:t=>Cd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>ab(t,2,16,n),stringify:t=>z2(t,16,"0x")};var H2=[Zn,Jn,rs,$s,Wc,Ed,Dd,Md,Ad,Od,Td];function U2(t){return typeof t=="bigint"||Number.isInteger(t)}var Nd=({value:t})=>JSON.stringify(t),oH=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Nd},{identify:t=>t==null,createNode:()=>new q(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nd},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Nd},{identify:U2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>U2(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Nd}],lH={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},F2=[Zn,Jn].concat(oH,lH);var Zc={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=q.BLOCK_LITERAL),e!==q.QUOTE_DOUBLE){let a=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(l.length/a),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=a)u[f]=l.substr(h,a);l=u.join(e===q.BLOCK_LITERAL?`
105
- `:" ")}return Gs({comment:t,type:e,value:l},i,r,s)}};function cb(t,e){if(zt(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!re(i)){if(Pt(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Fe(new q(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
100
+ `+Ln(c(t),a),l&&l()):f&&o&&o(),d}function pH({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;i+=s;let a=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let m=0;m<t.length;++m){let g=t[m],b=null;if(oe(g))g.spaceBefore&&f.push(""),Td(e,f,g.commentBefore,!1),g.comment&&(b=g.comment);else if(se(g)){let y=oe(g.key)?g.key:null;y&&(y.spaceBefore&&f.push(""),Td(e,f,y.commentBefore,!1),y.comment&&(c=!0));let v=oe(g.value)?g.value:null;v?(v.comment&&(b=v.comment),v.commentBefore&&(c=!0)):g.value==null&&y?.comment&&(b=y.comment)}b&&(c=!0);let p=gr(g,a,()=>b=null);c||(c=f.length>u||p.includes(`
101
+ `)),m<t.length-1?p+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((y,v)=>y+v.length+2,2)+(p.length+2)>e.options.lineWidth)),c&&(p+=",")),b&&(p+=Ri(p,i,l(b))),f.push(p),u=f.length}let{start:h,end:d}=n;if(f.length===0)return h+d;if(!c){let m=f.reduce((g,b)=>g+b.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=h;for(let g of f)m+=g?`
102
+ ${s}${r}${g}`:`
103
+ `;return`${m}
104
+ ${r}${d}`}else return`${h}${o}${f.join(" ")}${o}${d}`}function Td({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Ln(e(i),t);n.push(s.trimStart())}}function cs(t,e){let n=Y(e)?e.value:e;for(let i of t)if(se(i)&&(i.key===e||i.key===n||Y(i.key)&&i.key.value===n))return i}var Qe=class extends Pl{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Wn,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),l=(a,c)=>{if(typeof s=="function")c=s.call(n,a,c);else if(Array.isArray(s)&&!s.includes(a))return;(c!==void 0||r)&&o.items.push(Ul(a,c,i))};if(n instanceof Map)for(let[a,c]of n)l(a,c);else if(n&&typeof n=="object")for(let a of Object.keys(n))l(a,n[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;se(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new je(e,e?.value):i=new je(e.key,e.value);let r=cs(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Y(r.value)&&bd(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(l=>s(i,l)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=cs(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=cs(this.items,e)?.value;return(!n&&Y(r)?r.value:r)??void 0}has(e){return!!cs(this.items,e)}set(e,n){this.add(new je(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)Od(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!se(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Cd(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};var ei={collection:"map",default:!0,nodeClass:Qe,tag:"tag:yaml.org,2002:map",resolve(t,e){return zt(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Qe.from(t,e,n)};var Ct=class extends Pl{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(dr,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Ed(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Ed(e);if(typeof i!="number")return;let r=this.items[i];return!n&&Y(r)?r.value:r}has(e){let n=Ed(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Ed(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];Y(r)&&bd(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(it(s,String(r++),n));return i}toString(e,n,i){return e?Cd(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){let a=n instanceof Set?l:String(o++);l=r.call(n,a,l)}s.items.push(mr(l,void 0,i))}}return s}};function Ed(t){let e=Y(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var ti={collection:"seq",default:!0,nodeClass:Ct,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Ht(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ct.from(t,e,n)};var us={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),Js(t,e,n,i)}};var eo={identify:t=>t==null,createNode:()=>new I(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new I(null),stringify:({source:t},e)=>typeof t=="string"&&eo.test.test(t)?t:e.options.nullStr};var nu={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new I(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&nu.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function Et({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}var Dd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Et},Md={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Et(t)}},Nd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new I(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Et};var Rd=t=>typeof t=="bigint"||Number.isInteger(t),hb=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function K2(t,e,n){let{value:i}=t;return Rd(i)&&i>=0?n+i.toString(e):Et(t)}var _d={identify:t=>Rd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>hb(t,2,8,n),stringify:t=>K2(t,8,"0o")},Ld={identify:Rd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>hb(t,0,10,n),stringify:Et},Bd={identify:t=>Rd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>hb(t,2,16,n),stringify:t=>K2(t,16,"0x")};var Q2=[ei,ti,us,eo,nu,_d,Ld,Bd,Dd,Md,Nd];function $2(t){return typeof t=="bigint"||Number.isInteger(t)}var Id=({value:t})=>JSON.stringify(t),mH=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Id},{identify:t=>t==null,createNode:()=>new I(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Id},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Id},{identify:$2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>$2(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Id}],gH={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},G2=[ei,ti].concat(mH,gH);var iu={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=I.BLOCK_LITERAL),e!==I.QUOTE_DOUBLE){let a=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(l.length/a),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=a)u[f]=l.substr(h,a);l=u.join(e===I.BLOCK_LITERAL?`
105
+ `:" ")}return Js({comment:t,type:e,value:l},i,r,s)}};function db(t,e){if(Ht(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!se(i)){if(zt(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new je(new I(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
106
106
  ${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
107
- ${s.comment}`:i.comment}i=r}t.items[n]=re(i)?i:new Fe(i)}}else e("Expected a sequence for this tag");return t}function ub(t,e,n){let{replacer:i}=n,r=new At(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;r.items.push(Ll(l,a,n))}return r}var Jc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cb,createNode:ub};var Bl=class t extends At{constructor(){super(),this.add=Qe.prototype.add.bind(this),this.delete=Qe.prototype.delete.bind(this),this.get=Qe.prototype.get.bind(this),this.has=Qe.prototype.has.bind(this),this.set=Qe.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(re(r)?(s=st(r.key,"",n),o=st(r.value,s,n)):s=st(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=ub(e,n,i),s=new this;return s.items=r.items,s}};Bl.tag="tag:yaml.org,2002:omap";var eu={collection:"seq",identify:t=>t instanceof Map,nodeClass:Bl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=cb(t,e),i=[];for(let{key:r}of n.items)K(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Bl,n)},createNode:(t,e,n)=>Bl.from(t,e,n)};function j2({value:t,source:e},n){return e&&(t?fb:hb).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var fb={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new q(!0),stringify:j2},hb={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new q(!1),stringify:j2};var V2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ot},Y2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Ot(t)}},K2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new q(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Ot};var tu=t=>typeof t=="bigint"||Number.isInteger(t);function Rd(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function db(t,e,n){let{value:i}=t;if(tu(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Ot(t)}var Q2={identify:tu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Rd(t,2,2,n),stringify:t=>db(t,2,"0b")},G2={identify:tu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Rd(t,1,8,n),stringify:t=>db(t,8,"0")},$2={identify:tu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Rd(t,0,10,n),stringify:Ot},X2={identify:tu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Rd(t,2,16,n),stringify:t=>db(t,16,"0x")};var Il=class t extends Qe{constructor(e){super(e),this.tag=t.tag}add(e){let n;re(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Fe(e.key,null):n=new Fe(e,null),is(this.items,n.key)||this.items.push(n)}get(e,n){let i=is(this.items,e);return!n&&re(i)?K(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=is(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Fe(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Ll(o,null,i));return s}};Il.tag="tag:yaml.org,2002:set";var nu={collection:"map",identify:t=>t instanceof Set,nodeClass:Il,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Il.from(t,e,n),resolve(t,e){if(Pt(t)){if(t.hasAllNullValues(!0))return Object.assign(new Il,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function pb(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function W2(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Ot(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var _d={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>pb(t,n),stringify:W2},Ld={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>pb(t,!1),stringify:W2},ql={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(ql.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,s||0,o||0,l||0,a),u=e[8];if(u&&u!=="Z"){let f=pb(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var mb=[Zn,Jn,rs,$s,fb,hb,Q2,G2,$2,X2,V2,Y2,K2,Zc,Wn,eu,Jc,nu,_d,Ld,ql];var Z2=new Map([["core",H2],["failsafe",[Zn,Jn,rs]],["json",F2],["yaml11",mb],["yaml-1.1",mb]]),J2={binary:Zc,bool:Wc,float:Td,floatExp:Od,floatNaN:Ad,floatTime:Ld,int:Dd,intHex:Md,intOct:Ed,intTime:_d,map:Zn,merge:Wn,null:$s,omap:eu,pairs:Jc,seq:Jn,set:nu,timestamp:ql},eC={"tag:yaml.org,2002:binary":Zc,"tag:yaml.org,2002:merge":Wn,"tag:yaml.org,2002:omap":eu,"tag:yaml.org,2002:pairs":Jc,"tag:yaml.org,2002:set":nu,"tag:yaml.org,2002:timestamp":ql};function Bd(t,e,n){let i=Z2.get(e);if(i&&!t)return n&&!i.includes(Wn)?i.concat(Wn):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(Z2.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Wn)),r.reduce((s,o)=>{let l=typeof o=="string"?J2[o]:o;if(!l){let a=JSON.stringify(o),c=Object.keys(J2).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}var aH=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,iu=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Bd(e,"compat"):e?Bd(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?eC:{},this.tags=Bd(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,$n,{value:Zn}),Object.defineProperty(this,hn,{value:rs}),Object.defineProperty(this,ar,{value:Jn}),this.sortMapEntries=typeof o=="function"?o:o===!0?aH:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function tC(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let a=t.directives.toString(t);a?(n.push(a),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=bd(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let a=s(t.commentBefore);n.unshift(Rn(a,""))}let o=!1,l=null;if(t.contents){if(se(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Rn(u,""))}r.forceBlockIndent=!!t.comment,l=t.contents.comment}let a=l?void 0:()=>o=!0,c=fr(t.contents,r,()=>l=null,a);l&&(c+=Ei(c,"",s(l))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(fr(t.contents,r));if(t.directives?.docEnd)if(t.comment){let a=s(t.comment);a.includes(`
108
- `)?(n.push("..."),n.push(Rn(a,""))):n.push(`... ${a}`)}else n.push("...");else{let a=t.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Rn(s(a),"")))}return n.join(`
107
+ ${s.comment}`:i.comment}i=r}t.items[n]=se(i)?i:new je(i)}}else e("Expected a sequence for this tag");return t}function pb(t,e,n){let{replacer:i}=n,r=new Ct(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;r.items.push(Ul(l,a,n))}return r}var ru={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:db,createNode:pb};var Fl=class t extends Ct{constructor(){super(),this.add=Qe.prototype.add.bind(this),this.delete=Qe.prototype.delete.bind(this),this.get=Qe.prototype.get.bind(this),this.has=Qe.prototype.has.bind(this),this.set=Qe.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(se(r)?(s=it(r.key,"",n),o=it(r.value,s,n)):s=it(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=pb(e,n,i),s=new this;return s.items=r.items,s}};Fl.tag="tag:yaml.org,2002:omap";var su={collection:"seq",identify:t=>t instanceof Map,nodeClass:Fl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=db(t,e),i=[];for(let{key:r}of n.items)Y(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Fl,n)},createNode:(t,e,n)=>Fl.from(t,e,n)};function X2({value:t,source:e},n){return e&&(t?mb:gb).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var mb={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new I(!0),stringify:X2},gb={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new I(!1),stringify:X2};var W2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Et},Z2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Et(t)}},J2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new I(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Et};var ou=t=>typeof t=="bigint"||Number.isInteger(t);function qd(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function yb(t,e,n){let{value:i}=t;if(ou(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Et(t)}var eC={identify:ou,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>qd(t,2,2,n),stringify:t=>yb(t,2,"0b")},tC={identify:ou,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>qd(t,1,8,n),stringify:t=>yb(t,8,"0")},nC={identify:ou,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>qd(t,0,10,n),stringify:Et},iC={identify:ou,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>qd(t,2,16,n),stringify:t=>yb(t,16,"0x")};var jl=class t extends Qe{constructor(e){super(e),this.tag=t.tag}add(e){let n;se(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new je(e.key,null):n=new je(e,null),cs(this.items,n.key)||this.items.push(n)}get(e,n){let i=cs(this.items,e);return!n&&se(i)?Y(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=cs(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new je(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Ul(o,null,i));return s}};jl.tag="tag:yaml.org,2002:set";var lu={collection:"map",identify:t=>t instanceof Set,nodeClass:jl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>jl.from(t,e,n),resolve(t,e){if(zt(t)){if(t.hasAllNullValues(!0))return Object.assign(new jl,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function bb(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function rC(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Et(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Pd={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>bb(t,n),stringify:rC},zd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>bb(t,!1),stringify:rC},Vl={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Vl.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,s||0,o||0,l||0,a),u=e[8];if(u&&u!=="Z"){let f=bb(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var vb=[ei,ti,us,eo,mb,gb,eC,tC,nC,iC,W2,Z2,J2,iu,Jn,su,ru,lu,Pd,zd,Vl];var sC=new Map([["core",Q2],["failsafe",[ei,ti,us]],["json",G2],["yaml11",vb],["yaml-1.1",vb]]),oC={binary:iu,bool:nu,float:Nd,floatExp:Md,floatNaN:Dd,floatTime:zd,int:Ld,intHex:Bd,intOct:_d,intTime:Pd,map:ei,merge:Jn,null:eo,omap:su,pairs:ru,seq:ti,set:lu,timestamp:Vl},lC={"tag:yaml.org,2002:binary":iu,"tag:yaml.org,2002:merge":Jn,"tag:yaml.org,2002:omap":su,"tag:yaml.org,2002:pairs":ru,"tag:yaml.org,2002:set":lu,"tag:yaml.org,2002:timestamp":Vl};function Hd(t,e,n){let i=sC.get(e);if(i&&!t)return n&&!i.includes(Jn)?i.concat(Jn):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(sC.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Jn)),r.reduce((s,o)=>{let l=typeof o=="string"?oC[o]:o;if(!l){let a=JSON.stringify(o),c=Object.keys(oC).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}var yH=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,au=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Hd(e,"compat"):e?Hd(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?lC:{},this.tags=Hd(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Wn,{value:ei}),Object.defineProperty(this,mn,{value:us}),Object.defineProperty(this,dr,{value:ti}),this.sortMapEntries=typeof o=="function"?o:o===!0?yH:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function aC(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let a=t.directives.toString(t);a?(n.push(a),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=kd(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let a=s(t.commentBefore);n.unshift(Ln(a,""))}let o=!1,l=null;if(t.contents){if(oe(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Ln(u,""))}r.forceBlockIndent=!!t.comment,l=t.contents.comment}let a=l?void 0:()=>o=!0,c=gr(t.contents,r,()=>l=null,a);l&&(c+=Ri(c,"",s(l))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(gr(t.contents,r));if(t.directives?.docEnd)if(t.comment){let a=s(t.comment);a.includes(`
108
+ `)?(n.push("..."),n.push(Ln(a,""))):n.push(`... ${a}`)}else n.push("...");else{let a=t.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Ln(s(a),"")))}return n.join(`
109
109
  `)+`
110
- `}var ss=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qt,{value:ad});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ci({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[qt]:{value:ad}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=se(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Pl(this.contents)&&this.contents.add(e)}addIn(e,n){Pl(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=eb(this);e.anchor=!n||i.has(n)?tb(n||"a",i):n}return new cr(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let b=g=>typeof g=="number"||g instanceof String||g instanceof Number,y=n.filter(b).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:d}=_2(this,o||"a"),p={aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:d},m=ur(e,u,p);return l&&de(m)&&(m.flow=!0),h(),m}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new Fe(r,s)}delete(e){return Pl(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Rl(e)?this.contents==null?!1:(this.contents=null,!0):Pl(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return de(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Rl(e)?!n&&K(this.contents)?this.contents.value:this.contents:de(this.contents)?this.contents.getIn(e,n):void 0}has(e){return de(this.contents)?this.contents.has(e):!1}hasIn(e){return Rl(e)?this.contents!==void 0:de(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Qc(this.schema,[e],n):Pl(this.contents)&&this.contents.set(e,n)}setIn(e,n){Rl(e)?this.contents=n:this.contents==null?this.contents=Qc(this.schema,Array.from(e),n):Pl(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ci({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ci({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new iu(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=st(this.contents,n??"",l);if(typeof s=="function")for(let{count:c,res:u}of l.anchors.values())s(u,c);return typeof o=="function"?ts(o,{"":a},"",a):a}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return tC(this,e)}};function Pl(t){if(de(t))return!0;throw new Error("Expected a YAML collection as document contents")}var ru=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},ei=class extends ru{constructor(e,n,i){super("YAMLParseError",e,n,i)}},su=class extends ru{constructor(e,n,i){super("YAMLWarning",e,n,i)}},gb=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>e.linePos(l));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
110
+ `}var fs=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pt,{value:dd});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ni({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Pt]:{value:dd}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=oe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Yl(this.contents)&&this.contents.add(e)}addIn(e,n){Yl(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=rb(this);e.anchor=!n||i.has(n)?sb(n||"a",i):n}return new pr(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let b=y=>typeof y=="number"||y instanceof String||y instanceof Number,p=n.filter(b).map(String);p.length>0&&(n=n.concat(p)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:d}=H2(this,o||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:d},g=mr(e,u,m);return l&&pe(g)&&(g.flow=!0),h(),g}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new je(r,s)}delete(e){return Yl(this.contents)?this.contents.delete(e):!1}deleteIn(e){return zl(e)?this.contents==null?!1:(this.contents=null,!0):Yl(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return pe(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return zl(e)?!n&&Y(this.contents)?this.contents.value:this.contents:pe(this.contents)?this.contents.getIn(e,n):void 0}has(e){return pe(this.contents)?this.contents.has(e):!1}hasIn(e){return zl(e)?this.contents!==void 0:pe(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Zc(this.schema,[e],n):Yl(this.contents)&&this.contents.set(e,n)}setIn(e,n){zl(e)?this.contents=n:this.contents==null?this.contents=Zc(this.schema,Array.from(e),n):Yl(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ni({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ni({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new au(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=it(this.contents,n??"",l);if(typeof s=="function")for(let{count:c,res:u}of l.anchors.values())s(u,c);return typeof o=="function"?ls(o,{"":a},"",a):a}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return aC(this,e)}};function Yl(t){if(pe(t))return!0;throw new Error("Expected a YAML collection as document contents")}var cu=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},ni=class extends cu{constructor(e,n,i){super("YAMLParseError",e,n,i)}},uu=class extends cu{constructor(e,n,i){super("YAMLWarning",e,n,i)}},Sb=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>e.linePos(l));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
111
111
  `),o=l+o}if(/[^ ]/.test(o)){let l=1,a=n.linePos[1];a?.line===i&&a.col>r&&(l=Math.max(1,Math.min(a.col-r,80-s)));let c=" ".repeat(s)+"^".repeat(l);n.message+=`:
112
112
 
113
113
  ${o}
114
114
  ${c}
115
- `}};function Di(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,f="",h="",d=!1,p=!1,m=null,b=null,y=null,g=null,v=null,S=null,w=null;for(let O of t)switch(p&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&s(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),m&&(c&&O.type!=="comment"&&O.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),O.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&O.source.includes(" ")&&(m=O),u=!0;break;case"comment":{u||s(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let M=O.source.substring(1)||" ";f?f+=h+M:f=M,h="",c=!1;break}case"newline":c?f?f+=O.source:(!S||n!=="seq-item-ind")&&(a=!0):h+=O.source,c=!0,d=!0,(b||y)&&(g=O),u=!0;break;case"anchor":b&&s(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&s(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=O,w??(w=O.offset),c=!1,u=!1,p=!0;break;case"tag":{y&&s(O,"MULTIPLE_TAGS","A node can have at most one tag"),y=O,w??(w=O.offset),c=!1,u=!1,p=!0;break}case n:(b||y)&&s(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),S&&s(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${e??"collection"}`),S=O,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(O,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=O,c=!1,u=!1;break}default:s(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),c=!1,u=!1}let A=t[t.length-1],k=A?A.offset+A.source.length:r;return p&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:S,spaceBefore:a,comment:f,hasNewline:d,anchor:b,tag:y,newlineAfterProp:g,end:k,start:w??k}}function os(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
116
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(os(e.key)||os(e.value))return!0}return!1;default:return!0}}function ou(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&os(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Id(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||K(s)&&K(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}var nC="All mapping items must start at the same column";function iC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Qe,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let a=i.offset,c=null;for(let u of i.items){let{start:f,key:h,sep:d,value:p}=u,m=Di(f,{indicator:"explicit-key-ind",next:h??d?.[0],offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0}),b=!m.found;if(b){if(h&&(h.type==="block-seq"?r(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&r(a,"BAD_INDENT",nC)),!m.anchor&&!m.tag&&!d){c=m.end,m.comment&&(l.comment?l.comment+=`
117
- `+m.comment:l.comment=m.comment);continue}(m.newlineAfterProp||os(h))&&r(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&r(a,"BAD_INDENT",nC);n.atKey=!0;let y=m.end,g=h?t(n,h,m,r):e(n,y,f,null,m,r);n.schema.compat&&ou(i.indent,h,r),n.atKey=!1,Id(n,l.items,g)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let v=Di(d??[],{indicator:"map-value-ind",next:p,offset:g.range[2],onError:r,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(a=v.end,v.found){b&&(p?.type==="block-map"&&!v.hasNewline&&r(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<v.found.offset-1024&&r(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=p?t(n,p,v,r):e(n,a,d,null,v,r);n.schema.compat&&ou(i.indent,p,r),a=S.range[2];let w=new Fe(g,S);n.options.keepSourceTokens&&(w.srcToken=u),l.items.push(w)}else{b&&r(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(g.comment?g.comment+=`
118
- `+v.comment:g.comment=v.comment);let S=new Fe(g);n.options.keepSourceTokens&&(S.srcToken=u),l.items.push(S)}}return c&&c<a&&r(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,a,c??a],l}function rC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??At,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=i.offset,c=null;for(let{start:u,value:f}of i.items){let h=Di(u,{indicator:"seq-item-ind",next:f,offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?r(h.end,"BAD_INDENT","All sequence items must start at the same column"):r(a,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(l.comment=h.comment);continue}let d=f?t(n,f,h,r):e(n,h.end,u,null,h,r);n.schema.compat&&ou(i.indent,f,r),a=d.range[2],l.items.push(d)}return l.range=[i.offset,a,c??a],l}function Mi(t,e,n,i){let r="";if(t){let s=!1,o="";for(let l of t){let{source:a,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{n&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=a.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=a),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:r,offset:e}}var yb="Block collections are not allowed within flow collections",bb=t=>t&&(t.type==="block-map"||t.type==="block-seq");function sC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",l=o?"flow map":"flow sequence",a=s?.nodeClass??(o?Qe:At),c=new a(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let b=0;b<i.items.length;++b){let y=i.items[b],{start:g,key:v,sep:S,value:w}=y,A=Di(g,{flow:l,indicator:"explicit-key-ind",next:v??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!S&&!w){b===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):b<i.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),A.comment&&(c.comment?c.comment+=`
119
- `+A.comment:c.comment=A.comment),f=A.end;continue}!o&&n.options.strict&&os(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${l} items`),A.comment){let k="";e:for(let O of g)switch(O.type){case"comma":case"space":break;case"comment":k=O.source.substring(1);break e;default:break e}if(k){let O=c.items[c.items.length-1];re(O)&&(O=O.value??O.key),O.comment?O.comment+=`
120
- `+k:O.comment=k,A.comment=A.comment.substring(k.length+1)}}if(!o&&!S&&!A.found){let k=w?t(n,w,A,r):e(n,A.end,S,null,A,r);c.items.push(k),f=k.range[2],bb(w)&&r(k.range,"BLOCK_IN_FLOW",yb)}else{n.atKey=!0;let k=A.end,O=v?t(n,v,A,r):e(n,k,g,null,A,r);bb(v)&&r(O.range,"BLOCK_IN_FLOW",yb),n.atKey=!1;let M=Di(S??[],{flow:l,indicator:"map-value-ind",next:w,offset:O.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(M.found){if(!o&&!A.found&&n.options.strict){if(S)for(let R of S){if(R===M.found)break;if(R.type==="newline"){r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<M.found.offset-1024&&r(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?r(w,"MISSING_CHAR",`Missing space after : in ${l}`):r(M.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let E=w?t(n,w,M,r):M.found?e(n,M.end,S,null,M,r):null;E?bb(w)&&r(E.range,"BLOCK_IN_FLOW",yb):M.comment&&(O.comment?O.comment+=`
121
- `+M.comment:O.comment=M.comment);let L=new Fe(O,E);if(n.options.keepSourceTokens&&(L.srcToken=y),o){let R=c;Id(n,R.items,O)&&r(k,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(L)}else{let R=new Qe(n.schema);R.flow=!0,R.items.push(L);let j=(E??O).range;R.range=[O.range[0],j[1],j[2]],c.items.push(R)}f=E?E.range[2]:M.end}}let h=o?"}":"]",[d,...p]=i.end,m=f;if(d?.source===h)m=d.offset+d.source.length;else{let b=l[0].toUpperCase()+l.substring(1),y=u?`${b} must end with a ${h}`:`${b} in block collection must be sufficiently indented and end with a ${h}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",y),d&&d.source.length!==1&&p.unshift(d)}if(p.length>0){let b=Mi(p,m,n.options.strict,r);b.comment&&(c.comment?c.comment+=`
122
- `+b.comment:c.comment=b.comment),c.range=[i.offset,m,b.offset]}else c.range=[i.offset,m,m];return c}function vb(t,e,n,i,r,s){let o=n.type==="block-map"?iC(t,e,n,i,s):n.type==="block-seq"?rC(t,e,n,i,s):sC(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function oC(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,h=>r(s,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){let{anchor:h,newlineAfterProp:d}=i,p=h&&s?h.offset>s.offset?h:s:h??s;p&&(!d||d.offset<p.offset)&&r(p,"MISSING_CHAR","Missing newline after block sequence props")}let l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Qe.tagName&&l==="map"||o===At.tagName&&l==="seq")return vb(t,e,n,r,o);let a=e.schema.tags.find(h=>h.tag===o&&h.collection===l);if(!a){let h=e.schema.knownTags[o];if(h?.collection===l)e.schema.tags.push(Object.assign({},h,{default:!1})),a=h;else return h?r(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${l} collection, but expects ${h.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vb(t,e,n,r,o)}let c=vb(t,e,n,r,o,a),u=a.resolve?.(c,h=>r(s,"TAG_RESOLVE_FAILED",h),e.options)??c,f=se(u)?u:new q(u);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Sb(t,e,n){let i=e.offset,r=cH(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?q.BLOCK_FOLDED:q.BLOCK_LITERAL,o=e.source?uH(e.source):[],l=o.length;for(let m=o.length-1;m>=0;--m){let b=o[m][1];if(b===""||b==="\r")l=m;else break}if(l===0){let m=r.chomp==="+"&&o.length>0?`
123
- `.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:m,type:s,comment:r.comment,range:[i,b,b]}}let a=e.indent+r.indent,c=e.offset+r.length,u=0;for(let m=0;m<l;++m){let[b,y]=o[m];if(y===""||y==="\r")r.indent===0&&b.length>a&&(a=b.length);else{b.length<a&&n(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(a=b.length),u=m,a===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+y.length+1}for(let m=o.length-1;m>=l;--m)o[m][0].length>a&&(l=m+1);let f="",h="",d=!1;for(let m=0;m<u;++m)f+=o[m][0].slice(a)+`
124
- `;for(let m=u;m<l;++m){let[b,y]=o[m];c+=b.length+y.length+1;let g=y[y.length-1]==="\r";if(g&&(y=y.slice(0,-1)),y&&b.length<a){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(g?2:1),"BAD_INDENT",S),b=""}s===q.BLOCK_LITERAL?(f+=h+b.slice(a)+y,h=`
125
- `):b.length>a||y[0]===" "?(h===" "?h=`
115
+ `}};function _i(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,f="",h="",d=!1,m=!1,g=null,b=null,p=null,y=null,v=null,S=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),A.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&A.source.includes(" ")&&(g=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";f?f+=h+D:f=D,h="",c=!1;break}case"newline":c?f?f+=A.source:(!S||n!=="seq-item-ind")&&(a=!0):h+=A.source,c=!0,d=!0,(b||p)&&(y=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,w??(w=A.offset),c=!1,u=!1,m=!0;break;case"tag":{p&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),p=A,w??(w=A.offset),c=!1,u=!1,m=!0;break}case n:(b||p)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),S&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),S=A,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let O=t[t.length-1],k=O?O.offset+O.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:S,spaceBefore:a,comment:f,hasNewline:d,anchor:b,tag:p,newlineAfterProp:y,end:k,start:w??k}}function hs(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
116
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(hs(e.key)||hs(e.value))return!0}return!1;default:return!0}}function fu(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&hs(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Ud(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||Y(s)&&Y(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}var cC="All mapping items must start at the same column";function uC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Qe,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let a=i.offset,c=null;for(let u of i.items){let{start:f,key:h,sep:d,value:m}=u,g=_i(f,{indicator:"explicit-key-ind",next:h??d?.[0],offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0}),b=!g.found;if(b){if(h&&(h.type==="block-seq"?r(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&r(a,"BAD_INDENT",cC)),!g.anchor&&!g.tag&&!d){c=g.end,g.comment&&(l.comment?l.comment+=`
117
+ `+g.comment:l.comment=g.comment);continue}(g.newlineAfterProp||hs(h))&&r(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(a,"BAD_INDENT",cC);n.atKey=!0;let p=g.end,y=h?t(n,h,g,r):e(n,p,f,null,g,r);n.schema.compat&&fu(i.indent,h,r),n.atKey=!1,Ud(n,l.items,y)&&r(p,"DUPLICATE_KEY","Map keys must be unique");let v=_i(d??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(a=v.end,v.found){b&&(m?.type==="block-map"&&!v.hasNewline&&r(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<v.found.offset-1024&&r(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=m?t(n,m,v,r):e(n,a,d,null,v,r);n.schema.compat&&fu(i.indent,m,r),a=S.range[2];let w=new je(y,S);n.options.keepSourceTokens&&(w.srcToken=u),l.items.push(w)}else{b&&r(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(y.comment?y.comment+=`
118
+ `+v.comment:y.comment=v.comment);let S=new je(y);n.options.keepSourceTokens&&(S.srcToken=u),l.items.push(S)}}return c&&c<a&&r(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,a,c??a],l}function fC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Ct,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=i.offset,c=null;for(let{start:u,value:f}of i.items){let h=_i(u,{indicator:"seq-item-ind",next:f,offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?r(h.end,"BAD_INDENT","All sequence items must start at the same column"):r(a,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(l.comment=h.comment);continue}let d=f?t(n,f,h,r):e(n,h.end,u,null,h,r);n.schema.compat&&fu(i.indent,f,r),a=d.range[2],l.items.push(d)}return l.range=[i.offset,a,c??a],l}function Li(t,e,n,i){let r="";if(t){let s=!1,o="";for(let l of t){let{source:a,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{n&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=a.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=a),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:r,offset:e}}var xb="Block collections are not allowed within flow collections",wb=t=>t&&(t.type==="block-map"||t.type==="block-seq");function hC({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",l=o?"flow map":"flow sequence",a=s?.nodeClass??(o?Qe:Ct),c=new a(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let b=0;b<i.items.length;++b){let p=i.items[b],{start:y,key:v,sep:S,value:w}=p,O=_i(y,{flow:l,indicator:"explicit-key-ind",next:v??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!S&&!w){b===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):b<i.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),O.comment&&(c.comment?c.comment+=`
119
+ `+O.comment:c.comment=O.comment),f=O.end;continue}!o&&n.options.strict&&hs(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${l} items`),O.comment){let k="";e:for(let A of y)switch(A.type){case"comma":case"space":break;case"comment":k=A.source.substring(1);break e;default:break e}if(k){let A=c.items[c.items.length-1];se(A)&&(A=A.value??A.key),A.comment?A.comment+=`
120
+ `+k:A.comment=k,O.comment=O.comment.substring(k.length+1)}}if(!o&&!S&&!O.found){let k=w?t(n,w,O,r):e(n,O.end,S,null,O,r);c.items.push(k),f=k.range[2],wb(w)&&r(k.range,"BLOCK_IN_FLOW",xb)}else{n.atKey=!0;let k=O.end,A=v?t(n,v,O,r):e(n,k,y,null,O,r);wb(v)&&r(A.range,"BLOCK_IN_FLOW",xb),n.atKey=!1;let D=_i(S??[],{flow:l,indicator:"map-value-ind",next:w,offset:A.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(D.found){if(!o&&!O.found&&n.options.strict){if(S)for(let R of S){if(R===D.found)break;if(R.type==="newline"){r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<D.found.offset-1024&&r(D.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?r(w,"MISSING_CHAR",`Missing space after : in ${l}`):r(D.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let E=w?t(n,w,D,r):D.found?e(n,D.end,S,null,D,r):null;E?wb(w)&&r(E.range,"BLOCK_IN_FLOW",xb):D.comment&&(A.comment?A.comment+=`
121
+ `+D.comment:A.comment=D.comment);let L=new je(A,E);if(n.options.keepSourceTokens&&(L.srcToken=p),o){let R=c;Ud(n,R.items,A)&&r(k,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(L)}else{let R=new Qe(n.schema);R.flow=!0,R.items.push(L);let Z=(E??A).range;R.range=[A.range[0],Z[1],Z[2]],c.items.push(R)}f=E?E.range[2]:D.end}}let h=o?"}":"]",[d,...m]=i.end,g=f;if(d?.source===h)g=d.offset+d.source.length;else{let b=l[0].toUpperCase()+l.substring(1),p=u?`${b} must end with a ${h}`:`${b} in block collection must be sufficiently indented and end with a ${h}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",p),d&&d.source.length!==1&&m.unshift(d)}if(m.length>0){let b=Li(m,g,n.options.strict,r);b.comment&&(c.comment?c.comment+=`
122
+ `+b.comment:c.comment=b.comment),c.range=[i.offset,g,b.offset]}else c.range=[i.offset,g,g];return c}function kb(t,e,n,i,r,s){let o=n.type==="block-map"?uC(t,e,n,i,s):n.type==="block-seq"?fC(t,e,n,i,s):hC(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function dC(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,h=>r(s,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){let{anchor:h,newlineAfterProp:d}=i,m=h&&s?h.offset>s.offset?h:s:h??s;m&&(!d||d.offset<m.offset)&&r(m,"MISSING_CHAR","Missing newline after block sequence props")}let l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Qe.tagName&&l==="map"||o===Ct.tagName&&l==="seq")return kb(t,e,n,r,o);let a=e.schema.tags.find(h=>h.tag===o&&h.collection===l);if(!a){let h=e.schema.knownTags[o];if(h?.collection===l)e.schema.tags.push(Object.assign({},h,{default:!1})),a=h;else return h?r(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${l} collection, but expects ${h.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),kb(t,e,n,r,o)}let c=kb(t,e,n,r,o,a),u=a.resolve?.(c,h=>r(s,"TAG_RESOLVE_FAILED",h),e.options)??c,f=oe(u)?u:new I(u);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Ab(t,e,n){let i=e.offset,r=bH(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?I.BLOCK_FOLDED:I.BLOCK_LITERAL,o=e.source?vH(e.source):[],l=o.length;for(let g=o.length-1;g>=0;--g){let b=o[g][1];if(b===""||b==="\r")l=g;else break}if(l===0){let g=r.chomp==="+"&&o.length>0?`
123
+ `.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:g,type:s,comment:r.comment,range:[i,b,b]}}let a=e.indent+r.indent,c=e.offset+r.length,u=0;for(let g=0;g<l;++g){let[b,p]=o[g];if(p===""||p==="\r")r.indent===0&&b.length>a&&(a=b.length);else{b.length<a&&n(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(a=b.length),u=g,a===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+p.length+1}for(let g=o.length-1;g>=l;--g)o[g][0].length>a&&(l=g+1);let f="",h="",d=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(a)+`
124
+ `;for(let g=u;g<l;++g){let[b,p]=o[g];c+=b.length+p.length+1;let y=p[p.length-1]==="\r";if(y&&(p=p.slice(0,-1)),p&&b.length<a){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-p.length-(y?2:1),"BAD_INDENT",S),b=""}s===I.BLOCK_LITERAL?(f+=h+b.slice(a)+p,h=`
125
+ `):b.length>a||p[0]===" "?(h===" "?h=`
126
126
  `:!d&&h===`
127
127
  `&&(h=`
128
128
 
129
- `),f+=h+b.slice(a)+y,h=`
130
- `,d=!0):y===""?h===`
129
+ `),f+=h+b.slice(a)+p,h=`
130
+ `,d=!0):p===""?h===`
131
131
  `?f+=`
132
132
  `:h=`
133
- `:(f+=h+y,h=" ",d=!1)}switch(r.chomp){case"-":break;case"+":for(let m=l;m<o.length;++m)f+=`
134
- `+o[m][0].slice(a);f[f.length-1]!==`
133
+ `:(f+=h+p,h=" ",d=!1)}switch(r.chomp){case"-":break;case"+":for(let g=l;g<o.length;++g)f+=`
134
+ `+o[g][0].slice(a);f[f.length-1]!==`
135
135
  `&&(f+=`
136
136
  `);break;default:f+=`
137
- `}let p=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,p,p]}}function cH({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,l="",a=-1;for(let h=1;h<r.length;++h){let d=r[h];if(!l&&(d==="-"||d==="+"))l=d;else{let p=Number(d);!o&&p?o=p:a===-1&&(a=t+h)}}a!==-1&&i(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let h=1;h<e.length;++h){let d=e[h];switch(d.type){case"space":c=!0;case"newline":f+=d.source.length;break;case"comment":n&&!c&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,u=d.source.substring(1);break;case"error":i(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let p=`Unexpected token in block scalar header: ${d.type}`;i(d,"UNEXPECTED_TOKEN",p);let m=d.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:s,indent:o,chomp:l,comment:u,length:f}}function uH(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function xb(t,e,n){let{offset:i,type:r,source:s,end:o}=t,l,a,c=(h,d,p)=>n(i+h,d,p);switch(r){case"scalar":l=q.PLAIN,a=fH(s,c);break;case"single-quoted-scalar":l=q.QUOTE_SINGLE,a=hH(s,c);break;case"double-quoted-scalar":l=q.QUOTE_DOUBLE,a=dH(s,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=Mi(o,u,e,n);return{value:a,type:l,comment:f.comment,range:[i,u,f.offset]}}function fH(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),lC(t)}function hH(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),lC(t.slice(1,-1)).replace(/''/g,"'")}function lC(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
137
+ `}let m=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,m,m]}}function bH({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,l="",a=-1;for(let h=1;h<r.length;++h){let d=r[h];if(!l&&(d==="-"||d==="+"))l=d;else{let m=Number(d);!o&&m?o=m:a===-1&&(a=t+h)}}a!==-1&&i(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let h=1;h<e.length;++h){let d=e[h];switch(d.type){case"space":c=!0;case"newline":f+=d.source.length;break;case"comment":n&&!c&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,u=d.source.substring(1);break;case"error":i(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;i(d,"UNEXPECTED_TOKEN",m);let g=d.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:s,indent:o,chomp:l,comment:u,length:f}}function vH(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function Ob(t,e,n){let{offset:i,type:r,source:s,end:o}=t,l,a,c=(h,d,m)=>n(i+h,d,m);switch(r){case"scalar":l=I.PLAIN,a=SH(s,c);break;case"single-quoted-scalar":l=I.QUOTE_SINGLE,a=xH(s,c);break;case"double-quoted-scalar":l=I.QUOTE_DOUBLE,a=wH(s,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=Li(o,u,e,n);return{value:a,type:l,comment:f.comment,range:[i,u,f.offset]}}function SH(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),pC(t)}function xH(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),pC(t.slice(1,-1)).replace(/''/g,"'")}function pC(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
138
138
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
139
139
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
140
140
  `?r+=s:s=`
141
- `:(r+=s+i[1],s=" "),o=n.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(t),r+s+(i?.[1]??"")}function dH(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
141
+ `:(r+=s+i[1],s=" "),o=n.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(t),r+s+(i?.[1]??"")}function wH(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
142
142
  `))if(r===`
143
- `){let{fold:s,offset:o}=pH(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=mH[s];if(o)n+=o;else if(s===`
143
+ `){let{fold:s,offset:o}=kH(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=AH[s];if(o)n+=o;else if(s===`
144
144
  `)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
145
- `)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;n+=gH(t,i+1,l,e),i+=l}else{let l=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
145
+ `)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;n+=OH(t,i+1,l,e),i+=l}else{let l=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
146
146
  `&&!(o==="\r"&&t[i+2]===`
147
- `)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function pH(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
147
+ `)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function kH(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
148
148
  `||i==="\r")&&!(i==="\r"&&t[e+2]!==`
149
149
  `);)i===`
150
150
  `&&(n+=`
151
- `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var mH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
152
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gH(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function wb(t,e,n,i){let{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?Sb(t,e,i):xb(e,t.options.strict,i),a=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[hn]:a?c=yH(t.schema,r,a,n,i):e.type==="scalar"?c=bH(t,r,e,i):c=t.schema[hn];let u;try{let f=c.resolve(r,h=>i(n??e,"TAG_RESOLVE_FAILED",h),t.options);u=K(f)?f:new q(f)}catch(f){let h=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",h),u=new q(r)}return u.range=l,u.source=r,s&&(u.type=s),a&&(u.tag=a),c.format&&(u.format=c.format),o&&(u.comment=o),u}function yH(t,e,n,i,r){if(n==="!")return t[hn];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[hn])}function bH({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(i))||n[hn];if(n.compat){let l=n.compat.find(a=>a.default&&a.test?.test(i))??n[hn];if(o.tag!==l.tag){let a=e.tagString(o.tag),c=e.tagString(l.tag),u=`Value may be parsed as either ${a} or ${c}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}function aC(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}var vH={composeNode:kb,composeEmptyNode:qd};function kb(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:a}=n,c,u=!0;switch(e.type){case"alias":c=SH(t,e,i),(l||a)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=wb(t,e,a,i),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=oC(vH,t,e,n,i),l&&(c.anchor=l.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=qd(t,e.offset,void 0,null,n,i)),l&&c.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!K(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function qd(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:a},c){let u={type:"scalar",offset:aC(e,n,i),indent:-1,source:""},f=wb(t,u,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=a),f}function SH({options:t},{offset:e,source:n,end:i},r){let s=new cr(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,l=Mi(i,o,t.strict,r);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}function cC(t,e,{offset:n,start:i,value:r,end:s},o){let l=Object.assign({_directives:e},t),a=new ss(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},u=Di(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(a.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=r?kb(c,r,u,o):qd(c,u.end,i,null,u,o);let f=a.contents.range[2],h=Mi(s,f,!1,o);return h.comment&&(a.comment=h.comment),a.range=[n,f,h.offset],a}function lu(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function uC(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
151
+ `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var AH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
152
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function OH(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function Tb(t,e,n,i){let{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?Ab(t,e,i):Ob(e,t.options.strict,i),a=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[mn]:a?c=TH(t.schema,r,a,n,i):e.type==="scalar"?c=CH(t,r,e,i):c=t.schema[mn];let u;try{let f=c.resolve(r,h=>i(n??e,"TAG_RESOLVE_FAILED",h),t.options);u=Y(f)?f:new I(f)}catch(f){let h=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",h),u=new I(r)}return u.range=l,u.source=r,s&&(u.type=s),a&&(u.tag=a),c.format&&(u.format=c.format),o&&(u.comment=o),u}function TH(t,e,n,i,r){if(n==="!")return t[mn];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[mn])}function CH({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(i))||n[mn];if(n.compat){let l=n.compat.find(a=>a.default&&a.test?.test(i))??n[mn];if(o.tag!==l.tag){let a=e.tagString(o.tag),c=e.tagString(l.tag),u=`Value may be parsed as either ${a} or ${c}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}function mC(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}var EH={composeNode:Cb,composeEmptyNode:Fd};function Cb(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:a}=n,c,u=!0;switch(e.type){case"alias":c=DH(t,e,i),(l||a)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Tb(t,e,a,i),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=dC(EH,t,e,n,i),l&&(c.anchor=l.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Fd(t,e.offset,void 0,null,n,i)),l&&c.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!Y(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Fd(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:a},c){let u={type:"scalar",offset:mC(e,n,i),indent:-1,source:""},f=Tb(t,u,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=a),f}function DH({options:t},{offset:e,source:n,end:i},r){let s=new pr(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,l=Li(i,o,t.strict,r);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}function gC(t,e,{offset:n,start:i,value:r,end:s},o){let l=Object.assign({_directives:e},t),a=new fs(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},u=_i(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(a.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=r?Cb(c,r,u,o):Fd(c,u.end,i,null,u,o);let f=a.contents.range[2],h=Li(s,f,!1,o);return h.comment&&(a.comment=h.comment),a.range=[n,f,h.offset],a}function hu(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function yC(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
153
153
 
154
154
  `:`
155
- `)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var au=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=lu(n);s?this.warnings.push(new su(o,i,r)):this.errors.push(new ei(o,i,r))},this.directives=new Ci({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=uC(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
156
- ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(de(s)&&!s.flow&&s.items.length>0){let o=s.items[0];re(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${i}
155
+ `)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var du=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=hu(n);s?this.warnings.push(new uu(o,i,r)):this.errors.push(new ni(o,i,r))},this.directives=new Ni({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=yC(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
156
+ ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(pe(s)&&!s.flow&&s.items.length>0){let o=s.items[0];se(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${i}
157
157
  ${l}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
158
- ${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:uC(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=lu(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=cC(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new ei(lu(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new ei(lu(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Mi(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
159
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ei(lu(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new ss(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};var Ab=Symbol("break visit"),xH=Symbol("skip children"),fC=Symbol("remove item");function Xs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),hC(Object.freeze([]),t,e)}Xs.BREAK=Ab;Xs.SKIP=xH;Xs.REMOVE=fC;Xs.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};Xs.parentCollection=(t,e)=>{let n=Xs.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function hC(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let l=hC(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof l=="number")o=l-1;else{if(l===Ab)return Ab;l===fC&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}var Ob="\uFEFF",Tb="",Cb="",Pd="";function dC(t){switch(t){case Ob:return"byte-order-mark";case Tb:return"doc-mode";case Cb:return"flow-error-end";case Pd:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
158
+ ${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yC(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=hu(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=gC(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new ni(hu(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new ni(hu(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Li(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
159
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ni(hu(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new fs(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};var Eb=Symbol("break visit"),MH=Symbol("skip children"),bC=Symbol("remove item");function to(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),vC(Object.freeze([]),t,e)}to.BREAK=Eb;to.SKIP=MH;to.REMOVE=bC;to.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};to.parentCollection=(t,e)=>{let n=to.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function vC(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let l=vC(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof l=="number")o=l-1;else{if(l===Eb)return Eb;l===bC&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}var Db="\uFEFF",Mb="",Nb="",jd="";function SC(t){switch(t){case Db:return"byte-order-mark";case Mb:return"doc-mode";case Nb:return"flow-error-end";case jd:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
160
160
  `:case`\r
161
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ti(t){switch(t){case void 0:case" ":case`
162
- `:case"\r":case" ":return!0;default:return!1}}var pC=new Set("0123456789ABCDEFabcdef"),kH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),zd=new Set(",[]{}"),AH=new Set(` ,[]{}
163
- \r `),Eb=t=>!t||AH.has(t),cu=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
161
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ii(t){switch(t){case void 0:case" ":case`
162
+ `:case"\r":case" ":return!0;default:return!1}}var xC=new Set("0123456789ABCDEFabcdef"),RH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vd=new Set(",[]{}"),_H=new Set(` ,[]{}
163
+ \r `),Rb=t=>!t||_H.has(t),pu=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
164
164
  `?!0:n==="\r"?this.buffer[e+1]===`
165
165
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
166
166
  `||!r&&!this.atEnd)return e+i+1}return n===`
167
- `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ti(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
168
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ob&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Tb,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ti(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ti(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ti(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Eb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ti(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Cb,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Eb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ti(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
167
+ `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ii(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
168
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Db&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Mb,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ii(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ii(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ii(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ii(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Nb,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Rb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ii(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
169
169
  `,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
170
- `,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ti(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
170
+ `,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ii(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
171
171
  `:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
172
172
  `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
173
173
  `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
174
174
  `;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let l=s;for(;o===" ";)o=this.buffer[--s];if(o===`
175
- `&&s>=this.pos&&s+1+n>l)e=s;else break}while(!0);return yield Pd,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ti(s)||e&&zd.has(s))break;n=i}else if(ti(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
175
+ `&&s>=this.pos&&s+1+n>l)e=s;else break}while(!0);return yield jd,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ii(s)||e&&Vd.has(s))break;n=i}else if(ii(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
176
176
  `?(i+=1,r=`
177
- `,s=this.buffer[i+1]):n=i),s==="#"||e&&zd.has(s))break;if(r===`
178
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&zd.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Pd,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Eb),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ti(i)||n&&zd.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ti(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(kH.has(n))n=this.buffer[++e];else if(n==="%"&&pC.has(this.buffer[e+1])&&pC.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
177
+ `,s=this.buffer[i+1]):n=i),s==="#"||e&&Vd.has(s))break;if(r===`
178
+ `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Vd.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield jd,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Rb),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ii(i)||n&&Vd.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ii(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(RH.has(n))n=this.buffer[++e];else if(n==="%"&&xC.has(this.buffer[e+1])&&xC.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
179
179
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
180
- `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var uu=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};function ls(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function mC(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function yC(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Hd(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function zl(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Ud(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function gC(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ls(e.start,"explicit-key-ind")&&!ls(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,yC(e.value)?e.value.end?Ud(e.value.end,e.sep):e.value.end=e.sep:Ud(e.start,e.sep),delete e.sep)}var fu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new cu,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=dC(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&gC(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&mC(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{mC(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Hd(this.peek(2)),i=zl(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
180
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var mu=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};function ds(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function wC(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function AC(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Yd(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Kl(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Kd(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function kC(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ds(e.start,"explicit-key-ind")&&!ds(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,AC(e.value)?e.value.end?Kd(e.value.end,e.sep):e.value.end=e.sep:Kd(e.start,e.sep),delete e.sep)}var gu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new pu,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=SC(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&kC(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&wC(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{wC(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Yd(this.peek(2)),i=Kl(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
181
181
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
182
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Ud(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let l=0;l<n.sep.length;++l){let a=n.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ls(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(yC(n.key)&&!ls(n.sep,"newline")){let o=zl(n.start),l=n.key,a=n.sep;a.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(ls(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=zl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ls(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ls(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Ud(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ls(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Hd(i),s=zl(r);gC(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
182
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Kd(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let l=0;l<n.sep.length;++l){let a=n.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ds(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(AC(n.key)&&!ds(n.sep,"newline")){let o=Kl(n.start),l=n.key,a=n.sep;a.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(ds(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Kl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ds(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ds(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Kd(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ds(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Yd(i),s=Kl(r);kC(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
183
183
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
184
- `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Hd(e),i=zl(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Hd(e),i=zl(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function OH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new uu||null,prettyErrors:e}}function Db(t,e={}){let{lineCounter:n,prettyErrors:i}=OH(e),r=new fu(n?.addNewLine),s=new au(e),o=null;for(let l of s.compose(r.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ei(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(gb(t,n)),o.warnings.forEach(gb(t,n))),o}function CH(t){let e=[0];for(let n=0;n<t.length;n++)t[n]===`
185
- `&&e.push(n+1);return e}function EH(t,e,n,i){let r=Math.min(Math.max(t-1,0),n.length-1);return Math.min(n[r]+Math.max(e-1,0),i)}function DH(t){if(Pt(t)&&t.items.length>0){let e=t.items[0].key;if(K(e)&&e.range)return[e.range[0],e.range[1]]}return null}function Mb(t,e){if(Pt(t)){for(let n of t.items)if(K(n.key)&&String(n.key.value)===e&&n.key.range)return[n.key.range[0],n.key.range[1]];for(let n of t.items){let i=Mb(n.value,e);if(i)return i}}else if(zt(t))for(let n of t.items){let i=Mb(n,e);if(i)return i}return null}function Fd(t,e){if(e.length===0)return null;if(e.length===1)return Mb(t,e[0]);let[n,...i]=e;if(Pt(t)){for(let r of t.items)if(K(r.key)&&String(r.key.value)===n){let s=Fd(r.value,i);if(s)return s}for(let r of t.items){let s=Fd(r.value,e);if(s)return s}}else if(zt(t))for(let r of t.items){let s=Fd(r,e);if(s)return s}return null}function MH(t,e,n,i,r){if(t.itemId&&n){let s=e.get(t.itemId);if(s){let o=n.get(s.section);if(zt(o)){let l=o.items[s.index];if(l!==void 0){if(t.fieldKey){let c=Fd(l,t.fieldKey.split("."));if(c)return c}let a=DH(l);if(a)return a}}}}if(t.line!==void 0){let s=EH(t.line,t.column??1,i,r);return[s,Math.min(s+1,r)]}return null}function Nb(t,e,n){let i=new Map;e.constraints.forEach((l,a)=>i.set(l.id,{section:"constraints",index:a})),e.directives.forEach((l,a)=>i.set(l.id,{section:"directives",index:a}));let r=null;try{r=Db(t)}catch{r=null}let s=CH(t),o=t.length;return n.map(l=>{let a=MH(l,i,r,s,o);if(!a)return{...l};let c=Math.max(0,Math.min(a[0],o)),u=Math.max(c,Math.min(a[1],o));return{...l,from:c,to:u}})}function Rb(t,e){if(t.trim()==="")return[];let n;try{n=Cl(t)}catch(r){let s=r,o={severity:"error",code:"yaml-syntax",source:"yaml",message:`YAML syntax error: ${s.message}`,...s.line!==void 0?{line:s.line}:{},...s.column!==void 0?{column:s.column}:{}};return Nb(t,{constraints:[],directives:[]},[o])}let i=jc(n,e).filter(r=>r.severity==="error"||r.severity==="warning");return Nb(t,n,i)}var bC={types:[],relations:[]},vC=new Set(["univ","Int","seq/Int","iden","none","String"]);function NH(t){return t.isBuiltin===!0?!0:vC.has(t.id)}function RH(t){return t.length===0?!1:t.every(e=>vC.has(e))}function _H(t){let e;try{e=t.getTypes()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{if(!r||typeof r.id!="string"||r.id.length===0||NH(r)||i.has(r.id))continue;i.add(r.id);let s=[],o=new Set;if(Array.isArray(r.atoms))for(let l of r.atoms){let a=l&&typeof l.label=="string"&&l.label.length>0?l.label:l&&typeof l.id=="string"?l.id:void 0;a!==void 0&&!o.has(a)&&(o.add(a),s.push(a))}n.push({name:r.id,atoms:s})}catch{continue}return n}function LH(t){let e;try{e=t.getRelations()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{let s=r&&typeof r.name=="string"&&r.name.length>0?r.name:void 0;if(s===void 0)continue;let o=Array.isArray(r.types)?r.types.filter(c=>typeof c=="string"):[];if(RH(o))continue;let l=`${s}\0${o.join("\0")}`;if(i.has(l))continue;i.add(l);let a={name:s};o.length>0&&(a.arity=o.length,a.typeSignature=o),n.push(a)}catch{continue}return n}function _b(t){if(t==null)return bC;try{return{types:_H(t),relations:LH(t)}}catch{return bC}}var BH=["univ","none","iden","Int"],IH=["all","some","no","one","lone","set","sum","let","disj"],qH=["in","and","or","not","implies","iff","else"],PH=[{insert:".",detail:"join"},{insert:"->",detail:"product"},{insert:"+",detail:"union"},{insert:"&",detail:"intersection"},{insert:"-",detail:"difference"},{insert:"~",detail:"transpose"},{insert:"^",detail:"transitive closure"},{insert:"*",detail:"reflexive-transitive closure"},{insert:"#",detail:"cardinality"}],Lb;function xC(){if(Lb)return Lb.map(e=>({...e}));let t=[];for(let e of BH)t.push({label:e,kind:"keyword",detail:"built-in"});for(let e of IH)t.push({label:e,kind:"keyword",detail:"quantifier"});for(let e of qH)t.push({label:e,kind:"keyword",detail:"operator"});for(let e of PH)t.push({label:e.insert,insertText:e.insert,kind:"snippet",detail:e.detail});return Lb=t,t.map(e=>({...e}))}function wC(t){let e=[];for(let s of t.types)e.push({label:s.name,kind:"type",detail:"type"});for(let s of t.relations)e.push({label:s.name,kind:"relation",detail:s.arity!==void 0?`relation \xB7 arity ${s.arity}`:"relation"});let n=new Set(t.types.map(s=>s.name)),i=new Set,r=0;for(let s of t.types){if(r>=200)break;for(let o of s.atoms){if(r>=200)break;i.has(o)||n.has(o)||(i.add(o),e.push({label:o,kind:"atom",detail:`atom \xB7 ${s.name}`}),r+=1)}}return e}function zH(t,e){if(e.length===0)return 0;let n=t.toLowerCase(),i=e.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2}function SC(t){switch(t){case"type":return 0;case"relation":return 1;case"atom":return 2;case"keyword":return 3;case"snippet":return 4;default:return 5}}function HH(t){return`${t.label}\0${t.insertText??t.label}`}function Bb(t){let e=[];t&&e.push(...wC(t)),e.push(...xC());let n=kC(e);return i=>{let r=[];return n.forEach((s,o)=>{let l=zH(s.label,i);l<2&&r.push({c:s,rank:l,idx:o})}),r.sort((s,o)=>{if(s.rank!==o.rank)return s.rank-o.rank;let l=SC(s.c.kind),a=SC(o.c.kind);return l!==a?l-a:s.c.label.length!==o.c.label.length?s.c.label.length-o.c.label.length:s.idx-o.idx}),r.map(s=>s.c)}}function Ib(...t){let e=[];for(let n of t)for(let i of n)e.push(i);return kC(e)}function kC(t){let e=new Set,n=[];for(let i of t){let r=HH(i);e.has(r)||(e.add(r),n.push(i))}return n}var OC={accent:"#b5431a",accentText:"#fdf6ec",surface:"#faf8f2",surfaceRaised:"#f1ecdf",border:"#d9d2c0",text:"#221d14",textMuted:"#6e6553",danger:"#a32014",warning:"#8a6200",success:"#2f6c43",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#6d28a8",synType:"#0e6b6b",synRelation:"#1f4f9e",synOperator:"#b5431a",synString:"#7a5901",synComment:"#8a8170"},TC={accent:"#e08a3c",accentText:"#16100a",surface:"#12161e",surfaceRaised:"#1a202b",border:"#2d3645",text:"#e7e2d3",textMuted:"#94865f",danger:"#e06c5d",warning:"#d4a843",success:"#5fb98a",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#b48ee0",synType:"#5fb3a1",synRelation:"#7ba3e8",synOperator:"#e08a3c",synString:"#cfa75e",synComment:"#6e7889"},AC={accent:"--spytial-ed-accent",accentText:"--spytial-ed-accent-text",surface:"--spytial-ed-surface",surfaceRaised:"--spytial-ed-surface-raised",border:"--spytial-ed-border",text:"--spytial-ed-text",textMuted:"--spytial-ed-text-muted",danger:"--spytial-ed-danger",warning:"--spytial-ed-warning",success:"--spytial-ed-success",fontFamily:"--spytial-ed-font-family",monoFontFamily:"--spytial-ed-mono-font-family",fontSize:"--spytial-ed-font-size",radius:"--spytial-ed-radius",spacing:"--spytial-ed-spacing",synKeyword:"--spytial-ed-syn-keyword",synType:"--spytial-ed-syn-type",synRelation:"--spytial-ed-syn-relation",synOperator:"--spytial-ed-syn-operator",synString:"--spytial-ed-syn-string",synComment:"--spytial-ed-syn-comment"};function qb(t){let e={};return Object.keys(AC).forEach(n=>{let i=t[n];i!=null&&(e[AC[n]]=i)}),e}var CC=new Map([["light",OC],["dark",TC]]);function Pb(t){for(let[e,n]of Object.entries(t))CC.set(e,n)}function zb(t){if(t!==void 0)return typeof t=="string"?CC.get(t):t}var UH=new Set(["univ","none","iden","all","some","no","one","lone","set","sum","let","disj","count","and","or","not","implies","else","in"]),FH=["->","<:",":>","<=",">=","=<","=>","!="],jH=new Set(["+","-","&","~","*","^",".","<",">","=","!","#"]);var VH=/[A-Za-z_$]/,YH=/[A-Za-z0-9_$]/,jd=/[0-9]/,EC=/\s/;function Hb(t){let e=[],n=t.length,i=0,r=(s,o,l)=>{e.push({kind:s,text:t.slice(o,l),start:o,end:l})};for(;i<n;){let s=t[i];if(EC.test(s)){let l=i;for(;i<n&&EC.test(t[i]);)i++;r("whitespace",l,i);continue}if(s==="-"&&t[i+1]==="-"||s==="/"&&t[i+1]==="/"){let l=i;for(i+=2;i<n&&t[i]!==`
184
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Yd(e),i=Kl(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Yd(e),i=Kl(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function LH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new mu||null,prettyErrors:e}}function _b(t,e={}){let{lineCounter:n,prettyErrors:i}=LH(e),r=new gu(n?.addNewLine),s=new du(e),o=null;for(let l of s.compose(r.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ni(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(Sb(t,n)),o.warnings.forEach(Sb(t,n))),o}function IH(t){let e=[0];for(let n=0;n<t.length;n++)t[n]===`
185
+ `&&e.push(n+1);return e}function qH(t,e,n,i){let r=Math.min(Math.max(t-1,0),n.length-1);return Math.min(n[r]+Math.max(e-1,0),i)}function PH(t){if(zt(t)&&t.items.length>0){let e=t.items[0].key;if(Y(e)&&e.range)return[e.range[0],e.range[1]]}return null}function Lb(t,e){if(zt(t)){for(let n of t.items)if(Y(n.key)&&String(n.key.value)===e&&n.key.range)return[n.key.range[0],n.key.range[1]];for(let n of t.items){let i=Lb(n.value,e);if(i)return i}}else if(Ht(t))for(let n of t.items){let i=Lb(n,e);if(i)return i}return null}function Qd(t,e){if(e.length===0)return null;if(e.length===1)return Lb(t,e[0]);let[n,...i]=e;if(zt(t)){for(let r of t.items)if(Y(r.key)&&String(r.key.value)===n){let s=Qd(r.value,i);if(s)return s}for(let r of t.items){let s=Qd(r.value,e);if(s)return s}}else if(Ht(t))for(let r of t.items){let s=Qd(r,e);if(s)return s}return null}function zH(t,e,n,i,r){if(t.itemId&&n){let s=e.get(t.itemId);if(s){let o=n.get(s.section);if(Ht(o)){let l=o.items[s.index];if(l!==void 0){if(t.fieldKey){let c=Qd(l,t.fieldKey.split("."));if(c)return c}let a=PH(l);if(a)return a}}}}if(t.line!==void 0){let s=qH(t.line,t.column??1,i,r);return[s,Math.min(s+1,r)]}return null}function Bb(t,e,n){let i=new Map;e.constraints.forEach((l,a)=>i.set(l.id,{section:"constraints",index:a})),e.directives.forEach((l,a)=>i.set(l.id,{section:"directives",index:a}));let r=null;try{r=_b(t)}catch{r=null}let s=IH(t),o=t.length;return n.map(l=>{let a=zH(l,i,r,s,o);if(!a)return{...l};let c=Math.max(0,Math.min(a[0],o)),u=Math.max(c,Math.min(a[1],o));return{...l,from:c,to:u}})}function Ib(t,e){if(t.trim()==="")return[];let n;try{n=Ll(t)}catch(r){let s=r,o={severity:"error",code:"yaml-syntax",source:"yaml",message:`YAML syntax error: ${s.message}`,...s.line!==void 0?{line:s.line}:{},...s.column!==void 0?{column:s.column}:{}};return Bb(t,{constraints:[],directives:[]},[o])}let i=$c(n,e).filter(r=>r.severity==="error"||r.severity==="warning");return Bb(t,n,i)}var OC={types:[],relations:[]},TC=new Set(["univ","Int","seq/Int","iden","none","String"]);function HH(t){return t.isBuiltin===!0?!0:TC.has(t.id)}function UH(t){return t.length===0?!1:t.every(e=>TC.has(e))}function FH(t){let e;try{e=t.getTypes()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{if(!r||typeof r.id!="string"||r.id.length===0||HH(r)||i.has(r.id))continue;i.add(r.id);let s=[],o=new Set;if(Array.isArray(r.atoms))for(let l of r.atoms){let a=l&&typeof l.label=="string"&&l.label.length>0?l.label:l&&typeof l.id=="string"?l.id:void 0;a!==void 0&&!o.has(a)&&(o.add(a),s.push(a))}n.push({name:r.id,atoms:s})}catch{continue}return n}function jH(t){let e;try{e=t.getRelations()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{let s=r&&typeof r.name=="string"&&r.name.length>0?r.name:void 0;if(s===void 0)continue;let o=Array.isArray(r.types)?r.types.filter(c=>typeof c=="string"):[];if(UH(o))continue;let l=`${s}\0${o.join("\0")}`;if(i.has(l))continue;i.add(l);let a={name:s};o.length>0&&(a.arity=o.length,a.typeSignature=o),n.push(a)}catch{continue}return n}function qb(t){if(t==null)return OC;try{return{types:FH(t),relations:jH(t)}}catch{return OC}}var VH=["univ","none","iden","Int"],YH=["all","some","no","one","lone","set","sum","let","disj"],KH=["in","and","or","not","implies","iff","else"],QH=[{insert:".",detail:"join"},{insert:"->",detail:"product"},{insert:"+",detail:"union"},{insert:"&",detail:"intersection"},{insert:"-",detail:"difference"},{insert:"~",detail:"transpose"},{insert:"^",detail:"transitive closure"},{insert:"*",detail:"reflexive-transitive closure"},{insert:"#",detail:"cardinality"}],Pb;function EC(){if(Pb)return Pb.map(e=>({...e}));let t=[];for(let e of VH)t.push({label:e,kind:"keyword",detail:"built-in"});for(let e of YH)t.push({label:e,kind:"keyword",detail:"quantifier"});for(let e of KH)t.push({label:e,kind:"keyword",detail:"operator"});for(let e of QH)t.push({label:e.insert,insertText:e.insert,kind:"snippet",detail:e.detail});return Pb=t,t.map(e=>({...e}))}function DC(t){let e=[];for(let s of t.types)e.push({label:s.name,kind:"type",detail:"type"});for(let s of t.relations)e.push({label:s.name,kind:"relation",detail:s.arity!==void 0?`relation \xB7 arity ${s.arity}`:"relation"});let n=new Set(t.types.map(s=>s.name)),i=new Set,r=0;for(let s of t.types){if(r>=200)break;for(let o of s.atoms){if(r>=200)break;i.has(o)||n.has(o)||(i.add(o),e.push({label:o,kind:"atom",detail:`atom \xB7 ${s.name}`}),r+=1)}}return e}function $H(t,e){if(e.length===0)return 0;let n=t.toLowerCase(),i=e.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2}function CC(t){switch(t){case"type":return 0;case"relation":return 1;case"atom":return 2;case"keyword":return 3;case"snippet":return 4;default:return 5}}function GH(t){return`${t.label}\0${t.insertText??t.label}`}function zb(t){let e=[];t&&e.push(...DC(t)),e.push(...EC());let n=MC(e);return i=>{let r=[];return n.forEach((s,o)=>{let l=$H(s.label,i);l<2&&r.push({c:s,rank:l,idx:o})}),r.sort((s,o)=>{if(s.rank!==o.rank)return s.rank-o.rank;let l=CC(s.c.kind),a=CC(o.c.kind);return l!==a?l-a:s.c.label.length!==o.c.label.length?s.c.label.length-o.c.label.length:s.idx-o.idx}),r.map(s=>s.c)}}function Hb(...t){let e=[];for(let n of t)for(let i of n)e.push(i);return MC(e)}function MC(t){let e=new Set,n=[];for(let i of t){let r=GH(i);e.has(r)||(e.add(r),n.push(i))}return n}var RC={accent:"#b5431a",accentText:"#fdf6ec",surface:"#faf8f2",surfaceRaised:"#f1ecdf",border:"#d9d2c0",text:"#221d14",textMuted:"#6e6553",danger:"#a32014",warning:"#8a6200",success:"#2f6c43",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#6d28a8",synType:"#0e6b6b",synRelation:"#1f4f9e",synOperator:"#b5431a",synString:"#7a5901",synComment:"#8a8170"},_C={accent:"#e08a3c",accentText:"#16100a",surface:"#12161e",surfaceRaised:"#1a202b",border:"#2d3645",text:"#e7e2d3",textMuted:"#94865f",danger:"#e06c5d",warning:"#d4a843",success:"#5fb98a",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#b48ee0",synType:"#5fb3a1",synRelation:"#7ba3e8",synOperator:"#e08a3c",synString:"#cfa75e",synComment:"#6e7889"},NC={accent:"--spytial-ed-accent",accentText:"--spytial-ed-accent-text",surface:"--spytial-ed-surface",surfaceRaised:"--spytial-ed-surface-raised",border:"--spytial-ed-border",text:"--spytial-ed-text",textMuted:"--spytial-ed-text-muted",danger:"--spytial-ed-danger",warning:"--spytial-ed-warning",success:"--spytial-ed-success",fontFamily:"--spytial-ed-font-family",monoFontFamily:"--spytial-ed-mono-font-family",fontSize:"--spytial-ed-font-size",radius:"--spytial-ed-radius",spacing:"--spytial-ed-spacing",synKeyword:"--spytial-ed-syn-keyword",synType:"--spytial-ed-syn-type",synRelation:"--spytial-ed-syn-relation",synOperator:"--spytial-ed-syn-operator",synString:"--spytial-ed-syn-string",synComment:"--spytial-ed-syn-comment"};function Ub(t){let e={};return Object.keys(NC).forEach(n=>{let i=t[n];i!=null&&(e[NC[n]]=i)}),e}var LC=new Map([["light",RC],["dark",_C]]);function Fb(t){for(let[e,n]of Object.entries(t))LC.set(e,n)}function jb(t){if(t!==void 0)return typeof t=="string"?LC.get(t):t}var XH=new Set(["univ","none","iden","all","some","no","one","lone","set","sum","let","disj","count","and","or","not","implies","else","in"]),WH=["->","<:",":>","<=",">=","=<","=>","!="],ZH=new Set(["+","-","&","~","*","^",".","<",">","=","!","#"]);var JH=/[A-Za-z_$]/,eU=/[A-Za-z0-9_$]/,$d=/[0-9]/,BC=/\s/;function Vb(t){let e=[],n=t.length,i=0,r=(s,o,l)=>{e.push({kind:s,text:t.slice(o,l),start:o,end:l})};for(;i<n;){let s=t[i];if(BC.test(s)){let l=i;for(;i<n&&BC.test(t[i]);)i++;r("whitespace",l,i);continue}if(s==="-"&&t[i+1]==="-"||s==="/"&&t[i+1]==="/"){let l=i;for(i+=2;i<n&&t[i]!==`
186
186
  `;)i++;r("comment",l,i);continue}if(s==='"'||s==="'"){let l=s,a=i;for(i++;i<n&&t[i]!==l&&t[i]!==`
187
- `;)t[i]==="\\"&&i+1<n?i+=2:i++;i<n&&t[i]===l&&i++,r("string",a,i);continue}if(jd.test(s)){let l=i;for(;i<n&&jd.test(t[i]);)i++;if(i<n&&t[i]==="."&&i+1<n&&jd.test(t[i+1]))for(i++;i<n&&jd.test(t[i]);)i++;r("number",l,i);continue}if(VH.test(s)){let l=i;for(i++;i<n&&YH.test(t[i]);)i++;let a=t.slice(l,i);r(UH.has(a)?"keyword":"identifier",l,i);continue}let o=t.slice(i,i+2);if(FH.includes(o)){r("operator",i,i+2),i+=2;continue}if(jH.has(s)){r("operator",i,i+1),i++;continue}r("punctuation",i,i+1),i++}return e}function Ub(t){switch(t){case"keyword":return"spytial-ed-syn-keyword";case"operator":return"spytial-ed-syn-operator";case"string":return"spytial-ed-syn-string";case"number":return"spytial-ed-syn-number";case"identifier":return"spytial-ed-syn-identifier";case"comment":return"spytial-ed-syn-comment";default:return}}var W=Ve(di());var Vd=Ve(di());function hu(t,e,n){let{align:i="start",gap:r=2,estimatedHeight:s=280}=n??{},[o,l]=(0,Vd.useState)({});return(0,Vd.useLayoutEffect)(()=>{if(!t){l({});return}let a=()=>{let c=e.current;if(!c)return;let u=c.getBoundingClientRect(),f=window.innerWidth||document.documentElement.clientWidth,h=window.innerHeight||document.documentElement.clientHeight,d=h-u.bottom-r,p=u.top-r,m=d<s&&p>d,b={maxHeight:Math.max(120,(m?p:d)-8)};m?b.bottom=h-u.top+r:b.top=u.bottom+r,i==="end"?b.right=Math.max(8,f-u.right):i==="stretch"?(b.left=u.left,b.width=u.width):b.left=u.left,l(b)};return a(),window.addEventListener("resize",a),document.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),document.removeEventListener("scroll",a,!0)}},[t,e,i,r,s]),o}var oe=Ve(dn()),GH=150,$H=/[A-Za-z0-9_$]/;function XH(t){if(!(!t||t.length===0))return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}function WH(t,e){let n=e;for(;n>0&&$H.test(t[n-1]);)n--;return{prefix:t.slice(n,e),start:n}}var RC=({value:t})=>{let e=(0,W.useMemo)(()=>Hb(t),[t]);return(0,oe.jsxs)(oe.Fragment,{children:[e.map((n,i)=>{let r=Ub(n.kind);return r?(0,oe.jsx)("span",{className:r,children:n.text},i):(0,oe.jsx)(W.default.Fragment,{children:n.text},i)}),t.endsWith(`
188
- `)?"\u200B":null]})},Fb=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let h=(0,W.useRef)(null),d=(0,W.useRef)(null),p=(0,W.useId)(),m=`${p}-listbox`,b=H=>`${p}-opt-${H}`,y=`${p}-diag`,[g,v]=(0,W.useState)(!1),[S,w]=(0,W.useState)([]),[A,k]=(0,W.useState)(0),O=(0,W.useRef)(0),M=(0,W.useRef)(null),E=(0,W.useRef)(0),[L,R]=(0,W.useState)(!1),[j,pe]=(0,W.useState)(""),[Ee,Vt]=(0,W.useState)(!1),[xe,xn]=(0,W.useState)(null),[Ze,jn]=(0,W.useState)(null),at=(0,W.useRef)(null),Je=XH(l),et=(0,W.useCallback)(()=>{let H=h.current,J=d.current;!H||!J||(J.scrollTop=H.scrollTop,J.scrollLeft=H.scrollLeft)},[]),Nt=(0,W.useRef)(0),Yt=(0,W.useCallback)(()=>{let H=h.current;if(H){if(H.value===""){H.style.height="",Nt.current=0;return}if(H.clientWidth<60){Nt.current<10&&(Nt.current+=1,requestAnimationFrame(Yt));return}Nt.current=0,H.style.height="auto",H.style.height=`${H.scrollHeight}px`}},[]);(0,W.useEffect)(()=>{Yt(),et()},[t,Yt,et]);let Vn=(0,W.useCallback)((H,J)=>{if(!s)return;let{prefix:Os,start:Ts}=WH(H,J);E.current=Ts,M.current&&clearTimeout(M.current);let I=++O.current;M.current=setTimeout(()=>{let me;try{me=s(Os)}catch{return}Promise.resolve(me).then(ze=>{if(I===O.current){if(!ze||ze.length===0){w([]),v(!1);return}w(ze),k(0),v(!0)}}).catch(()=>{I===O.current&&(w([]),v(!1))})},GH)},[s]),Yn=(0,W.useCallback)(()=>{O.current++,M.current&&clearTimeout(M.current),v(!1),w([])},[]),Ca=(0,W.useCallback)(H=>{let J=h.current,Os=J?J.selectionStart:t.length,Ts=H.insertText??H.label,I=t.slice(0,E.current)+Ts+t.slice(Os);e(I),Yn();let me=E.current+Ts.length;requestAnimationFrame(()=>{let ze=h.current;ze&&(ze.focus(),ze.setSelectionRange(me,me))})},[t,e,Yn]),Um=(0,W.useCallback)(H=>{let J=H.target.value;e(J),Vn(J,H.target.selectionStart)},[e,Vn]),Fm=(0,W.useCallback)(H=>{if(H.code==="Space"&&(H.ctrlKey||H.metaKey)){H.preventDefault();let J=h.current;J&&Vn(J.value,J.selectionStart);return}if(!(!g||S.length===0))switch(H.key){case"ArrowDown":H.preventDefault(),k(J=>(J+1)%S.length);break;case"ArrowUp":H.preventDefault(),k(J=>(J-1+S.length)%S.length);break;case"Enter":case"Tab":H.preventDefault(),Ca(S[A]);break;case"Escape":H.preventDefault(),Yn();break;default:break}},[g,S,A,Ca,Yn,Vn]),jm=(0,W.useCallback)(H=>{let J=H.relatedTarget;J&&d.current?.parentElement?.contains(J)||Yn()},[Yn]),Vm=(0,W.useCallback)(()=>{R(!0),xn(null),jn(null),requestAnimationFrame(()=>at.current?.focus())},[]),To=(0,W.useCallback)(()=>{R(!1),Vt(!1),xn(null),jn(null),pe("")},[]),Co=(0,W.useCallback)(async()=>{if(!o||Ee)return;let H=j.trim();if(H){Vt(!0),xn(null),jn(null);try{let J=await o(H);jn(J)}catch(J){xn(J instanceof Error?J.message:"Synthesis failed. Try again.")}finally{Vt(!1)}}},[o,Ee,j]),Ea=(0,W.useCallback)(()=>{Ze&&(e(Ze.value),To(),requestAnimationFrame(()=>h.current?.focus()))},[Ze,e,To]);(0,W.useEffect)(()=>()=>{M.current&&clearTimeout(M.current)},[]);let Ym=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),Km=l&&l.length>0?y:void 0,kf=hu(g&&S.length>0,h,{align:"stretch",estimatedHeight:224});return(0,oe.jsxs)("div",{className:`spytial-ed-selector${Je?` spytial-ed-selector--${Je}`:""}${c?` ${c}`:""}`,children:[(0,oe.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,oe.jsx)("pre",{ref:d,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,oe.jsx)(RC,{value:t})}):null,(0,oe.jsx)("textarea",{ref:h,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:Um,onScroll:et,onKeyDown:Fm,onBlur:jm,placeholder:Ym,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":g,"aria-controls":m,"aria-autocomplete":"list","aria-activedescendant":g&&S.length>0?b(A):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":Km,"aria-invalid":Je==="error"||void 0}),o?(0,oe.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:Vm,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":L,title:"Generate selector from a description",children:(0,oe.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,g&&S.length>0?(0,oe.jsx)("ul",{className:"spytial-ed-autocomplete",style:kf,id:m,role:"listbox","aria-label":"Selector completions",children:S.map((H,J)=>(0,oe.jsxs)("li",{id:b(J),role:"option","aria-selected":J===A,className:`spytial-ed-autocomplete-item${J===A?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Os=>{Os.preventDefault(),Ca(H)},onMouseEnter:()=>k(J),children:[(0,oe.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${H.kind}`,"aria-hidden":"true"}),(0,oe.jsx)("span",{className:"spytial-ed-autocomplete-label",children:H.label}),H.detail?(0,oe.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:H.detail}):null]},`${H.label}-${J}`))}):null]}),L?(0,oe.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,oe.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,oe.jsx)("input",{ref:at,type:"text",className:"spytial-ed-synth-input",value:j,placeholder:"Describe the selector you want\u2026",disabled:Ee,"aria-label":"Selector description",onChange:H=>pe(H.target.value),onKeyDown:H=>{H.key==="Enter"?(H.preventDefault(),Co()):H.key==="Escape"&&(H.preventDefault(),To())}}),(0,oe.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Co()},disabled:Ee||j.trim().length===0,children:Ee?"Generating\u2026":"Generate"})]}),xe?(0,oe.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:xe}):null,Ze?(0,oe.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,oe.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,oe.jsx)(RC,{value:Ze.value})}),Ze.explanation?(0,oe.jsx)("p",{className:"spytial-ed-synth-explanation",children:Ze.explanation}):null,(0,oe.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,oe.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:Ea,children:"Accept"}),(0,oe.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:To,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,oe.jsx)("ul",{className:"spytial-ed-diagnostics",id:y,children:l.map((H,J)=>(0,oe.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${H.severity}`,children:[(0,oe.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,oe.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:H.message})]},J))}):null]})};var _C=Ve(di());var ne=Ve(dn());function Hl(t){return t==null?"":String(t)}function ZH(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function JH(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var eU=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),tU=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},nU=({diagnostics:t,id:e})=>t.length>0?(0,ne.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,ne.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,ne.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ne.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,Kd=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,_C.useId)();return(0,ne.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,ne.jsx)(iU,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,h=`${u}-diag`,d=eU(i,c.key),p=tU(d),m=e[c.key];return(0,ne.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${p?` spytial-ed-field--${p}`:""}`,children:[(0,ne.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,ne.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,ne.jsxs)("div",{className:"spytial-ed-field-control",children:[rU(c,m,{fieldId:u,labelId:f,diagId:h,hasDiagnostics:d.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:d}),c.kind==="selector"?null:(0,ne.jsx)(nU,{diagnostics:d,id:h})]})]},c.key)})})};function iU({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=JH(e)?e:void 0,a=!t.required;if(l===void 0)return(0,ne.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let h={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete h[u]:h[u]=f,n(t.key,h)};return(0,ne.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,ne.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,ne.jsx)("span",{children:t.label}),a?(0,ne.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,ne.jsx)(Kd,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function rU(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,h=o?s:void 0;switch(t.kind){case"selector":{let d=u?.(t)??{};return(0,ne.jsx)(Fb,{value:Hl(e),onChange:p=>a(t.key,p),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:d.complete,synthesize:d.synthesize,highlight:d.highlight})}case"relationName":case"typeName":{let d=t.kind==="relationName"?c?.relationNames:c?.typeNames,p=`${i}-list`,m=!!d&&d.length>0;return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:Hl(e),placeholder:t.placeholder,disabled:l,list:m?p:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":h,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),m?(0,ne.jsx)("datalist",{id:p,children:d.map(b=>(0,ne.jsx)("option",{value:b},b))}):null]})}case"enum":{let d=t.options??[];if(t.multiple){let m=ZH(e);return(0,ne.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":h,children:d.map(b=>{let y=m.includes(b);return(0,ne.jsx)("button",{type:"button",className:`spytial-ed-pill${y?" spytial-ed-pill--active":""}`,"aria-pressed":y,disabled:l,onClick:()=>{let g=y?m.filter(v=>v!==b):[...m,b];a(t.key,g)},children:b},b)})})}let p=Hl(e);return(0,ne.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":h,children:d.map(m=>{let b=p===m;return(0,ne.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,m),children:m},m)})})}case"number":{let d=e,p=d==null||d===""?"":String(d);return(0,ne.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:p,placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(m=>m.severity==="error")||void 0,onChange:m=>{let b=m.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let d=Hl(e)||"#000000";return(0,ne.jsxs)("div",{className:"spytial-ed-color",children:[(0,ne.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:sU(d),disabled:l,"aria-describedby":h,"aria-label":`${t.label} color`,onChange:p=>a(t.key,p.target.value)}),(0,ne.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:Hl(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:p=>a(t.key,p.target.value)})]})}case"boolean":{let d=e===!0||e==="true";return(0,ne.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":d,"aria-describedby":h,className:`spytial-ed-switch${d?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!d),children:(0,ne.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}default:return(0,ne.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:Hl(e),placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(d=>d.severity==="error")||void 0,onChange:d=>a(t.key,d.target.value)})}}function sU(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var tn=Ve(di());var Vb=[],qC=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?qC:Vb).push(n=n+t[e])})();function oU(t){if(t<768)return!1;for(let e=0,n=Vb.length;;){let i=e+n>>1;if(t<Vb[i])n=i;else if(t>=qC[i])e=i+1;else return!0;if(e==n)return!1}}function LC(t){return t>=127462&&t<=127487}var BC=8205;function PC(t,e,n=!0,i=!0){return(n?zC:lU)(t,e,i)}function zC(t,e,n){if(e==t.length)return e;e&&HC(t.charCodeAt(e))&&UC(t.charCodeAt(e-1))&&e--;let i=jb(t,e);for(e+=IC(i);e<t.length;){let r=jb(t,e);if(i==BC||r==BC||n&&oU(r))e+=IC(r),i=r;else if(LC(r)){let s=0,o=e-2;for(;o>=0&&LC(jb(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function lU(t,e,n){for(;e>1;){let i=zC(t,e-2,n);if(i<e)return i;e--}return 0}function jb(t,e){let n=t.charCodeAt(e);if(!UC(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return HC(i)?(n-55296<<10)+(i-56320)+65536:n}function HC(t){return t>=56320&&t<57344}function UC(t){return t>=55296&&t<56320}function IC(t){return t<65536?1:2}var le=class t{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,i){[e,n]=Vl(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Ul.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Vl(this,e,n);let i=[];return this.decompose(e,n,i,0),Ul.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new eo(this),s=new eo(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new eo(this,e)}iterRange(e,n=this.length){return new Wd(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Zd(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new pn(e):Ul.from(pn.split(e,[]))}},pn=class t extends le{constructor(e,n=aU(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new Kb(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(FC(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Xd(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=Vl(this,e,n);let r=Xd(this.text,Xd(i.text,FC(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):Ul.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
189
- `){[e,n]=Vl(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new t(i,r)),i=[],r=-1);return r>-1&&n.push(new t(i,r)),n}},Ul=class t extends le{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((n?a:l)>=e)return o.lineInner(e,n,i,r);r=l+1,i=a+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&n>=o){let c=r&((o<=e?1:0)|(a>=n?2:0));o>=e&&a<=n&&!c?i.push(l):l.decompose(e-o,n-o,i,c)}o=a+1}}replace(e,n,i){if([e,n]=Vl(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&n<=l){let a=o.replace(e-s,n-s,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new t(u,this.length-(n-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
190
- `){[e,n]=Vl(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=a+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof t))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,n);i+=a.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new pn(d,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function f(d){let p;if(d.lines>s&&d instanceof t)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(h(),l.push(d)):d instanceof pn&&a&&(p=u[u.length-1])instanceof pn&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new pn(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&h(),a+=d.lines,c+=d.length+1,u.push(d))}function h(){a!=0&&(l.push(u.length==1?u[0]:t.from(u,c)),c=-1,a=u.length=0)}for(let d of e)f(d);return h(),l.length==1?l[0]:new t(l,n)}};le.empty=new pn([""],0);function aU(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Xd(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function FC(t,e,n){return Xd(t,[""],e,n)}var eo=class{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof pn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof pn?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
191
- `,this;e--}else if(r instanceof pn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof pn?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Wd=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new eo(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}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 i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Zd=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(le.prototype[Symbol.iterator]=function(){return this.iter()},eo.prototype[Symbol.iterator]=Wd.prototype[Symbol.iterator]=Zd.prototype[Symbol.iterator]=function(){return this});var Kb=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function Vl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function pt(t,e,n=!0,i=!0){return PC(t,e,n,i)}function cU(t){return t>=56320&&t<57344}function uU(t){return t>=55296&&t<56320}function QC(t,e){let n=t.charCodeAt(e);if(!uU(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return cU(i)?(n-55296<<10)+(i-56320)+65536:n}function GC(t){return t<65536?1:2}var Qb=/\r\n?|\n/,Ht=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ht||(Ht={})),hr=class t{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){Gb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:$C(this,e)}mapDesc(e,n=!1){return e.empty?this:$b(this,e,n)}mapPos(e,n=-1,i=Ht.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=Ht.Simple&&c>=e&&(i==Ht.TrackDel&&r<e&&c>e||i==Ht.TrackBefore&&r<e||i==Ht.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}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 t(e)}static create(e){return new t(e)}},Ut=class t extends hr{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 Gb(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return $b(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(le.empty);i.push(o?e.slice(s,s+o):le.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:$C(this,e,!0)}map(e,n=!1){return e.empty?this:$b(this,e,n,!0)}iterChanges(e,n=!1){Gb(this,e,n)}get desc(){return hr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new to(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);Tt(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;Tt(n,u,f),f>0&&as(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);Tt(n,u,-1),Tt(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:hr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&Tt(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:h=f,insert:d}=u;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let p=d?typeof d=="string"?le.of(d.split(i||Qb)):d:le.empty,m=p.length;if(f==h&&m==0)return;f<o&&a(),f>o&&Tt(r,f-o,-1),Tt(r,h-f,m),as(s,r,p),o=h}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(le.empty);i[r]=le.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function Tt(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function as(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(le.empty);t.push(n)}}function Gb(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=le.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function $b(t,e,n,i=!1){let r=[],s=i?[]:null,o=new to(t),l=new to(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);Tt(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(Tt(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(Tt(r,0,o.ins),s&&as(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;Tt(r,c,a<o.i?o.ins:0),s&&a<o.i&&as(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?Ut.createSet(r,s):hr.create(r);throw new Error("Mismatched change set lengths")}}}function $C(t,e,n=!1){let i=[],r=n?[]:null,s=new to(t),o=new to(e);for(let l=!1;;){if(s.done&&o.done)return r?Ut.createSet(i,r):hr.create(i);if(s.ins==0)Tt(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)Tt(i,0,o.ins,l),r&&as(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Tt(i,a,u,l),r&&u&&as(r,i,o.text)}else o.ins==-1?(Tt(i,s.off?0:s.len,a,l),r&&as(r,i,s.textBit(a))):(Tt(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&as(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var to=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?le.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?le.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Ws=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return D.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return D.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 D.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},D=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>Ws.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.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 i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return Ws.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?Ws.create(n,e,o|32,i):Ws.create(e,n,o,i)}static undirectionalRange(e,n){return Ws.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function XC(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var sv=0,B=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=sv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:ov),!!e.static,e.enables)}of(e){return new Fl([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fl(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fl(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function ov(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var Fl=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=sv++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(a&&h.docChanged||c&&(h.docChanged||h.selection)||Xb(f,u)){let d=i(f);if(l?!jC(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[s];if(p!=null){let m=tp(h,p);if(this.dependencies.every(b=>b instanceof B?h.facet(b)===f.facet(b):b instanceof Ct?h.field(b,!1)==f.field(b,!1):!0)||(l?jC(d=i(f),m,r):r(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function jC(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function Xb(t,e){let n=!1;for(let i of e)pu(t,i)&1&&(n=!0);return n}function fU(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=tp(a,i[u]);if(r[u]==2)for(let h of f)c.push(h);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)pu(a,c);return a.values[o]=l(a),1},update(a,c){if(!Xb(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=Xb(a,i),f=c.config.facets[e.id],h=c.facet(e);if(f&&!u&&ov(n,f))return a.values[o]=h,0;let d=l(a);return e.compare(d,h)?(a.values[o]=h,0):(a.values[o]=d,1)}}}var Qd=B.define({static:!0}),Ct=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(sv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Qd).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Qd),o=r.facet(Qd),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,Qd.of({field:this,create:e})]}get extension(){return this}},Zs={lowest:4,low:3,default:2,high:1,highest:0};function du(t){return e=>new Jd(e,t)}var bu={highest:du(Zs.highest),high:du(Zs.high),default:du(Zs.default),low:du(Zs.low),lowest:du(Zs.lowest)},Jd=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},Yl=class t{of(e){return new mu(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},mu=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},ep=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of hU(e,n,o))h instanceof Ct?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],c=[];for(let h of r)l[h.id]=c.length<<1,c.push(d=>h.slot(d));let u=i?.config.facets;for(let h in s){let d=s[h],p=d[0].facet,m=u&&u[h]||[];if(d.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,ov(m,d))a.push(i.facet(p));else{let b=p.combine(d.map(y=>y.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(y=>b.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(b=>fU(b,p,d))}}let f=c.map(h=>h(l));return new t(e,o,f,l,a,s)}};function hU(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof mu&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof mu){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof Jd)s(o.inner,o.prec);else if(o instanceof Ct)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Fl)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Zs.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,Zs.default),i.reduce((o,l)=>o.concat(l))}function pu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function tp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var WC=B.define(),Wb=B.define({combine:t=>t.some(e=>e),static:!0}),ZC=B.define({combine:t=>t.length?t[0]:void 0,static:!0}),JC=B.define(),eE=B.define(),tE=B.define(),nE=B.define({combine:t=>t.length?t[0]:!1}),_n=class{constructor(e,n){this.type=e,this.value=n}static define(){return new Zb}},Zb=class{of(e){return new _n(this,e)}},Jb=class{constructor(e){this.map=e}of(e){return new ce(this,e)}},ce=class t{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 t(this.type,n)}is(e){return this.type==e}static define(e={}){return new Jb(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};ce.reconfigure=ce.define();ce.appendConfig=ce.define();var dt=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&XC(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}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(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};dt.time=_n.define();dt.userEvent=_n.define();dt.addToHistory=_n.define();dt.remote=_n.define();function dU(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function iE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Ut.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:ce.mapEffects(t.effects,r).concat(ce.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function ev(t,e,n){let i=e.selection,r=jl(e.annotations);return e.userEvent&&(r=r.concat(dt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ut?e.changes:Ut.of(e.changes||[],n,t.facet(ZC)),selection:i&&(i instanceof D?i:D.single(i.anchor,i.head)),effects:jl(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function rE(t,e,n){let i=ev(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=iE(i,ev(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=dt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return mU(n?pU(r):r)}function pU(t){let e=t.startState,n=!0;for(let r of e.facet(JC)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:dU(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Ut.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=dt.create(e,r,t.selection&&t.selection.map(s),ce.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(eE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof dt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof dt?t=s[0]:t=rE(e,jl(s),!1)}return t}function mU(t){let e=t.startState,n=e.facet(tE),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=iE(i,ev(e,s,t.changes.newLength),!0))}return i==t?t:dt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var gU=[];function jl(t){return t==null?gU:Array.isArray(t)?t:[t]}var ni=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(ni||(ni={})),yU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,tv;try{tv=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function bU(t){if(tv)return tv.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||yU.test(n)))return!0}return!1}function vU(t){return e=>{if(!/\S/.test(e))return ni.Space;if(bU(e))return ni.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ni.Word;return ni.Other}}var Oe=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)pu(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return pu(this,i),tp(this,i)}update(...e){return rE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(Yl.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(ce.reconfigure)?(n=null,i=l.value):l.is(ce.appendConfig)&&(n=null,i=jl(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=ep.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Wb)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(l,a)=>a.update(l,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:D.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=jl(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let h=0;h<l;h++)s[h]=s[h].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=ce.mapEffects(o,u).concat(ce.mapEffects(jl(a.effects),f))}return{changes:r,selection:D.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Ut?e:Ut.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return le.of(e.split(this.facet(t.lineSeparator)||Qb))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(pu(this,n),tp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Ct&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:D.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=ep.resolve(e.extensions||[],new Map),i=e.doc instanceof le?e.doc:le.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||Qb)),r=e.selection?e.selection instanceof D?e.selection:D.single(e.selection.anchor,e.selection.head):D.single(0);return XC(r,i.length),n.staticFacet(Wb)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
192
- `}get readOnly(){return this.facet(nE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(WC))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return vU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=pt(n,o,!1);if(s(n.slice(a,o))!=ni.Word)break;o=a}for(;l<r;){let a=pt(n,l);if(s(n.slice(l,a))!=ni.Word)break;l=a}return o==l?null:D.range(o+i,l+i)}};Oe.allowMultipleSelections=Wb;Oe.tabSize=B.define({combine:t=>t.length?t[0]:4});Oe.lineSeparator=ZC;Oe.readOnly=nE;Oe.phrases=B.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});Oe.languageData=WC;Oe.changeFilter=JC;Oe.transactionFilter=eE;Oe.transactionExtender=tE;Yl.reconfigure=ce.define();function cs(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Ni=class{eq(e){return this==e}range(e,n=e){return gu.create(e,n,this)}};Ni.prototype.startSide=Ni.prototype.endSide=0;Ni.prototype.point=!1;Ni.prototype.mapMode=Ht.TrackDel;function lv(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var gu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function nv(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var iv=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,h,d;if(u==f){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(h=d=p,c.startSide!=c.endSide&&(d=n.mapPos(u,c.endSide),d<h)))continue}else if(h=n.mapPos(u,c.startSide),d=n.mapPos(f,c.endSide),h>d||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(o<0&&(o=h),c.point&&(l=Math.max(l,d-h)),i.push(c),r.push(h-o),s.push(d-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},ue=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let 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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(nv)),this.isEmpty)return n.length?t.of(n):this;let l=new np(this,null,-1).goto(0),a=0,c=[],u=new dr;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(gu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return yu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return yu.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=VC(o,l,i),c=new Js(o,a,s),u=new Js(l,a,s);i.iterGaps((f,h,d)=>YC(c,f,u,h,d,r)),i.empty&&i.length==0&&YC(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=VC(s,o),a=new Js(s,l,0).goto(i),c=new Js(o,l,0).goto(i);for(;;){if(a.to!=c.to||!rv(a.active,c.active)||a.point&&(!c.point||!lv(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new Js(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new dr;for(let r of e instanceof gu?[e]:n?SU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};ue.empty=new ue([],[],null,-1);function SU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(nv(e,i)>0)return t.slice().sort(nv);e=i}return t}ue.empty.nextLayer=ue.empty;var dr=class t{finishChunk(e){this.chunks.push(new iv(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,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.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 i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(ue.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ue.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function VC(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var np=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},yu=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new np(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)Yb(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)Yb(this.heap,i);(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(),Yb(this.heap,0)}}};function Yb(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var Js=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=yu.from(e,n,i)}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){Gd(this.active,e),Gd(this.activeTo,e),Gd(this.activeRank,e),this.minActive=KC(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;$d(this.active,n,i),$d(this.activeTo,n,r),$d(this.activeRank,n,s),e&&$d(e,n,this.cursor.from),this.minActive=KC(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Gd(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function YC(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,h=f||t.endSide-n.endSide,d=h<0?t.to+a:n.to,p=Math.min(d,o);if(t.point||n.point?(t.point&&n.point&&lv(t.point,n.point)&&rv(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,p,t.point,n.point),u=!1):(u&&s.boundChange(l),p>l&&!rv(t.active,n.active)&&s.compareRange(l,p,t.active,n.active),c&&p<o&&(f||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>o)break;l=d,h<=0&&t.next(),h>=0&&n.next()}}function rv(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!lv(t[n],e[n]))return!1;return!0}function Gd(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function $d(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function KC(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function no(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=pt(t,r));return i}function sE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=pt(t,r)}return i===!0?-1:t.length}var oE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),av=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),lE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Ln=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(m=>o.map(b=>m.replace(/&/,b))).reduce((m,b)=>m.concat(b)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),p,u,h)}else p!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||h)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
193
- `)}static newName(){let e=lE[oE]||1;return lE[oE]=e+1,"\u037C"+e.toString(36)}static mount(e,n,i){let r=e[av],s=i&&i.nonce;r?s&&r.setNonce(s):r=new cv(e,s),r.mount(Array.isArray(n)?n:[n],e)}},aE=new Map,cv=class{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=aE.get(i);if(s)return e[av]=s;this.sheet=new r.CSSStyleSheet,aE.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[av]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
194
- `;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var pr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Kl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xU=typeof navigator<"u"&&/Mac/.test(navigator.platform),wU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(We=0;We<10;We++)pr[48+We]=pr[96+We]=String(We);var We;for(We=1;We<=24;We++)pr[We+111]="F"+We;var We;for(We=65;We<=90;We++)pr[We]=String.fromCharCode(We+32),Kl[We]=String.fromCharCode(We);var We;for(ip in pr)Kl.hasOwnProperty(ip)||(Kl[ip]=pr[ip]);var ip;function cE(t){var e=xU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||wU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Kl:pr)[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 mn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)uE(t,arguments[e]);return t}function uE(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)uE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var Ft=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},bv=typeof document<"u"?document:{documentElement:{style:{}}},vv=/Edge\/(\d+)/.exec(Ft.userAgent),VE=/MSIE \d/.test(Ft.userAgent),Sv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ft.userAgent),Lp=!!(VE||Sv||vv),fE=!Lp&&/gecko\/(\d+)/i.test(Ft.userAgent),uv=!Lp&&/Chrome\/(\d+)/.exec(Ft.userAgent),hE="webkitFontSmoothing"in bv.documentElement.style,xv=!Lp&&/Apple Computer/.test(Ft.vendor),dE=xv&&(/Mobile\/\w+/.test(Ft.userAgent)||Ft.maxTouchPoints>2),_={mac:dE||/Mac/.test(Ft.platform),windows:/Win/.test(Ft.platform),linux:/Linux|X11/.test(Ft.platform),ie:Lp,ie_version:VE?bv.documentMode||6:Sv?+Sv[1]:vv?+vv[1]:0,gecko:fE,gecko_version:fE?+(/Firefox\/(\d+)/.exec(Ft.userAgent)||[0,0])[1]:0,chrome:!!uv,chrome_version:uv?+uv[1]:0,ios:dE,android:/Android\b/.test(Ft.userAgent),webkit:hE,webkit_version:hE?+(/\bAppleWebKit\/(\d+)/.exec(Ft.userAgent)||[0,0])[1]:0,safari:xv,safari_version:xv?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ft.userAgent)||[0,0])[1]:0,tabSize:bv.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function o1(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}var mp=Object.create(null);function l1(t,e,n){if(t==e)return!0;t||(t=mp),e||(e=mp);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function kU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function pE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function AU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var yr=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},en=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(en||(en={})),be=class extends Ni{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Mu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new so(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=YE(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new so(e,i,r,n,e.widget||null,!0)}static line(e){return new Nu(e)}static set(e,n=!1){return ue.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};be.none=ue.empty;var Mu=class t extends be{constructor(e){let{start:n,end:i}=YE(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?o1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||mp}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&l1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Mu.prototype.point=!1;var Nu=class t extends be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&l1(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)}};Nu.prototype.mapMode=Ht.TrackBefore;Nu.prototype.point=!0;var so=class t extends be{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Ht.TrackBefore:Ht.TrackAfter:Ht.TrackDel}get type(){return this.startSide!=this.endSide?en.WidgetRange:this.startSide<=0?en.WidgetBefore:en.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&OU(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)}};so.prototype.point=!0;function YE(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function OU(t,e){return t==e||!!(t&&e&&t.compare(e))}function Zl(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var gp=class t extends Ni{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&l1(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||mp,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ue.of(e,n)}};gp.prototype.startSide=gp.prototype.endSide=-1;function Ru(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function wv(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function xu(t,e){if(!e.anchorNode)return!1;try{return wv(t,e.anchorNode)}catch{return!1}}function dp(t){return t.nodeType==3?_u(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function wu(t,e,n,i){return n?mE(t,e,n,i,-1)||mE(t,e,n,i,1):!1}function hs(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function yp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function mE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:br(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=hs(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?br(t):0}else return!1}}function br(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function bp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function TU(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 KE(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function CU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let h,d=u==a.body,p=1,m=1;if(d)h=TU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let g=u.getBoundingClientRect();({scaleX:p,scaleY:m}=KE(u,g)),h={left:g.left,right:g.left+u.clientWidth*p,top:g.top,bottom:g.top+u.clientHeight*m}}let b=0,y=0;if(r=="nearest")e.top<h.top+o?(y=e.top-(h.top+o),n>0&&e.bottom>h.bottom+y&&(y=e.bottom-h.bottom+o)):e.bottom>h.bottom-o&&(y=e.bottom-h.bottom+o,n<0&&e.top-y<h.top&&(y=e.top-(h.top+o)));else{let g=e.bottom-e.top,v=h.bottom-h.top;y=(r=="center"&&g<=v?e.top+g/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-h.top}if(i=="nearest"?e.left<h.left+s?(b=e.left-(h.left+s),n>0&&e.right>h.right+b&&(b=e.right-h.right+s)):e.right>h.right-s&&(b=e.right-h.right+s,n<0&&e.left<h.left+b&&(b=e.left-(h.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:i=="start"==l?e.left-s:e.right-(h.right-h.left)+s)-h.left,b||y)if(d)c.scrollBy(b,y);else{let g=0,v=0;if(y){let S=u.scrollTop;u.scrollTop+=y/m,v=(u.scrollTop-S)*m}if(b){let S=u.scrollLeft;u.scrollLeft+=b/p,g=(u.scrollLeft-S)*p}e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v},g&&Math.abs(g-b)<1&&(i="nearest"),v&&Math.abs(v-y)<1&&(r="nearest")}if(d)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function QE(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var kv=class{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:i}=e;this.set(n,Math.min(e.anchorOffset,n?br(n):0),i,Math.min(e.focusOffset,i?br(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},io=null;_.safari&&_.safari_version>=26&&(io=!1);function GE(t){if(t.setActive)return t.setActive();if(io)return t.focus(io);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(io==null?{get preventScroll(){return io={preventScroll:!0},!0}}:void 0),!io){io=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var gE;function _u(t,e,n=e){let i=gE||(gE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function Jl(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function EU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function DU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,br(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=br(n))}else{if(n==t)return!0;i=hs(n),n=n.parentNode}}function $E(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function XE(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=br(n)}else if(n.parentNode&&!yp(n))i=hs(n),n=n.parentNode;else return null}}function WE(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!yp(n))i=hs(n)+1,n=n.parentNode;else return null}}var _i=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,hs(e),n)}static after(e,n){return new t(e.parentNode,hs(e)+1,n)}},Me=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Me||(Me={})),oo=Me.LTR,a1=Me.RTL;function ZE(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var MU=ZE("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),NU=ZE("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Av=Object.create(null),Ri=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Av[e]=n,Av[n]=-e}function JE(t){return t<=247?MU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?NU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var RU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,qn=class{get dir(){return this.level%2?a1:oo}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function eD(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!eD(i.inner,r.inner))return!1}return!0}var ke=[];function _U(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let h=JE(t.charCodeAt(c));h==512?h=u:h==8&&f==4&&(h=16),ke[c]=h==4?2:h,h&7&&(f=h),u=h}for(let c=o,u=a,f=a;c<l;c++){let h=ke[c];if(h==128)c<l-1&&u==ke[c+1]&&u&24?h=ke[c]=u:ke[c]=256;else if(h==64){let d=c+1;for(;d<l&&ke[d]==64;)d++;let p=c&&u==8||d<n&&ke[d]==8?f==1?1:8:256;for(let m=c;m<d;m++)ke[m]=p;c=d-1}else h==8&&f==1&&(ke[c]=1);u=h,h&7&&(f=h)}}}function LU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,h,d,p;f<u;f++)if(d=Av[h=t.charCodeAt(f)])if(d<0){for(let m=l-3;m>=0;m-=3)if(Ri[m+1]==-d){let b=Ri[m+2],y=b&2?r:b&4?b&1?s:r:0;y&&(ke[f]=ke[Ri[m]]=y),l=m;break}}else{if(Ri.length==189)break;Ri[l++]=f,Ri[l++]=h,Ri[l++]=a}else if((p=ke[f])==2||p==1){let m=p==r;a=m?0:1;for(let b=l-3;b>=0;b-=3){let y=Ri[b+2];if(y&2)break;if(m)Ri[b+2]|=2;else{if(y&4)break;Ri[b+2]|=4}}}}}function BU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=ke[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(ke[u]==256)u++;else break;let f=s==1,h=(u<e?ke[u]:i)==1,d=f==h?f?1:2:i;for(let p=u,m=r,b=m?n[m-1].to:t;p>a;)p==b&&(p=n[--m].from,b=m?n[m-1].to:t),ke[--p]=d;a=u}else s=c,a++}}}function Ov(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let m=ke[a];m!=l&&(u=!1,f=m==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(f)break e;let m=s[c];if(!u)for(let b=m.to,y=c+1;;){if(b==n)break e;if(y<s.length&&s[y].from==b)b=s[y++].to;else{if(ke[b]==l)break e;break}}if(c++,h)h.push(m);else{m.from>a&&o.push(new qn(a,m.from,d));let b=m.direction==oo!=!(d%2);Tv(t,b?i+1:i,r,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==n||(u?ke[p]!=l:ke[p]==l))break;p++}h?Ov(t,a,p,i+1,r,h,o):a<p&&o.push(new qn(a,p,d)),a=p}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let m=ke[a-1];m!=l&&(u=!1,f=m==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(f)break e;let m=s[--c];if(!u)for(let b=m.from,y=c;;){if(b==e)break e;if(y&&s[y-1].to==b)b=s[--y].from;else{if(ke[b-1]==l)break e;break}}if(h)h.push(m);else{m.to<a&&o.push(new qn(m.to,a,d));let b=m.direction==oo!=!(d%2);Tv(t,b?i+1:i,r,m.inner,m.from,m.to,o),a=m.from}p=m.from}else{if(p==e||(u?ke[p-1]!=l:ke[p-1]==l))break;p--}h?Ov(t,p,a,i+1,r,h,o):p<a&&o.push(new qn(p,a,d)),a=p}}function Tv(t,e,n,i,r,s,o){let l=e%2?2:1;_U(t,r,s,i,l),LU(t,r,s,i,l),BU(r,s,i,l),Ov(t,r,s,e,n,i,o)}function IU(t,e,n){if(!t)return[new qn(0,0,e==a1?1:0)];if(e==oo&&!n.length&&!RU.test(t))return tD(t.length);if(n.length)for(;t.length>ke.length;)ke[ke.length]=256;let i=[],r=e==oo?0:1;return Tv(t,r,r,n,0,t.length,i),i}function tD(t){return[new qn(0,t,0)]}var nD="";function qU(t,e,n,i,r){var s;let o=i.head-t.from,l=qn.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let h=l+=r?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],o=a.side(!r,n),c=a.side(r,n)}let u=pt(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),nD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?D.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):D.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function PU(t,e,n){for(let i=e;i<n;i++){let r=JE(t.charCodeAt(i));if(r==1)return oo;if(r==2||r==4)return a1}return oo}var iD=B.define(),rD=B.define(),sD=B.define(),oD=B.define(),Cv=B.define(),lD=B.define(),aD=B.define(),c1=B.define(),u1=B.define(),cD=B.define({combine:t=>t.some(e=>e)}),zU=B.define({combine:t=>t.some(e=>e)}),uD=B.define(),ku=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(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 t(D.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},rp=ce.define({map:(t,e)=>t.map(e)}),fD=ce.define();function gn(t,e,n){let i=t.facet(oD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var mr=B.define({combine:t=>t.length?t[0]:!0}),HU=0,Gl=B.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),Pn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Gl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Gl.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(HU++,e,i,r,l=>{let a=[];return o&&a.push(Bp.of(c=>{let u=c.plugin(l);return u?o(u):be.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Au=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(gn(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){gn(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(i){gn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},hD=B.define(),f1=B.define(),Bp=B.define(),dD=B.define(),h1=B.define(),Lu=B.define(),pD=B.define();function yE(t,e){let n=t.state.facet(pD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return ue.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,p;if(d==null&&(d=PU(e.text,c,u)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:d,inner:[]};f.push(m),f=m.inner}}}}),r}var mD=B.define();function d1(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(mD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var vu=B.define(),ri=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(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,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,h=u;for(;;)if(s<n.length&&n[s]<=f){let d=n[s+1];s+=2,f=Math.max(f,d);for(let p=r;p<e.length&&e[p].fromB<=f;p++)o=e[p].toA-e[p].toB;h=Math.max(h,d+o)}else if(r<e.length&&e[r].fromB<=f){let d=e[r++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),o=d.toA-d.toB}else break;i.push(new t(u,h,c,f))}return i}},vp=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Ut.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new ri(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},UU=[],Ie=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return UU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&kU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=hs(this.dom),r=this.length?e>0:n>0;return new _i(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ta)return e;return null}static get(e){return e.cmTile}},ea=class extends Ie{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=bE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=bE(r);this.length=o}};function bE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var ta=class extends ea{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Ie.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof gr)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},gr=class t extends ea{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},na=class t extends ea{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let h=0,d=0;h<u.children.length&&d<=f;h++){let p=u.children[h],m=d+p.length;m>=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&jU(o,p)))&&(m>f||p.flags&32)?(o=p,l=f-d):(d<f||p.flags&16&&!p.isHidden)&&(r=p,s=f-d)),d=m}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):FU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new _i(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new _i(a.dom,0);a==i.tile&&(l=!0)}}return new _i(this.dom,0)}};function FU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=dp(e);return n[n.length-1]||null}function jU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var Jt=class t extends ea{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ro=class t extends Ie{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?_.chrome||_.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=_u(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return _.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:bp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},lo=class t extends Ie{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return bp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return bp(o,!l)}}get overrideDOMText(){if(!this.length)return le.empty;let{root:e}=this;if(!e)return le.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},ia=class extends Ie{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return le.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:bp(r,n>0==i)}},Ev=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Dv=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},Mv=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new ro(l.dom,l.text+e);a.parent=o}else o.append(r||ro.of(e,(s=this.cache.find(ro))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?fv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof Jt&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(fv(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=Ie.get(a.dom);f&&f.setDOM(fv(a.dom))}let u=Jt.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=Ie.get(e.text);s&&this.cache.reused.set(s,2);let o=new ro(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=gD);let r=na.start(e,n||((i=this.cache.find(na))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof Jt&&l.mark.eq(o))r=l,n--;else{let a=Jt.of(o,(i=this.cache.find(Jt,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_.ios&&vE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(hv,0,32)||new lo(hv.toDOM(),0,hv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new Dv(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof gr&&r.wrapper.eq(i.wrapper))n=r;else{let s=gr.of(i.wrapper,(e=this.cache.find(gr,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(ia,void 0,1);return i&&(i.flags=n),i||new ia(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Nv=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},Sp=[lo,na,ro,Jt,ia,gr,ta];for(let t=0;t<Sp.length;t++)Sp[t].bucket=t;var Rv=class{constructor(e){this.view=e,this.buckets=Sp.map(()=>[]),this.index=Sp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new lo(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},_v=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Rv(e),this.text=new Nv(e.state.doc),this.builder=new Mv(this.cache,new ta(e,e.contentDOM),ue.iter(i)),this.cache.reused.set(n,2),this.old=new Ev(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=KU(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?lo.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof ia)this.cache.add(o);else if(o instanceof Jt)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Jt&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Jt&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=ue.spans(this.decorations,e,n,{point:(l,a,c,u,f,h)=>{if(c instanceof so){if(this.disallowBlockEffectsFor[h]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let d=c.widget||(c.block?ds.block:ds.inline),p=VU(c),m=this.cache.findWidget(d,a-l,p)||lo.of(d,this.view,a-l,p);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(m)):(r.ensureLine(i),r.addInlineWidget(m,u,f))}i=null}else i=YU(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let h=this.text.next(Math.min(512,a-f));h==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(h,c,f==l?u:c.length),f+=h.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=Ie.get(r);if(r==this.view.contentDOM)break;s instanceof Jt?n.push(s):s?.isLine()?i=s:s instanceof gr||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new na(r,gD):i||n.push(Jt.of(new Mu({tagName:r.nodeName.toLowerCase(),attributes:AU(r)}),r)))}return{line:i,marks:n}}};function vE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function VU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var gD={class:"cm-line"};function YU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&o1(n,t),i&&(t.class+=" "+i)),t}function KU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof Jt&&e.push(i.mark)}return e}function fv(t){let e=Ie.get(t);return e&&e.setDOM(t.cloneNode()),t}var ds=class extends yr{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}};ds.inline=new ds("span");ds.block=new ds("div");var hv=new class extends yr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},xp=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=be.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ta(e,e.contentDOM),this.updateInner([new ri(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!eF(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?GU(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new ri(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(_.ie||_.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=WU(o,this.decorations,e.changes);a.length&&(i=ri.extendWithRanges(i,a));let c=ZU(l,this.blockWrappers,e.changes);return c.length&&(i=ri.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new _v(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Ie.get(n.text)&&l.cache.reused.set(Ie.get(n.text),2),this.tile=l.run(e,n),Lv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=_.chrome||_.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Ou&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(fD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(mr)||i.tabIndex>-1)&&xu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),_.gecko&&a.empty&&!this.hasComposition&&QU(c)){let h=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(h,c.node.childNodes[c.offset]||null)),c=u=new _i(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!wu(c.node,c.offset,f.anchorNode,f.anchorOffset)||!wu(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{_.android&&_.chrome&&i.contains(f.focusNode)&&JU(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=Ru(this.view.root);if(h)if(a.empty){if(_.gecko){let d=$U(c.node,c.offset);if(d&&d!=3){let p=(d==1?XE:WE)(c.node,c.offset);p&&(c=new _i(p.node,p.offset))}}h.collapse(c.node,c.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(c.node,c.offset);try{h.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new _i(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new _i(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&wu(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,i=Ru(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=br(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Ie.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Ou?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=pt(s.text,o);if(l==o)return null;let a=_u(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Me.LTR,c=0,u=(f,h,d)=>{for(let p=0;p<f.children.length&&!(h>r);p++){let m=f.children[p],b=h+m.length,y=m.dom.getBoundingClientRect(),{height:g}=y;if(d&&!p&&(c+=y.top-d.top),m instanceof gr)b>i&&u(m,h,y);else if(h>=i&&(c>0&&n.push(-c),n.push(g+c),c=0,o)){let v=m.dom.lastChild,S=v?dp(v):[];if(S.length){let w=S[S.length-1],A=a?w.right-y.left:y.right-w.left;A>l&&(l=A,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=b)}}d&&p==f.children.length-1&&(c+=d.bottom-y.bottom),h=b+m.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Me.RTL:Me.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=dp(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=dp(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(be.replace({widget:new Ou(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return be.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Bp).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(h1).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(ue.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(dD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(uD))try{if(c(this.view,e.range,e))return!0}catch(u){gn(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=d1(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(CU(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Me.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Lv(this.tile)}};function Lv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)Lv(i,e)}}function QU(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function yD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=XE(n.focusNode,n.focusOffset),r=WE(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Ie.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=Ie.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function GU(t,e,n){let i=yD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new ri(a.mapPos(s),a.mapPos(o),s,o),text:r}}function $U(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}var XU=class{constructor(){this.changes=[]}compareRange(e,n){Zl(e,n,this.changes)}comparePoint(e,n){Zl(e,n,this.changes)}boundChange(e){Zl(e,e,this.changes)}};function WU(t,e,n){let i=new XU;return ue.compare(t,e,n,i),i.changes}var Bv=class{constructor(){this.changes=[]}compareRange(e,n){Zl(e,n,this.changes)}comparePoint(){}boundChange(e){Zl(e,e,this.changes)}};function ZU(t,e,n){let i=new Bv;return ue.compare(t,e,n,i),i.changes}function JU(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function eF(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var Ou=class extends yr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function tF(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return D.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=pt(r.text,s,!1):l=pt(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=pt(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=pt(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return D.undirectionalRange(o+r.from,l+r.from)}function nF(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+sE(o,s,t.state.tabSize)}function iF(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==en.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function rF(t,e,n,i){let r=iF(t,e.head,e.assoc||-1),s=!i||r.type!=en.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==Me.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return D.cursor(a,n?-1:1)}return D.cursor(n?r.to:r.from,n?-1:1)}function SE(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=qU(r,s,o,l,n),u=nD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
195
- `,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function sF(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==ni.Space&&(r=o),r==o}}function oF(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return D.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+u}let f=a.left+o,h=t.viewState.heightOracle.textHeight>>1,d=i??h;for(let p=0;;p+=h){let m=l+(d+p)*s,b=Iv(t,{x:f,y:m},!1,s);if(n?m>a.bottom:m<a.top)return D.cursor(b.pos,b.assoc);let y=t.coordsAtPos(b.pos,b.assoc),g=y?(y.top+y.bottom)/2:0;if(!y||(n?g>l:g<l))return D.cursor(b.pos,b.assoc,void 0,o)}}function Tu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function bD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Tu(t,r.from,0);o!=r.from&&(s=D.cursor(o,-1))}else{let o=Tu(t,r.from,-1),l=Tu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=D.undirectionalRange(r.from,r.to):s=D.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?D.create(n,e.mainIndex):e}function dv(t,e,n){let i=Tu(t.state.facet(Lu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:D.cursor(i,i<n.from?1:-1)}var In=class{constructor(e,n){this.pos=e,this.assoc=n}};function Iv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new In(0,1);if(a>t.viewState.docHeight)return new In(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==en.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let h=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(h&&(i<0?h.top<=a+s:h.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==en.Text){let f=nF(t,r,c,o,l);return new In(f,f==c.from?1:-1)}}if(c.type!=en.Text)return a<(c.top+c.bottom)/2?new In(c.from,1):new In(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new qv(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var qv=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[qn.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[qn.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,h;e:for(;r<s;){let p=s-r,m=r+s>>1;t:if(o.has(m)){let y=r+Math.floor(Math.random()*p);for(let g=0;g<p;g++){if(!o.has(y)){m=y;break t}y++,y==s&&(y=r)}break e}o.add(m);let b=n(m);if(b)for(let y=0;y<b.length;y++){let g=b[y],v=0;if(!(g.width==0&&b.length>1)){if(g.bottom<this.y)(!a||a.bottom<g.bottom)&&(a=g),v=1;else if(g.top>this.y)(!c||c.top>g.top)&&(c=g),v=-1;else{let S=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,w=Math.abs(S);w<f&&(u=m,f=w,h=g),S&&(v=S<0==(this.baseDir==Me.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[m],1))?s=m:v==1&&(!l||this.baseDirAt(e[m+1],-1))&&(r=m+1)}}}if(!h){if(!c&&!a)return{i:e[0],after:!1};let p=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(p.top+p.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:p,bottom:m}=h;if(a&&a.bottom>(p+p+m)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(p+m+m)/3)return this.y=c.top+1,this.scan(e,n,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==Me.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=pt(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return _u(e.dom,o,l).getClientRects()});return r.after?new In(i[r.i+1],-1):new In(i[r.i],1)}scanTile(e,n){if(!e.length)return new In(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:_u(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new In(i[r.i+1],-1):new In(o,1)}},Ql="\uFFFF",Pv=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Oe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ql}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=Ie.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=Ie.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:yp(r))||yp(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!aF(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=Ie.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(lF(e,i.node,i.offset)?n:0))}};function lF(t,e,n){for(;;){if(!e||n<br(e))return!1;if(e==t)return!0;n=hs(e)+1,e=e.parentNode}}function aF(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=Ie.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var wp=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},zv=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=vD(e.docView.tile,n,i,0))){let a=s||o?[]:uF(e),c=new Pv(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=fF(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!wv(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!wv(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((_.ios||_.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let h=Math.min(c,u),d=Math.max(c,u),p=f.from-h,m=f.to-d;(p==0||p==1||h==0)&&(m==0||m==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(D.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let h=e.coordsAtPos(c,-1),d=0;h&&(d=e.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=D.create([D.cursor(c,d)])}else this.newSel=D.single(u,c)}}};function vD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],h=c+f.length;if(c<e&&h>n)return vD(f,e,n,c);if(h>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=h,c=h+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function SD(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||_.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,Ql),h,d;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(h=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:le.of(e.text.slice(s.from-l,h).split(Ql))}:(d=xD(f,e.text,c-l,u))&&(_.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ql+Ql&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:le.of(e.text.slice(d.from,d.toB).split(Ql))})}else i&&(!t.hasFocus&&r.facet(mr)||kp(i,s))&&(i=null);if(!n&&!i)return!1;if((_.mac||_.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=D.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:le.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:_.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
196
- `&&t.lineWrapping&&(i&&(i=D.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:le.of([" "])}),n)return p1(t,n,i,o);if(i&&!kp(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=bD(r.facet(Lu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function p1(t,e,n,i=-1){if(_.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(_.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Jl(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Jl(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Jl(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=cF(t,e,n));return t.state.facet(lD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function cF(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Tu(r.facet(Lu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:D.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,h=n&&yD(t,n.main.head);if(h){let p=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-p}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:c||p.map(a)};let m=p.to-d,b=m-u.length;if(t.state.sliceDoc(b,m)!=u||m>=f.from&&b<=f.to)return{range:p};let y=r.changes({from:b,to:m,insert:e.insert}),g=p.to-s.to;return{changes:y,range:c?D.range(Math.max(0,c.anchor+g),Math.max(0,c.head+g)):p.map(y)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function xD(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function uF(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new wp(n,i)),(r!=n||s!=i)&&e.push(new wp(r,s))),e}function fF(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?D.single(n+e,i+e):null}function kp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var Hv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,_.safari&&e.contentDOM.addEventListener("input",()=>null),_.gecko&&TF(e.contentDOM.ownerDocument)}handleEvent(e){!vF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=dF(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,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&&kD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_.android&&_.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(_.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(wD.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||pF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&_.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hF(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Jl(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:_.safari&&!_.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function hF(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function xE(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){gn(n.state,r)}}}function dF(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(xE(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(xE(i.value,a))}}for(let i in si)n(i).handlers.push(si[i]);for(let i in jt)n(i).observers.push(jt[i]);return e}var wD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],pF="dthko",kD=[16,17,18,20,91,92,224,225],sp=6;function op(t){return Math.max(0,t)*.7+8}function mF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var Uv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=QE(e.contentDOM),this.atoms=e.state.facet(Lu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Oe.allowMultipleSelections)&&gF(e,n),this.dragging=bF(e,n)&&TD(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&&mF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=d1(this.view);e.clientX-a.left<=r+sp?n=-op(r-e.clientX):e.clientX+a.right>=o-sp&&(n=op(e.clientX-o)),e.clientY-a.top<=s+sp?i=-op(s-e.clientY):e.clientY+a.bottom>=l-sp&&(i=op(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,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)}select(e){let{view:n}=this,i=bD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function gF(t,e){let n=t.state.facet(iD);return n.length?n[0](e):_.mac?e.metaKey:e.ctrlKey}function yF(t,e){let n=t.state.facet(rD);return n.length?n[0](e):_.mac?!e.altKey:!e.ctrlKey}function bF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Ru(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function vF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Ie.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var si=Object.create(null),jt=Object.create(null),AD=_.ie&&_.ie_version<15||_.ios&&_.webkit_version<604;function SF(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(),OD(t,n.value)},50)}function Ip(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function OD(t,e){e=Ip(t.state,c1,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Fv!=null&&n.selection.ranges.every(a=>a.empty)&&Fv==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:D.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:D.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}jt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,_.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};jt.wheel=jt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};si.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);jt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};jt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};jt.touchend=(t,e)=>{t.inputState.touchActive=!1};si.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(sD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=wF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Uv(t,e,n,i)),i&&t.observer.ignore(()=>{GE(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function wE(t,e,n,i){if(i==1)return D.cursor(e,n);if(i==2)return tF(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,D.undirectionalRange(o,l)}}var xF=_.ie&&_.ie_version<=11,kE=null,AE=0,OE=0;function TD(t){if(!xF)return t.detail;let e=kE,n=OE;return kE=t,OE=Date.now(),AE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(AE+1)%3:1}function wF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=TD(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=wE(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=wE(t,n.pos,n.assoc,i),h=Math.min(f.from,u.from),d=Math.max(f.to,u.to);u=h<u.from?D.range(h,d,u.assoc):D.range(d,h,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=kF(r,a.pos))?c:l?r.addRange(u):D.create([u])}}}function kF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return D.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}si.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=D.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Ip(t.state,u1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};si.dragend=t=>(t.inputState.draggedContent=null,!1);function TE(t,e,n,i){if(n=Ip(t.state,c1,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&yF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}si.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&TE(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return TE(t,e,i,!0),!0}return!1};si.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=AD?null:e.clipboardData;return n?(OD(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(SF(t),!1)};function AF(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function OF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:Ip(t,u1,e.join(t.lineBreak)),ranges:n,linewise:i}}var Fv=null;si.copy=si.cut=(t,e)=>{if(!xu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=OF(t.state);if(!n&&!r)return!1;Fv=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=AD?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(AF(t,n),!1)};var CD=_n.define();function ED(t,e){let n=[];for(let i of t.facet(aD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:CD.of(!0)}):null}function DD(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ED(t.state,e);n?t.dispatch(n):t.update([])}},10)}jt.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),DD(t)};jt.blur=t=>{t.observer.clearSelectionRange(),DD(t)};jt.compositionstart=jt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};jt.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,_.chrome&&_.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};jt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};si.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return p1(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(_.chrome&&_.android&&(r=wD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return _.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),_.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>jt.compositionend(t,e),20),!1};var CE=new Set;function TF(t){CE.has(t)||(CE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var EE=["pre-wrap","normal","pre-line","break-spaces"],ra=!1;function DE(){ra=!1}var jv=class{constructor(e){this.lineWrapping=e,this.doc=le.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return EE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=EE.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},Vv=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},ii=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?en.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof so?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},Te=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Te||(Te={})),pp=.001,yn=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>pp&&(ra=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],h=s.lineAt(a,Te.ByPosNoHeight,i.setDoc(n),0,0),d=h.to>=c?h:s.lineAt(c,Te.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&h.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<h.from&&(h=s.lineAt(a,Te.ByPosNoHeight,i,0,0));u+=h.from-a,a=h.from;let p=Kv.build(i.setDoc(o),e,u,f);s=Ap(s,s.replace(a,c,p))}return s.updateHeight(i,0)}static empty(){return new Bn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new Yv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function Ap(t,e){return t==e?t:(t.constructor!=e.constructor&&(ra=!0),e)}yn.prototype.size=1;var CF=be.replace({}),Op=class extends yn{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new ii(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new ii(r,0,i,this.spaceAbove,CF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Te.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Bn=class t extends Op{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new ii(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof fs&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof fs?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):yn.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},fs=class t extends yn{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,h=Math.max(i,e-f/2);return new ii(u.from,u.length,h,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new ii(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==Te.ByHeight)return this.blockAt(e,i,r,s);if(n==Te.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new ii(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,h=r+l*f+a*(c.from-s-f);return new ii(c.from,c.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let h=i.doc.lineAt(u);if(u==e){let p=h.number-l;f+=a*p+c*(e-s-p)}let d=a+c*h.length;o(new ii(h.from,h.length,f,d,0)),f+=d,u=h.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return yn.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=pp&&(a=-2);let d=new Bn(u,f,h);d.outdated=!1,o.push(d),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=yn.of(o);return(a<0||Math.abs(c.height-this.height)>=pp||Math.abs(a-this.heightMetrics(e,n).perLine)>=pp)&&(ra=!0),Ap(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Yv=class extends yn{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==Te.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Te.ByPosNoHeight?Te.ByPosNoHeight:Te.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,Te.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&ME(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),ME(s,l)}return yn.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?yn.of(this.break?[e,null,n]:[e,n]):(this.left=Ap(this.left,e),this.right=Ap(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,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function ME(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof fs&&(i=t[e+1])instanceof fs&&t.splice(e-1,3,new fs(n.length+1+i.length))}var EF=5,Kv=class t{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 i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Bn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Bn(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new Op(o,r,i)):(o||s||r>=EF)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Bn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new fs(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Bn)return e;let n=new Bn(0,-1,0);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Bn)&&!this.isCovered?this.nodes.push(new Bn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Bn&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return ue.spans(n,i,r,s,0),s.finish(i)}};function DF(t,e,n){let i=new Qv;return ue.compare(t,e,n,i,0),i.changes}var Qv=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&Zl(e,n,this.changes,5)}};function MF(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let h=u.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),a=Math.min(c==t.parentNode?r.innerHeight:a,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function NF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function RF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var Cu=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return be.replace({widget:new Gv(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},Gv=class extends yr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}},Tp=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=NE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Me.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(f1).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new jv(i),this.stateDeco=RE(n),this.heightMap=yn.empty().applyChanges(this.stateDeco,le.empty,this.heightOracle.setDoc(n.doc),[new ri(0,0,0,n.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=be.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new $l(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?NE:new $v(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(Su(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=RE(this.state);let r=e.changedRanges,s=ri.extendWithRanges(r,DF(i,this.stateDeco,e?e.changes:Ut.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);DE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||ra)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,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(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(zU)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Me.RTL:Me.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:w,scaleY:A}=KE(n,l);(w>.005&&Math.abs(this.scaleX-w)>.005||A>.005&&Math.abs(this.scaleY-A)>.005)&&(this.scaleX=w,this.scaleY=A,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=QE(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=$E(this.scrollParent||e.win);let m=(this.printing?RF:MF)(n,this.paddingTop),b=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget&&!NF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:A,charWidth:k,textHeight:O}=e.docView.measureTextSize();o=A>0&&r.refresh(s,A,k,O,Math.max(5,v/k),w),o&&(e.docView.minWidth=0,c|=16)}b>0&&y>0?u=Math.max(b,y):b<0&&y<0&&(u=Math.min(b,y)),DE();for(let A of this.viewports){let k=A.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(A);this.heightMap=(o?yn.empty().applyChanges(this.stateDeco,le.empty,this.heightOracle,[new ri(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Vv(A.from,k))}ra&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]: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 i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new $l(r.lineAt(o-i*1e3,Te.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Te.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,Te.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?h=f.top:h=f.bottom-u,a=new $l(r.lineAt(h-1e3/2,Te.ByHeight,s,0,0).from,r.lineAt(h+u+1e3/2,Te.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new $l(this.heightMap.lineAt(i,Te.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Te.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Te.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Te.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new Cu(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Me.LTR&&!i)return[];let l=[],a=(u,f,h,d)=>{if(f-u<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let y of m)if(y>u&&y<f){a(u,y-10,h,d),a(y+10,f,h,d);return}let b=LF(e,y=>y.from>=h.from&&y.to<=h.to&&Math.abs(y.from-u)<s&&Math.abs(y.to-f)<s&&!m.some(g=>y.from<g&&y.to>g));if(!b){if(f<h.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(D.cursor(f),!1,!0).head;v>u&&(f=v)}let y=this.gapSize(h,u,f,d),g=i||y<2e6?y:2e6;b=new Cu(u,f,y,g)}l.push(b)},c=u=>{if(u.length<o||u.type!=en.Text)return;let f=_F(u.from,u.to,this.stateDeco);if(f.total<o)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let m=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(h!=null){let g=ap(f,h),v=((this.visibleBottom-this.visibleTop)/2+m)/u.height;b=g-v,y=g+v}else b=(this.visibleTop-u.top-m)/u.height,y=(this.visibleBottom-u.top+m)/u.height;d=lp(f,b),p=lp(f,y)}else{let m=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,y=0;if(m>2e6)for(let A of e)A.from>=u.from&&A.from<u.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=A.size-A.displaySize);let g=this.pixelViewport.left+y,v=this.pixelViewport.right+y,S,w;if(h!=null){let A=ap(f,h),k=((v-g)/2+b)/m;S=A-k,w=A+k}else S=(g-b)/m,w=(v+b)/m;d=lp(f,S),p=lp(f,w)}d>u.from&&a(u.from,d,u,f),p<u.to&&a(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=ap(r,i)-ap(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Cu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=be.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];ue.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Su(this.heightMap.lineAt(e,Te.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)||Su(this.heightMap.lineAt(this.scaler.fromDOM(e),Te.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Su(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}},$l=class{constructor(e,n){this.from=e,this.to=n}};function _F(t,e,n){let i=[],r=t,s=0;return ue.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function lp({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function ap(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function LF(t,e){for(let n of t)if(e(n))return n}var NE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function RE(t){let e=t.facet(Bp).filter(i=>typeof i!="function"),n=t.facet(h1).filter(i=>typeof i!="function");return n.length&&e.push(ue.join(n)),e}var $v=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,Te.ByPos,e,0,0).top,u=n.lineAt(a,Te.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function Su(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ii(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Su(r,e)):t._content)}var cp=B.define({combine:t=>t.join(" ")}),Xv=B.define({combine:t=>t.indexOf(!0)>-1}),Wv=Ln.newName(),MD=Ln.newName(),ND=Ln.newName(),RD={"&light":"."+MD,"&dark":"."+ND};function Zv(t,e,n){return new Ln(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var BF=Zv("."+Wv,{"&":{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":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},RD),IF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},pv=_.ie&&_.ie_version<=11,Jv=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new kv,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 i of n)this.queue.push(i);(_.ie&&_.ie_version<=11||_.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&_.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_.chrome&&_.chrome_version<126)&&(this.editContext=new e1(e),e.state.facet(mr)&&(e.contentDOM.editContext=this.editContext.editContext)),pv&&(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)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{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,i)=>n!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(mr)?i.root.activeElement!=this.dom:!xu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(_.ie&&_.ie_version<=11||_.android&&_.chrome)&&!i.state.selection.main.empty&&r.focusNode&&wu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Ru(e.root);if(!n)return!1;let i=_.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&qF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=xu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&DU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,IF),pv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),pv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Jl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&xu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new zv(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=SD(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!kp(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=_E(n,e.previousSibling||e.target.previousSibling,-1),r=_E(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):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(mr)!=e.state.facet(mr)&&(e.view.contentDOM.editContext=e.state.facet(mr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function _E(t,e,n){for(;e;){let i=Ie.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function LE(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return wu(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function qF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return LE(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?LE(t,n):null}var e1=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=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=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=xD(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let h=D.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));kp(h,r)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:le.of(i.text.slice(u.from,u.toB).split(`
197
- `))};if((_.mac||_.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:le.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);p1(e,f,D.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(be.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:fD.of(be.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Ru(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||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)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let 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,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},z=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var 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:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||EU(e.parent)||document,this.viewState=new Tp(this,e.state||Oe.create(e)),e.scrollTo&&e.scrollTo.is(rp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gl).map(r=>new Au(r));for(let r of this.plugins)r.update(this);this.observer=new Jv(this),this.inputState=new Hv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new xp(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof dt?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,i=!1,r,s=this.state;for(let h of e){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(CD))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ED(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Oe.phrases)!=this.state.facet(Oe.phrases))return this.setState(s);r=vp.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection,{x:p,y:m}=this.state.facet(t.cursorScrollMargin);f=new ku(d.empty?d:D.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",m,p)}for(let d of h.effects)d.is(rp)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Cp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(vu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(cp)!=r.state.facet(cp)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Cv))try{h(r)}catch(d){gn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!SD(this,u)&&c.force&&Jl(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 i of this.plugins)i.destroy(this);this.viewState=new Tp(this,e),this.plugins=e.facet(Gl).map(i=>new Au(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new xp(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(Gl),i=e.state.facet(Gl);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Au(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){gn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if($E(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(p){return gn(this.state,p),BE}}),f=vp.create(this,this.state,[]),h=!1;f.flags|=a,n?n.flags|=a:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=BE)try{let p=c[d];p.write&&p.write(u[d],this)}catch(p){gn(this.state,p)}if(h&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((p>1||p<-1)&&!(_.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Cv))l(n)}get themeClasses(){return Wv+" "+(this.state.facet(Xv)?ND:MD)+" "+this.state.facet(cp)}updateAttrs(){let e=IE(this,hD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(mr)?"true":"false",class:"cm-content",style:`${_.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),IE(this,f1,n);let i=this.observer.ignore(()=>{let r=pE(this.contentDOM,this.contentAttrs,n),s=pE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(vu);let e=this.state.facet(t.cspNonce);Ln.mount(this.root,this.styleModules.concat(BF).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;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==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,i){return dv(this,e,SE(this,e,n,i))}moveByGroup(e,n){return dv(this,e,SE(this,e,n,i=>sF(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return D.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return rF(this,e,n,i)}moveVertically(e,n,i){return dv(this,e,oF(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=Iv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Iv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[qn.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==Me.RTL)}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(cD)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>PF)return tD(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||eD(s.isolates,i=yE(this,e))))return s.order;i||(i=yE(this,e));let r=IU(e.text,n,i);return this.bidiCache.push(new Cp(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{GE(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={}){var i,r,s,o;return rp.of(new ku(typeof e=="number"?D.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return rp.of(new ku(D.cursor(i.from),"start","start",i.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 Pn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Pn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Ln.newName(),r=[cp.of(i),vu.of(Zv(`.${i}`,e))];return n&&n.dark&&r.push(Xv.of(!0)),r}static baseTheme(e){return bu.lowest(vu.of(Zv("."+Wv,e,RD)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&Ie.get(i)||Ie.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};z.styleModule=vu;z.inputHandler=lD;z.clipboardInputFilter=c1;z.clipboardOutputFilter=u1;z.scrollHandler=uD;z.focusChangeEffect=aD;z.perLineTextDirection=cD;z.exceptionSink=oD;z.updateListener=Cv;z.editable=mr;z.mouseSelectionStyle=sD;z.dragMovesSelection=rD;z.clickAddsSelectionRange=iD;z.decorations=Bp;z.blockWrappers=dD;z.outerDecorations=h1;z.atomicRanges=Lu;z.bidiIsolatedRanges=pD;z.cursorScrollMargin=B.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});z.scrollMargins=mD;z.darkTheme=Xv;z.cspNonce=B.define({combine:t=>t.length?t[0]:""});z.contentAttributes=f1;z.editorAttributes=hD;z.lineWrapping=z.contentAttributes.of({class:"cm-lineWrapping"});z.announce=ce.define();var PF=4096,BE={},Cp=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Me.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function IE(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&o1(o,n)}return n}var zF=_.mac?"mac":_.windows?"win":_.linux?"linux":"key";function HF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function up(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}var UF=bu.default(z.domEventHandlers({keydown(t,e){return YF(FF(e.state),t,e,"editor")}})),m1=B.define({enables:UF}),qE=new WeakMap;function FF(t){let e=t.facet(m1),n=qE.get(e);return n||qE.set(e,n=VF(e.reduce((i,r)=>i.concat(r),[]))),n}var us=null,jF=4e3;function VF(t,e=zF){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,h;let d=n[o]||(n[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>HF(y,e));for(let y=1;y<p.length;y++){let g=p.slice(0,y).join(" ");r(g,!0),d[g]||(d[g]={preventDefault:!0,stopPropagation:!1,run:[v=>{let S=us={view:v,prefix:g,scope:o};return setTimeout(()=>{us==S&&(us=null)},jF),!0}]})}let m=p.join(" ");r(m,!1);let b=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in u)u[h].run.push(d=>f(d,t1))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var t1=null;function YF(t,e,n,i){t1=e;let r=cE(e),s=QC(r,0),o=GC(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;us&&us.view==n&&us.scope==i&&(l=us.prefix+" ",kD.indexOf(e.keyCode)<0&&(c=!0,us=null));let f=new Set,h=b=>{if(b){for(let y of b.run)if(!f.has(y)&&(f.add(y),y(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},d=t[i],p,m;return d&&(h(d[l+up(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_.windows&&e.ctrlKey&&e.altKey)&&!(_.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=pr[e.keyCode])&&p!=r?(h(d[l+up(p,e,!0)])||e.shiftKey&&(m=Kl[e.keyCode])!=r&&m!=p&&h(d[l+up(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&h(d[l+up(r,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),t1=null,a}var Vfe=/x/.unicode!=null?"gu":"g";var fp="-10000px",Ep=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function KF(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var mv=B.define({combine:t=>{var e,n,i;return{position:_.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||KF}}}),PE=new WeakMap,_D=Pn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(mv);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ep(t,qp,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(mv);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=fp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(_.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=d1(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(mv).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],h=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=fp;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=h.right-h.left,b=(e=PE.get(c))!==null&&e!==void 0?e:h.bottom-h.top,y=c.offset||GF,g=this.view.textDirection==Me.LTR,v=h.width>i.right-i.left?g?i.left:i.right-h.width:g?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,f.left-m+(d?14:0)-y.x),i.right-m),S=this.above[l];!a.strictSide&&(S?f.top-b-p-y.y<i.top:f.bottom+b+p+y.y>i.bottom)&&S==i.bottom-f.bottom>f.top-i.top&&(S=this.above[l]=!S);let w=(S?f.top-i.top:i.bottom-f.bottom)-p;if(w<b&&c.resize!==!1){if(w<this.view.defaultLineHeight){u.style.top=fp;continue}PE.set(c,b),u.style.height=(b=w)/s+"px"}else u.style.height&&(u.style.height="");let A=S?f.top-b-p-y.y:f.bottom+p+y.y,k=v+m;if(c.overlap!==!0)for(let O of o)O.left<k&&O.right>v&&O.top<A+b&&O.bottom>A&&(A=S?O.top-b-2-p:O.bottom+p+2);if(this.position=="absolute"?(u.style.top=(A-t.parent.top)/s+"px",zE(u,(v-t.parent.left)/r)):(u.style.top=A/s+"px",zE(u,v/r)),d){let O=f.left+(g?y.x:-y.x)-(v+14-7);d.style.left=O/r+"px"}c.overlap!==!0&&o.push({left:v,top:A,right:k,bottom:A+b}),u.classList.toggle("cm-tooltip-above",S),u.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=fp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function zE(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var QF=z.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),GF={x:0,y:0},qp=B.define({enables:[_D,QF]}),Dp=B.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),Mp=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ep(e,Dp,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},$F=qp.compute([Dp],t=>{let e=t.facet(Dp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Mp.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),XF=B.define(),n1=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==Me.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>gn(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(_D),n=e?e.manager.tooltips.findIndex(i=>i.create==Mp.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!WF(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!ZF(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},hp=4;function WF(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-hp&&e.clientX<=i+hp&&e.clientY>=r-hp&&e.clientY<=s+hp}function ZF(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function LD(t,e={}){let n=ce.define(),i=new WeakMap,r=Ct.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,Ht.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),u);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),c.push(h)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(JF)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>Dp.from(o)}),s=Pn.define(o=>new n1(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,XF.of(s),$F]}}var JF=ce.define();var HE=B.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var ej=Pn.fromClass(class{constructor(t){this.input=t.state.facet(Np),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(HE);this.top=new Xl(t,!0,e.topContainer),this.bottom=new Xl(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(HE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Xl(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xl(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Np);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),Xl=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=UE(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=UE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function UE(t){let e=t.nextSibling;return t.remove(),e}var Np=B.define({enables:ej});var zn=class extends Ni{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};zn.prototype.elementClass="";zn.prototype.toDOM=void 0;zn.prototype.mapMode=Ht.TrackBefore;zn.prototype.startSide=zn.prototype.endSide=-1;zn.prototype.point=!0;var gv=B.define(),tj=B.define(),nj={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ue.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Eu=B.define();function g1(t){return[BD(),Eu.of({...nj,...t})]}var i1=B.define({combine:t=>t.some(e=>e)});function BD(t){let e=[ij];return t&&t.fixed===!1&&e.push(i1.of(!0)),e}var ij=Pn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Eu).map(e=>new Rp(t,e)),this.fixed=!t.state.facet(i1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(i1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ue.iter(this.view.state.facet(gv),this.view.viewport.from),i=[],r=this.gutters.map(s=>new s1(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==en.Text&&o){r1(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==en.Text){r1(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Eu),n=t.state.facet(Eu),i=t.docChanged||t.heightChanged||t.viewportChanged||!ue.eq(t.startState.facet(gv),t.state.facet(gv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new Rp(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Me.LTR?{left:i,right:r}:{right:i,left:r}})});function FE(t){return Array.isArray(t)?t:[t]}function r1(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var s1=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ue.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new _p(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];r1(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(tj)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}},Rp=class{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 i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=FE(n.markers(e)),n.initialSpacer&&(this.spacer=new _p(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=FE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!ue.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},_p=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),rj(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function rj(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}var sj=B.define(),oj=B.define(),Wl=B.define({combine(t){return cs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Du=class extends zn{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(Wl).formatNumber(e,t.state)}var lj=Eu.compute([Wl],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(sj)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Du(yv(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(oj)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Wl)!=e.state.facet(Wl),initialSpacer(e){return new Du(yv(e,jE(e.state.doc.lines)))},updateSpacer(e,n){let i=yv(n.view,jE(n.view.state.doc.lines));return i==e.number?e:new Du(i)},domEventHandlers:t.facet(Wl).domEventHandlers,side:"before"}));function ID(t={}){return[Wl.of(t),BD(),lj]}function jE(t){let e=9;for(;e<t;)e=e*10+9;return e}var aj=0,Bu=class{constructor(e,n){this.from=e,this.to=n}},Q=class{constructor(e={}){this.id=aj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Et.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};Q.closedBy=new Q({deserialize:t=>t.split(" ")});Q.openedBy=new Q({deserialize:t=>t.split(" ")});Q.group=new Q({deserialize:t=>t.split(" ")});Q.isolate=new Q({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Q.contextHash=new Q({perNode:!0});Q.lookAhead=new Q({perNode:!0});Q.mounted=new Q({perNode:!0});var ao=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[Q.mounted.id]}},cj=Object.create(null),Et=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):cj,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Q.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(Q.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};Et.none=new Et("",Object.create(null),0,8);var Iu=class t{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new Et(i.name,r,i.id,i.flags):i)}return new t(n)}},Pp=new WeakMap,qD=new WeakMap,qe;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(qe||(qe={}));var je=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=ao.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new zu(this.topNode,e)}cursorAt(e,n=0,i=0){let r=Pp.get(this)||this.topNode,s=new zu(r);return s.moveTo(e,n),Pp.set(this,s._tree),s}get topNode(){return new Li(this,0,0,null)}resolve(e,n=0){let i=qu(Pp.get(this)||this.topNode,e,n,!1);return Pp.set(this,i),i}resolveInner(e,n=0){let i=qu(qD.get(this)||this.topNode,e,n,!0);return qD.set(this,i),i}resolveStack(e,n=0){return uj(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&qe.IncludeAnonymous)>0;for(let a=this.cursor(o|qe.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.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:k1(Et.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(Et.none,n,i,r)))}static build(e){return fj(e)}};je.empty=new je(Et.none,[],[],0);var y1=class t{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 t(this.buffer,this.index)}},ps=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Et.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(HD(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function HD(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function qu(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof Li&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:qe.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Li&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var Hp=class{cursor(e=0){return new zu(this,e)}getChild(e,n=null,i=null){let r=PD(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return PD(this,e,n,i)}resolve(e,n=0){return qu(this,e,n,!1)}resolveInner(e,n=0){return qu(this,e,n,!0)}matchContext(e){return b1(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},Li=class t extends Hp{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,h;if(!(!(s&qe.EnterBracketed&&u instanceof je&&(h=ao.get(u))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+u.length)&&!HD(r,i,f,f+u.length))){if(u instanceof ps){if(s&qe.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,i-f,r);if(d>-1)return new Pu(new v1(o,u,e,f),null,d)}else if(s&qe.IncludeAnonymous||!u.type.isAnonymous||w1(u)){let d;if(!(s&qe.IgnoreMounts)&&(d=ao.get(u))&&!d.overlay)return new t(d.tree,f,e,o);let p=new t(u,f,e,o);return s&qe.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&qe.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&qe.IgnoreOverlays)&&(r=ao.get(this._tree))&&r.overlay){let s=e-this.from,o=i&qe.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function PD(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function b1(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var v1=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},Pu=class t extends Hp{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,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&qe.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(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 t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new je(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function UD(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof Li&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new S1(r,n)}var S1=class{constructor(e,n){this.heads=e,this.node=n}get next(){return UD(this.heads)}};function uj(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof Li?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=ao.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Li(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(qu(l,e,n,!1))}}return r?UD(r):i}var zu=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~qe.EnterBracketed,e instanceof Li)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Li?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&qe.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&qe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&qe.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&qe.IncludeAnonymous||l instanceof ps||!l.type.isAnonymous||w1(l))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<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new Pu(this.buffer,n,this.stack[r]);return this.bufferNode=new Pu(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return b1(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return b1(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function w1(t){return t.children.some(e=>e instanceof ps||!e.type.isAnonymous||w1(e))}function fj(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new y1(n,n.length):n,a=i.types,c=0,u=0;function f(w,A,k,O,M,E){let{id:L,start:R,end:j,size:pe}=l,Ee=u,Vt=c;if(pe<0)if(l.next(),pe==-1){let at=s[L];k.push(at),O.push(R-w);return}else if(pe==-3){c=L;return}else if(pe==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${pe}`);let xe=a[L],xn,Ze,jn=R-w;if(j-R<=r&&(Ze=b(l.pos-A,M))){let at=new Uint16Array(Ze.size-Ze.skip),Je=l.pos-Ze.size,et=at.length;for(;l.pos>Je;)et=y(Ze.start,at,et);xn=new ps(at,j-Ze.start,i),jn=Ze.start-w}else{let at=l.pos-pe;l.next();let Je=[],et=[],Nt=L>=o?L:-1,Yt=0,Vn=j;for(;l.pos>at;)Nt>=0&&l.id==Nt&&l.size>=0?(l.end<=Vn-r&&(p(Je,et,R,Yt,l.end,Vn,Nt,Ee,Vt),Yt=Je.length,Vn=l.end),l.next()):E>2500?h(R,at,Je,et):f(R,at,Je,et,Nt,E+1);if(Nt>=0&&Yt>0&&Yt<Je.length&&p(Je,et,R,Yt,R,Vn,Nt,Ee,Vt),Je.reverse(),et.reverse(),Nt>-1&&Yt>0){let Yn=d(xe,Vt);xn=k1(xe,Je,et,0,Je.length,0,j-R,Yn,Yn)}else xn=m(xe,Je,et,j-R,Ee-j,Vt)}k.push(xn),O.push(jn)}function h(w,A,k,O){let M=[],E=0,L=-1;for(;l.pos>A;){let{id:R,start:j,end:pe,size:Ee}=l;if(Ee>4)l.next();else{if(L>-1&&j<L)break;L<0&&(L=pe-r),M.push(R,j,pe),E++,l.next()}}if(E){let R=new Uint16Array(E*4),j=M[M.length-2];for(let pe=M.length-3,Ee=0;pe>=0;pe-=3)R[Ee++]=M[pe],R[Ee++]=M[pe+1]-j,R[Ee++]=M[pe+2]-j,R[Ee++]=Ee;k.push(new ps(R,M[2]-j,i)),O.push(j-w)}}function d(w,A){return(k,O,M)=>{let E=0,L=k.length-1,R,j;if(L>=0&&(R=k[L])instanceof je){if(!L&&R.type==w&&R.length==M)return R;(j=R.prop(Q.lookAhead))&&(E=O[L]+R.length+j)}return m(w,k,O,M,E,A)}}function p(w,A,k,O,M,E,L,R,j){let pe=[],Ee=[];for(;w.length>O;)pe.push(w.pop()),Ee.push(A.pop()+k-M);w.push(m(i.types[L],pe,Ee,E-M,R-E,j)),A.push(M-k)}function m(w,A,k,O,M,E,L){if(E){let R=[Q.contextHash,E];L=L?[R].concat(L):[R]}if(M>25){let R=[Q.lookAhead,M];L=L?[R].concat(L):[R]}return new je(w,A,k,O,L)}function b(w,A){let k=l.fork(),O=0,M=0,E=0,L=k.end-r,R={size:0,start:0,skip:0};e:for(let j=k.pos-w;k.pos>j;){let pe=k.size;if(k.id==A&&pe>=0){R.size=O,R.start=M,R.skip=E,E+=4,O+=4,k.next();continue}let Ee=k.pos-pe;if(pe<0||Ee<j||k.start<L)break;let Vt=k.id>=o?4:0,xe=k.start;for(k.next();k.pos>Ee;){if(k.size<0)if(k.size==-3||k.size==-4)Vt+=4;else break e;else k.id>=o&&(Vt+=4);k.next()}M=xe,O+=pe,E+=Vt}return(A<0||O==w)&&(R.size=O,R.start=M,R.skip=E),R.size>4?R:void 0}function y(w,A,k){let{id:O,start:M,end:E,size:L}=l;if(l.next(),L>=0&&O<o){let R=k;if(L>4){let j=l.pos-(L-4);for(;l.pos>j;)k=y(w,A,k)}A[--k]=R,A[--k]=E-w,A[--k]=M-w,A[--k]=O}else L==-3?c=O:L==-4&&(u=O);return k}let g=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,g,v,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:g.length?v[0]+g[0].length:0;return new je(a[t.topID],g.reverse(),v.reverse(),S)}var zD=new WeakMap;function zp(t,e){if(!t.isAnonymous||e instanceof ps||e.type!=t)return 1;let n=zD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof je)){n=1;break}n+=zp(t,i)}zD.set(e,n)}return n}function k1(t,e,n,i,r,s,o,l,a){let c=0;for(let p=i;p<r;p++)c+=zp(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(p,m,b,y,g){for(let v=b;v<y;){let S=v,w=m[v],A=zp(t,p[v]);for(v++;v<y;v++){let k=zp(t,p[v]);if(A+k>=u)break;A+=k}if(v==S+1){if(A>u){let k=p[S];d(k.children,k.positions,0,k.children.length,m[S]+g);continue}f.push(p[S])}else{let k=m[v-1]+p[v-1].length-w;f.push(k1(t,p,m,S,v,w,k,null,a))}h.push(w+g-s)}}return d(e,n,i,r,0),(l||a)(f,h,o)}var co=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let h=o;if(a>=h.from||f<=h.to||c){let d=Math.max(h.from,a)-c,p=Math.min(h.to,f)-c;h=d>=p?null:new t(d,p,h.tree,h.offset+c,l>0,!!u)}if(h&&r.push(h),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},sa=class{startParse(e,n,i){return typeof e=="string"&&(e=new x1(e)),i=i?i.length?i.map(r=>new Bu(r.from,r.to)):[new Bu(0,0)]:[new Bu(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},x1=class{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)}};var Xfe=new Q({perNode:!0});var hj=0,oi=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=hj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new Vp(e);return i=>i.modified.indexOf(n)>-1?i:Vp.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},dj=0,Vp=class t{constructor(e){this.name=e,this.instances=[],this.id=dj++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&pj(n,l.modified));if(i)return i;let r=[],s=new oi(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=mj(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function pj(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function mj(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function oa(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new fo(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return VD.add(e)}var VD=new Q({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new fo(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),fo=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};fo.empty=new fo([],2,null);function C1(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function gj(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function YD(t,e,n,i=0,r=t.length){let s=new O1(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var O1=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,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,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=yj(e)||fo.empty,f=gj(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let h=e.tree&&e.tree.prop(Q.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),p=this.highlighters.filter(b=>!b.scope||b.scope(h.tree.type)),m=e.firstChild();for(let b=0,y=l;;b++){let g=b<h.overlay.length?h.overlay[b]:null,v=g?g.from+l:a,S=Math.max(n,y),w=Math.min(i,v);if(S<w&&m)for(;e.from<w&&(this.highlightRange(e,S,w,r,s),this.startSpan(Math.min(w,e.to),c),!(e.to>=v||!e.nextSibling())););if(!g||v>i)break;y=g.to+l,y>n&&(this.highlightRange(d.cursor(),Math.max(n,g.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}m&&e.parent()}else if(e.firstChild()){h&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function yj(t){let e=t.type.prop(VD);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var N=oi.define,Up=N(),ms=N(),FD=N(ms),jD=N(ms),gs=N(),Fp=N(gs),A1=N(gs),qi=N(),uo=N(qi),Bi=N(),Ii=N(),T1=N(),Hu=N(T1),jp=N(),T={comment:Up,lineComment:N(Up),blockComment:N(Up),docComment:N(Up),name:ms,variableName:N(ms),typeName:FD,tagName:N(FD),propertyName:jD,attributeName:N(jD),className:N(ms),labelName:N(ms),namespace:N(ms),macroName:N(ms),literal:gs,string:Fp,docString:N(Fp),character:N(Fp),attributeValue:N(Fp),number:A1,integer:N(A1),float:N(A1),bool:N(gs),regexp:N(gs),escape:N(gs),color:N(gs),url:N(gs),keyword:Bi,self:N(Bi),null:N(Bi),atom:N(Bi),unit:N(Bi),modifier:N(Bi),operatorKeyword:N(Bi),controlKeyword:N(Bi),definitionKeyword:N(Bi),moduleKeyword:N(Bi),operator:Ii,derefOperator:N(Ii),arithmeticOperator:N(Ii),logicOperator:N(Ii),bitwiseOperator:N(Ii),compareOperator:N(Ii),updateOperator:N(Ii),definitionOperator:N(Ii),typeOperator:N(Ii),controlOperator:N(Ii),punctuation:T1,separator:N(T1),bracket:Hu,angleBracket:N(Hu),squareBracket:N(Hu),paren:N(Hu),brace:N(Hu),content:qi,heading:uo,heading1:N(uo),heading2:N(uo),heading3:N(uo),heading4:N(uo),heading5:N(uo),heading6:N(uo),contentSeparator:N(qi),list:N(qi),quote:N(qi),emphasis:N(qi),strong:N(qi),link:N(qi),monospace:N(qi),strikethrough:N(qi),inserted:N(),deleted:N(),changed:N(),invalid:N(),meta:jp,documentMeta:N(jp),annotation:N(jp),processingInstruction:N(jp),definition:oi.defineModifier("definition"),constant:oi.defineModifier("constant"),function:oi.defineModifier("function"),standard:oi.defineModifier("standard"),local:oi.defineModifier("local"),special:oi.defineModifier("special")};for(let t in T){let e=T[t];e instanceof oi&&(e.name=t)}var Jfe=C1([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var E1,la=new Q;function bj(t){return B.define({combine:t?e=>e.concat(t):void 0})}var vj=new Q,bn=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,Oe.prototype.hasOwnProperty("tree")||Object.defineProperty(Oe.prototype,"tree",{get(){return li(this)}}),this.parser=n,this.extension=[aa.of(this),Oe.languageData.of((s,o,l)=>{let a=KD(s,o,l),c=a.type.prop(la);if(!c)return[];let u=s.facet(c),f=a.type.prop(vj);if(f){let h=a.resolve(o-a.from,l);for(let d of f)if(d.test(h,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return KD(e,n,i).type.prop(la)==this.data}findRegions(e){let n=e.facet(aa);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(la)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(Q.mounted);if(l){if(l.tree.prop(la)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof je&&r(c,s.positions[a]+o)}};return r(li(e),0),i}get allowsNesting(){return!0}};bn.setState=ce.define();function KD(t,e,n){let i=t.facet(aa),r=li(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,qe.ExcludeBuffers|qe.EnterBracketed))s.type.isTop&&(r=s);return r}var Fu=class t extends bn{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=bj(e.languageData);return new t(n,e.parser.configure({props:[la.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function li(t){let e=t.field(bn.state,!1);return e?e.tree:je.empty}var R1=class{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 i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},Uu=null,_1=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],je.empty,0,i,[],null)}startParse(){return this.parser.startParse(new R1(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=je.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(co.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=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(co.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Uu;Uu=this;try{return e()}finally{Uu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=QD(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,h)=>a.push({fromA:c,toA:u,fromB:f,toB:h})),i=co.applyChanges(i,a),r=je.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=QD(this.fragments,r,s),this.skipped.splice(i--,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 sa{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Uu;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new je(Et.none,[],[],o-s)},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 Uu}};function QD(t,e,n){return co.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var ju=class t{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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=_1.create(e.facet(aa).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};bn.state=Ct.define({create:ju.init,update(t,e){for(let n of e.effects)if(n.is(bn.setState))return n.value;return e.startState.facet(aa)!=e.state.facet(aa)?ju.init(e.state):t.apply(e)}});var WD=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(WD=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var D1=typeof navigator<"u"&&(!((E1=navigator.scheduling)===null||E1===void 0)&&E1.isInputPending)?()=>navigator.scheduling.isInputPending():null,Sj=Pn.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(bn.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(bn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=WD(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(bn.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!D1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>D1&&D1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:bn.setState.of(new ju(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>gn(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()}}}),aa=B.define({combine(t){return t.length?t[0]:null},enables:t=>[bn.state,Sj,z.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),Yp=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var xj=B.define(),Kp=B.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 Vu(t){let e=t.facet(Kp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Yu(t,e){let n="",i=t.tabSize,r=t.facet(Kp)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function z1(t,e){t instanceof Oe&&(t=new ho(t));for(let i of t.state.facet(xj)){let r=i(t,e);if(r!==void 0)return r}let n=li(t.state);return n.length>=e?wj(t,n,e):null}var ho=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=Vu(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return no(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},H1=new Q;function wj(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return ZD(i,t,n)}function ZD(t,e,n){for(let i=t;i;i=i.next){let r=Aj(i.node);if(r)return r(L1.create(e,n,i))}return 0}function kj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Aj(t){let e=t.type.prop(H1);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(Q.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>JD(o,!0,1,void 0,s&&!kj(o)?r.from:void 0)}return t.parent==null?Oj:null}function Oj(){return 0}var L1=class t extends ho{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}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 i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Tj(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return ZD(this.context.next,this.base,this.pos)}};function Tj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Cj(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function U1({closing:t,align:e=!0,units:n=1}){return i=>JD(i,e,n,t)}function JD(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?Cj(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var eM=new Q;function tM(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}var ca=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=Ln.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof bn?l=>l.prop(la)==o.data:o?l=>l==o:void 0,this.style=C1(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Ln(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},B1=B.define(),nM=B.define({combine(t){return t.length?[t[0]]:null}});function M1(t){let e=t.facet(B1);return e.length?e:t.facet(nM)}function iM(t,e){let n=[Ej],i;return t instanceof ca&&(t.module&&n.push(z.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(nM.of(t)):i?n.push(B1.computeN([z.darkTheme],r=>r.facet(z.darkTheme)==(i=="dark")?[t]:[])):n.push(B1.of(t)),n}var I1=class{constructor(e){this.markCache=Object.create(null),this.tree=li(e.state),this.decorations=this.buildDeco(e,M1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=li(e.state),i=M1(e.state),r=i!=M1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return be.none;let i=new dr;for(let{from:r,to:s}of e.visibleRanges)YD(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=be.mark({class:a})))},r,s);return i.finish()}},Ej=bu.high(Pn.fromClass(I1,{decorations:t=>t.decorations})),lhe=ca.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]);var Dj=1e4,Mj="()[]{}";var Nj=new Q;function q1(t,e,n){let i=t.prop(e<0?Q.openedBy:Q.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function P1(t){let e=t.type.prop(Nj);return e?e(t.node):t}function po(t,e,n,i={}){let r=i.maxScanDistance||Dj,s=i.brackets||Mj,o=li(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=q1(a.type,n,s);if(c&&a.from<a.to){let u=P1(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Rj(t,e,n,a,u,c,s)}}return _j(t,e,n,o,l.type,r,s)}function Rj(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=P1(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(q1(u.type,n,o))c++;else if(q1(u.type,-n,o)){if(c==0){let f=P1(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function _j(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)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),f=0;for(let h=0;!u.next().done&&h<=s;){let d=u.value;n<0&&(h+=d.length);let p=e+h*n;for(let m=n>0?0:d.length-1,b=n>0?d.length:-1;m!=b;m+=n){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}var Lj=Object.create(null),GD=[Et.none];var $D=[],XD=Object.create(null),Bj=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"]])Bj[t]=Ij(Lj,e);function N1(t,e){$D.indexOf(t)>-1||($D.push(t),console.warn(e))}function Ij(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||T[c];u?typeof u=="function"?a.length?a=a.map(u):N1(c,`Modifier ${c} used at start of tag`):a.length?N1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:N1(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=XD[r];if(s)return s.id;let o=XD[r]=Et.define({id:GD.length,name:i,props:[oa({[i]:n})]});return GD.push(o),o.id}var ahe={rtl:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Me.RTL}),ltr:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Me.LTR}),auto:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var qj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=G1(t.state,n.from);return i.line?Pj(t):i.block?Hj(t):!1};function Q1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var Pj=Q1(jj,0);var zj=Q1(hM,0);var Hj=Q1((t,e)=>hM(t,e,Fj(e)),0);function G1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var Ku=50;function Uj(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-Ku,i),o=t.sliceDoc(r,r+Ku),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*Ku?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+Ku),f=t.sliceDoc(r-Ku,r));let h=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return u.slice(h,h+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:i+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Fj(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function hM(t,e,n=e.selection.ranges){let i=n.map(s=>G1(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>Uj(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function jj(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=G1(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+c.length)==c?h:-1;h<f.text.length&&h<a&&(a=h),i.push({line:f,comment:p,token:c,indent:h,empty:d,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var j1=_n.define(),Vj=_n.define(),Yj=B.define(),dM=B.define({combine(t){return cs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),pM=Ct.define({create(){return mo.empty},update(t,e){let n=e.state.facet(dM),i=e.annotation(j1);if(i){let a=ai.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=Gp(u,u.length,n.minDepth,a):u=bM(u,e.startState.selection),new mo(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(Vj);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(dt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=ai.fromTransaction(e),o=e.annotation(dt.time),l=e.annotation(dt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="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 mo(t.done.map(ai.fromJSON),t.undone.map(ai.fromJSON))}});function mM(t={}){return[pM,dM.of(t),z.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?gM:e.inputType=="historyRedo"?V1:null;return i?(e.preventDefault(),i(n)):!1}})]}function $p(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(pM,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var gM=$p(0,!1),V1=$p(1,!1),Kj=$p(0,!0),Qj=$p(1,!0);var ai=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&Ut.fromJSON(e.changes),[],e.mapped&&hr.fromJSON(e.mapped),e.startSelection&&D.fromJSON(e.startSelection),e.selectionsAfter.map(D.fromJSON))}static fromTransaction(e,n){let i=Hn;for(let r of e.startState.facet(Yj)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Hn)}static selection(e){return new t(void 0,Hn,void 0,void 0,e)}};function Gp(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function Gj(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function $j(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function yM(t,e){return t.length?e.length?t.concat(e):t:e}var Hn=[],Xj=200;function bM(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Xj));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Gp(t,t.length-1,1e9,n.setSelAfter(i)))}else return[ai.selection([e])]}function Wj(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 F1(t,e){if(!t.length)return t;let n=t.length,i=Hn;for(;n;){let r=Zj(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ai.selection(i)]:Hn}function Zj(t,e,n){let i=yM(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Hn,n);if(!t.changes)return ai.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new ai(r,ce.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var Jj=/^(input\.type|delete)($|\.)/,mo=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Jj.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,Gj(l.changes,e.changes))||i=="input.type.compose")?o=Gp(o,o.length-1,r.minDepth,new ai(e.changes.compose(l.changes),yM(ce.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Hn)):o=Gp(o,o.length,r.minDepth,e),new t(o,Hn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Hn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&$j(s[s.length-1],e)?this:new t(bM(this.done,e),this.undone,n,i)}addMapping(e){return new t(F1(this.done,e),F1(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:j1.of({side:e,rest:Wj(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Hn:r.slice(0,r.length-1);return s.mapped&&(l=F1(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:j1.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};mo.empty=new mo(Hn,Hn);var vM=[{key:"Mod-z",run:gM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:V1,preventDefault:!0},{linux:"Ctrl-Shift-z",run:V1,preventDefault:!0},{key:"Mod-u",run:Kj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Qj,preventDefault:!0}];function ua(t,e){return D.create(t.ranges.map(e),t.mainIndex)}function ci(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function ui({state:t,dispatch:e},n){let i=ua(t.selection,n);return i.eq(t.selection,!0)?!1:(e(ci(t,i)),!0)}function Xp(t,e){return D.cursor(e?t.to:t.from)}function SM(t,e){return ui(t,n=>n.empty?t.moveByChar(n,e):Xp(n,e))}function Dt(t){return t.textDirectionAt(t.state.selection.main.head)==Me.LTR}var xM=t=>SM(t,!Dt(t)),wM=t=>SM(t,Dt(t));function kM(t,e){return ui(t,n=>n.empty?t.moveByGroup(n,e):Xp(n,e))}var e7=t=>kM(t,!Dt(t)),t7=t=>kM(t,Dt(t));var mhe=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function n7(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Wp(t,e,n){let i=li(t).resolveInner(e.head),r=n?Q.closedBy:Q.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;n7(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?po(t,i.from,1):po(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,D.cursor(l,n?-1:1)}var i7=t=>ui(t,e=>Wp(t.state,e,!Dt(t))),r7=t=>ui(t,e=>Wp(t.state,e,Dt(t)));function AM(t,e){return ui(t,n=>{if(!n.empty)return Xp(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var OM=t=>AM(t,!1),TM=t=>AM(t,!0);function CM(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(z.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function EM(t,e){let n=CM(t),{state:i}=t,r=ua(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):Xp(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(ci(i,r),{effects:s}),!0}var rM=t=>EM(t,!1),Y1=t=>EM(t,!0);function ys(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=D.cursor(i.from+s))}return r}var s7=t=>ui(t,e=>ys(t,e,!0)),o7=t=>ui(t,e=>ys(t,e,!1)),l7=t=>ui(t,e=>ys(t,e,!Dt(t))),a7=t=>ui(t,e=>ys(t,e,Dt(t))),c7=t=>ui(t,e=>D.cursor(t.lineBlockAt(e.head).from,1)),u7=t=>ui(t,e=>D.cursor(t.lineBlockAt(e.head).to,-1));function f7(t,e,n){let i=!1,r=ua(t.selection,s=>{let o=po(t,s.head,-1)||po(t,s.head,1)||s.head>0&&po(t,s.head-1,1)||s.head<t.doc.length&&po(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?D.range(s.anchor,l):D.cursor(l)});return i?(e(ci(t,r)),!0):!1}var h7=({state:t,dispatch:e})=>f7(t,e,!1);function Un(t,e,n){let i=ua(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=D.range(r.head,r.anchor));let s=n(r);return D.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(ci(t.state,i)),!0)}function DM(t,e){return Un(t,e,n=>t.moveByChar(n,e))}var MM=t=>DM(t,!Dt(t)),NM=t=>DM(t,Dt(t));function RM(t,e){return Un(t,e,n=>t.moveByGroup(n,e))}var d7=t=>RM(t,!Dt(t)),p7=t=>RM(t,Dt(t));var m7=t=>{let e=!Dt(t);return Un(t,e,n=>Wp(t.state,n,e))},g7=t=>{let e=Dt(t);return Un(t,e,n=>Wp(t.state,n,e))};function _M(t,e){return Un(t,e,n=>t.moveVertically(n,e))}var LM=t=>_M(t,!1),BM=t=>_M(t,!0);function IM(t,e){return Un(t,e,n=>t.moveVertically(n,e,CM(t).height))}var sM=t=>IM(t,!1),oM=t=>IM(t,!0),y7=t=>Un(t,!0,e=>ys(t,e,!0)),b7=t=>Un(t,!1,e=>ys(t,e,!1)),v7=t=>{let e=!Dt(t);return Un(t,e,n=>ys(t,n,e))},S7=t=>{let e=Dt(t);return Un(t,e,n=>ys(t,n,e))},x7=t=>Un(t,!1,e=>D.cursor(t.lineBlockAt(e.head).from)),w7=t=>Un(t,!0,e=>D.cursor(t.lineBlockAt(e.head).to)),lM=({state:t,dispatch:e})=>(e(ci(t,{anchor:0})),!0),aM=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.doc.length})),!0),cM=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.selection.main.anchor,head:0})),!0),uM=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),k7=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),A7=({state:t,dispatch:e})=>{let n=Zp(t).map(({from:i,to:r})=>D.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:D.create(n),userEvent:"select"})),!0},O7=({state:t,dispatch:e})=>{let n=ua(t.selection,i=>{let r=li(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return D.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(ci(t,n)),!0)};function qM(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(ci(n,D.create(r,r.length-1))),!0)}var T7=t=>qM(t,!1),C7=t=>qM(t,!0),E7=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=D.create([n.main]):n.main.empty||(i=D.create([D.cursor(n.main.head)])),i?(e(ci(t,i)),!0):!1};function Qu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=Qp(t,a,!1)):a>o&&(n="delete.forward",a=Qp(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Qp(t,o,!1),l=Qp(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:D.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?z.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Qp(t,e,n){if(t instanceof z)for(let i of t.state.facet(z.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var PM=(t,e,n)=>Qu(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=no(l,s.tabSize),u=c%Vu(s)||Vu(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=pt(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=pt(o.text,a-o.from,!1,!1)+o.from);return a}),K1=t=>PM(t,!1,!0);var zM=t=>PM(t,!0,!1),HM=(t,e)=>Qu(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=pt(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),UM=t=>HM(t,!1),D7=t=>HM(t,!0);var M7=t=>Qu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var N7=t=>Qu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),R7=t=>Qu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var _7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:le.of(["",""])},range:D.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},L7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:pt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:pt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:D.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Zp(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function FM(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of Zp(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(D.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(D.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:D.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var B7=({state:t,dispatch:e})=>FM(t,e,!1),I7=({state:t,dispatch:e})=>FM(t,e,!0);function jM(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of Zp(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var q7=({state:t,dispatch:e})=>jM(t,e,!1),P7=({state:t,dispatch:e})=>jM(t,e,!0),z7=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Zp(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=ua(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function H7(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=li(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(Q.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var fM=VM(!1),U7=VM(!0);function VM(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&H7(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new ho(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=z1(c,s);for(u==null&&(u=no(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",Yu(e,u)];return a&&f.push(Yu(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:le.of(f)},range:D.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function $1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:D.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var F7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new ho(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=$1(t,(s,o,l)=>{let a=z1(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=Yu(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},j7=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update($1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Kp)})}),{userEvent:"input.indent"})),!0),V7=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update($1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=no(r,t.tabSize),o=0,l=Yu(t,Math.max(0,s-Vu(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),Y7=t=>(t.setTabFocusMode(),!0);var K7=[{key:"Ctrl-b",run:xM,shift:MM,preventDefault:!0},{key:"Ctrl-f",run:wM,shift:NM},{key:"Ctrl-p",run:OM,shift:LM},{key:"Ctrl-n",run:TM,shift:BM},{key:"Ctrl-a",run:c7,shift:x7},{key:"Ctrl-e",run:u7,shift:w7},{key:"Ctrl-d",run:zM},{key:"Ctrl-h",run:K1},{key:"Ctrl-k",run:M7},{key:"Ctrl-Alt-h",run:UM},{key:"Ctrl-o",run:_7},{key:"Ctrl-t",run:L7},{key:"Ctrl-v",run:Y1}],Q7=[{key:"ArrowLeft",run:xM,shift:MM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e7,shift:d7,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:l7,shift:v7,preventDefault:!0},{key:"ArrowRight",run:wM,shift:NM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t7,shift:p7,preventDefault:!0},{mac:"Cmd-ArrowRight",run:a7,shift:S7,preventDefault:!0},{key:"ArrowUp",run:OM,shift:LM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:lM,shift:cM},{mac:"Ctrl-ArrowUp",run:rM,shift:sM},{key:"ArrowDown",run:TM,shift:BM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:aM,shift:uM},{mac:"Ctrl-ArrowDown",run:Y1,shift:oM},{key:"PageUp",run:rM,shift:sM},{key:"PageDown",run:Y1,shift:oM},{key:"Home",run:o7,shift:b7,preventDefault:!0},{key:"Mod-Home",run:lM,shift:cM},{key:"End",run:s7,shift:y7,preventDefault:!0},{key:"Mod-End",run:aM,shift:uM},{key:"Enter",run:fM,shift:fM},{key:"Mod-a",run:k7},{key:"Backspace",run:K1,shift:K1,preventDefault:!0},{key:"Delete",run:zM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:UM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:D7,preventDefault:!0},{mac:"Mod-Backspace",run:N7,preventDefault:!0},{mac:"Mod-Delete",run:R7,preventDefault:!0}].concat(K7.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),YM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:i7,shift:m7},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:r7,shift:g7},{key:"Alt-ArrowUp",run:B7},{key:"Shift-Alt-ArrowUp",run:q7},{key:"Alt-ArrowDown",run:I7},{key:"Shift-Alt-ArrowDown",run:P7},{key:"Mod-Alt-ArrowUp",run:T7},{key:"Mod-Alt-ArrowDown",run:C7},{key:"Escape",run:E7},{key:"Mod-Enter",run:U7},{key:"Alt-l",mac:"Ctrl-l",run:A7},{key:"Mod-i",run:O7,preventDefault:!0},{key:"Mod-[",run:V7},{key:"Mod-]",run:j7},{key:"Mod-Alt-\\",run:F7},{key:"Shift-Mod-k",run:z7},{key:"Shift-Mod-\\",run:h7},{key:"Mod-/",run:qj},{key:"Alt-A",run:zj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Y7}].concat(Q7);var Z1=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new Jp(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new J1(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}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 r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}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=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new Jp(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Jp=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},J1=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},eS=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(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 t(this.stack,this.pos,this.index)}};function Gu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var fa=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},KM=new fa,tS=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=KM,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=KM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(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 i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},bs=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;WM(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};bs.prototype.contextual=bs.prototype.fallback=bs.prototype.extend=!1;var nS=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?Gu(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(WM(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};nS.prototype.contextual=bs.prototype.fallback=bs.prototype.extend=!1;var go=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function WM(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let d=o+3;d<c;d+=2)if((t[d+1]&l)>0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||$7(p,e.token.value,r,s))){e.acceptToken(p);break}}let u=e.next,f=0,h=t[o+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){o=t[c+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=c+d+(d<<1),m=t[p],b=t[p+1]||65536;if(u<m)h=d;else if(u>=b)f=d+1;else{o=t[p+2],e.advance();continue e}}break}}function QM(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function $7(t,e,n,i){let r=QM(n,i,e);return r<0||QM(n,i,t)<r}var vn=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),X1=null;function GM(t,e,n){let i=t.cursor(qe.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var iS=class{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?GM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?GM(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof je){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(Q.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},rS=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new fa)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new fa,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new fa,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=vr(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(vr(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(vr(l,c+1),n,i,r))}return r}},sS=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new tS(n,r),this.tokens=new rS(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[Z1.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new iS(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&X7(r);if(o)return vn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw vn&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return vn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,i){let r=e.pos,{parser:s}=this,o=vn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>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 f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(Q.contextHash)||0)==u))return e.useNode(f,h),vn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof je)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof je&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),vn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],h=a[c++],d=c==a.length||!i,p=d?e:e.split(),m=this.tokens.mainToken;if(p.apply(u,f,m?m.start:p.pos,h),vn&&console.log(o+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${p==e?"":", split"})`),d)return!0;p.pos>r?n.push(p):i.push(p)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return $M(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=vn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),vn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=u;for(let d=0;d<10&&f.forceReduce()&&(vn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)vn&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))vn&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),vn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),$M(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),je.build({buffer:eS.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(X1||(X1=new WeakMap)).get(e);return n||X1.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function $M(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var oS=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},W1=t=>t,em=class{constructor(e){this.start=e.start,this.shift=e.shift||W1,this.reduce=e.reduce||W1,this.reuse=e.reuse||W1,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},ha=class t extends sa{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 l=0;l<e.repeatNodeCount;l++)n.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=Q[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let h=-u;h>0;h--)s(l[c++],a,f);c++}}}this.nodeSet=new Iu(n.map((l,a)=>Et.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Gu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(XM),this.states=Gu(e.states,Uint32Array),this.data=Gu(e.stateData),this.goto=Gu(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new bs(o,l):l),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,i){let r=new sS(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=vr(i,s+2)];else{if(i[s+1]==2)return vr(i,s+2);break}if(o==n||o==0)return vr(i,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vr(this.data,s+2);else break;r=n(vr(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=vr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=XM(o),o})),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),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new oS(e,i,r)}static deserialize(e){return new t(e)}};function vr(t,e){return t[e]|t[e+1]<<16}function X7(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function XM(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var da=63,ZM=64,W7=1,Z7=2,tN=3,J7=4,nN=5,eV=6,tV=7,iN=65,nV=66,iV=8,rV=9,sV=10,oV=11,lV=12,rN=13,aV=19,cV=20,uV=29,fV=33,hV=34,dV=47,pV=0,hS=1,aS=2,Xu=3,cS=4,Sr=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};Sr.top=new Sr(null,-1,pV);function $u(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(xr(r)||r==-1)return n}}function uS(t){return t==32||t==9}function xr(t){return t==10||t==13}function sN(t){return uS(t)||xr(t)}function yo(t){return t<0||sN(t)}var mV=new em({start:Sr.top,reduce(t,e){return t.type==Xu&&(e==cV||e==hV)?t.parent:t},shift(t,e,n,i){if(e==tN)return new Sr(t,$u(i,i.pos),hS);if(e==iN||e==nN)return new Sr(t,$u(i,i.pos),aS);if(e==da)return t.parent;if(e==aV||e==fV)return new Sr(t,0,Xu);if(e==rN&&t.type==cS)return t.parent;if(e==dV){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Sr(t,t.depth+ +r[0],cS)}return t},hash(t){return t.hash}});function pa(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&yo(t.peek(n+3))}var gV=new go((t,e)=>{if(t.next==-1&&e.canShift(ZM))return t.acceptToken(ZM);let n=t.peek(-1);if((xr(n)||n<0)&&e.context.type!=Xu){if(pa(t,45))if(e.canShift(da))t.acceptToken(da);else return t.acceptToken(W7,3);if(pa(t,46))if(e.canShift(da))t.acceptToken(da);else return t.acceptToken(Z7,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==hS&&(t.next!=45||!yo(t.peek(1))))&&t.next!=-1&&!xr(t.next)&&t.next!=35&&t.acceptToken(da,-i)}},{contextual:!0}),yV=new go((t,e)=>{if(e.context.type==Xu){t.next==63&&(t.advance(),yo(t.next)&&t.acceptToken(tV));return}if(t.next==45)t.advance(),yo(t.next)&&t.acceptToken(e.context.type==hS&&e.context.depth==$u(t,t.pos-1)?J7:tN);else if(t.next==63)t.advance(),yo(t.next)&&t.acceptToken(e.context.type==aS&&e.context.depth==$u(t,t.pos-1)?eV:nN);else{let n=t.pos;for(;;)if(uS(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)oN(t);else if(t.next==38)fS(t);else if(t.next==42){fS(t);break}else if(t.next==39||t.next==34){if(dS(t,!0))break;return}else if(t.next==91||t.next==123){if(!vV(t))return;break}else{lN(t,!0,!1,0);break}for(;uS(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(uV))return;let i=t.peek(1);yo(i)&&t.acceptTokenTo(e.context.type==aS&&e.context.depth==$u(t,n)?nV:iN,n)}}},{contextual:!0});function bV(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function JM(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function eN(t,e){return t.next==37?(t.advance(),JM(t.next)&&t.advance(),JM(t.next)&&t.advance(),!0):bV(t.next)||e&&t.next==44?(t.advance(),!0):!1}function oN(t){if(t.advance(),t.next==60){for(t.advance();;)if(!eN(t,!0)){t.next==62&&t.advance();break}}else for(;eN(t,!1););}function fS(t){for(t.advance();!yo(t.next)&&tm(t.next)!="f";)t.advance()}function dS(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(xr(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function vV(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!dS(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||xr(t.next))return!1;t.advance()}}var SV="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function tm(t){return t<33?"u":t>125?"s":SV[t-33]}function lS(t,e){let n=tm(t);return n!="u"&&!(e&&n=="f")}function lN(t,e,n,i){if(tm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&lS(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;sN(s);){if(xr(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?lS(t.peek(o+1),n):s==35?t.peek(o-1)!=32:lS(s,n)))||!n&&l<=i||l==0&&!n&&(pa(t,45,o)||pa(t,46,o)))break;if(e&&tm(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var xV=new go((t,e)=>{if(t.next==33)oN(t),t.acceptToken(lV);else if(t.next==38||t.next==42){let n=t.next==38?sV:oV;fS(t),t.acceptToken(n)}else t.next==39||t.next==34?(dS(t,!1),t.acceptToken(rV)):lN(t,!1,e.context.type==Xu,e.context.depth)&&t.acceptToken(iV)}),wV=new go((t,e)=>{let n=e.context.type==cS?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(pa(t,45,r)||pa(t,46,r))||!xr(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=xr(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(rN,i)}),kV=oa({DirectiveName:T.keyword,DirectiveContent:T.attributeValue,"DirectiveEnd DocEnd":T.meta,QuotedLiteral:T.string,BlockLiteralHeader:T.special(T.string),BlockLiteralContent:T.content,Literal:T.content,"Key/Literal Key/QuotedLiteral":T.definition(T.propertyName),"Anchor Alias":T.labelName,Tag:T.typeName,Comment:T.lineComment,": , -":T.separator,"?":T.punctuation,"[ ]":T.squareBracket,"{ }":T.brace}),aN=ha.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:mV,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[kV],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[gV,yV,xV,wV,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var AV=ha.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),OV=Fu.define({name:"yaml",parser:aN.configure({props:[H1.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:U1({closing:"}"}),FlowSequence:U1({closing:"]"})}),eM.add({"FlowMapping FlowSequence":tM,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function cN(){return new Yp(OV)}var Ehe=Fu.define({name:"yaml-frontmatter",parser:AV.configure({props:[oa({DashLine:T.meta})]})});var rm=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},bo=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(Wu).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new dr,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let d=0;;){let p=d==s.length?null:s[d];if(!p&&!l.length)break;let m,b;if(l.length)m=a,b=l.reduce((v,S)=>Math.min(v,S.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;b=p.to,l.push(p),d++}for(;d<s.length;){let v=s[d];if(v.from==m&&(v.to>v.from||v.to==m))l.push(v),d++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let y=!1;if(l.some(v=>v.from==m&&(v.to==b||b==f))&&(y=m==b,!y&&b-m<10)){let v=m-(u+c.value.length);v>0&&(c.next(v),u=m);for(let S=m;;){if(S>=b){y=!0;break}if(!c.lineBreak&&u+c.value.length>S)break;S=u+c.value.length,u+=c.value.length,c.next()}}let g=vN(l);if(y)o.add(m,m,be.widget({widget:new pS(g),diagnostics:l.slice()}));else{let v=l.reduce((S,w)=>w.markClass?S+" "+w.markClass:S,"");o.add(m,b,be.mark({class:"cm-lintRange cm-lintRange-"+g+v,diagnostics:l.slice(),inclusiveEnd:l.some(S=>S.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let h=o.finish();return new t(h,n,ma(h))}};function ma(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new rm(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new rm(i.from,s,i.diagnostic)}}),i}function hN(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(Wu).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(am))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function TV(t,e){return t.field(fi,!1)?e:e.concat(ce.appendConfig.of(qV))}function dN(t,e){return{effects:TV(t,[am.of(e)])}}var am=ce.define(),pN=ce.define(),mN=ce.define(),fi=Ct.define({create(){return new bo(be.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=ma(n,t.selected.diagnostic,s)||ma(n,null,s)}!n.size&&r&&e.state.facet(Wu).autoPanel&&(r=null),t=new bo(n,r,i)}for(let n of e.effects)if(n.is(am)){let i=e.state.facet(Wu).autoPanel?n.value.length?om.open:null:t.panel;t=bo.init(n.value,i,e.state)}else n.is(pN)?t=new bo(t.diagnostics,n.value?om.open:null,t.selected):n.is(mN)&&(t=new bo(t.diagnostics,t.panel,n.value));return t},provide:t=>[Np.from(t,e=>e.panel),z.decorations.from(t,e=>e.diagnostics)]});var CV=be.mark({class:"cm-lintRange cm-lintRange-active"});function EV(t,e,n){let{diagnostics:i}=t.state.field(fi),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(Wu).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:gN(t,r)}}}:null}function gN(t,e){return mn("ul",{class:"cm-tooltip-lint"},e.map(n=>bN(t,n,!1)))}var uN=t=>{let e=t.state.field(fi,!1);return!e||!e.panel?!1:(t.dispatch({effects:pN.of(!1)}),!0)};var Wu=B.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...cs(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:fN,tooltipFilter:fN,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function fN(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function yN(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function bN(t,e,n){var i;let r=n?yN(e.actions):[];return mn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},mn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=ma(t.state.field(fi).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),mn("u",c.slice(u,u+1)),c.slice(u+1)],h=s.markClass?" "+s.markClass:"";return mn("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&mn("div",{class:"cm-diagnosticSource"},e.source))}var pS=class extends yr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return mn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},sm=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bN(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},om=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)uN(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=yN(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=ma(this.view.state.field(fi).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=mn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=mn("div",{class:"cm-panel-lint"},this.list,mn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>uN(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(fi).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(fi),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,h;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==u){f=d;break}f<0?(h=new sm(this.view,u),this.items.splice(i,0,h),r=!0):(h=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new sm(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(fi),i=ma(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:mN.of(i)})}static open(e){return new t(e)}};function im(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function nm(t){return im(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}var DV=z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:nm("#f11")},".cm-lintRange-warning":{backgroundImage:nm("orange")},".cm-lintRange-info":{backgroundImage:nm("#999")},".cm-lintRange-hint":{backgroundImage:nm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function MV(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function vN(t){let e="hint",n=1;for(let i of t){let r=MV(i.severity);r>n&&(n=r,e=i.severity)}return e}var lm=class extends zn{constructor(e){super(),this.diagnostics=e,this.severity=vN(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(cm).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>RV(e,n,i)),n}};function NV(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(SN)&&t.dispatch({effects:gS.of(null)})}};window.addEventListener("mousemove",n)}function RV(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:gS.of({pos:o.from,above:!1,clip:!1,create(){return{dom:gN(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,NV(t,e)}let{hoverTime:r}=t.state.facet(cm),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function _V(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new lm(n[r]).range(+r));return ue.of(i,!0)}var LV=g1({class:"cm-gutter-lint",markers:t=>t.state.field(mS),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(mS).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new lm(i):null}}),mS=Ct.define({create(){return ue.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(cm).markerFilter;for(let i of e.effects)if(i.is(am)){let r=i.value;n&&(r=n(r||[],e.state)),t=_V(e.state.doc,r.slice(0))}return t}}),gS=ce.define(),SN=Ct.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=hN(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(gS)?i.value:n,t)},provide:t=>qp.from(t)}),BV=z.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:im('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:im('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:im('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),IV=LD(EV,{hideOn:hN}),qV=[fi,z.decorations.compute([fi],t=>{let{selected:e,panel:n}=t.field(fi);return!e||!n||e.from==e.to?be.none:be.set([CV.range(e.from,e.to)])}),IV,DV],cm=B.define({combine(t){return cs(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function xN(t={}){return[cm.of(t),mS,LV,BV,SN]}var Pi=Ve(dn()),wN={error:0,warning:1,info:2},PV=ca.define([{tag:T.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[T.string,T.special(T.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[T.number,T.bool,T.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[T.propertyName,T.definition(T.propertyName),T.keyword,T.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[T.punctuation,T.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),zV=z.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function HV(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var yS=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,tn.useRef)(null),u=(0,tn.useRef)(null),f=(0,tn.useRef)(e);f.current=e;let h=(0,tn.useRef)(new Yl),p=`${(0,tn.useId)()}-diag`;(0,tn.useEffect)(()=>{let b=c.current;if(!b)return;let y=[mM(),m1.of([...YM,...vM]),...r?[ID()]:[],...s?[cN(),iM(PV)]:[],xN(),zV,h.current.of([z.editable.of(!o),Oe.readOnly.of(o)]),z.contentAttributes.of({"aria-label":l,"aria-describedby":p}),z.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],g=new z({state:Oe.create({doc:t,extensions:y}),parent:b});return u.current=g,()=>{g.destroy(),u.current=null}},[]),(0,tn.useEffect)(()=>{let b=u.current;if(!b)return;let y=b.state.doc.toString();y!==t&&b.dispatch({changes:{from:0,to:y.length,insert:t}})},[t]),(0,tn.useEffect)(()=>{let b=u.current;b&&b.dispatch(dN(b.state,HV(n,b.state.doc.length)))},[n]),(0,tn.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:h.current.reconfigure([z.editable.of(!o),Oe.readOnly.of(o)])})},[o]);let m=(0,tn.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,y)=>{let g=wN[b.severity]-wN[y.severity];return g!==0?g:(b.line??1/0)-(y.line??1/0)}),[n]);return(0,Pi.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Pi.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Pi.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),m.length>0?(0,Pi.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:p,children:m.map((b,y)=>(0,Pi.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Pi.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Pi.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Pi.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},y))}):null]})};var ie=Ve(di());var P=Ve(dn()),UV=new Set(["orientation","cyclic","align","groupselector","groupfield"]),bS=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h=!1,className:d})=>{let[p,m]=(0,ie.useState)(null),b=(0,ie.useCallback)(S=>{m(w=>w===S?null:S)},[]),y=(0,ie.useCallback)(S=>m(null),[]),g=(0,ie.useCallback)((S,w)=>{let A=s(S,w);return A&&typeof A=="object"&&"id"in A&&m(A.id),A},[s]),v=t.length===0&&e.length===0;return(0,P.jsxs)("div",{className:`spytial-ed-builder${d?` ${d}`:""}`,children:[(0,P.jsx)(kN,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:y,onAddItem:g,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),(0,P.jsx)(kN,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:y,onAddItem:g,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),v?(0,P.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},kN=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:p,onMove:m,disabled:b})=>{let y=`${t} List`,g=(0,ie.useRef)(new Map),v=(0,ie.useRef)(null),S=(0,ie.useRef)(null),w=(0,ie.useCallback)((k,O)=>{O?g.current.set(k,O):g.current.delete(k)},[]),A=(0,ie.useCallback)(k=>{let O=n.findIndex(L=>L.id===k),M=n[O+1],E=n[O-1];S.current=M?.id??E?.id??"__add__",p(k)},[n,p]);return(0,ie.useEffect)(()=>{let k=S.current;if(k!==null){if(S.current=null,k==="__add__"){v.current?.focus();return}g.current.get(k)?.focus()}},[n]),(0,P.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,P.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,P.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,P.jsx)(VV,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,P.jsx)("ul",{className:"spytial-ed-rows","aria-label":y,children:n.map((k,O)=>(0,P.jsx)(FV,{item:k,index:O,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===k.id,onToggleExpand:l,onCollapse:a,registerToggle:w,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:A,onMove:m,disabled:b},k.id))})]})},FV=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:p,onMove:m,disabled:b})=>{let y=(0,ie.useId)(),g=`${y}-panel`,v=Bt(t.type),S=(0,ie.useRef)(null),w=t.id;(0,ie.useEffect)(()=>(c(w,S.current),()=>c(w,null)),[w,c]);let A=(0,ie.useMemo)(()=>(i??[]).filter(L=>L.itemId===t.id),[i,t.id]),k=KV(A);if(!v)return(0,P.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,P.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,P.jsx)("span",{className:"spytial-ed-badge spytial-ed-badge--unknown",children:t.kind==="constraint"?"C":"D"}),(0,P.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,P.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let O=(()=>{try{return v.summary(t.params)}catch{return""}})(),M=UV.has(t.type),E=t.params.hold==="never";return(0,P.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${k?` spytial-ed-row--${k}`:""}`,children:[(0,P.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,P.jsxs)("button",{ref:S,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":g,disabled:b,onClick:()=>l(t.id),children:[(0,P.jsx)("span",{className:`spytial-ed-badge spytial-ed-badge--${t.kind}`,"aria-hidden":"true",children:t.kind==="constraint"?"C":"D"}),(0,P.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),E?(0,P.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,P.jsx)("span",{className:"spytial-ed-row-summary",children:O}),k?(0,P.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${k}`,role:"img","aria-label":`${k}: ${A.length} issue${A.length===1?"":"s"}`}):null]}),(0,P.jsx)(jV,{item:t,index:e,count:n,disabled:b,onDuplicate:d,onRemove:p,onMove:m,onAddComment:()=>l(t.id)})]}),o?(0,P.jsxs)("div",{className:"spytial-ed-row-panel",id:g,onKeyDown:L=>{L.key==="Escape"&&(L.stopPropagation(),a(t.id),S.current?.focus())},children:[(0,P.jsx)(Kd,{fields:YV(v.fields),values:t.params,diagnostics:A,options:r,disabled:b,onChange:(L,R)=>u(t.id,L,R),selectorProps:s?L=>s(t,L):void 0}),M?(0,P.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,P.jsx)("span",{className:"spytial-ed-field-label",id:`${y}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,P.jsx)("div",{className:"spytial-ed-field-control",children:(0,P.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${y}-hold-label`,children:[(0,P.jsx)("button",{type:"button",role:"radio","aria-checked":!E,className:`spytial-ed-pill${E?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>h(t.id,!1),children:"Should hold"}),(0,P.jsx)("button",{type:"button",role:"radio","aria-checked":E,className:`spytial-ed-pill${E?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>h(t.id,!0),children:"Should not hold"})]})})]}):null,(0,P.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,P.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${y}-comment`,children:"Comment"}),(0,P.jsx)("div",{className:"spytial-ed-field-control",children:(0,P.jsx)("input",{id:`${y}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:L=>f(t.id,L.target.value)})})]})]}):null]})},jV=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,ie.useState)(!1),u=(0,ie.useRef)(null),f=(0,ie.useRef)(null),h=hu(a,f,{align:"end",estimatedHeight:220}),d=Bt(t.type)?.label??t.type;(0,ie.useEffect)(()=>{if(!a)return;let b=y=>{u.current&&!u.current.contains(y.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let p=(0,ie.useCallback)(()=>c(!1),[]),m=(0,ie.useCallback)(b=>{b(),p()},[p]);return(0,P.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,P.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${d}`,disabled:i,onClick:()=>c(b=>!b),children:(0,P.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,P.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:h,role:"menu","aria-label":`Actions for ${d}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),p())},children:[(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>m(l),children:"Add comment"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>m(()=>r(t.id)),children:"Duplicate"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>m(()=>o(t.id,-1)),children:"Move up"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>m(()=>o(t.id,1)),children:"Move down"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${d} ${t.kind}`,onClick:()=>m(()=>s(t.id)),children:"Delete"})})]}):null]})},VV=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,ie.useState)(!1),[o,l]=(0,ie.useState)(""),a=(0,ie.useRef)(null),c=(0,ie.useRef)(null),u=(0,ie.useRef)(null),f=(0,ie.useCallback)(g=>{u.current=g,typeof i=="function"?i(g):i&&typeof i=="object"&&(i.current=g)},[i]),h=hu(r,u,{align:"end",estimatedHeight:320}),d=(0,ie.useMemo)(()=>R0(t),[t]),p=(0,ie.useMemo)(()=>{let g=o.trim().toLowerCase();return g?d.filter(v=>v.label.toLowerCase().includes(g)||v.type.toLowerCase().includes(g)||(v.description??"").toLowerCase().includes(g)):d},[d,o]);(0,ie.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let g=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[r]);let m=(0,ie.useCallback)(()=>{s(!1),l("")},[]),b=(0,ie.useCallback)(g=>{e(t,g),m()},[e,t,m]),y=t==="constraint"?"Add constraint":"Add directive";return(0,P.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,P.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(g=>!g),children:["+ ",y]}),r?(0,P.jsxs)("div",{className:"spytial-ed-add-menu",style:h,role:"menu","aria-label":y,onKeyDown:g=>{g.key==="Escape"&&(g.preventDefault(),m())},children:[(0,P.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:g=>l(g.target.value)}),(0,P.jsx)("ul",{className:"spytial-ed-add-list",children:p.length===0?(0,P.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):p.map(g=>(0,P.jsx)("li",{role:"none",children:(0,P.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(g.type),children:[(0,P.jsx)("span",{className:"spytial-ed-add-item-label",children:g.label}),g.description?(0,P.jsx)("span",{className:"spytial-ed-add-item-desc",children:g.description}):null]})},g.type))})]}):null]})};function YV(t){return t.filter(e=>e.key!=="hold")}function KV(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var Y=Ve(di());var Mt=Ve(dn()),QV=300,GV=400,SS=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,density:o="compact",syntaxHighlighting:l=!0,defaultView:a="builder",view:c,onViewChange:u,className:f,disabled:h=!1,"aria-label":d="Layout specification editor",onDiagnostics:p})=>{let m=(0,Y.useRef)(null);m.current===null&&(m.current=$V(t));let b=m.current.doc,[,y]=(0,Y.useReducer)(I=>I+1,0),g=(0,Y.useRef)(t),v=(0,Y.useRef)(0),[S,w]=(0,Y.useState)(a),A=c??S,k=(0,Y.useRef)(null),O=(0,Y.useRef)(null),M=(0,Y.useRef)(()=>{}),E=(0,Y.useCallback)(I=>{M.current(),c===void 0&&w(I),u?.(I)},[c,u]),[L,R]=(0,Y.useState)(()=>m.current?.error??null),j=(0,Y.useMemo)(()=>{if(i)return i;if(n)return _b(n)},[i,n]),pe=(0,Y.useMemo)(()=>Bb(j),[j]),Ee=(0,Y.useMemo)(()=>j?.relations.map(I=>I.name)??[],[j]),Vt=(0,Y.useMemo)(()=>j?.types.map(I=>I.name)??[],[j]),xe=(0,Y.useCallback)(()=>{let I=b.toYaml();g.current=I,v.current+=1,R(null),e(I)},[b,e]),[xn,Ze]=(0,Y.useState)([]),jn=(0,Y.useRef)(0),at=(0,Y.useRef)(null),Je=(0,Y.useMemo)(()=>b.validate(j),[b,j,t]),et=(0,Y.useMemo)(()=>[...Je,...xn],[Je,xn]),Nt=(0,Y.useRef)("");(0,Y.useEffect)(()=>{if(!p)return;let I=XV(et);I!==Nt.current&&(Nt.current=I,p(et))},[et,p]),(0,Y.useEffect)(()=>{if(t===g.current)return;let I;try{I=b.toYaml()}catch{I=""}if(t===I){g.current=t;return}try{b.replaceFromYaml(t),g.current=t,v.current+=1,R(null),y()}catch(me){R(vS(me))}},[t,b]),(0,Y.useEffect)(()=>b.subscribe(()=>y()),[b]);let Yt=(0,Y.useCallback)(()=>{k.current&&(clearTimeout(k.current),k.current=null);let I=O.current;if(O.current=null,!!I&&v.current===I.seq)try{b.replaceFromYaml(I.text),R(null),y()}catch(me){R(vS(me))}},[b]);M.current=Yt;let Vn=(0,Y.useCallback)(I=>{h||(g.current=I,e(I),k.current&&clearTimeout(k.current),O.current={text:I,seq:v.current},k.current=setTimeout(Yt,QV))},[h,e,Yt]);(0,Y.useEffect)(()=>()=>{k.current&&clearTimeout(k.current),at.current&&clearTimeout(at.current)},[]);let Yn=(0,Y.useCallback)((I,me)=>{if(h)return;let ze=b.addItem(I,me);return xe(),ze},[h,b,xe]),Ca=(0,Y.useCallback)((I,me,ze)=>{if(h)return;let Da=ze===""?void 0:ze;b.updateItem(I,{params:{[me]:Da}}),xe()},[h,b,xe]),Um=(0,Y.useCallback)((I,me)=>{h||(b.updateItem(I,{comment:me}),xe())},[h,b,xe]),Fm=(0,Y.useCallback)((I,me)=>{h||(b.updateItem(I,{params:{hold:me?"never":void 0}}),xe())},[h,b,xe]),jm=(0,Y.useCallback)(I=>{h||!b.duplicateItem(I)||xe()},[h,b,xe]),Vm=(0,Y.useCallback)(I=>{h||(b.removeItem(I),xe())},[h,b,xe]),To=(0,Y.useCallback)((I,me)=>{if(h)return;let ze=b.getState(),kr=(ze.constraints.some(vt=>vt.id===I)?ze.constraints:ze.directives).findIndex(vt=>vt.id===I);kr!==-1&&(b.moveItem(I,kr+me),xe())},[h,b,xe]),Co=(0,Y.useCallback)(()=>{h||!b.canUndo()||(b.undo(),xe())},[h,b,xe]),Ea=(0,Y.useCallback)(()=>{h||!b.canRedo()||(b.redo(),xe())},[h,b,xe]),Ym=(0,Y.useCallback)(I=>{!(I.metaKey||I.ctrlKey)||I.key.toLowerCase()!=="z"||(I.preventDefault(),I.shiftKey?Ea():Co())},[Co,Ea]),Km=(0,Y.useCallback)((I,me)=>{if(me.kind!=="selector")return;let ze={itemKind:I.kind,itemType:I.type,fieldKey:me.key,domain:j,specYaml:g.current},kr={complete:vt=>{let Ui=pe(vt),Fi=s?.complete;if(!Fi)return Ui;let Ma={...ze,currentValue:String(I.params[me.key]??"")},Af;try{Af=Fi(Ma,vt)??[]}catch{return Ui}return Promise.resolve(Af).then(Qm=>Ib(Qm??[],Ui)).catch(()=>Ui)},highlight:l};if(s?.synthesize){let vt=s.synthesize;kr.synthesize=Ui=>{let Fi={...ze,currentValue:String(I.params[me.key]??"")};return vt(Fi,Ui)}}return kr},[j,pe,s,l]);(0,Y.useEffect)(()=>{let I=s?.review;if(!I){Ze([]);return}at.current&&clearTimeout(at.current);let me=++jn.current;at.current=setTimeout(()=>{let ze=b.getState(),Da=[...ze.constraints,...ze.directives],kr=[];for(let vt of Da){let Ui=Bt(vt.type);if(Ui)for(let Fi of Ui.fields){if(Fi.kind!=="selector")continue;let Ma=String(vt.params[Fi.key]??"");if(Ma.trim()==="")continue;let Af={itemKind:vt.kind,itemType:vt.type,fieldKey:Fi.key,currentValue:Ma,domain:j,specYaml:g.current};kr.push(Promise.resolve().then(()=>I(Af,Ma)).then(Qm=>(Qm??[]).map(z4=>({...z4,itemId:vt.id,fieldKey:Fi.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(kr).then(vt=>{me===jn.current&&Ze(vt.flat())}).catch(()=>{me===jn.current&&Ze([])})},GV)},[s,j,t,b]);let kf=b.getState(),H=L!==null,J=["spytial-ed",o==="compact"?"spytial-ed--compact":"",f??""].filter(Boolean).join(" "),Os=(0,Y.useMemo)(()=>Rb(t,j),[t,j]),Ts=zb(r);return(0,Mt.jsxs)("section",{className:J,style:Ts?qb(Ts):void 0,"aria-label":d,onKeyDown:Ym,children:[(0,Mt.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,Mt.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,Mt.jsxs)("button",{type:"button",role:"tab","aria-selected":A==="builder",className:`spytial-ed-viewtoggle-btn${A==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>E("builder"),children:["Builder",H?(0,Mt.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,Mt.jsx)("button",{type:"button",role:"tab","aria-selected":A==="code",className:`spytial-ed-viewtoggle-btn${A==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>E("code"),children:"Code"})]}),(0,Mt.jsxs)("div",{className:"spytial-ed-history",children:[(0,Mt.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:h||!b.canUndo(),onClick:Co,children:(0,Mt.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,Mt.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:h||!b.canRedo(),onClick:Ea,children:(0,Mt.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]}),(0,Mt.jsx)("div",{className:"spytial-ed-body",children:A==="builder"?(0,Mt.jsx)(bS,{constraints:kf.constraints,directives:kf.directives,diagnostics:et,options:{relationNames:Ee,typeNames:Vt},selectorProps:Km,onAddItem:Yn,onUpdateParam:Ca,onUpdateComment:Um,onToggleNegate:Fm,onDuplicate:jm,onRemove:Vm,onMove:To,disabled:h}):(0,Mt.jsx)(yS,{value:t,onChange:Vn,diagnostics:Os,hasUnappliedEdits:H,syntaxHighlighting:l,disabled:h})})]})};function $V(t){try{return{doc:El.fromYaml(t),error:null}}catch(e){return{doc:new El,error:vS(e)}}}function vS(t){return t instanceof es?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function XV(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
198
- `)}function WV(t,e){return{_:"tuple",types:t,atoms:Array.from(e.querySelectorAll("atom")).map((n,i)=>xS(t[i],n).id)}}function AN(t,e){return Array.from(e).map(n=>WV(t,n))}function um(t){return t.tuples}function ZV(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label found for field element");let i=JV(t,e);if(i.length===0)throw new Error("No types found for field element");let r=e.getAttribute("parentID"),o=(r?t[r]:void 0)??i[0],l=AN(i,e.querySelectorAll("tuple"));return{_:"relation",id:`${o}<:${n}`,name:n,types:i,tuples:l}}function wS(t,e){return Array.from(e).map(n=>ZV(t,n))}function JV(t,e){let n=e.querySelectorAll("type");return Array.from(n).map(i=>{let r=i.getAttribute("ID");if(!r)throw new Error("Type element must have an ID attribute");let s=t[r];if(!s)throw new Error(`Type element with ID ${r} not found`);return s})}function ON(t){return t!==void 0}function fm(t,e){let n={};for(let i of t)n[e(i)]=i;return n}function TN(t){let n=new globalThis.DOMParser().parseFromString(t,"application/xml"),i=Array.from(n.querySelectorAll("instance"));if(!i.length)throw new Error(`No Alloy instance in XML: ${t}`);let r=n.querySelectorAll("visualizer"),s,o,l;for(let a of Array.from(r))s=hm(a,"script")??s,o=hm(a,"theme")??o,l=hm(a,"cnd")??l;return{instances:i.map(a=>DN(a)),bitwidth:wr(i[0],"bitwidth"),command:hm(i[0],"command"),loopBack:eY(i[0]),maxSeq:wr(i[0],"maxseq"),maxTrace:wr(i[0],"maxtrace"),minTrace:wr(i[0],"mintrace"),traceLength:wr(i[0],"tracelength"),visualizerConfig:{script:kS(s),theme:kS(o),cnd:kS(l)}}}function eY(t){let e=wr(t,"backloop");if(e!==void 0)return e;let n=wr(t,"loop");if(n!==void 0)return n;let i=wr(t,"tracelength"),r=wr(t,"looplength");if(i!==void 0&&r!==void 0&&i>1)return i-r}function wr(t,e){let n=t.getAttribute(e);return n?+n:void 0}function hm(t,e){let n=t.getAttribute(e);return n?`${n}`:void 0}function kS(t){return t?.replaceAll("&quot;",'"').replaceAll('\\"','"').replaceAll("&gt;",">").replaceAll("&lt;","<")}function AS(t){return t.querySelectorAll("type").length>0}function CN(t,e){let n={},i=e.querySelectorAll("sig");for(let o of i)if(!AS(o)){let l=o.getAttribute("ID"),a=o.getAttribute("parentID"),c=o.getAttribute("label");if(!l)throw new Error("No ID found for sig element");if(!c)throw new Error("No label found for sig element");a&&(n[l]=a)}let r=(o,l)=>n[o]?r(n[o],[...l,t[o]]):l,s={};for(let o in t)s[t[o]]=r(o,[]);return s}function EN(t){let e={},n=t.querySelectorAll("sig");for(let i of n){let r=i.getAttribute("ID"),s=i.getAttribute("label");if(!r)throw new Error("No ID found for sig element");if(!s)throw new Error("No label found for sig element");e[r]=s}return e}function MN(t,e){let n=e.find(i=>i.id==="Int");if(!n)throw new Error("Could not find Int type");n.atoms=BN(t)}function NN(t){return t.types[t.types.length-1]}function RN(t){return t.atoms}function vs(t){return t.meta!==void 0&&t.meta.builtin===!0}function tY(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");let i=t[n];if(!i)throw console.log(t),new Error(`No type hierarchy for ${n}`);let r=nY(e),s={_:"type",id:n,types:i,atoms:LN(n,e.querySelectorAll("atom")),meta:void 0};return ON(r)&&(s.meta=r),s}function _N(t,e){return Array.from(e).filter(n=>!AS(n)).map(n=>tY(t,n))}function dm(t,e,n){return typeof e=="string"&&(e=pm(t,e)),typeof n!="string"&&(n=n.id),e.types.includes(n)}function nY(t){let e={};return t.getAttribute("abstract")==="yes"&&(e.abstract=!0),t.getAttribute("builtin")==="yes"&&(e.builtin=!0),t.getAttribute("enum")==="yes"&&(e.enum=!0),t.getAttribute("meta")==="yes"&&(e.meta=!0),t.getAttribute("one")==="yes"&&(e.one=!0),t.getAttribute("private")==="yes"&&(e.private=!0),Object.keys(e).length===0?void 0:e}function Ss(t,e){let n=vo(t).find(i=>i.id===e);if(!n)throw new Error(`Could not find atom with id ${e}`);return n}function vo(t){return Ju(t).map(RN).reduce((e,n)=>e.concat(n),[])}function IN(t,e){let n=Ss(t,e),i={...t.types},r={...t.relations},s={...t.skolems},o=t.types[n.type];if(o){let l=o.atoms.filter(a=>a.id!==e);l.length===0?delete i[o.id]:i[n.type]={...o,atoms:l};for(let[a,c]of Object.entries(t.relations)){let u=c.tuples.filter(f=>!f.atoms.includes(e));r[a]={...c,tuples:u}}for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!f.atoms.includes(e));s[a]={...c,tuples:u}}return{types:i,relations:r,skolems:s}}else throw new Error(`Could not find type for atom ${e}`)}function qN(t,e){let n={...t.types},i=n[e.type];if(i)n[e.type]={...i,atoms:[...i.atoms,e]};else{let r={_:"type",id:e.type,types:[e.type,"univ"],atoms:[e]};n[r.id]=r}return{...t,types:n}}function PN(t,e,n){let i=iY(t,e),r={...t.relations},s={...t.skolems},o=(a,c)=>a.atoms.length===c.atoms.length&&a.atoms.every((u,f)=>u===c.atoms[f]),l=i.tuples.filter(a=>!o(a,n));r[i.id]={...i,tuples:l};for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!o(f,n));u.length===0?delete s[a]:s[a]={...c,tuples:u}}return{...t,relations:r,skolems:s}}function zN(t,e,n){let i=t.relations[e];if(!i){let o=Object.values(t.relations).filter(l=>l.name===e);o.length>1&&console.warn(`addInstanceRelationTuple: name "${e}" is ambiguous (${o.map(l=>l.id).join(", ")}); appending to the first. Use a qualified id (Sig<:field) to disambiguate.`),i=o[0]}let r={...t.relations},s={...t.skolems};return i?r[i.id]={...i,tuples:[...i.tuples,n]}:r[e]={id:e,name:e,tuples:[n],types:n.types,_:"relation"},{...t,relations:r,skolems:s}}function iY(t,e){let n=t.relations[e];if(n)return n;let i=Object.values(t.relations).filter(r=>r.name===e);if(i.length>1&&console.warn(`getInstanceRelation: name "${e}" is ambiguous (${i.map(r=>r.id).join(", ")}); returning the first. Use a qualified id (Sig<:field) to disambiguate.`),i.length>0)return i[0];throw new Error(`Could not find relation ${e}`)}function ga(t){return Object.values(t.relations)}function Zu(t,e){let n=[];for(let i of Object.values(t.skolems))for(let r of i.tuples)if(r.atoms.includes(e)){n.push(i.name);break}return n}function pm(t,e){let n=t.types[e];if(!n)throw new Error(`Could not find type with id ${e}`);return n}function Ju(t){return Object.values(t.types)}function DN(t){let e=t.getAttribute("bitwidth");if(!e)throw new Error("No bitwidth found in instance");let n=EN(t),i=CN(n,t),r=_N(i,t.querySelectorAll("sig")),s=wS(n,t.querySelectorAll("field")),o=wS(n,t.querySelectorAll("skolem"));return MN(parseInt(e),r),{types:fm(r,l=>l.id),relations:fm(s,l=>l.id),skolems:fm(o,l=>l.id)}}function xS(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:t}}function LN(t,e){return Array.from(e).map(n=>xS(t,n))}function HN(t,e){return typeof e=="string"&&(e=Ss(t,e)),ef(t,e).types.map(r=>pm(t,r)).some(vs)}function BN(t){let e=[],n=Math.pow(2,t);for(let i=-n/2;i<n/2;++i)e.push({_:"atom",id:i.toString(),type:"Int"});return e}function ef(t,e){if(typeof e=="string"&&(e=Ss(t,e)),!t.types[e.type])throw new Error(`The atom's type is not part of the instance: ${e.type}`);return t.types[e.type]}function UN(t,e){let n={};return e.forEach(i=>{let r=ef(t,i),s=NN(r);if(!n[s])n[s]=i;else throw new Error(`Cannot project ${i} and ${n[s]}. Both are of type ${s}`)}),{types:rY(t,n),relations:sY(t,n),skolems:t.skolems}}function rY(t,e){let n={},i=Object.keys(e);for(let r in t.types){let s=t.types[r],o=i.some(l=>dm(t,s,l));n[r]={_:"type",id:s.id,types:s.types,atoms:o?[]:s.atoms,meta:s.meta}}return n}function sY(t,e){let n={},i=Object.keys(e),r=Object.values(e);for(let s in t.relations){let o=t.relations[s],l=o.types.some(c=>i.some(u=>dm(t,c,u))),a=l?oY(t,o.types,i):[];n[s]={_:"relation",id:o.id,name:o.name,types:l?OS(o.types,a):o.types,tuples:l?lY(o.tuples,a,r):o.tuples},l||(n[s]=o)}return n}function oY(t,e,n){let i=[];return e.forEach((r,s)=>{n.some(o=>dm(t,r,o))&&i.push(s)}),i}function lY(t,e,n){return t.filter(i=>i.atoms.some(r=>n.includes(r))).map(i=>({_:"tuple",types:OS(i.types,e),atoms:OS(i.atoms,e)})).filter(i=>i.atoms.length>1)}function OS(t,e){let n=[];for(let i=0;i<t.length;i++)e.includes(i)||n.push(t[i]);return n}function So(t){return t.id}function TS(t,e){let n=t.id,i=e.atoms;return`${n}:${i.join("->")}`}var I4=Ve(B4());function Yre(t,e){return e<2?[0,0]:[0,e-1]}function q4(t,e,n){let i=new I4.Graph({directed:!0,multigraph:!0}),{nodeIds:r,edgeIds:s}=Kre(t,e,n);return vo(t).forEach(o=>{let l=So(o);r.has(l)&&i.setNode(l,l)}),ga(t).forEach(o=>{um(o).forEach(a=>{let c=TS(o,a),u=a.atoms,[f,h]=Yre(o.id,u.length),d=f?u[f]:u[0],p=h?u[h]:u[u.length-1];if(d&&p&&s.has(c)){let m=u.slice(1,-1).join(","),b=m.length>0?`[${m}]`:"",y=o.name+b,g=So(Ss(t,d)),v=So(Ss(t,p));i.setEdge(g,v,y,c)}})}),i}function Kre(t,e,n){let i=new Set,r=new Set;return ga(t).forEach(s=>{um(s).forEach(o=>{let l=o.atoms.map(u=>Ss(t,u)),[a,c]=Qre(s,l);a&&c&&(i.add(So(a)),i.add(So(c)),r.add(TS(s,o)))})}),vo(t).forEach(s=>{let o=So(s);i.has(o)||e||(!HN(t,s)||!n)&&i.add(o)}),{nodeIds:i,edgeIds:r}}function Qre(t,e){let n=e[0],i=e[e.length-1];return[n,i]}var wf=class t{constructor(e){this.eventListeners=new Map;this.alloyInstance=e,this.declaredTypeIds=new Set(Object.keys(e.types)),this.declaredRelationNames=new Set(Object.values(e.relations).map(n=>n.name))}isValidForgeIdentifier(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)}sanitizeForgeIdentifier(e,n){let i=e.replace(/[^A-Za-z0-9_$]/g,"_");i||(i="_"),/^[A-Za-z_$]/.test(i)||(i=`_${i}`);let r=i,s=1;for(;n.has(r);)r=`${i}_${s}`,s++;return n.add(r),r}addEventListener(e,n){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(n)}removeEventListener(e,n){let i=this.eventListeners.get(e);i&&i.delete(n)}emitEvent(e){let n=this.eventListeners.get(e.type);n&&n.forEach(i=>{try{i(e)}catch(r){console.error("Error in data instance event listener:",r)}})}getAtomType(e){let n=ef(this.alloyInstance,e);return{id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=Zu(this.alloyInstance,i.id);return{id:i.id,label:i.id,type:i.type,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:vs(n)}}getTypes(){return Ju(this.alloyInstance).map(n=>({id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=Zu(this.alloyInstance,i.id);return{id:i.id,type:i.type,label:i.id,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:vs(n)}))}getAtoms(){return vo(this.alloyInstance).map(n=>{let i=Zu(this.alloyInstance,n.id);return{id:n.id,type:n.type,label:n.id,labels:i.length>0?{skolems:i}:void 0}})}getRelations(){return ga(this.alloyInstance).map(n=>({id:n.id,name:n.name,types:n.types,tuples:n.tuples.map(i=>({atoms:i.atoms,types:i.types}))}))}applyProjections(e){let n=UN(this.alloyInstance,e);return new t(n)}generateGraph(e,n){return q4(this.alloyInstance,e,n)}getAlloyInstance(){return this.alloyInstance}reify(){let e="",i="inst builtinstance {",r="}",s=this.alloyInstance.types,o=new Set,l=new Map,a=[],c=[],u=new Set,f=new Set,h=new Set,d=y=>{let g=l.get(y);if(g)return g;let v=this.sanitizeForgeIdentifier(y,o);return l.set(y,v),v!==y&&a.push(`${y} -> ${v}`),v},p={};for(let y in s){let g=s[y];if(vs(g))continue;if(!this.declaredTypeIds.has(y)){g.atoms.length>0&&c.push(y);continue}let v=g.atoms;p[y]=v.map(S=>(h.add(S.id),`\`${d(S.id)}`))}let m=this.alloyInstance.relations,b={};for(let y in m){let g=m[y];if(!this.declaredRelationNames.has(g.name)||!this.isValidForgeIdentifier(g.name)){g.tuples.length>0&&u.add(g.name);continue}let S=g.tuples.filter(A=>{let k=A.atoms.every((O,M)=>{let E=s[A.types[M]];return E&&vs(E)||h.has(O)});return k||f.add(g.name),k}).map(A=>`(${A.atoms.map((O,M)=>{let E=s[A.types[M]];return E&&vs(E)?O:`\`${d(O)}`}).join("->")})`),w=g.name;b[w]=(b[w]??[]).concat(S)}for(let y in p){let g=p[y];g.length>0&&(e+=`${y} = ${g.join("+")}
199
- `)}for(let y in b){let g=b[y];g.length>0?e+=`${y} = ${g.join("+")}
200
- `:e+=`no ${y}
187
+ `;)t[i]==="\\"&&i+1<n?i+=2:i++;i<n&&t[i]===l&&i++,r("string",a,i);continue}if($d.test(s)){let l=i;for(;i<n&&$d.test(t[i]);)i++;if(i<n&&t[i]==="."&&i+1<n&&$d.test(t[i+1]))for(i++;i<n&&$d.test(t[i]);)i++;r("number",l,i);continue}if(JH.test(s)){let l=i;for(i++;i<n&&eU.test(t[i]);)i++;let a=t.slice(l,i);r(XH.has(a)?"keyword":"identifier",l,i);continue}let o=t.slice(i,i+2);if(WH.includes(o)){r("operator",i,i+2),i+=2;continue}if(ZH.has(s)){r("operator",i,i+1),i++;continue}r("punctuation",i,i+1),i++}return e}function Yb(t){switch(t){case"keyword":return"spytial-ed-syn-keyword";case"operator":return"spytial-ed-syn-operator";case"string":return"spytial-ed-syn-string";case"number":return"spytial-ed-syn-number";case"identifier":return"spytial-ed-syn-identifier";case"comment":return"spytial-ed-syn-comment";default:return}}var W=Pe(yi());var Gd=Pe(yi());function yu(t,e,n){let{align:i="start",gap:r=2,estimatedHeight:s=280}=n??{},[o,l]=(0,Gd.useState)({});return(0,Gd.useLayoutEffect)(()=>{if(!t){l({});return}let a=()=>{let c=e.current;if(!c)return;let u=c.getBoundingClientRect(),f=window.innerWidth||document.documentElement.clientWidth,h=window.innerHeight||document.documentElement.clientHeight,d=h-u.bottom-r,m=u.top-r,g=d<s&&m>d,b={maxHeight:Math.max(120,(g?m:d)-8)};g?b.bottom=h-u.top+r:b.top=u.bottom+r,i==="end"?b.right=Math.max(8,f-u.right):i==="stretch"?(b.left=u.left,b.width=u.width):b.left=u.left,l(b)};return a(),window.addEventListener("resize",a),document.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),document.removeEventListener("scroll",a,!0)}},[t,e,i,r,s]),o}var le=Pe(Ut()),iU=150,rU=/[A-Za-z0-9_$]/;function sU(t){if(!(!t||t.length===0))return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}function oU(t,e){let n=e;for(;n>0&&rU.test(t[n-1]);)n--;return{prefix:t.slice(n,e),start:n}}var zC=({value:t})=>{let e=(0,W.useMemo)(()=>Vb(t),[t]);return(0,le.jsxs)(le.Fragment,{children:[e.map((n,i)=>{let r=Yb(n.kind);return r?(0,le.jsx)("span",{className:r,children:n.text},i):(0,le.jsx)(W.default.Fragment,{children:n.text},i)}),t.endsWith(`
188
+ `)?"\u200B":null]})},Kb=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let h=(0,W.useRef)(null),d=(0,W.useRef)(null),m=(0,W.useId)(),g=`${m}-listbox`,b=U=>`${m}-opt-${U}`,p=`${m}-diag`,[y,v]=(0,W.useState)(!1),[S,w]=(0,W.useState)([]),[O,k]=(0,W.useState)(0),A=(0,W.useRef)(0),D=(0,W.useRef)(null),E=(0,W.useRef)(0),[L,R]=(0,W.useState)(!1),[Z,$]=(0,W.useState)(""),[ke,Kt]=(0,W.useState)(!1),[mi,me]=(0,W.useState)(null),[ot,Yn]=(0,W.useState)(null),St=(0,W.useRef)(null),He=sU(l),dt=(0,W.useCallback)(()=>{let U=h.current,ee=d.current;!U||!ee||(ee.scrollTop=U.scrollTop,ee.scrollLeft=U.scrollLeft)},[]),pt=(0,W.useRef)(0),rn=(0,W.useCallback)(()=>{let U=h.current;if(U){if(U.value===""){U.style.height="",pt.current=0;return}if(U.clientWidth<60){pt.current<10&&(pt.current+=1,requestAnimationFrame(rn));return}pt.current=0,U.style.height="auto",U.style.height=`${U.scrollHeight}px`}},[]);(0,W.useEffect)(()=>{rn(),dt()},[t,rn,dt]);let sn=(0,W.useCallback)((U,ee)=>{if(!s)return;let{prefix:Yi,start:Er}=oU(U,ee);E.current=Er,D.current&&clearTimeout(D.current);let Lo=++A.current;D.current=setTimeout(()=>{let Ns;try{Ns=s(Yi)}catch{return}Promise.resolve(Ns).then(gi=>{if(Lo===A.current){if(!gi||gi.length===0){w([]),v(!1);return}w(gi),k(0),v(!0)}}).catch(()=>{Lo===A.current&&(w([]),v(!1))})},iU)},[s]),Kn=(0,W.useCallback)(()=>{A.current++,D.current&&clearTimeout(D.current),v(!1),w([])},[]),Qn=(0,W.useCallback)(U=>{let ee=h.current,Yi=ee?ee.selectionStart:t.length,Er=U.insertText??U.label,Lo=t.slice(0,E.current)+Er+t.slice(Yi);e(Lo),Kn();let Ns=E.current+Er.length;requestAnimationFrame(()=>{let gi=h.current;gi&&(gi.focus(),gi.setSelectionRange(Ns,Ns))})},[t,e,Kn]),No=(0,W.useCallback)(U=>{let ee=U.target.value;e(ee),sn(ee,U.target.selectionStart)},[e,sn]),Ro=(0,W.useCallback)(U=>{if(U.code==="Space"&&(U.ctrlKey||U.metaKey)){U.preventDefault();let ee=h.current;ee&&sn(ee.value,ee.selectionStart);return}if(!(!y||S.length===0))switch(U.key){case"ArrowDown":U.preventDefault(),k(ee=>(ee+1)%S.length);break;case"ArrowUp":U.preventDefault(),k(ee=>(ee-1+S.length)%S.length);break;case"Enter":case"Tab":U.preventDefault(),Qn(S[O]);break;case"Escape":U.preventDefault(),Kn();break;default:break}},[y,S,O,Qn,Kn,sn]),La=(0,W.useCallback)(U=>{let ee=U.relatedTarget;ee&&d.current?.parentElement?.contains(ee)||Kn()},[Kn]),Km=(0,W.useCallback)(()=>{R(!0),me(null),Yn(null),requestAnimationFrame(()=>St.current?.focus())},[]),_o=(0,W.useCallback)(()=>{R(!1),Kt(!1),me(null),Yn(null),$("")},[]),Ef=(0,W.useCallback)(async()=>{if(!o||ke)return;let U=Z.trim();if(U){Kt(!0),me(null),Yn(null);try{let ee=await o(U);Yn(ee)}catch(ee){me(ee instanceof Error?ee.message:"Synthesis failed. Try again.")}finally{Kt(!1)}}},[o,ke,Z]),Qm=(0,W.useCallback)(()=>{ot&&(e(ot.value),_o(),requestAnimationFrame(()=>h.current?.focus()))},[ot,e,_o]);(0,W.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]);let $m=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),Gm=l&&l.length>0?p:void 0,Xm=yu(y&&S.length>0,h,{align:"stretch",estimatedHeight:224});return(0,le.jsxs)("div",{className:`spytial-ed-selector${He?` spytial-ed-selector--${He}`:""}${c?` ${c}`:""}`,children:[(0,le.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,le.jsx)("pre",{ref:d,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,le.jsx)(zC,{value:t})}):null,(0,le.jsx)("textarea",{ref:h,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:No,onScroll:dt,onKeyDown:Ro,onBlur:La,placeholder:$m,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":y,"aria-controls":g,"aria-autocomplete":"list","aria-activedescendant":y&&S.length>0?b(O):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":Gm,"aria-invalid":He==="error"||void 0}),o?(0,le.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:Km,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":L,title:"Generate selector from a description",children:(0,le.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,y&&S.length>0?(0,le.jsx)("ul",{className:"spytial-ed-autocomplete",style:Xm,id:g,role:"listbox","aria-label":"Selector completions",children:S.map((U,ee)=>(0,le.jsxs)("li",{id:b(ee),role:"option","aria-selected":ee===O,className:`spytial-ed-autocomplete-item${ee===O?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Yi=>{Yi.preventDefault(),Qn(U)},onMouseEnter:()=>k(ee),children:[(0,le.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${U.kind}`,"aria-hidden":"true"}),(0,le.jsx)("span",{className:"spytial-ed-autocomplete-label",children:U.label}),U.detail?(0,le.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:U.detail}):null]},`${U.label}-${ee}`))}):null]}),L?(0,le.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,le.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,le.jsx)("input",{ref:St,type:"text",className:"spytial-ed-synth-input",value:Z,placeholder:"Describe the selector you want\u2026",disabled:ke,"aria-label":"Selector description",onChange:U=>$(U.target.value),onKeyDown:U=>{U.key==="Enter"?(U.preventDefault(),Ef()):U.key==="Escape"&&(U.preventDefault(),_o())}}),(0,le.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Ef()},disabled:ke||Z.trim().length===0,children:ke?"Generating\u2026":"Generate"})]}),mi?(0,le.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:mi}):null,ot?(0,le.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,le.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,le.jsx)(zC,{value:ot.value})}),ot.explanation?(0,le.jsx)("p",{className:"spytial-ed-synth-explanation",children:ot.explanation}):null,(0,le.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,le.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:Qm,children:"Accept"}),(0,le.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:_o,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,le.jsx)("ul",{className:"spytial-ed-diagnostics",id:p,children:l.map((U,ee)=>(0,le.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${U.severity}`,children:[(0,le.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,le.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:U.message})]},ee))}):null]})};var HC=Pe(yi());var ie=Pe(Ut());function Ql(t){return t==null?"":String(t)}function lU(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function aU(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var cU=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),uU=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},fU=({diagnostics:t,id:e})=>t.length>0?(0,ie.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,ie.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,ie.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ie.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,Wd=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,HC.useId)();return(0,ie.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,ie.jsx)(hU,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,h=`${u}-diag`,d=cU(i,c.key),m=uU(d),g=e[c.key];return(0,ie.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${m?` spytial-ed-field--${m}`:""}`,children:[(0,ie.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,ie.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,ie.jsxs)("div",{className:"spytial-ed-field-control",children:[dU(c,g,{fieldId:u,labelId:f,diagId:h,hasDiagnostics:d.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:d}),c.kind==="selector"?null:(0,ie.jsx)(fU,{diagnostics:d,id:h})]})]},c.key)})})};function hU({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=aU(e)?e:void 0,a=!t.required;if(l===void 0)return(0,ie.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let h={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete h[u]:h[u]=f,n(t.key,h)};return(0,ie.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,ie.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,ie.jsx)("span",{children:t.label}),a?(0,ie.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,ie.jsx)(Wd,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function dU(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,h=o?s:void 0;switch(t.kind){case"selector":{let d=u?.(t)??{};return(0,ie.jsx)(Kb,{value:Ql(e),onChange:m=>a(t.key,m),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:d.complete,synthesize:d.synthesize,highlight:d.highlight})}case"relationName":case"typeName":{let d=t.kind==="relationName"?c?.relationNames:c?.typeNames,m=`${i}-list`,g=!!d&&d.length>0;return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:Ql(e),placeholder:t.placeholder,disabled:l,list:g?m:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":h,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),g?(0,ie.jsx)("datalist",{id:m,children:d.map(b=>(0,ie.jsx)("option",{value:b},b))}):null]})}case"enum":{let d=t.options??[];if(t.multiple){let g=lU(e);return(0,ie.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":h,children:d.map(b=>{let p=g.includes(b);return(0,ie.jsx)("button",{type:"button",className:`spytial-ed-pill${p?" spytial-ed-pill--active":""}`,"aria-pressed":p,disabled:l,onClick:()=>{let y=p?g.filter(v=>v!==b):[...g,b];a(t.key,y)},children:b},b)})})}let m=Ql(e);return(0,ie.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":h,children:d.map(g=>{let b=m===g;return(0,ie.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,g),children:g},g)})})}case"number":{let d=e,m=d==null||d===""?"":String(d);return(0,ie.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:m,placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(g=>g.severity==="error")||void 0,onChange:g=>{let b=g.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let d=Ql(e)||"#000000";return(0,ie.jsxs)("div",{className:"spytial-ed-color",children:[(0,ie.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:pU(d),disabled:l,"aria-describedby":h,"aria-label":`${t.label} color`,onChange:m=>a(t.key,m.target.value)}),(0,ie.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:Ql(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:m=>a(t.key,m.target.value)})]})}case"boolean":{let d=e===!0||e==="true";return(0,ie.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":d,"aria-describedby":h,className:`spytial-ed-switch${d?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!d),children:(0,ie.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}default:return(0,ie.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:Ql(e),placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(d=>d.severity==="error")||void 0,onChange:d=>a(t.key,d.target.value)})}}function pU(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var nn=Pe(yi());var $b=[],VC=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?VC:$b).push(n=n+t[e])})();function mU(t){if(t<768)return!1;for(let e=0,n=$b.length;;){let i=e+n>>1;if(t<$b[i])n=i;else if(t>=VC[i])e=i+1;else return!0;if(e==n)return!1}}function UC(t){return t>=127462&&t<=127487}var FC=8205;function YC(t,e,n=!0,i=!0){return(n?KC:gU)(t,e,i)}function KC(t,e,n){if(e==t.length)return e;e&&QC(t.charCodeAt(e))&&$C(t.charCodeAt(e-1))&&e--;let i=Qb(t,e);for(e+=jC(i);e<t.length;){let r=Qb(t,e);if(i==FC||r==FC||n&&mU(r))e+=jC(r),i=r;else if(UC(r)){let s=0,o=e-2;for(;o>=0&&UC(Qb(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function gU(t,e,n){for(;e>1;){let i=KC(t,e-2,n);if(i<e)return i;e--}return 0}function Qb(t,e){let n=t.charCodeAt(e);if(!$C(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return QC(i)?(n-55296<<10)+(i-56320)+65536:n}function QC(t){return t>=56320&&t<57344}function $C(t){return t>=55296&&t<56320}function jC(t){return t<65536?1:2}var ae=class t{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,i){[e,n]=Wl(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),$l.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Wl(this,e,n);let i=[];return this.decompose(e,n,i,0),$l.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new so(this),s=new so(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new so(this,e)}iterRange(e,n=this.length){return new np(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new ip(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new gn(e):$l.from(gn.split(e,[]))}},gn=class t extends ae{constructor(e,n=yU(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new Xb(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(GC(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=tp(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=Wl(this,e,n);let r=tp(this.text,tp(i.text,GC(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):$l.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
189
+ `){[e,n]=Wl(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new t(i,r)),i=[],r=-1);return r>-1&&n.push(new t(i,r)),n}},$l=class t extends ae{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((n?a:l)>=e)return o.lineInner(e,n,i,r);r=l+1,i=a+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&n>=o){let c=r&((o<=e?1:0)|(a>=n?2:0));o>=e&&a<=n&&!c?i.push(l):l.decompose(e-o,n-o,i,c)}o=a+1}}replace(e,n,i){if([e,n]=Wl(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&n<=l){let a=o.replace(e-s,n-s,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new t(u,this.length-(n-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
190
+ `){[e,n]=Wl(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=a+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof t))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,n);i+=a.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let m of e)m.flatten(d);return new gn(d,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function f(d){let m;if(d.lines>s&&d instanceof t)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(h(),l.push(d)):d instanceof gn&&a&&(m=u[u.length-1])instanceof gn&&d.lines+m.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new gn(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>r&&h(),a+=d.lines,c+=d.length+1,u.push(d))}function h(){a!=0&&(l.push(u.length==1?u[0]:t.from(u,c)),c=-1,a=u.length=0)}for(let d of e)f(d);return h(),l.length==1?l[0]:new t(l,n)}};ae.empty=new gn([""],0);function yU(t){let e=-1;for(let n of t)e+=n.length+1;return e}function tp(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function GC(t,e,n){return tp(t,[""],e,n)}var so=class{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof gn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof gn?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
191
+ `,this;e--}else if(r instanceof gn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof gn?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},np=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new so(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}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 i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},ip=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(ae.prototype[Symbol.iterator]=function(){return this.iter()},so.prototype[Symbol.iterator]=np.prototype[Symbol.iterator]=ip.prototype[Symbol.iterator]=function(){return this});var Xb=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function Wl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function ht(t,e,n=!0,i=!0){return YC(t,e,n,i)}function bU(t){return t>=56320&&t<57344}function vU(t){return t>=55296&&t<56320}function eE(t,e){let n=t.charCodeAt(e);if(!vU(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return bU(i)?(n-55296<<10)+(i-56320)+65536:n}function tE(t){return t<65536?1:2}var Wb=/\r\n?|\n/,Ft=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ft||(Ft={})),yr=class t{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){Zb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:nE(this,e)}mapDesc(e,n=!1){return e.empty?this:Jb(this,e,n)}mapPos(e,n=-1,i=Ft.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=Ft.Simple&&c>=e&&(i==Ft.TrackDel&&r<e&&c>e||i==Ft.TrackBefore&&r<e||i==Ft.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}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 t(e)}static create(e){return new t(e)}},jt=class t extends yr{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 Zb(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return Jb(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(ae.empty);i.push(o?e.slice(s,s+o):ae.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:nE(this,e,!0)}map(e,n=!1){return e.empty?this:Jb(this,e,n,!0)}iterChanges(e,n=!1){Zb(this,e,n)}get desc(){return yr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new oo(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);Dt(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;Dt(n,u,f),f>0&&ps(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);Dt(n,u,-1),Dt(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:yr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&Dt(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:h=f,insert:d}=u;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let m=d?typeof d=="string"?ae.of(d.split(i||Wb)):d:ae.empty,g=m.length;if(f==h&&g==0)return;f<o&&a(),f>o&&Dt(r,f-o,-1),Dt(r,h-f,g),ps(s,r,m),o=h}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(ae.empty);i[r]=ae.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function Dt(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function ps(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(ae.empty);t.push(n)}}function Zb(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=ae.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function Jb(t,e,n,i=!1){let r=[],s=i?[]:null,o=new oo(t),l=new oo(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);Dt(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(Dt(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(Dt(r,0,o.ins),s&&ps(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;Dt(r,c,a<o.i?o.ins:0),s&&a<o.i&&ps(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?jt.createSet(r,s):yr.create(r);throw new Error("Mismatched change set lengths")}}}function nE(t,e,n=!1){let i=[],r=n?[]:null,s=new oo(t),o=new oo(e);for(let l=!1;;){if(s.done&&o.done)return r?jt.createSet(i,r):yr.create(i);if(s.ins==0)Dt(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)Dt(i,0,o.ins,l),r&&ps(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Dt(i,a,u,l),r&&u&&ps(r,i,o.text)}else o.ins==-1?(Dt(i,s.off?0:s.len,a,l),r&&ps(r,i,s.textBit(a))):(Dt(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&ps(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var oo=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?ae.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?ae.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},no=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return M.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return M.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 M.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},M=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>no.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.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 i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return no.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?no.create(n,e,o|32,i):no.create(e,n,o,i)}static undirectionalRange(e,n){return no.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function iE(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var cv=0,B=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=cv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:uv),!!e.static,e.enables)}of(e){return new Gl([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gl(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gl(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function uv(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var Gl=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=cv++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(a&&h.docChanged||c&&(h.docChanged||h.selection)||ev(f,u)){let d=i(f);if(l?!XC(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,h)=>{let d,m=h.config.address[s];if(m!=null){let g=op(h,m);if(this.dependencies.every(b=>b instanceof B?h.facet(b)===f.facet(b):b instanceof Mt?h.field(b,!1)==f.field(b,!1):!0)||(l?XC(d=i(f),g,r):r(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function XC(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function ev(t,e){let n=!1;for(let i of e)vu(t,i)&1&&(n=!0);return n}function SU(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=op(a,i[u]);if(r[u]==2)for(let h of f)c.push(h);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)vu(a,c);return a.values[o]=l(a),1},update(a,c){if(!ev(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=ev(a,i),f=c.config.facets[e.id],h=c.facet(e);if(f&&!u&&uv(n,f))return a.values[o]=h,0;let d=l(a);return e.compare(d,h)?(a.values[o]=h,0):(a.values[o]=d,1)}}}var Zd=B.define({static:!0}),Mt=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(cv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Zd).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Zd),o=r.facet(Zd),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,Zd.of({field:this,create:e})]}get extension(){return this}},io={lowest:4,low:3,default:2,high:1,highest:0};function bu(t){return e=>new rp(e,t)}var ku={highest:bu(io.highest),high:bu(io.high),default:bu(io.default),low:bu(io.low),lowest:bu(io.lowest)},rp=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},Zl=class t{of(e){return new Su(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Su=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},sp=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let h of xU(e,n,o))h instanceof Mt?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],c=[];for(let h of r)l[h.id]=c.length<<1,c.push(d=>h.slot(d));let u=i?.config.facets;for(let h in s){let d=s[h],m=d[0].facet,g=u&&u[h]||[];if(d.every(b=>b.type==0))if(l[m.id]=a.length<<1|1,uv(g,d))a.push(i.facet(m));else{let b=m.combine(d.map(p=>p.value));a.push(i&&m.compare(b,i.facet(m))?i.facet(m):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(p=>b.dynamicSlot(p)));l[m.id]=c.length<<1,c.push(b=>SU(b,m,d))}}let f=c.map(h=>h(l));return new t(e,o,f,l,a,s)}};function xU(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof Su&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof Su){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof rp)s(o.inner,o.prec);else if(o instanceof Mt)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Gl)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,io.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,io.default),i.reduce((o,l)=>o.concat(l))}function vu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function op(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var rE=B.define(),tv=B.define({combine:t=>t.some(e=>e),static:!0}),sE=B.define({combine:t=>t.length?t[0]:void 0,static:!0}),oE=B.define(),lE=B.define(),aE=B.define(),cE=B.define({combine:t=>t.length?t[0]:!1}),Bn=class{constructor(e,n){this.type=e,this.value=n}static define(){return new nv}},nv=class{of(e){return new Bn(this,e)}},iv=class{constructor(e){this.map=e}of(e){return new ue(this,e)}},ue=class t{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 t(this.type,n)}is(e){return this.type==e}static define(e={}){return new iv(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};ue.reconfigure=ue.define();ue.appendConfig=ue.define();var ft=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&iE(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}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(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};ft.time=Bn.define();ft.userEvent=Bn.define();ft.addToHistory=Bn.define();ft.remote=Bn.define();function wU(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function uE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=jt.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:ue.mapEffects(t.effects,r).concat(ue.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function rv(t,e,n){let i=e.selection,r=Xl(e.annotations);return e.userEvent&&(r=r.concat(ft.userEvent.of(e.userEvent))),{changes:e.changes instanceof jt?e.changes:jt.of(e.changes||[],n,t.facet(sE)),selection:i&&(i instanceof M?i:M.single(i.anchor,i.head)),effects:Xl(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function fE(t,e,n){let i=rv(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=uE(i,rv(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=ft.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return AU(n?kU(r):r)}function kU(t){let e=t.startState,n=!0;for(let r of e.facet(oE)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:wU(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=jt.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=ft.create(e,r,t.selection&&t.selection.map(s),ue.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(lE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof ft?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ft?t=s[0]:t=fE(e,Xl(s),!1)}return t}function AU(t){let e=t.startState,n=e.facet(aE),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=uE(i,rv(e,s,t.changes.newLength),!0))}return i==t?t:ft.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var OU=[];function Xl(t){return t==null?OU:Array.isArray(t)?t:[t]}var ri=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(ri||(ri={})),TU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,sv;try{sv=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function CU(t){if(sv)return sv.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||TU.test(n)))return!0}return!1}function EU(t){return e=>{if(!/\S/.test(e))return ri.Space;if(CU(e))return ri.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ri.Word;return ri.Other}}var Te=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)vu(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return vu(this,i),op(this,i)}update(...e){return fE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(Zl.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(ue.reconfigure)?(n=null,i=l.value):l.is(ue.appendConfig)&&(n=null,i=Xl(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=sp.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(tv)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(l,a)=>a.update(l,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:M.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=Xl(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let h=0;h<l;h++)s[h]=s[h].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=ue.mapEffects(o,u).concat(ue.mapEffects(Xl(a.effects),f))}return{changes:r,selection:M.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof jt?e:jt.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return ae.of(e.split(this.facet(t.lineSeparator)||Wb))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(vu(this,n),op(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Mt&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:M.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=sp.resolve(e.extensions||[],new Map),i=e.doc instanceof ae?e.doc:ae.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||Wb)),r=e.selection?e.selection instanceof M?e.selection:M.single(e.selection.anchor,e.selection.head):M.single(0);return iE(r,i.length),n.staticFacet(tv)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
192
+ `}get readOnly(){return this.facet(cE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(rE))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return EU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ht(n,o,!1);if(s(n.slice(a,o))!=ri.Word)break;o=a}for(;l<r;){let a=ht(n,l);if(s(n.slice(l,a))!=ri.Word)break;l=a}return o==l?null:M.range(o+i,l+i)}};Te.allowMultipleSelections=tv;Te.tabSize=B.define({combine:t=>t.length?t[0]:4});Te.lineSeparator=sE;Te.readOnly=cE;Te.phrases=B.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});Te.languageData=rE;Te.changeFilter=oE;Te.transactionFilter=lE;Te.transactionExtender=aE;Zl.reconfigure=ue.define();function ms(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Bi=class{eq(e){return this==e}range(e,n=e){return xu.create(e,n,this)}};Bi.prototype.startSide=Bi.prototype.endSide=0;Bi.prototype.point=!1;Bi.prototype.mapMode=Ft.TrackDel;function fv(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var xu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function ov(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var lv=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,h,d;if(u==f){let m=n.mapPos(u,c.startSide,c.mapMode);if(m==null||(h=d=m,c.startSide!=c.endSide&&(d=n.mapPos(u,c.endSide),d<h)))continue}else if(h=n.mapPos(u,c.startSide),d=n.mapPos(f,c.endSide),h>d||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(o<0&&(o=h),c.point&&(l=Math.max(l,d-h)),i.push(c),r.push(h-o),s.push(d-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},fe=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let 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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(ov)),this.isEmpty)return n.length?t.of(n):this;let l=new lp(this,null,-1).goto(0),a=0,c=[],u=new br;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(xu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return wu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return wu.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=WC(o,l,i),c=new ro(o,a,s),u=new ro(l,a,s);i.iterGaps((f,h,d)=>ZC(c,f,u,h,d,r)),i.empty&&i.length==0&&ZC(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=WC(s,o),a=new ro(s,l,0).goto(i),c=new ro(o,l,0).goto(i);for(;;){if(a.to!=c.to||!av(a.active,c.active)||a.point&&(!c.point||!fv(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new ro(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new br;for(let r of e instanceof xu?[e]:n?DU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};fe.empty=new fe([],[],null,-1);function DU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(ov(e,i)>0)return t.slice().sort(ov);e=i}return t}fe.empty.nextLayer=fe.empty;var br=class t{finishChunk(e){this.chunks.push(new lv(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,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.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 i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(fe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=fe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function WC(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var lp=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},wu=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new lp(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)Gb(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)Gb(this.heap,i);(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(),Gb(this.heap,0)}}};function Gb(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var ro=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=wu.from(e,n,i)}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){Jd(this.active,e),Jd(this.activeTo,e),Jd(this.activeRank,e),this.minActive=JC(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;ep(this.active,n,i),ep(this.activeTo,n,r),ep(this.activeRank,n,s),e&&ep(e,n,this.cursor.from),this.minActive=JC(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Jd(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function ZC(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,h=f||t.endSide-n.endSide,d=h<0?t.to+a:n.to,m=Math.min(d,o);if(t.point||n.point?(t.point&&n.point&&fv(t.point,n.point)&&av(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,m,t.point,n.point),u=!1):(u&&s.boundChange(l),m>l&&!av(t.active,n.active)&&s.compareRange(l,m,t.active,n.active),c&&m<o&&(f||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>o)break;l=d,h<=0&&t.next(),h>=0&&n.next()}}function av(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!fv(t[n],e[n]))return!1;return!0}function Jd(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function ep(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function JC(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function lo(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=ht(t,r));return i}function hE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=ht(t,r)}return i===!0?-1:t.length}var dE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),hv=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),pE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},In=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let m=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),m,a);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),m,u,h)}else m!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+m+";")}(u.length||h)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
193
+ `)}static newName(){let e=pE[dE]||1;return pE[dE]=e+1,"\u037C"+e.toString(36)}static mount(e,n,i){let r=e[hv],s=i&&i.nonce;r?s&&r.setNonce(s):r=new dv(e,s),r.mount(Array.isArray(n)?n:[n],e)}},mE=new Map,dv=class{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=mE.get(i);if(s)return e[hv]=s;this.sheet=new r.CSSStyleSheet,mE.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[hv]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
194
+ `;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var vr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Jl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},MU=typeof navigator<"u"&&/Mac/.test(navigator.platform),NU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ze=0;Ze<10;Ze++)vr[48+Ze]=vr[96+Ze]=String(Ze);var Ze;for(Ze=1;Ze<=24;Ze++)vr[Ze+111]="F"+Ze;var Ze;for(Ze=65;Ze<=90;Ze++)vr[Ze]=String.fromCharCode(Ze+32),Jl[Ze]=String.fromCharCode(Ze);var Ze;for(ap in vr)Jl.hasOwnProperty(ap)||(Jl[ap]=vr[ap]);var ap;function gE(t){var e=MU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||NU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Jl:vr)[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 yn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)yE(t,arguments[e]);return t}function yE(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)yE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var Vt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},wv=typeof document<"u"?document:{documentElement:{style:{}}},kv=/Edge\/(\d+)/.exec(Vt.userAgent),WE=/MSIE \d/.test(Vt.userAgent),Av=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vt.userAgent),zp=!!(WE||Av||kv),bE=!zp&&/gecko\/(\d+)/i.test(Vt.userAgent),pv=!zp&&/Chrome\/(\d+)/.exec(Vt.userAgent),vE="webkitFontSmoothing"in wv.documentElement.style,Ov=!zp&&/Apple Computer/.test(Vt.vendor),SE=Ov&&(/Mobile\/\w+/.test(Vt.userAgent)||Vt.maxTouchPoints>2),_={mac:SE||/Mac/.test(Vt.platform),windows:/Win/.test(Vt.platform),linux:/Linux|X11/.test(Vt.platform),ie:zp,ie_version:WE?wv.documentMode||6:Av?+Av[1]:kv?+kv[1]:0,gecko:bE,gecko_version:bE?+(/Firefox\/(\d+)/.exec(Vt.userAgent)||[0,0])[1]:0,chrome:!!pv,chrome_version:pv?+pv[1]:0,ios:SE,android:/Android\b/.test(Vt.userAgent),webkit:vE,webkit_version:vE?+(/\bAppleWebKit\/(\d+)/.exec(Vt.userAgent)||[0,0])[1]:0,safari:Ov,safari_version:Ov?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Vt.userAgent)||[0,0])[1]:0,tabSize:wv.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function u1(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}var Sp=Object.create(null);function f1(t,e,n){if(t==e)return!0;t||(t=Sp),e||(e=Sp);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function RU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function xE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function _U(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var wr=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},tn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(tn||(tn={})),be=class extends Bi{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Bu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new uo(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=ZE(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new uo(e,i,r,n,e.widget||null,!0)}static line(e){return new Iu(e)}static set(e,n=!1){return fe.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};be.none=fe.empty;var Bu=class t extends be{constructor(e){let{start:n,end:i}=ZE(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?u1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Sp}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&f1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Bu.prototype.point=!1;var Iu=class t extends be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&f1(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)}};Iu.prototype.mapMode=Ft.TrackBefore;Iu.prototype.point=!0;var uo=class t extends be{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Ft.TrackBefore:Ft.TrackAfter:Ft.TrackDel}get type(){return this.startSide!=this.endSide?tn.WidgetRange:this.startSide<=0?tn.WidgetBefore:tn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&LU(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)}};uo.prototype.point=!0;function ZE(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function LU(t,e){return t==e||!!(t&&e&&t.compare(e))}function sa(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var xp=class t extends Bi{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&f1(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||Sp,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return fe.of(e,n)}};xp.prototype.startSide=xp.prototype.endSide=-1;function qu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Tv(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Tu(t,e){if(!e.anchorNode)return!1;try{return Tv(t,e.anchorNode)}catch{return!1}}function bp(t){return t.nodeType==3?Pu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Cu(t,e,n,i){return n?wE(t,e,n,i,-1)||wE(t,e,n,i,1):!1}function bs(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function wp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function wE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:kr(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=bs(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?kr(t):0}else return!1}}function kr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function kp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function BU(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 JE(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function IU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let h,d=u==a.body,m=1,g=1;if(d)h=BU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:m,scaleY:g}=JE(u,y)),h={left:y.left,right:y.left+u.clientWidth*m,top:y.top,bottom:y.top+u.clientHeight*g}}let b=0,p=0;if(r=="nearest")e.top<h.top+o?(p=e.top-(h.top+o),n>0&&e.bottom>h.bottom+p&&(p=e.bottom-h.bottom+o)):e.bottom>h.bottom-o&&(p=e.bottom-h.bottom+o,n<0&&e.top-p<h.top&&(p=e.top-(h.top+o)));else{let y=e.bottom-e.top,v=h.bottom-h.top;p=(r=="center"&&y<=v?e.top+y/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-h.top}if(i=="nearest"?e.left<h.left+s?(b=e.left-(h.left+s),n>0&&e.right>h.right+b&&(b=e.right-h.right+s)):e.right>h.right-s&&(b=e.right-h.right+s,n<0&&e.left<h.left+b&&(b=e.left-(h.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:i=="start"==l?e.left-s:e.right-(h.right-h.left)+s)-h.left,b||p)if(d)c.scrollBy(b,p);else{let y=0,v=0;if(p){let S=u.scrollTop;u.scrollTop+=p/g,v=(u.scrollTop-S)*g}if(b){let S=u.scrollLeft;u.scrollLeft+=b/m,y=(u.scrollLeft-S)*m}e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v},y&&Math.abs(y-b)<1&&(i="nearest"),v&&Math.abs(v-p)<1&&(r="nearest")}if(d)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function eD(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Cv=class{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:i}=e;this.set(n,Math.min(e.anchorOffset,n?kr(n):0),i,Math.min(e.focusOffset,i?kr(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},ao=null;_.safari&&_.safari_version>=26&&(ao=!1);function tD(t){if(t.setActive)return t.setActive();if(ao)return t.focus(ao);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ao==null?{get preventScroll(){return ao={preventScroll:!0},!0}}:void 0),!ao){ao=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var kE;function Pu(t,e,n=e){let i=kE||(kE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function oa(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function qU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function PU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,kr(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=kr(n))}else{if(n==t)return!0;i=bs(n),n=n.parentNode}}function nD(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function iD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=kr(n)}else if(n.parentNode&&!wp(n))i=bs(n),n=n.parentNode;else return null}}function rD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!wp(n))i=bs(n)+1,n=n.parentNode;else return null}}var qi=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,bs(e),n)}static after(e,n){return new t(e.parentNode,bs(e)+1,n)}},Me=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Me||(Me={})),fo=Me.LTR,h1=Me.RTL;function sD(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var zU=sD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),HU=sD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ev=Object.create(null),Ii=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ev[e]=n,Ev[n]=-e}function oD(t){return t<=247?zU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?HU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var UU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,zn=class{get dir(){return this.level%2?h1:fo}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function lD(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!lD(i.inner,r.inner))return!1}return!0}var we=[];function FU(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let h=oD(t.charCodeAt(c));h==512?h=u:h==8&&f==4&&(h=16),we[c]=h==4?2:h,h&7&&(f=h),u=h}for(let c=o,u=a,f=a;c<l;c++){let h=we[c];if(h==128)c<l-1&&u==we[c+1]&&u&24?h=we[c]=u:we[c]=256;else if(h==64){let d=c+1;for(;d<l&&we[d]==64;)d++;let m=c&&u==8||d<n&&we[d]==8?f==1?1:8:256;for(let g=c;g<d;g++)we[g]=m;c=d-1}else h==8&&f==1&&(we[c]=1);u=h,h&7&&(f=h)}}}function jU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,h,d,m;f<u;f++)if(d=Ev[h=t.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(Ii[g+1]==-d){let b=Ii[g+2],p=b&2?r:b&4?b&1?s:r:0;p&&(we[f]=we[Ii[g]]=p),l=g;break}}else{if(Ii.length==189)break;Ii[l++]=f,Ii[l++]=h,Ii[l++]=a}else if((m=we[f])==2||m==1){let g=m==r;a=g?0:1;for(let b=l-3;b>=0;b-=3){let p=Ii[b+2];if(p&2)break;if(g)Ii[b+2]|=2;else{if(p&4)break;Ii[b+2]|=4}}}}}function VU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=we[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(we[u]==256)u++;else break;let f=s==1,h=(u<e?we[u]:i)==1,d=f==h?f?1:2:i;for(let m=u,g=r,b=g?n[g-1].to:t;m>a;)m==b&&(m=n[--g].from,b=g?n[g-1].to:t),we[--m]=d;a=u}else s=c,a++}}}function Dv(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let g=we[a];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,m=a;e:for(;;)if(c<s.length&&m==s[c].from){if(f)break e;let g=s[c];if(!u)for(let b=g.to,p=c+1;;){if(b==n)break e;if(p<s.length&&s[p].from==b)b=s[p++].to;else{if(we[b]==l)break e;break}}if(c++,h)h.push(g);else{g.from>a&&o.push(new zn(a,g.from,d));let b=g.direction==fo!=!(d%2);Mv(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.to}m=g.to}else{if(m==n||(u?we[m]!=l:we[m]==l))break;m++}h?Dv(t,a,m,i+1,r,h,o):a<m&&o.push(new zn(a,m,d)),a=m}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let g=we[a-1];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(f)break e;let g=s[--c];if(!u)for(let b=g.from,p=c;;){if(b==e)break e;if(p&&s[p-1].to==b)b=s[--p].from;else{if(we[b-1]==l)break e;break}}if(h)h.push(g);else{g.to<a&&o.push(new zn(g.to,a,d));let b=g.direction==fo!=!(d%2);Mv(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.from}m=g.from}else{if(m==e||(u?we[m-1]!=l:we[m-1]==l))break;m--}h?Dv(t,m,a,i+1,r,h,o):m<a&&o.push(new zn(m,a,d)),a=m}}function Mv(t,e,n,i,r,s,o){let l=e%2?2:1;FU(t,r,s,i,l),jU(t,r,s,i,l),VU(r,s,i,l),Dv(t,r,s,e,n,i,o)}function YU(t,e,n){if(!t)return[new zn(0,0,e==h1?1:0)];if(e==fo&&!n.length&&!UU.test(t))return aD(t.length);if(n.length)for(;t.length>we.length;)we[we.length]=256;let i=[],r=e==fo?0:1;return Mv(t,r,r,n,0,t.length,i),i}function aD(t){return[new zn(0,t,0)]}var cD="";function KU(t,e,n,i,r){var s;let o=i.head-t.from,l=zn.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let h=l+=r?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],o=a.side(!r,n),c=a.side(r,n)}let u=ht(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),cD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?M.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):M.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function QU(t,e,n){for(let i=e;i<n;i++){let r=oD(t.charCodeAt(i));if(r==1)return fo;if(r==2||r==4)return h1}return fo}var uD=B.define(),fD=B.define(),hD=B.define(),dD=B.define(),Nv=B.define(),pD=B.define(),mD=B.define(),d1=B.define(),p1=B.define(),gD=B.define({combine:t=>t.some(e=>e)}),$U=B.define({combine:t=>t.some(e=>e)}),yD=B.define(),Eu=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(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 t(M.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},cp=ue.define({map:(t,e)=>t.map(e)}),bD=ue.define();function bn(t,e,n){let i=t.facet(dD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var Sr=B.define({combine:t=>t.length?t[0]:!0}),GU=0,ta=B.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),Hn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ta.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ta.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(GU++,e,i,r,l=>{let a=[];return o&&a.push(Hp.of(c=>{let u=c.plugin(l);return u?o(u):be.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Du=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(bn(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){bn(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(i){bn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},vD=B.define(),m1=B.define(),Hp=B.define(),SD=B.define(),g1=B.define(),zu=B.define(),xD=B.define();function AE(t,e){let n=t.state.facet(xD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return fe.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,m;if(d==null&&(d=QU(e.text,c,u)),a>0&&f.length&&(m=f[f.length-1]).to==c&&m.direction==d)m.to=u,f=m.inner;else{let g={from:c,to:u,direction:d,inner:[]};f.push(g),f=g.inner}}}}),r}var wD=B.define();function y1(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(wD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var Au=B.define(),oi=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(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,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,h=u;for(;;)if(s<n.length&&n[s]<=f){let d=n[s+1];s+=2,f=Math.max(f,d);for(let m=r;m<e.length&&e[m].fromB<=f;m++)o=e[m].toA-e[m].toB;h=Math.max(h,d+o)}else if(r<e.length&&e[r].fromB<=f){let d=e[r++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),o=d.toA-d.toB}else break;i.push(new t(u,h,c,f))}return i}},Ap=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=jt.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new oi(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},XU=[],Ie=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return XU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&RU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=bs(this.dom),r=this.length?e>0:n>0;return new qi(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof aa)return e;return null}static get(e){return e.cmTile}},la=class extends Ie{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=OE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=OE(r);this.length=o}};function OE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var aa=class extends la{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Ie.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof xr)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},xr=class t extends la{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ca=class t extends la{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let h=0,d=0;h<u.children.length&&d<=f;h++){let m=u.children[h],g=d+m.length;g>=f&&(m.isComposite()?a(m,f-d):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&ZU(o,m)))&&(g>f||m.flags&32)?(o=m,l=f-d):(d<f||m.flags&16&&!m.isHidden)&&(r=m,s=f-d)),d=g}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):WU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new qi(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new qi(a.dom,0);a==i.tile&&(l=!0)}}return new qi(this.dom,0)}};function WU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=bp(e);return n[n.length-1]||null}function ZU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var en=class t extends la{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},co=class t extends Ie{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?_.chrome||_.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=Pu(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return _.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:kp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},ho=class t extends Ie{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return kp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return kp(o,!l)}}get overrideDOMText(){if(!this.length)return ae.empty;let{root:e}=this;if(!e)return ae.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},ua=class extends Ie{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return ae.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:kp(r,n>0==i)}},Rv=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},_v=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},Lv=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new co(l.dom,l.text+e);a.parent=o}else o.append(r||co.of(e,(s=this.cache.find(co))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?mv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof en&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(mv(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=Ie.get(a.dom);f&&f.setDOM(mv(a.dom))}let u=en.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=Ie.get(e.text);s&&this.cache.reused.set(s,2);let o=new co(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=kD);let r=ca.start(e,n||((i=this.cache.find(ca))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof en&&l.mark.eq(o))r=l,n--;else{let a=en.of(o,(i=this.cache.find(en,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!TE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_.ios&&TE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(gv,0,32)||new ho(gv.toDOM(),0,gv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new _v(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof xr&&r.wrapper.eq(i.wrapper))n=r;else{let s=xr.of(i.wrapper,(e=this.cache.find(xr,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(ua,void 0,1);return i&&(i.flags=n),i||new ua(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Bv=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},Op=[ho,ca,co,en,ua,xr,aa];for(let t=0;t<Op.length;t++)Op[t].bucket=t;var Iv=class{constructor(e){this.view=e,this.buckets=Op.map(()=>[]),this.index=Op.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new ho(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},qv=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Iv(e),this.text=new Bv(e.state.doc),this.builder=new Lv(this.cache,new aa(e,e.contentDOM),fe.iter(i)),this.cache.reused.set(n,2),this.old=new Rv(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=tF(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?ho.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof ua)this.cache.add(o);else if(o instanceof en)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof en&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof en&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=fe.spans(this.decorations,e,n,{point:(l,a,c,u,f,h)=>{if(c instanceof uo){if(this.disallowBlockEffectsFor[h]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let d=c.widget||(c.block?vs.block:vs.inline),m=JU(c),g=this.cache.findWidget(d,a-l,m)||ho.of(d,this.view,a-l,m);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(g)):(r.ensureLine(i),r.addInlineWidget(g,u,f))}i=null}else i=eF(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let h=this.text.next(Math.min(512,a-f));h==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(h,c,f==l?u:c.length),f+=h.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=Ie.get(r);if(r==this.view.contentDOM)break;s instanceof en?n.push(s):s?.isLine()?i=s:s instanceof xr||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new ca(r,kD):i||n.push(en.of(new Bu({tagName:r.nodeName.toLowerCase(),attributes:_U(r)}),r)))}return{line:i,marks:n}}};function TE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function JU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var kD={class:"cm-line"};function eF(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&u1(n,t),i&&(t.class+=" "+i)),t}function tF(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof en&&e.push(i.mark)}return e}function mv(t){let e=Ie.get(t);return e&&e.setDOM(t.cloneNode()),t}var vs=class extends wr{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}};vs.inline=new vs("span");vs.block=new vs("div");var gv=new class extends wr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Tp=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=be.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new aa(e,e.contentDOM),this.updateInner([new oi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!cF(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?iF(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new oi(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(_.ie||_.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=oF(o,this.decorations,e.changes);a.length&&(i=oi.extendWithRanges(i,a));let c=lF(l,this.blockWrappers,e.changes);return c.length&&(i=oi.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new qv(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Ie.get(n.text)&&l.cache.reused.set(Ie.get(n.text),2),this.tile=l.run(e,n),Pv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=_.chrome||_.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Mu&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(bD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(Sr)||i.tabIndex>-1)&&Tu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),_.gecko&&a.empty&&!this.hasComposition&&nF(c)){let h=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(h,c.node.childNodes[c.offset]||null)),c=u=new qi(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Cu(c.node,c.offset,f.anchorNode,f.anchorOffset)||!Cu(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{_.android&&_.chrome&&i.contains(f.focusNode)&&aF(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=qu(this.view.root);if(h)if(a.empty){if(_.gecko){let d=rF(c.node,c.offset);if(d&&d!=3){let m=(d==1?iD:rD)(c.node,c.offset);m&&(c=new qi(m.node,m.offset))}}h.collapse(c.node,c.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(c.node,c.offset);try{h.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new qi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new qi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Cu(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,i=qu(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=kr(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Ie.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Mu?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=ht(s.text,o);if(l==o)return null;let a=Pu(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Me.LTR,c=0,u=(f,h,d)=>{for(let m=0;m<f.children.length&&!(h>r);m++){let g=f.children[m],b=h+g.length,p=g.dom.getBoundingClientRect(),{height:y}=p;if(d&&!m&&(c+=p.top-d.top),g instanceof xr)b>i&&u(g,h,p);else if(h>=i&&(c>0&&n.push(-c),n.push(y+c),c=0,o)){let v=g.dom.lastChild,S=v?bp(v):[];if(S.length){let w=S[S.length-1],O=a?w.right-p.left:p.right-w.left;O>l&&(l=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=b)}}d&&m==f.children.length-1&&(c+=d.bottom-p.bottom),h=b+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Me.RTL:Me.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=bp(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=bp(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(be.replace({widget:new Mu(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return be.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Hp).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(g1).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(fe.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(SD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(yD))try{if(c(this.view,e.range,e))return!0}catch(u){bn(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=y1(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(IU(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Me.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Pv(this.tile)}};function Pv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)Pv(i,e)}}function nF(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function AD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=iD(n.focusNode,n.focusOffset),r=rD(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=Ie.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=Ie.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function iF(t,e,n){let i=AD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new oi(a.mapPos(s),a.mapPos(o),s,o),text:r}}function rF(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}var sF=class{constructor(){this.changes=[]}compareRange(e,n){sa(e,n,this.changes)}comparePoint(e,n){sa(e,n,this.changes)}boundChange(e){sa(e,e,this.changes)}};function oF(t,e,n){let i=new sF;return fe.compare(t,e,n,i),i.changes}var zv=class{constructor(){this.changes=[]}compareRange(e,n){sa(e,n,this.changes)}comparePoint(){}boundChange(e){sa(e,e,this.changes)}};function lF(t,e,n){let i=new zv;return fe.compare(t,e,n,i),i.changes}function aF(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function cF(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var Mu=class extends wr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function uF(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return M.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=ht(r.text,s,!1):l=ht(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=ht(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=ht(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return M.undirectionalRange(o+r.from,l+r.from)}function fF(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+hE(o,s,t.state.tabSize)}function hF(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==tn.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function dF(t,e,n,i){let r=hF(t,e.head,e.assoc||-1),s=!i||r.type!=tn.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==Me.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return M.cursor(a,n?-1:1)}return M.cursor(n?r.to:r.from,n?-1:1)}function CE(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=KU(r,s,o,l,n),u=cD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
195
+ `,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function pF(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==ri.Space&&(r=o),r==o}}function mF(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return M.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-m.from))),l=(s<0?m.top:m.bottom)+u}let f=a.left+o,h=t.viewState.heightOracle.textHeight>>1,d=i??h;for(let m=0;;m+=h){let g=l+(d+m)*s,b=Hv(t,{x:f,y:g},!1,s);if(n?g>a.bottom:g<a.top)return M.cursor(b.pos,b.assoc);let p=t.coordsAtPos(b.pos,b.assoc),y=p?(p.top+p.bottom)/2:0;if(!p||(n?y>l:y<l))return M.cursor(b.pos,b.assoc,void 0,o)}}function Nu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function OD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Nu(t,r.from,0);o!=r.from&&(s=M.cursor(o,-1))}else{let o=Nu(t,r.from,-1),l=Nu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=M.undirectionalRange(r.from,r.to):s=M.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?M.create(n,e.mainIndex):e}function yv(t,e,n){let i=Nu(t.state.facet(zu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:M.cursor(i,i<n.from?1:-1)}var Pn=class{constructor(e,n){this.pos=e,this.assoc=n}};function Hv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new Pn(0,1);if(a>t.viewState.docHeight)return new Pn(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==tn.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let h=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(h&&(i<0?h.top<=a+s:h.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==tn.Text){let f=fF(t,r,c,o,l);return new Pn(f,f==c.from?1:-1)}}if(c.type!=tn.Text)return a<(c.top+c.bottom)/2?new Pn(c.from,1):new Pn(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new Uv(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var Uv=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[zn.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[zn.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,h;e:for(;r<s;){let m=s-r,g=r+s>>1;t:if(o.has(g)){let p=r+Math.floor(Math.random()*m);for(let y=0;y<m;y++){if(!o.has(p)){g=p;break t}p++,p==s&&(p=r)}break e}o.add(g);let b=n(g);if(b)for(let p=0;p<b.length;p++){let y=b[p],v=0;if(!(y.width==0&&b.length>1)){if(y.bottom<this.y)(!a||a.bottom<y.bottom)&&(a=y),v=1;else if(y.top>this.y)(!c||c.top>y.top)&&(c=y),v=-1;else{let S=y.left>this.x?this.x-y.left:y.right<this.x?this.x-y.right:0,w=Math.abs(S);w<f&&(u=g,f=w,h=y),S&&(v=S<0==(this.baseDir==Me.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[g],1))?s=g:v==1&&(!l||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}}if(!h){if(!c&&!a)return{i:e[0],after:!1};let m=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(m.top+m.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:m,bottom:g}=h;if(a&&a.bottom>(m+m+g)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(m+g+g)/3)return this.y=c.top+1,this.scan(e,n,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==Me.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=ht(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return Pu(e.dom,o,l).getClientRects()});return r.after?new Pn(i[r.i+1],-1):new Pn(i[r.i],1)}scanTile(e,n){if(!e.length)return new Pn(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Pu(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Pn(i[r.i+1],-1):new Pn(o,1)}},ea="\uFFFF",Fv=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Te.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ea}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=Ie.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=Ie.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:wp(r))||wp(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!yF(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=Ie.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(gF(e,i.node,i.offset)?n:0))}};function gF(t,e,n){for(;;){if(!e||n<kr(e))return!1;if(e==t)return!0;n=bs(e)+1,e=e.parentNode}}function yF(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=Ie.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Cp=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},jv=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=TD(e.docView.tile,n,i,0))){let a=s||o?[]:vF(e),c=new Fv(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=SF(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Tv(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Tv(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((_.ios||_.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let h=Math.min(c,u),d=Math.max(c,u),m=f.from-h,g=f.to-d;(m==0||m==1||h==0)&&(g==0||g==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(M.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let h=e.coordsAtPos(c,-1),d=0;h&&(d=e.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=M.create([M.cursor(c,d)])}else this.newSel=M.single(u,c)}}};function TD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],h=c+f.length;if(c<e&&h>n)return TD(f,e,n,c);if(h>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=h,c=h+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function CD(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||_.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,ea),h,d;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(h=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:ae.of(e.text.slice(s.from-l,h).split(ea))}:(d=ED(f,e.text,c-l,u))&&(_.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==ea+ea&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:ae.of(e.text.slice(d.from,d.toB).split(ea))})}else i&&(!t.hasFocus&&r.facet(Sr)||Ep(i,s))&&(i=null);if(!n&&!i)return!1;if((_.mac||_.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=M.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:ae.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:_.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
196
+ `&&t.lineWrapping&&(i&&(i=M.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:ae.of([" "])}),n)return b1(t,n,i,o);if(i&&!Ep(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=OD(r.facet(zu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function b1(t,e,n,i=-1){if(_.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(_.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&oa(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&oa(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&oa(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=bF(t,e,n));return t.state.facet(pD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function bF(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Nu(r.facet(zu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:M.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,h=n&&AD(t,n.main.head);if(h){let m=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-m}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:c||m.map(a)};let g=m.to-d,b=g-u.length;if(t.state.sliceDoc(b,g)!=u||g>=f.from&&b<=f.to)return{range:m};let p=r.changes({from:b,to:g,insert:e.insert}),y=m.to-s.to;return{changes:p,range:c?M.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):m.map(p)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function ED(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function vF(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Cp(n,i)),(r!=n||s!=i)&&e.push(new Cp(r,s))),e}function SF(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?M.single(n+e,i+e):null}function Ep(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var Vv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,_.safari&&e.contentDOM.addEventListener("input",()=>null),_.gecko&&BF(e.contentDOM.ownerDocument)}handleEvent(e){!EF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=wF(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,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&&MD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_.android&&_.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(_.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(DD.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||kF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&_.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&xF(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,oa(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:_.safari&&!_.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function xF(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function EE(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){bn(n.state,r)}}}function wF(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(EE(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(EE(i.value,a))}}for(let i in li)n(i).handlers.push(li[i]);for(let i in Yt)n(i).observers.push(Yt[i]);return e}var DD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],kF="dthko",MD=[16,17,18,20,91,92,224,225],up=6;function fp(t){return Math.max(0,t)*.7+8}function AF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var Yv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=eD(e.contentDOM),this.atoms=e.state.facet(zu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Te.allowMultipleSelections)&&OF(e,n),this.dragging=CF(e,n)&&_D(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&&AF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=y1(this.view);e.clientX-a.left<=r+up?n=-fp(r-e.clientX):e.clientX+a.right>=o-up&&(n=fp(e.clientX-o)),e.clientY-a.top<=s+up?i=-fp(s-e.clientY):e.clientY+a.bottom>=l-up&&(i=fp(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,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)}select(e){let{view:n}=this,i=OD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function OF(t,e){let n=t.state.facet(uD);return n.length?n[0](e):_.mac?e.metaKey:e.ctrlKey}function TF(t,e){let n=t.state.facet(fD);return n.length?n[0](e):_.mac?!e.altKey:!e.ctrlKey}function CF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=qu(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function EF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Ie.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var li=Object.create(null),Yt=Object.create(null),ND=_.ie&&_.ie_version<15||_.ios&&_.webkit_version<604;function DF(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(),RD(t,n.value)},50)}function Up(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function RD(t,e){e=Up(t.state,d1,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Kv!=null&&n.selection.ranges.every(a=>a.empty)&&Kv==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:M.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:M.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Yt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,_.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Yt.wheel=Yt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};li.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Yt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Yt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Yt.touchend=(t,e)=>{t.inputState.touchActive=!1};li.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(hD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=NF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Yv(t,e,n,i)),i&&t.observer.ignore(()=>{tD(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function DE(t,e,n,i){if(i==1)return M.cursor(e,n);if(i==2)return uF(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,M.undirectionalRange(o,l)}}var MF=_.ie&&_.ie_version<=11,ME=null,NE=0,RE=0;function _D(t){if(!MF)return t.detail;let e=ME,n=RE;return ME=t,RE=Date.now(),NE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(NE+1)%3:1}function NF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=_D(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=DE(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=DE(t,n.pos,n.assoc,i),h=Math.min(f.from,u.from),d=Math.max(f.to,u.to);u=h<u.from?M.range(h,d,u.assoc):M.range(d,h,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=RF(r,a.pos))?c:l?r.addRange(u):M.create([u])}}}function RF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return M.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}li.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=M.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Up(t.state,p1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};li.dragend=t=>(t.inputState.draggedContent=null,!1);function _E(t,e,n,i){if(n=Up(t.state,d1,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&TF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}li.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&_E(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return _E(t,e,i,!0),!0}return!1};li.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=ND?null:e.clipboardData;return n?(RD(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(DF(t),!1)};function _F(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function LF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:Up(t,p1,e.join(t.lineBreak)),ranges:n,linewise:i}}var Kv=null;li.copy=li.cut=(t,e)=>{if(!Tu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=LF(t.state);if(!n&&!r)return!1;Kv=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=ND?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(_F(t,n),!1)};var LD=Bn.define();function BD(t,e){let n=[];for(let i of t.facet(mD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:LD.of(!0)}):null}function ID(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=BD(t.state,e);n?t.dispatch(n):t.update([])}},10)}Yt.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),ID(t)};Yt.blur=t=>{t.observer.clearSelectionRange(),ID(t)};Yt.compositionstart=Yt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Yt.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,_.chrome&&_.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Yt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};li.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return b1(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(_.chrome&&_.android&&(r=DD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return _.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),_.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Yt.compositionend(t,e),20),!1};var LE=new Set;function BF(t){LE.has(t)||(LE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var BE=["pre-wrap","normal","pre-line","break-spaces"],fa=!1;function IE(){fa=!1}var Qv=class{constructor(e){this.lineWrapping=e,this.doc=ae.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return BE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=BE.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},$v=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},si=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?tn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof uo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},Ce=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ce||(Ce={})),vp=.001,vn=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>vp&&(fa=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],h=s.lineAt(a,Ce.ByPosNoHeight,i.setDoc(n),0,0),d=h.to>=c?h:s.lineAt(c,Ce.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&h.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<h.from&&(h=s.lineAt(a,Ce.ByPosNoHeight,i,0,0));u+=h.from-a,a=h.from;let m=Xv.build(i.setDoc(o),e,u,f);s=Dp(s,s.replace(a,c,m))}return s.updateHeight(i,0)}static empty(){return new qn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new Gv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function Dp(t,e){return t==e?t:(t.constructor!=e.constructor&&(fa=!0),e)}vn.prototype.size=1;var IF=be.replace({}),Mp=class extends vn{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new si(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new si(r,0,i,this.spaceAbove,IF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Ce.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},qn=class t extends Mp{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new si(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof ys&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ys?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):vn.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},ys=class t extends vn{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,h=Math.max(i,e-f/2);return new si(u.from,u.length,h,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new si(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==Ce.ByHeight)return this.blockAt(e,i,r,s);if(n==Ce.ByPosNoHeight){let{from:d,to:m}=i.doc.lineAt(e);return new si(d,m-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,h=r+l*f+a*(c.from-s-f);return new si(c.from,c.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let h=i.doc.lineAt(u);if(u==e){let m=h.number-l;f+=a*m+c*(e-s-m)}let d=a+c*h.length;o(new si(h.from,h.length,f,d,0)),f+=d,u=h.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return vn.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=vp&&(a=-2);let d=new qn(u,f,h);d.outdated=!1,o.push(d),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=vn.of(o);return(a<0||Math.abs(c.height-this.height)>=vp||Math.abs(a-this.heightMetrics(e,n).perLine)>=vp)&&(fa=!0),Dp(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Gv=class extends vn{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==Ce.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Ce.ByPosNoHeight?Ce.ByPosNoHeight:Ce.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,Ce.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&qE(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),qE(s,l)}return vn.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?vn.of(this.break?[e,null,n]:[e,n]):(this.left=Dp(this.left,e),this.right=Dp(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,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function qE(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof ys&&(i=t[e+1])instanceof ys&&t.splice(e-1,3,new ys(n.length+1+i.length))}var qF=5,Xv=class t{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 i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof qn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new qn(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new Mp(o,r,i)):(o||s||r>=qF)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new qn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new ys(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof qn)return e;let n=new qn(0,-1,0);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof qn)&&!this.isCovered?this.nodes.push(new qn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof qn&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return fe.spans(n,i,r,s,0),s.finish(i)}};function PF(t,e,n){let i=new Wv;return fe.compare(t,e,n,i,0),i.changes}var Wv=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&sa(e,n,this.changes,5)}};function zF(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let h=u.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),a=Math.min(c==t.parentNode?r.innerHeight:a,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function HF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function UF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var Ru=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return be.replace({widget:new Zv(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},Zv=class extends wr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}},Np=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=PE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Me.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(m1).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Qv(i),this.stateDeco=zE(n),this.heightMap=vn.empty().applyChanges(this.stateDeco,ae.empty,this.heightOracle.setDoc(n.doc),[new oi(0,0,0,n.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=be.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new na(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?PE:new Jv(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(Ou(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=zE(this.state);let r=e.changedRanges,s=oi.extendWithRanges(r,PF(i,this.stateDeco,e?e.changes:jt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);IE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||fa)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,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(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet($U)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Me.RTL:Me.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:w,scaleY:O}=JE(n,l);(w>.005&&Math.abs(this.scaleX-w)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=w,this.scaleY=O,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=eD(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=nD(this.scrollParent||e.win);let g=(this.printing?UF:zF)(n,this.paddingTop),b=g.top-this.pixelViewport.top,p=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!HF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:k,textHeight:A}=e.docView.measureTextSize();o=O>0&&r.refresh(s,O,k,A,Math.max(5,v/k),w),o&&(e.docView.minWidth=0,c|=16)}b>0&&p>0?u=Math.max(b,p):b<0&&p<0&&(u=Math.min(b,p)),IE();for(let O of this.viewports){let k=O.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(O);this.heightMap=(o?vn.empty().applyChanges(this.stateDeco,ae.empty,this.heightOracle,[new oi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new $v(O.from,k))}fa&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]: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 i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new na(r.lineAt(o-i*1e3,Ce.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Ce.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,Ce.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?h=f.top:h=f.bottom-u,a=new na(r.lineAt(h-1e3/2,Ce.ByHeight,s,0,0).from,r.lineAt(h+u+1e3/2,Ce.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new na(this.heightMap.lineAt(i,Ce.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ce.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ce.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Ce.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new Ru(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Me.LTR&&!i)return[];let l=[],a=(u,f,h,d)=>{if(f-u<s)return;let m=this.state.selection.main,g=[m.from];m.empty||g.push(m.to);for(let p of g)if(p>u&&p<f){a(u,p-10,h,d),a(p+10,f,h,d);return}let b=jF(e,p=>p.from>=h.from&&p.to<=h.to&&Math.abs(p.from-u)<s&&Math.abs(p.to-f)<s&&!g.some(y=>p.from<y&&p.to>y));if(!b){if(f<h.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(M.cursor(f),!1,!0).head;v>u&&(f=v)}let p=this.gapSize(h,u,f,d),y=i||p<2e6?p:2e6;b=new Ru(u,f,p,y)}l.push(b)},c=u=>{if(u.length<o||u.type!=tn.Text)return;let f=FF(u.from,u.to,this.stateDeco);if(f.total<o)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,m;if(i){let g=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,p;if(h!=null){let y=dp(f,h),v=((this.visibleBottom-this.visibleTop)/2+g)/u.height;b=y-v,p=y+v}else b=(this.visibleTop-u.top-g)/u.height,p=(this.visibleBottom-u.top+g)/u.height;d=hp(f,b),m=hp(f,p)}else{let g=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,p=0;if(g>2e6)for(let O of e)O.from>=u.from&&O.from<u.to&&O.size!=O.displaySize&&O.from*this.heightOracle.charWidth+p<this.pixelViewport.left&&(p=O.size-O.displaySize);let y=this.pixelViewport.left+p,v=this.pixelViewport.right+p,S,w;if(h!=null){let O=dp(f,h),k=((v-y)/2+b)/g;S=O-k,w=O+k}else S=(y-b)/g,w=(v+b)/g;d=hp(f,S),m=hp(f,w)}d>u.from&&a(u.from,d,u,f),m<u.to&&a(m,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=dp(r,i)-dp(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Ru.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=be.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];fe.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ou(this.heightMap.lineAt(e,Ce.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)||Ou(this.heightMap.lineAt(this.scaler.fromDOM(e),Ce.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ou(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}},na=class{constructor(e,n){this.from=e,this.to=n}};function FF(t,e,n){let i=[],r=t,s=0;return fe.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function hp({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function dp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function jF(t,e){for(let n of t)if(e(n))return n}var PE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function zE(t){let e=t.facet(Hp).filter(i=>typeof i!="function"),n=t.facet(g1).filter(i=>typeof i!="function");return n.length&&e.push(fe.join(n)),e}var Jv=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,Ce.ByPos,e,0,0).top,u=n.lineAt(a,Ce.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function Ou(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new si(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Ou(r,e)):t._content)}var pp=B.define({combine:t=>t.join(" ")}),e1=B.define({combine:t=>t.indexOf(!0)>-1}),t1=In.newName(),qD=In.newName(),PD=In.newName(),zD={"&light":"."+qD,"&dark":"."+PD};function n1(t,e,n){return new In(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var VF=n1("."+t1,{"&":{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":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},zD),YF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},bv=_.ie&&_.ie_version<=11,i1=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Cv,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 i of n)this.queue.push(i);(_.ie&&_.ie_version<=11||_.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&_.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_.chrome&&_.chrome_version<126)&&(this.editContext=new r1(e),e.state.facet(Sr)&&(e.contentDOM.editContext=this.editContext.editContext)),bv&&(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)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{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,i)=>n!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(Sr)?i.root.activeElement!=this.dom:!Tu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(_.ie&&_.ie_version<=11||_.android&&_.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Cu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=qu(e.root);if(!n)return!1;let i=_.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&KF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=Tu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&PU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,YF),bv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),bv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&oa(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Tu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new jv(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=CD(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Ep(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=HE(n,e.previousSibling||e.target.previousSibling,-1),r=HE(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):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(Sr)!=e.state.facet(Sr)&&(e.view.contentDOM.editContext=e.state.facet(Sr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function HE(t,e,n){for(;e;){let i=Ie.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function UE(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Cu(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function KF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return UE(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?UE(t,n):null}var r1=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=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=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=ED(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let h=M.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Ep(h,r)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:ae.of(i.text.slice(u.from,u.toB).split(`
197
+ `))};if((_.mac||_.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ae.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);b1(e,f,M.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(be.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:bD.of(be.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=qu(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||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)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let 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,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},z=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var 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:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||qU(e.parent)||document,this.viewState=new Np(this,e.state||Te.create(e)),e.scrollTo&&e.scrollTo.is(cp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ta).map(r=>new Du(r));for(let r of this.plugins)r.update(this);this.observer=new i1(this),this.inputState=new Vv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Tp(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof ft?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,i=!1,r,s=this.state;for(let h of e){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(LD))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=BD(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Te.phrases)!=this.state.facet(Te.phrases))return this.setState(s);r=Ap.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection,{x:m,y:g}=this.state.facet(t.cursorScrollMargin);f=new Eu(d.empty?d:M.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,m)}for(let d of h.effects)d.is(cp)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Rp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(Au)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(pp)!=r.state.facet(pp)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Nv))try{h(r)}catch(d){bn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!CD(this,u)&&c.force&&oa(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 i of this.plugins)i.destroy(this);this.viewState=new Np(this,e),this.plugins=e.facet(ta).map(i=>new Du(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Tp(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(ta),i=e.state.facet(ta);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Du(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){bn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(nD(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(m){return bn(this.state,m),FE}}),f=Ap.create(this,this.state,[]),h=!1;f.flags|=a,n?n.flags|=a:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=FE)try{let m=c[d];m.write&&m.write(u[d],this)}catch(m){bn(this.state,m)}if(h&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let m=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((m>1||m<-1)&&!(_.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+m,i?i.scrollTop+=m:this.win.scrollBy(0,m),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Nv))l(n)}get themeClasses(){return t1+" "+(this.state.facet(e1)?PD:qD)+" "+this.state.facet(pp)}updateAttrs(){let e=jE(this,vD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Sr)?"true":"false",class:"cm-content",style:`${_.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),jE(this,m1,n);let i=this.observer.ignore(()=>{let r=xE(this.contentDOM,this.contentAttrs,n),s=xE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Au);let e=this.state.facet(t.cspNonce);In.mount(this.root,this.styleModules.concat(VF).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;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==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,i){return yv(this,e,CE(this,e,n,i))}moveByGroup(e,n){return yv(this,e,CE(this,e,n,i=>pF(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return M.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return dF(this,e,n,i)}moveVertically(e,n,i){return yv(this,e,mF(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=Hv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Hv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[zn.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==Me.RTL)}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(gD)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>QF)return aD(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||lD(s.isolates,i=AE(this,e))))return s.order;i||(i=AE(this,e));let r=YU(e.text,n,i);return this.bidiCache.push(new Rp(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{tD(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={}){var i,r,s,o;return cp.of(new Eu(typeof e=="number"?M.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return cp.of(new Eu(M.cursor(i.from),"start","start",i.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 Hn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Hn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=In.newName(),r=[pp.of(i),Au.of(n1(`.${i}`,e))];return n&&n.dark&&r.push(e1.of(!0)),r}static baseTheme(e){return ku.lowest(Au.of(n1("."+t1,e,zD)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&Ie.get(i)||Ie.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};z.styleModule=Au;z.inputHandler=pD;z.clipboardInputFilter=d1;z.clipboardOutputFilter=p1;z.scrollHandler=yD;z.focusChangeEffect=mD;z.perLineTextDirection=gD;z.exceptionSink=dD;z.updateListener=Nv;z.editable=Sr;z.mouseSelectionStyle=hD;z.dragMovesSelection=fD;z.clickAddsSelectionRange=uD;z.decorations=Hp;z.blockWrappers=SD;z.outerDecorations=g1;z.atomicRanges=zu;z.bidiIsolatedRanges=xD;z.cursorScrollMargin=B.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});z.scrollMargins=wD;z.darkTheme=e1;z.cspNonce=B.define({combine:t=>t.length?t[0]:""});z.contentAttributes=m1;z.editorAttributes=vD;z.lineWrapping=z.contentAttributes.of({class:"cm-lineWrapping"});z.announce=ue.define();var QF=4096,FE={},Rp=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Me.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function jE(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&u1(o,n)}return n}var $F=_.mac?"mac":_.windows?"win":_.linux?"linux":"key";function GF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function mp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}var XF=ku.default(z.domEventHandlers({keydown(t,e){return ej(WF(e.state),t,e,"editor")}})),v1=B.define({enables:XF}),VE=new WeakMap;function WF(t){let e=t.facet(v1),n=VE.get(e);return n||VE.set(e,n=JF(e.reduce((i,r)=>i.concat(r),[]))),n}var gs=null,ZF=4e3;function JF(t,e=$F){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,h;let d=n[o]||(n[o]=Object.create(null)),m=l.split(/ (?!$)/).map(p=>GF(p,e));for(let p=1;p<m.length;p++){let y=m.slice(0,p).join(" ");r(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[v=>{let S=gs={view:v,prefix:y,scope:o};return setTimeout(()=>{gs==S&&(gs=null)},ZF),!0}]})}let g=m.join(" ");r(g,!1);let b=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in u)u[h].run.push(d=>f(d,s1))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var s1=null;function ej(t,e,n,i){s1=e;let r=gE(e),s=eE(r,0),o=tE(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;gs&&gs.view==n&&gs.scope==i&&(l=gs.prefix+" ",MD.indexOf(e.keyCode)<0&&(c=!0,gs=null));let f=new Set,h=b=>{if(b){for(let p of b.run)if(!f.has(p)&&(f.add(p),p(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},d=t[i],m,g;return d&&(h(d[l+mp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_.windows&&e.ctrlKey&&e.altKey)&&!(_.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=vr[e.keyCode])&&m!=r?(h(d[l+mp(m,e,!0)])||e.shiftKey&&(g=Jl[e.keyCode])!=r&&g!=m&&h(d[l+mp(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&h(d[l+mp(r,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),s1=null,a}var ehe=/x/.unicode!=null?"gu":"g";var gp="-10000px",_p=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function tj(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var vv=B.define({combine:t=>{var e,n,i;return{position:_.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||tj}}}),YE=new WeakMap,HD=Hn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(vv);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new _p(t,Fp,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(vv);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=gp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(_.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=y1(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(vv).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],h=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=gp;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=d?7:0,g=h.right-h.left,b=(e=YE.get(c))!==null&&e!==void 0?e:h.bottom-h.top,p=c.offset||ij,y=this.view.textDirection==Me.LTR,v=h.width>i.right-i.left?y?i.left:i.right-h.width:y?Math.max(i.left,Math.min(f.left-(d?14:0)+p.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-p.x),i.right-g),S=this.above[l];!a.strictSide&&(S?f.top-b-m-p.y<i.top:f.bottom+b+m+p.y>i.bottom)&&S==i.bottom-f.bottom>f.top-i.top&&(S=this.above[l]=!S);let w=(S?f.top-i.top:i.bottom-f.bottom)-m;if(w<b&&c.resize!==!1){if(w<this.view.defaultLineHeight){u.style.top=gp;continue}YE.set(c,b),u.style.height=(b=w)/s+"px"}else u.style.height&&(u.style.height="");let O=S?f.top-b-m-p.y:f.bottom+m+p.y,k=v+g;if(c.overlap!==!0)for(let A of o)A.left<k&&A.right>v&&A.top<O+b&&A.bottom>O&&(O=S?A.top-b-2-m:A.bottom+m+2);if(this.position=="absolute"?(u.style.top=(O-t.parent.top)/s+"px",KE(u,(v-t.parent.left)/r)):(u.style.top=O/s+"px",KE(u,v/r)),d){let A=f.left+(y?p.x:-p.x)-(v+14-7);d.style.left=A/r+"px"}c.overlap!==!0&&o.push({left:v,top:O,right:k,bottom:O+b}),u.classList.toggle("cm-tooltip-above",S),u.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=gp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function KE(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var nj=z.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ij={x:0,y:0},Fp=B.define({enables:[HD,nj]}),Lp=B.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),Bp=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new _p(e,Lp,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},rj=Fp.compute([Lp],t=>{let e=t.facet(Lp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Bp.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),sj=B.define(),o1=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==Me.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>bn(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(HD),n=e?e.manager.tooltips.findIndex(i=>i.create==Bp.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!oj(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!lj(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},yp=4;function oj(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-yp&&e.clientX<=i+yp&&e.clientY>=r-yp&&e.clientY<=s+yp}function lj(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function UD(t,e={}){let n=ue.define(),i=new WeakMap,r=Mt.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,Ft.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),u);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),c.push(h)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(aj)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>Lp.from(o)}),s=Hn.define(o=>new o1(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,sj.of(s),rj]}}var aj=ue.define();var QE=B.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var cj=Hn.fromClass(class{constructor(t){this.input=t.state.facet(Ip),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(QE);this.top=new ia(t,!0,e.topContainer),this.bottom=new ia(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(QE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ia(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ia(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Ip);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),ia=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=$E(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=$E(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function $E(t){let e=t.nextSibling;return t.remove(),e}var Ip=B.define({enables:cj});var Un=class extends Bi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Un.prototype.elementClass="";Un.prototype.toDOM=void 0;Un.prototype.mapMode=Ft.TrackBefore;Un.prototype.startSide=Un.prototype.endSide=-1;Un.prototype.point=!0;var Sv=B.define(),uj=B.define(),fj={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>fe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},_u=B.define();function S1(t){return[FD(),_u.of({...fj,...t})]}var l1=B.define({combine:t=>t.some(e=>e)});function FD(t){let e=[hj];return t&&t.fixed===!1&&e.push(l1.of(!0)),e}var hj=Hn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(_u).map(e=>new qp(t,e)),this.fixed=!t.state.facet(l1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(l1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=fe.iter(this.view.state.facet(Sv),this.view.viewport.from),i=[],r=this.gutters.map(s=>new c1(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==tn.Text&&o){a1(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==tn.Text){a1(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(_u),n=t.state.facet(_u),i=t.docChanged||t.heightChanged||t.viewportChanged||!fe.eq(t.startState.facet(Sv),t.state.facet(Sv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new qp(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Me.LTR?{left:i,right:r}:{right:i,left:r}})});function GE(t){return Array.isArray(t)?t:[t]}function a1(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var c1=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=fe.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new Pp(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];a1(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(uj)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}},qp=class{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 i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=GE(n.markers(e)),n.initialSpacer&&(this.spacer=new Pp(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=GE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!fe.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Pp=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),dj(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function dj(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}var pj=B.define(),mj=B.define(),ra=B.define({combine(t){return ms(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Lu=class extends Un{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function xv(t,e){return t.state.facet(ra).formatNumber(e,t.state)}var gj=_u.compute([ra],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(pj)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Lu(xv(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(mj)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ra)!=e.state.facet(ra),initialSpacer(e){return new Lu(xv(e,XE(e.state.doc.lines)))},updateSpacer(e,n){let i=xv(n.view,XE(n.view.state.doc.lines));return i==e.number?e:new Lu(i)},domEventHandlers:t.facet(ra).domEventHandlers,side:"before"}));function jD(t={}){return[ra.of(t),FD(),gj]}function XE(t){let e=9;for(;e<t;)e=e*10+9;return e}var yj=0,Hu=class{constructor(e,n){this.from=e,this.to=n}},K=class{constructor(e={}){this.id=yj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Nt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};K.closedBy=new K({deserialize:t=>t.split(" ")});K.openedBy=new K({deserialize:t=>t.split(" ")});K.group=new K({deserialize:t=>t.split(" ")});K.isolate=new K({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});K.contextHash=new K({perNode:!0});K.lookAhead=new K({perNode:!0});K.mounted=new K({perNode:!0});var po=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[K.mounted.id]}},bj=Object.create(null),Nt=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):bj,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(K.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(K.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};Nt.none=new Nt("",Object.create(null),0,8);var Uu=class t{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new Nt(i.name,r,i.id,i.flags):i)}return new t(n)}},jp=new WeakMap,VD=new WeakMap,qe;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(qe||(qe={}));var Ve=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=po.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Vu(this.topNode,e)}cursorAt(e,n=0,i=0){let r=jp.get(this)||this.topNode,s=new Vu(r);return s.moveTo(e,n),jp.set(this,s._tree),s}get topNode(){return new Pi(this,0,0,null)}resolve(e,n=0){let i=Fu(jp.get(this)||this.topNode,e,n,!1);return jp.set(this,i),i}resolveInner(e,n=0){let i=Fu(VD.get(this)||this.topNode,e,n,!0);return VD.set(this,i),i}resolveStack(e,n=0){return vj(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&qe.IncludeAnonymous)>0;for(let a=this.cursor(o|qe.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.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:C1(Nt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(Nt.none,n,i,r)))}static build(e){return Sj(e)}};Ve.empty=new Ve(Nt.none,[],[],0);var x1=class t{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 t(this.buffer,this.index)}},Ss=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Nt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(QD(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function QD(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function Fu(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof Pi&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:qe.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Pi&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var Yp=class{cursor(e=0){return new Vu(this,e)}getChild(e,n=null,i=null){let r=YD(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return YD(this,e,n,i)}resolve(e,n=0){return Fu(this,e,n,!1)}resolveInner(e,n=0){return Fu(this,e,n,!0)}matchContext(e){return w1(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},Pi=class t extends Yp{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,h;if(!(!(s&qe.EnterBracketed&&u instanceof Ve&&(h=po.get(u))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+u.length)&&!QD(r,i,f,f+u.length))){if(u instanceof Ss){if(s&qe.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,i-f,r);if(d>-1)return new ju(new k1(o,u,e,f),null,d)}else if(s&qe.IncludeAnonymous||!u.type.isAnonymous||T1(u)){let d;if(!(s&qe.IgnoreMounts)&&(d=po.get(u))&&!d.overlay)return new t(d.tree,f,e,o);let m=new t(u,f,e,o);return s&qe.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&qe.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&qe.IgnoreOverlays)&&(r=po.get(this._tree))&&r.overlay){let s=e-this.from,o=i&qe.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function YD(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function w1(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var k1=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},ju=class t extends Yp{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,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&qe.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(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 t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new Ve(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function $D(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof Pi&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new A1(r,n)}var A1=class{constructor(e,n){this.heads=e,this.node=n}get next(){return $D(this.heads)}};function vj(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof Pi?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=po.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Pi(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Fu(l,e,n,!1))}}return r?$D(r):i}var Vu=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~qe.EnterBracketed,e instanceof Pi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Pi?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&qe.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&qe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&qe.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&qe.IncludeAnonymous||l instanceof Ss||!l.type.isAnonymous||T1(l))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<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new ju(this.buffer,n,this.stack[r]);return this.bufferNode=new ju(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return w1(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return w1(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function T1(t){return t.children.some(e=>e instanceof Ss||!e.type.isAnonymous||T1(e))}function Sj(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new x1(n,n.length):n,a=i.types,c=0,u=0;function f(w,O,k,A,D,E){let{id:L,start:R,end:Z,size:$}=l,ke=u,Kt=c;if($<0)if(l.next(),$==-1){let St=s[L];k.push(St),A.push(R-w);return}else if($==-3){c=L;return}else if($==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${$}`);let mi=a[L],me,ot,Yn=R-w;if(Z-R<=r&&(ot=b(l.pos-O,D))){let St=new Uint16Array(ot.size-ot.skip),He=l.pos-ot.size,dt=St.length;for(;l.pos>He;)dt=p(ot.start,St,dt);me=new Ss(St,Z-ot.start,i),Yn=ot.start-w}else{let St=l.pos-$;l.next();let He=[],dt=[],pt=L>=o?L:-1,rn=0,sn=Z;for(;l.pos>St;)pt>=0&&l.id==pt&&l.size>=0?(l.end<=sn-r&&(m(He,dt,R,rn,l.end,sn,pt,ke,Kt),rn=He.length,sn=l.end),l.next()):E>2500?h(R,St,He,dt):f(R,St,He,dt,pt,E+1);if(pt>=0&&rn>0&&rn<He.length&&m(He,dt,R,rn,R,sn,pt,ke,Kt),He.reverse(),dt.reverse(),pt>-1&&rn>0){let Kn=d(mi,Kt);me=C1(mi,He,dt,0,He.length,0,Z-R,Kn,Kn)}else me=g(mi,He,dt,Z-R,ke-Z,Kt)}k.push(me),A.push(Yn)}function h(w,O,k,A){let D=[],E=0,L=-1;for(;l.pos>O;){let{id:R,start:Z,end:$,size:ke}=l;if(ke>4)l.next();else{if(L>-1&&Z<L)break;L<0&&(L=$-r),D.push(R,Z,$),E++,l.next()}}if(E){let R=new Uint16Array(E*4),Z=D[D.length-2];for(let $=D.length-3,ke=0;$>=0;$-=3)R[ke++]=D[$],R[ke++]=D[$+1]-Z,R[ke++]=D[$+2]-Z,R[ke++]=ke;k.push(new Ss(R,D[2]-Z,i)),A.push(Z-w)}}function d(w,O){return(k,A,D)=>{let E=0,L=k.length-1,R,Z;if(L>=0&&(R=k[L])instanceof Ve){if(!L&&R.type==w&&R.length==D)return R;(Z=R.prop(K.lookAhead))&&(E=A[L]+R.length+Z)}return g(w,k,A,D,E,O)}}function m(w,O,k,A,D,E,L,R,Z){let $=[],ke=[];for(;w.length>A;)$.push(w.pop()),ke.push(O.pop()+k-D);w.push(g(i.types[L],$,ke,E-D,R-E,Z)),O.push(D-k)}function g(w,O,k,A,D,E,L){if(E){let R=[K.contextHash,E];L=L?[R].concat(L):[R]}if(D>25){let R=[K.lookAhead,D];L=L?[R].concat(L):[R]}return new Ve(w,O,k,A,L)}function b(w,O){let k=l.fork(),A=0,D=0,E=0,L=k.end-r,R={size:0,start:0,skip:0};e:for(let Z=k.pos-w;k.pos>Z;){let $=k.size;if(k.id==O&&$>=0){R.size=A,R.start=D,R.skip=E,E+=4,A+=4,k.next();continue}let ke=k.pos-$;if($<0||ke<Z||k.start<L)break;let Kt=k.id>=o?4:0,mi=k.start;for(k.next();k.pos>ke;){if(k.size<0)if(k.size==-3||k.size==-4)Kt+=4;else break e;else k.id>=o&&(Kt+=4);k.next()}D=mi,A+=$,E+=Kt}return(O<0||A==w)&&(R.size=A,R.start=D,R.skip=E),R.size>4?R:void 0}function p(w,O,k){let{id:A,start:D,end:E,size:L}=l;if(l.next(),L>=0&&A<o){let R=k;if(L>4){let Z=l.pos-(L-4);for(;l.pos>Z;)k=p(w,O,k)}O[--k]=R,O[--k]=E-w,O[--k]=D-w,O[--k]=A}else L==-3?c=A:L==-4&&(u=A);return k}let y=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,y,v,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new Ve(a[t.topID],y.reverse(),v.reverse(),S)}var KD=new WeakMap;function Vp(t,e){if(!t.isAnonymous||e instanceof Ss||e.type!=t)return 1;let n=KD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Ve)){n=1;break}n+=Vp(t,i)}KD.set(e,n)}return n}function C1(t,e,n,i,r,s,o,l,a){let c=0;for(let m=i;m<r;m++)c+=Vp(t,e[m]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(m,g,b,p,y){for(let v=b;v<p;){let S=v,w=g[v],O=Vp(t,m[v]);for(v++;v<p;v++){let k=Vp(t,m[v]);if(O+k>=u)break;O+=k}if(v==S+1){if(O>u){let k=m[S];d(k.children,k.positions,0,k.children.length,g[S]+y);continue}f.push(m[S])}else{let k=g[v-1]+m[v-1].length-w;f.push(C1(t,m,g,S,v,w,k,null,a))}h.push(w+y-s)}}return d(e,n,i,r,0),(l||a)(f,h,o)}var mo=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let h=o;if(a>=h.from||f<=h.to||c){let d=Math.max(h.from,a)-c,m=Math.min(h.to,f)-c;h=d>=m?null:new t(d,m,h.tree,h.offset+c,l>0,!!u)}if(h&&r.push(h),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},ha=class{startParse(e,n,i){return typeof e=="string"&&(e=new O1(e)),i=i?i.length?i.map(r=>new Hu(r.from,r.to)):[new Hu(0,0)]:[new Hu(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},O1=class{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)}};var ohe=new K({perNode:!0});var xj=0,ai=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=xj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new Gp(e);return i=>i.modified.indexOf(n)>-1?i:Gp.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},wj=0,Gp=class t{constructor(e){this.name=e,this.instances=[],this.id=wj++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&kj(n,l.modified));if(i)return i;let r=[],s=new ai(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=Aj(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function kj(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function Aj(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function da(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new yo(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return WD.add(e)}var WD=new K({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new yo(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),yo=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};yo.empty=new yo([],2,null);function N1(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function Oj(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function ZD(t,e,n,i=0,r=t.length){let s=new D1(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var D1=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,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,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=Tj(e)||yo.empty,f=Oj(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let h=e.tree&&e.tree.prop(K.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),m=this.highlighters.filter(b=>!b.scope||b.scope(h.tree.type)),g=e.firstChild();for(let b=0,p=l;;b++){let y=b<h.overlay.length?h.overlay[b]:null,v=y?y.from+l:a,S=Math.max(n,p),w=Math.min(i,v);if(S<w&&g)for(;e.from<w&&(this.highlightRange(e,S,w,r,s),this.startSpan(Math.min(w,e.to),c),!(e.to>=v||!e.nextSibling())););if(!y||v>i)break;p=y.to+l,p>n&&(this.highlightRange(d.cursor(),Math.max(n,y.from+l),Math.min(i,p),"",m),this.startSpan(Math.min(i,p),c))}g&&e.parent()}else if(e.firstChild()){h&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function Tj(t){let e=t.type.prop(WD);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var N=ai.define,Kp=N(),xs=N(),GD=N(xs),XD=N(xs),ws=N(),Qp=N(ws),E1=N(ws),Ui=N(),go=N(Ui),zi=N(),Hi=N(),M1=N(),Yu=N(M1),$p=N(),T={comment:Kp,lineComment:N(Kp),blockComment:N(Kp),docComment:N(Kp),name:xs,variableName:N(xs),typeName:GD,tagName:N(GD),propertyName:XD,attributeName:N(XD),className:N(xs),labelName:N(xs),namespace:N(xs),macroName:N(xs),literal:ws,string:Qp,docString:N(Qp),character:N(Qp),attributeValue:N(Qp),number:E1,integer:N(E1),float:N(E1),bool:N(ws),regexp:N(ws),escape:N(ws),color:N(ws),url:N(ws),keyword:zi,self:N(zi),null:N(zi),atom:N(zi),unit:N(zi),modifier:N(zi),operatorKeyword:N(zi),controlKeyword:N(zi),definitionKeyword:N(zi),moduleKeyword:N(zi),operator:Hi,derefOperator:N(Hi),arithmeticOperator:N(Hi),logicOperator:N(Hi),bitwiseOperator:N(Hi),compareOperator:N(Hi),updateOperator:N(Hi),definitionOperator:N(Hi),typeOperator:N(Hi),controlOperator:N(Hi),punctuation:M1,separator:N(M1),bracket:Yu,angleBracket:N(Yu),squareBracket:N(Yu),paren:N(Yu),brace:N(Yu),content:Ui,heading:go,heading1:N(go),heading2:N(go),heading3:N(go),heading4:N(go),heading5:N(go),heading6:N(go),contentSeparator:N(Ui),list:N(Ui),quote:N(Ui),emphasis:N(Ui),strong:N(Ui),link:N(Ui),monospace:N(Ui),strikethrough:N(Ui),inserted:N(),deleted:N(),changed:N(),invalid:N(),meta:$p,documentMeta:N($p),annotation:N($p),processingInstruction:N($p),definition:ai.defineModifier("definition"),constant:ai.defineModifier("constant"),function:ai.defineModifier("function"),standard:ai.defineModifier("standard"),local:ai.defineModifier("local"),special:ai.defineModifier("special")};for(let t in T){let e=T[t];e instanceof ai&&(e.name=t)}var che=N1([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var R1,pa=new K;function Cj(t){return B.define({combine:t?e=>e.concat(t):void 0})}var Ej=new K,Sn=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,Te.prototype.hasOwnProperty("tree")||Object.defineProperty(Te.prototype,"tree",{get(){return ci(this)}}),this.parser=n,this.extension=[ma.of(this),Te.languageData.of((s,o,l)=>{let a=JD(s,o,l),c=a.type.prop(pa);if(!c)return[];let u=s.facet(c),f=a.type.prop(Ej);if(f){let h=a.resolve(o-a.from,l);for(let d of f)if(d.test(h,s)){let m=s.facet(d.facet);return d.type=="replace"?m:m.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return JD(e,n,i).type.prop(pa)==this.data}findRegions(e){let n=e.facet(ma);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(pa)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(K.mounted);if(l){if(l.tree.prop(pa)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Ve&&r(c,s.positions[a]+o)}};return r(ci(e),0),i}get allowsNesting(){return!0}};Sn.setState=ue.define();function JD(t,e,n){let i=t.facet(ma),r=ci(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,qe.ExcludeBuffers|qe.EnterBracketed))s.type.isTop&&(r=s);return r}var Qu=class t extends Sn{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=Cj(e.languageData);return new t(n,e.parser.configure({props:[pa.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function ci(t){let e=t.field(Sn.state,!1);return e?e.tree:Ve.empty}var I1=class{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 i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},Ku=null,q1=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],Ve.empty,0,i,[],null)}startParse(){return this.parser.startParse(new I1(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ve.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(mo.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=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(mo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Ku;Ku=this;try{return e()}finally{Ku=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=eM(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,h)=>a.push({fromA:c,toA:u,fromB:f,toB:h})),i=mo.applyChanges(i,a),r=Ve.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=eM(this.fragments,r,s),this.skipped.splice(i--,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 ha{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Ku;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Ve(Nt.none,[],[],o-s)},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 Ku}};function eM(t,e,n){return mo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var $u=class t{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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=q1.create(e.facet(ma).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};Sn.state=Mt.define({create:$u.init,update(t,e){for(let n of e.effects)if(n.is(Sn.setState))return n.value;return e.startState.facet(ma)!=e.state.facet(ma)?$u.init(e.state):t.apply(e)}});var rM=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(rM=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var _1=typeof navigator<"u"&&(!((R1=navigator.scheduling)===null||R1===void 0)&&R1.isInputPending)?()=>navigator.scheduling.isInputPending():null,Dj=Hn.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(Sn.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(Sn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=rM(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(Sn.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!_1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>_1&&_1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Sn.setState.of(new $u(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>bn(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()}}}),ma=B.define({combine(t){return t.length?t[0]:null},enables:t=>[Sn.state,Dj,z.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),Xp=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var Mj=B.define(),Wp=B.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 Gu(t){let e=t.facet(Wp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xu(t,e){let n="",i=t.tabSize,r=t.facet(Wp)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function j1(t,e){t instanceof Te&&(t=new bo(t));for(let i of t.state.facet(Mj)){let r=i(t,e);if(r!==void 0)return r}let n=ci(t.state);return n.length>=e?Nj(t,n,e):null}var bo=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=Gu(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return lo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},V1=new K;function Nj(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return sM(i,t,n)}function sM(t,e,n){for(let i=t;i;i=i.next){let r=_j(i.node);if(r)return r(P1.create(e,n,i))}return 0}function Rj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function _j(t){let e=t.type.prop(V1);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(K.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>oM(o,!0,1,void 0,s&&!Rj(o)?r.from:void 0)}return t.parent==null?Lj:null}function Lj(){return 0}var P1=class t extends bo{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}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 i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Bj(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return sM(this.context.next,this.base,this.pos)}};function Bj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Ij(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function Y1({closing:t,align:e=!0,units:n=1}){return i=>oM(i,e,n,t)}function oM(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?Ij(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var lM=new K;function aM(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}var ga=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=In.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Sn?l=>l.prop(pa)==o.data:o?l=>l==o:void 0,this.style=N1(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new In(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},z1=B.define(),cM=B.define({combine(t){return t.length?[t[0]]:null}});function L1(t){let e=t.facet(z1);return e.length?e:t.facet(cM)}function uM(t,e){let n=[qj],i;return t instanceof ga&&(t.module&&n.push(z.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(cM.of(t)):i?n.push(z1.computeN([z.darkTheme],r=>r.facet(z.darkTheme)==(i=="dark")?[t]:[])):n.push(z1.of(t)),n}var H1=class{constructor(e){this.markCache=Object.create(null),this.tree=ci(e.state),this.decorations=this.buildDeco(e,L1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ci(e.state),i=L1(e.state),r=i!=L1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return be.none;let i=new br;for(let{from:r,to:s}of e.visibleRanges)ZD(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=be.mark({class:a})))},r,s);return i.finish()}},qj=ku.high(Hn.fromClass(H1,{decorations:t=>t.decorations})),yhe=ga.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]);var Pj=1e4,zj="()[]{}";var Hj=new K;function U1(t,e,n){let i=t.prop(e<0?K.openedBy:K.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function F1(t){let e=t.type.prop(Hj);return e?e(t.node):t}function vo(t,e,n,i={}){let r=i.maxScanDistance||Pj,s=i.brackets||zj,o=ci(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=U1(a.type,n,s);if(c&&a.from<a.to){let u=F1(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Uj(t,e,n,a,u,c,s)}}return Fj(t,e,n,o,l.type,r,s)}function Uj(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=F1(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(U1(u.type,n,o))c++;else if(U1(u.type,-n,o)){if(c==0){let f=F1(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function Fj(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)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),f=0;for(let h=0;!u.next().done&&h<=s;){let d=u.value;n<0&&(h+=d.length);let m=e+h*n;for(let g=n>0?0:d.length-1,b=n>0?d.length:-1;g!=b;g+=n){let p=o.indexOf(d[g]);if(!(p<0||i.resolveInner(m+g,1).type!=r))if(p%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:p>>1==a>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}var jj=Object.create(null),tM=[Nt.none];var nM=[],iM=Object.create(null),Vj=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"]])Vj[t]=Yj(jj,e);function B1(t,e){nM.indexOf(t)>-1||(nM.push(t),console.warn(e))}function Yj(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||T[c];u?typeof u=="function"?a.length?a=a.map(u):B1(c,`Modifier ${c} used at start of tag`):a.length?B1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:B1(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=iM[r];if(s)return s.id;let o=iM[r]=Nt.define({id:tM.length,name:i,props:[da({[i]:n})]});return tM.push(o),o.id}var bhe={rtl:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Me.RTL}),ltr:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Me.LTR}),auto:be.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Kj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=Z1(t.state,n.from);return i.line?Qj(t):i.block?Gj(t):!1};function W1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var Qj=W1(Zj,0);var $j=W1(vM,0);var Gj=W1((t,e)=>vM(t,e,Wj(e)),0);function Z1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var Wu=50;function Xj(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-Wu,i),o=t.sliceDoc(r,r+Wu),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*Wu?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+Wu),f=t.sliceDoc(r-Wu,r));let h=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(f)[0].length,m=f.length-d-n.length;return u.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:i+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function Wj(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function vM(t,e,n=e.selection.ranges){let i=n.map(s=>Z1(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>Xj(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function Zj(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=Z1(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;h<f.text.length&&h<a&&(a=h),i.push({line:f,comment:m,token:c,indent:h,empty:d,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var Q1=Bn.define(),Jj=Bn.define(),e7=B.define(),SM=B.define({combine(t){return ms(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),xM=Mt.define({create(){return So.empty},update(t,e){let n=e.state.facet(SM),i=e.annotation(Q1);if(i){let a=ui.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=Jp(u,u.length,n.minDepth,a):u=OM(u,e.startState.selection),new So(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(Jj);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(ft.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=ui.fromTransaction(e),o=e.annotation(ft.time),l=e.annotation(ft.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="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 So(t.done.map(ui.fromJSON),t.undone.map(ui.fromJSON))}});function wM(t={}){return[xM,SM.of(t),z.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?kM:e.inputType=="historyRedo"?$1:null;return i?(e.preventDefault(),i(n)):!1}})]}function em(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(xM,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var kM=em(0,!1),$1=em(1,!1),t7=em(0,!0),n7=em(1,!0);var ui=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&jt.fromJSON(e.changes),[],e.mapped&&yr.fromJSON(e.mapped),e.startSelection&&M.fromJSON(e.startSelection),e.selectionsAfter.map(M.fromJSON))}static fromTransaction(e,n){let i=Fn;for(let r of e.startState.facet(e7)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Fn)}static selection(e){return new t(void 0,Fn,void 0,void 0,e)}};function Jp(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function i7(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function r7(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function AM(t,e){return t.length?e.length?t.concat(e):t:e}var Fn=[],s7=200;function OM(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-s7));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Jp(t,t.length-1,1e9,n.setSelAfter(i)))}else return[ui.selection([e])]}function o7(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 K1(t,e){if(!t.length)return t;let n=t.length,i=Fn;for(;n;){let r=l7(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[ui.selection(i)]:Fn}function l7(t,e,n){let i=AM(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Fn,n);if(!t.changes)return ui.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new ui(r,ue.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var a7=/^(input\.type|delete)($|\.)/,So=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||a7.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,i7(l.changes,e.changes))||i=="input.type.compose")?o=Jp(o,o.length-1,r.minDepth,new ui(e.changes.compose(l.changes),AM(ue.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Fn)):o=Jp(o,o.length,r.minDepth,e),new t(o,Fn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Fn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&r7(s[s.length-1],e)?this:new t(OM(this.done,e),this.undone,n,i)}addMapping(e){return new t(K1(this.done,e),K1(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Q1.of({side:e,rest:o7(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Fn:r.slice(0,r.length-1);return s.mapped&&(l=K1(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Q1.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};So.empty=new So(Fn,Fn);var TM=[{key:"Mod-z",run:kM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:$1,preventDefault:!0},{linux:"Ctrl-Shift-z",run:$1,preventDefault:!0},{key:"Mod-u",run:t7,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:n7,preventDefault:!0}];function ya(t,e){return M.create(t.ranges.map(e),t.mainIndex)}function fi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function hi({state:t,dispatch:e},n){let i=ya(t.selection,n);return i.eq(t.selection,!0)?!1:(e(fi(t,i)),!0)}function tm(t,e){return M.cursor(e?t.to:t.from)}function CM(t,e){return hi(t,n=>n.empty?t.moveByChar(n,e):tm(n,e))}function Rt(t){return t.textDirectionAt(t.state.selection.main.head)==Me.LTR}var EM=t=>CM(t,!Rt(t)),DM=t=>CM(t,Rt(t));function MM(t,e){return hi(t,n=>n.empty?t.moveByGroup(n,e):tm(n,e))}var c7=t=>MM(t,!Rt(t)),u7=t=>MM(t,Rt(t));var Ohe=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function f7(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function nm(t,e,n){let i=ci(t).resolveInner(e.head),r=n?K.closedBy:K.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;f7(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?vo(t,i.from,1):vo(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,M.cursor(l,n?-1:1)}var h7=t=>hi(t,e=>nm(t.state,e,!Rt(t))),d7=t=>hi(t,e=>nm(t.state,e,Rt(t)));function NM(t,e){return hi(t,n=>{if(!n.empty)return tm(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var RM=t=>NM(t,!1),_M=t=>NM(t,!0);function LM(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(z.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function BM(t,e){let n=LM(t),{state:i}=t,r=ya(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):tm(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(fi(i,r),{effects:s}),!0}var fM=t=>BM(t,!1),G1=t=>BM(t,!0);function ks(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=M.cursor(i.from+s))}return r}var p7=t=>hi(t,e=>ks(t,e,!0)),m7=t=>hi(t,e=>ks(t,e,!1)),g7=t=>hi(t,e=>ks(t,e,!Rt(t))),y7=t=>hi(t,e=>ks(t,e,Rt(t))),b7=t=>hi(t,e=>M.cursor(t.lineBlockAt(e.head).from,1)),v7=t=>hi(t,e=>M.cursor(t.lineBlockAt(e.head).to,-1));function S7(t,e,n){let i=!1,r=ya(t.selection,s=>{let o=vo(t,s.head,-1)||vo(t,s.head,1)||s.head>0&&vo(t,s.head-1,1)||s.head<t.doc.length&&vo(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?M.range(s.anchor,l):M.cursor(l)});return i?(e(fi(t,r)),!0):!1}var x7=({state:t,dispatch:e})=>S7(t,e,!1);function jn(t,e,n){let i=ya(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=M.range(r.head,r.anchor));let s=n(r);return M.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(fi(t.state,i)),!0)}function IM(t,e){return jn(t,e,n=>t.moveByChar(n,e))}var qM=t=>IM(t,!Rt(t)),PM=t=>IM(t,Rt(t));function zM(t,e){return jn(t,e,n=>t.moveByGroup(n,e))}var w7=t=>zM(t,!Rt(t)),k7=t=>zM(t,Rt(t));var A7=t=>{let e=!Rt(t);return jn(t,e,n=>nm(t.state,n,e))},O7=t=>{let e=Rt(t);return jn(t,e,n=>nm(t.state,n,e))};function HM(t,e){return jn(t,e,n=>t.moveVertically(n,e))}var UM=t=>HM(t,!1),FM=t=>HM(t,!0);function jM(t,e){return jn(t,e,n=>t.moveVertically(n,e,LM(t).height))}var hM=t=>jM(t,!1),dM=t=>jM(t,!0),T7=t=>jn(t,!0,e=>ks(t,e,!0)),C7=t=>jn(t,!1,e=>ks(t,e,!1)),E7=t=>{let e=!Rt(t);return jn(t,e,n=>ks(t,n,e))},D7=t=>{let e=Rt(t);return jn(t,e,n=>ks(t,n,e))},M7=t=>jn(t,!1,e=>M.cursor(t.lineBlockAt(e.head).from)),N7=t=>jn(t,!0,e=>M.cursor(t.lineBlockAt(e.head).to)),pM=({state:t,dispatch:e})=>(e(fi(t,{anchor:0})),!0),mM=({state:t,dispatch:e})=>(e(fi(t,{anchor:t.doc.length})),!0),gM=({state:t,dispatch:e})=>(e(fi(t,{anchor:t.selection.main.anchor,head:0})),!0),yM=({state:t,dispatch:e})=>(e(fi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),R7=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),_7=({state:t,dispatch:e})=>{let n=im(t).map(({from:i,to:r})=>M.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:M.create(n),userEvent:"select"})),!0},L7=({state:t,dispatch:e})=>{let n=ya(t.selection,i=>{let r=ci(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return M.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(fi(t,n)),!0)};function VM(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(fi(n,M.create(r,r.length-1))),!0)}var B7=t=>VM(t,!1),I7=t=>VM(t,!0),q7=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=M.create([n.main]):n.main.empty||(i=M.create([M.cursor(n.main.head)])),i?(e(fi(t,i)),!0):!1};function Zu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=Zp(t,a,!1)):a>o&&(n="delete.forward",a=Zp(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Zp(t,o,!1),l=Zp(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:M.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?z.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Zp(t,e,n){if(t instanceof z)for(let i of t.state.facet(z.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var YM=(t,e,n)=>Zu(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=lo(l,s.tabSize),u=c%Gu(s)||Gu(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=ht(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=ht(o.text,a-o.from,!1,!1)+o.from);return a}),X1=t=>YM(t,!1,!0);var KM=t=>YM(t,!0,!1),QM=(t,e)=>Zu(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=ht(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),$M=t=>QM(t,!1),P7=t=>QM(t,!0);var z7=t=>Zu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var H7=t=>Zu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),U7=t=>Zu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var F7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ae.of(["",""])},range:M.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},j7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:ht(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:ht(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:M.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function im(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function GM(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of im(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(M.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(M.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:M.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var V7=({state:t,dispatch:e})=>GM(t,e,!1),Y7=({state:t,dispatch:e})=>GM(t,e,!0);function XM(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of im(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var K7=({state:t,dispatch:e})=>XM(t,e,!1),Q7=({state:t,dispatch:e})=>XM(t,e,!0),$7=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(im(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=ya(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function G7(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ci(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(K.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var bM=WM(!1),X7=WM(!0);function WM(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&G7(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new bo(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=j1(c,s);for(u==null&&(u=lo(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",Xu(e,u)];return a&&f.push(Xu(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:ae.of(f)},range:M.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function J1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:M.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var W7=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new bo(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=J1(t,(s,o,l)=>{let a=j1(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=Xu(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},Z7=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(J1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Wp)})}),{userEvent:"input.indent"})),!0),J7=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(J1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=lo(r,t.tabSize),o=0,l=Xu(t,Math.max(0,s-Gu(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),eV=t=>(t.setTabFocusMode(),!0);var tV=[{key:"Ctrl-b",run:EM,shift:qM,preventDefault:!0},{key:"Ctrl-f",run:DM,shift:PM},{key:"Ctrl-p",run:RM,shift:UM},{key:"Ctrl-n",run:_M,shift:FM},{key:"Ctrl-a",run:b7,shift:M7},{key:"Ctrl-e",run:v7,shift:N7},{key:"Ctrl-d",run:KM},{key:"Ctrl-h",run:X1},{key:"Ctrl-k",run:z7},{key:"Ctrl-Alt-h",run:$M},{key:"Ctrl-o",run:F7},{key:"Ctrl-t",run:j7},{key:"Ctrl-v",run:G1}],nV=[{key:"ArrowLeft",run:EM,shift:qM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:c7,shift:w7,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:g7,shift:E7,preventDefault:!0},{key:"ArrowRight",run:DM,shift:PM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:u7,shift:k7,preventDefault:!0},{mac:"Cmd-ArrowRight",run:y7,shift:D7,preventDefault:!0},{key:"ArrowUp",run:RM,shift:UM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pM,shift:gM},{mac:"Ctrl-ArrowUp",run:fM,shift:hM},{key:"ArrowDown",run:_M,shift:FM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:mM,shift:yM},{mac:"Ctrl-ArrowDown",run:G1,shift:dM},{key:"PageUp",run:fM,shift:hM},{key:"PageDown",run:G1,shift:dM},{key:"Home",run:m7,shift:C7,preventDefault:!0},{key:"Mod-Home",run:pM,shift:gM},{key:"End",run:p7,shift:T7,preventDefault:!0},{key:"Mod-End",run:mM,shift:yM},{key:"Enter",run:bM,shift:bM},{key:"Mod-a",run:R7},{key:"Backspace",run:X1,shift:X1,preventDefault:!0},{key:"Delete",run:KM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$M,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:P7,preventDefault:!0},{mac:"Mod-Backspace",run:H7,preventDefault:!0},{mac:"Mod-Delete",run:U7,preventDefault:!0}].concat(tV.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),ZM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:h7,shift:A7},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:d7,shift:O7},{key:"Alt-ArrowUp",run:V7},{key:"Shift-Alt-ArrowUp",run:K7},{key:"Alt-ArrowDown",run:Y7},{key:"Shift-Alt-ArrowDown",run:Q7},{key:"Mod-Alt-ArrowUp",run:B7},{key:"Mod-Alt-ArrowDown",run:I7},{key:"Escape",run:q7},{key:"Mod-Enter",run:X7},{key:"Alt-l",mac:"Ctrl-l",run:_7},{key:"Mod-i",run:L7,preventDefault:!0},{key:"Mod-[",run:J7},{key:"Mod-]",run:Z7},{key:"Mod-Alt-\\",run:W7},{key:"Shift-Mod-k",run:$7},{key:"Shift-Mod-\\",run:x7},{key:"Mod-/",run:Kj},{key:"Alt-A",run:$j},{key:"Ctrl-m",mac:"Shift-Alt-m",run:eV}].concat(nV);var nS=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new rm(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new iS(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}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 r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}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=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new rm(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},rm=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},iS=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},rS=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(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 t(this.stack,this.pos,this.index)}};function Ju(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var ba=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},JM=new ba,sS=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=JM,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=JM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(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 i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},As=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;rN(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};As.prototype.contextual=As.prototype.fallback=As.prototype.extend=!1;var oS=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?Ju(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(rN(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};oS.prototype.contextual=As.prototype.fallback=As.prototype.extend=!1;var xo=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function rN(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let d=o+3;d<c;d+=2)if((t[d+1]&l)>0){let m=t[d];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||rV(m,e.token.value,r,s))){e.acceptToken(m);break}}let u=e.next,f=0,h=t[o+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){o=t[c+h*3-1];continue e}for(;f<h;){let d=f+h>>1,m=c+d+(d<<1),g=t[m],b=t[m+1]||65536;if(u<g)h=d;else if(u>=b)f=d+1;else{o=t[m+2],e.advance();continue e}}break}}function eN(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function rV(t,e,n,i){let r=eN(n,i,e);return r<0||eN(n,i,t)<r}var xn=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),eS=null;function tN(t,e,n){let i=t.cursor(qe.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var lS=class{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?tN(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?tN(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof Ve){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(K.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},aS=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new ba)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new ba,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new ba,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=Ar(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(Ar(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(Ar(l,c+1),n,i,r))}return r}},cS=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new sS(n,r),this.tokens=new aS(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[nS.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new lS(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&sV(r);if(o)return xn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw xn&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return xn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,i){let r=e.pos,{parser:s}=this,o=xn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>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 f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(K.contextHash)||0)==u))return e.useNode(f,h),xn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ve)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof Ve&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),xn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],h=a[c++],d=c==a.length||!i,m=d?e:e.split(),g=this.tokens.mainToken;if(m.apply(u,f,g?g.start:m.pos,h),xn&&console.log(o+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${m==e?"":", split"})`),d)return!0;m.pos>r?n.push(m):i.push(m)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return nN(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=xn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),xn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=u;for(let d=0;d<10&&f.forceReduce()&&(xn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)xn&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))xn&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),xn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),nN(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),Ve.build({buffer:rS.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(eS||(eS=new WeakMap)).get(e);return n||eS.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function nN(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var uS=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},tS=t=>t,sm=class{constructor(e){this.start=e.start,this.shift=e.shift||tS,this.reduce=e.reduce||tS,this.reuse=e.reuse||tS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},va=class t extends ha{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 l=0;l<e.repeatNodeCount;l++)n.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=K[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let h=-u;h>0;h--)s(l[c++],a,f);c++}}}this.nodeSet=new Uu(n.map((l,a)=>Nt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Ju(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(iN),this.states=Ju(e.states,Uint32Array),this.data=Ju(e.stateData),this.goto=Ju(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new As(o,l):l),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,i){let r=new cS(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=Ar(i,s+2)];else{if(i[s+1]==2)return Ar(i,s+2);break}if(o==n||o==0)return Ar(i,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ar(this.data,s+2);else break;r=n(Ar(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ar(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=iN(o),o})),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),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new uS(e,i,r)}static deserialize(e){return new t(e)}};function Ar(t,e){return t[e]|t[e+1]<<16}function sV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function iN(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var Sa=63,sN=64,oV=1,lV=2,aN=3,aV=4,cN=5,cV=6,uV=7,uN=65,fV=66,hV=8,dV=9,pV=10,mV=11,gV=12,fN=13,yV=19,bV=20,vV=29,SV=33,xV=34,wV=47,kV=0,gS=1,hS=2,tf=3,dS=4,Or=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};Or.top=new Or(null,-1,kV);function ef(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(Tr(r)||r==-1)return n}}function pS(t){return t==32||t==9}function Tr(t){return t==10||t==13}function hN(t){return pS(t)||Tr(t)}function wo(t){return t<0||hN(t)}var AV=new sm({start:Or.top,reduce(t,e){return t.type==tf&&(e==bV||e==xV)?t.parent:t},shift(t,e,n,i){if(e==aN)return new Or(t,ef(i,i.pos),gS);if(e==uN||e==cN)return new Or(t,ef(i,i.pos),hS);if(e==Sa)return t.parent;if(e==yV||e==SV)return new Or(t,0,tf);if(e==fN&&t.type==dS)return t.parent;if(e==wV){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Or(t,t.depth+ +r[0],dS)}return t},hash(t){return t.hash}});function xa(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&wo(t.peek(n+3))}var OV=new xo((t,e)=>{if(t.next==-1&&e.canShift(sN))return t.acceptToken(sN);let n=t.peek(-1);if((Tr(n)||n<0)&&e.context.type!=tf){if(xa(t,45))if(e.canShift(Sa))t.acceptToken(Sa);else return t.acceptToken(oV,3);if(xa(t,46))if(e.canShift(Sa))t.acceptToken(Sa);else return t.acceptToken(lV,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==gS&&(t.next!=45||!wo(t.peek(1))))&&t.next!=-1&&!Tr(t.next)&&t.next!=35&&t.acceptToken(Sa,-i)}},{contextual:!0}),TV=new xo((t,e)=>{if(e.context.type==tf){t.next==63&&(t.advance(),wo(t.next)&&t.acceptToken(uV));return}if(t.next==45)t.advance(),wo(t.next)&&t.acceptToken(e.context.type==gS&&e.context.depth==ef(t,t.pos-1)?aV:aN);else if(t.next==63)t.advance(),wo(t.next)&&t.acceptToken(e.context.type==hS&&e.context.depth==ef(t,t.pos-1)?cV:cN);else{let n=t.pos;for(;;)if(pS(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)dN(t);else if(t.next==38)mS(t);else if(t.next==42){mS(t);break}else if(t.next==39||t.next==34){if(yS(t,!0))break;return}else if(t.next==91||t.next==123){if(!EV(t))return;break}else{pN(t,!0,!1,0);break}for(;pS(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(vV))return;let i=t.peek(1);wo(i)&&t.acceptTokenTo(e.context.type==hS&&e.context.depth==ef(t,n)?fV:uN,n)}}},{contextual:!0});function CV(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function oN(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function lN(t,e){return t.next==37?(t.advance(),oN(t.next)&&t.advance(),oN(t.next)&&t.advance(),!0):CV(t.next)||e&&t.next==44?(t.advance(),!0):!1}function dN(t){if(t.advance(),t.next==60){for(t.advance();;)if(!lN(t,!0)){t.next==62&&t.advance();break}}else for(;lN(t,!1););}function mS(t){for(t.advance();!wo(t.next)&&om(t.next)!="f";)t.advance()}function yS(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Tr(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function EV(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!yS(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Tr(t.next))return!1;t.advance()}}var DV="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function om(t){return t<33?"u":t>125?"s":DV[t-33]}function fS(t,e){let n=om(t);return n!="u"&&!(e&&n=="f")}function pN(t,e,n,i){if(om(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&fS(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;hN(s);){if(Tr(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?fS(t.peek(o+1),n):s==35?t.peek(o-1)!=32:fS(s,n)))||!n&&l<=i||l==0&&!n&&(xa(t,45,o)||xa(t,46,o)))break;if(e&&om(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var MV=new xo((t,e)=>{if(t.next==33)dN(t),t.acceptToken(gV);else if(t.next==38||t.next==42){let n=t.next==38?pV:mV;mS(t),t.acceptToken(n)}else t.next==39||t.next==34?(yS(t,!1),t.acceptToken(dV)):pN(t,!1,e.context.type==tf,e.context.depth)&&t.acceptToken(hV)}),NV=new xo((t,e)=>{let n=e.context.type==dS?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(xa(t,45,r)||xa(t,46,r))||!Tr(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=Tr(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(fN,i)}),RV=da({DirectiveName:T.keyword,DirectiveContent:T.attributeValue,"DirectiveEnd DocEnd":T.meta,QuotedLiteral:T.string,BlockLiteralHeader:T.special(T.string),BlockLiteralContent:T.content,Literal:T.content,"Key/Literal Key/QuotedLiteral":T.definition(T.propertyName),"Anchor Alias":T.labelName,Tag:T.typeName,Comment:T.lineComment,": , -":T.separator,"?":T.punctuation,"[ ]":T.squareBracket,"{ }":T.brace}),mN=va.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:AV,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[RV],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[OV,TV,MV,NV,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var _V=va.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),LV=Qu.define({name:"yaml",parser:mN.configure({props:[V1.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:Y1({closing:"}"}),FlowSequence:Y1({closing:"]"})}),lM.add({"FlowMapping FlowSequence":aM,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function gN(){return new Xp(LV)}var Phe=Qu.define({name:"yaml-frontmatter",parser:_V.configure({props:[da({DashLine:T.meta})]})});var cm=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},ko=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(nf).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((d,m)=>d.from-m.from||d.to-m.to),o=new br,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let d=0;;){let m=d==s.length?null:s[d];if(!m&&!l.length)break;let g,b;if(l.length)g=a,b=l.reduce((v,S)=>Math.min(v,S.to),m&&m.from>g?m.from:1e8);else{if(g=m.from,g>f)break;b=m.to,l.push(m),d++}for(;d<s.length;){let v=s[d];if(v.from==g&&(v.to>v.from||v.to==g))l.push(v),d++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let p=!1;if(l.some(v=>v.from==g&&(v.to==b||b==f))&&(p=g==b,!p&&b-g<10)){let v=g-(u+c.value.length);v>0&&(c.next(v),u=g);for(let S=g;;){if(S>=b){p=!0;break}if(!c.lineBreak&&u+c.value.length>S)break;S=u+c.value.length,u+=c.value.length,c.next()}}let y=TN(l);if(p)o.add(g,g,be.widget({widget:new bS(y),diagnostics:l.slice()}));else{let v=l.reduce((S,w)=>w.markClass?S+" "+w.markClass:S,"");o.add(g,b,be.mark({class:"cm-lintRange cm-lintRange-"+y+v,diagnostics:l.slice(),inclusiveEnd:l.some(S=>S.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let h=o.finish();return new t(h,n,wa(h))}};function wa(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new cm(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new cm(i.from,s,i.diagnostic)}}),i}function vN(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(nf).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(dm))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function BV(t,e){return t.field(di,!1)?e:e.concat(ue.appendConfig.of(KV))}function SN(t,e){return{effects:BV(t,[dm.of(e)])}}var dm=ue.define(),xN=ue.define(),wN=ue.define(),di=Mt.define({create(){return new ko(be.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=wa(n,t.selected.diagnostic,s)||wa(n,null,s)}!n.size&&r&&e.state.facet(nf).autoPanel&&(r=null),t=new ko(n,r,i)}for(let n of e.effects)if(n.is(dm)){let i=e.state.facet(nf).autoPanel?n.value.length?fm.open:null:t.panel;t=ko.init(n.value,i,e.state)}else n.is(xN)?t=new ko(t.diagnostics,n.value?fm.open:null,t.selected):n.is(wN)&&(t=new ko(t.diagnostics,t.panel,n.value));return t},provide:t=>[Ip.from(t,e=>e.panel),z.decorations.from(t,e=>e.diagnostics)]});var IV=be.mark({class:"cm-lintRange cm-lintRange-active"});function qV(t,e,n){let{diagnostics:i}=t.state.field(di),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(nf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:kN(t,r)}}}:null}function kN(t,e){return yn("ul",{class:"cm-tooltip-lint"},e.map(n=>ON(t,n,!1)))}var yN=t=>{let e=t.state.field(di,!1);return!e||!e.panel?!1:(t.dispatch({effects:xN.of(!1)}),!0)};var nf=B.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...ms(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:bN,tooltipFilter:bN,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function bN(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function AN(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function ON(t,e,n){var i;let r=n?AN(e.actions):[];return yn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},yn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let m=wa(t.state.field(di).diagnostics,e);m&&s.apply(t,m.from,m.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),yn("u",c.slice(u,u+1)),c.slice(u+1)],h=s.markClass?" "+s.markClass:"";return yn("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&yn("div",{class:"cm-diagnosticSource"},e.source))}var bS=class extends wr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return yn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},um=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=ON(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},fm=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)yN(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=AN(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=wa(this.view.state.field(di).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=yn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=yn("div",{class:"cm-panel-lint"},this.list,yn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>yN(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(di).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(di),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,h;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==u){f=d;break}f<0?(h=new um(this.view,u),this.items.splice(i,0,h),r=!0):(h=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new um(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(di),i=wa(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:wN.of(i)})}static open(e){return new t(e)}};function am(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function lm(t){return am(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}var PV=z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:lm("#f11")},".cm-lintRange-warning":{backgroundImage:lm("orange")},".cm-lintRange-info":{backgroundImage:lm("#999")},".cm-lintRange-hint":{backgroundImage:lm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function zV(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function TN(t){let e="hint",n=1;for(let i of t){let r=zV(i.severity);r>n&&(n=r,e=i.severity)}return e}var hm=class extends Un{constructor(e){super(),this.diagnostics=e,this.severity=TN(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(pm).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>UV(e,n,i)),n}};function HV(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(CN)&&t.dispatch({effects:SS.of(null)})}};window.addEventListener("mousemove",n)}function UV(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:SS.of({pos:o.from,above:!1,clip:!1,create(){return{dom:kN(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,HV(t,e)}let{hoverTime:r}=t.state.facet(pm),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function FV(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new hm(n[r]).range(+r));return fe.of(i,!0)}var jV=S1({class:"cm-gutter-lint",markers:t=>t.state.field(vS),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(vS).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new hm(i):null}}),vS=Mt.define({create(){return fe.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(pm).markerFilter;for(let i of e.effects)if(i.is(dm)){let r=i.value;n&&(r=n(r||[],e.state)),t=FV(e.state.doc,r.slice(0))}return t}}),SS=ue.define(),CN=Mt.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=vN(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(SS)?i.value:n,t)},provide:t=>Fp.from(t)}),VV=z.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:am('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:am('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:am('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),YV=UD(qV,{hideOn:vN}),KV=[di,z.decorations.compute([di],t=>{let{selected:e,panel:n}=t.field(di);return!e||!n||e.from==e.to?be.none:be.set([IV.range(e.from,e.to)])}),YV,PV],pm=B.define({combine(t){return ms(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function EN(t={}){return[pm.of(t),vS,jV,VV,CN]}var Fi=Pe(Ut()),DN={error:0,warning:1,info:2},QV=ga.define([{tag:T.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[T.string,T.special(T.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[T.number,T.bool,T.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[T.propertyName,T.definition(T.propertyName),T.keyword,T.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[T.punctuation,T.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),$V=z.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function GV(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var xS=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,nn.useRef)(null),u=(0,nn.useRef)(null),f=(0,nn.useRef)(e);f.current=e;let h=(0,nn.useRef)(new Zl),m=`${(0,nn.useId)()}-diag`;(0,nn.useEffect)(()=>{let b=c.current;if(!b)return;let p=[wM(),v1.of([...ZM,...TM]),...r?[jD()]:[],...s?[gN(),uM(QV)]:[],EN(),$V,h.current.of([z.editable.of(!o),Te.readOnly.of(o)]),z.contentAttributes.of({"aria-label":l,"aria-describedby":m}),z.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],y=new z({state:Te.create({doc:t,extensions:p}),parent:b});return u.current=y,()=>{y.destroy(),u.current=null}},[]),(0,nn.useEffect)(()=>{let b=u.current;if(!b)return;let p=b.state.doc.toString();p!==t&&b.dispatch({changes:{from:0,to:p.length,insert:t}})},[t]),(0,nn.useEffect)(()=>{let b=u.current;b&&b.dispatch(SN(b.state,GV(n,b.state.doc.length)))},[n]),(0,nn.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:h.current.reconfigure([z.editable.of(!o),Te.readOnly.of(o)])})},[o]);let g=(0,nn.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,p)=>{let y=DN[b.severity]-DN[p.severity];return y!==0?y:(b.line??1/0)-(p.line??1/0)}),[n]);return(0,Fi.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Fi.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Fi.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),g.length>0?(0,Fi.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:m,children:g.map((b,p)=>(0,Fi.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Fi.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Fi.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Fi.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},p))}):null]})};var re=Pe(yi());var q=Pe(Ut()),XV=new Set(["orientation","cyclic","align","groupselector","groupfield"]),wS=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h=!1,className:d})=>{let[m,g]=(0,re.useState)(null),b=(0,re.useCallback)(S=>{g(w=>w===S?null:S)},[]),p=(0,re.useCallback)(S=>g(null),[]),y=(0,re.useCallback)((S,w)=>{let O=s(S,w);return O&&typeof O=="object"&&"id"in O&&g(O.id),O},[s]),v=t.length===0&&e.length===0;return(0,q.jsxs)("div",{className:`spytial-ed-builder${d?` ${d}`:""}`,children:[(0,q.jsx)(MN,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),(0,q.jsx)(MN,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),v?(0,q.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},MN=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:m,onMove:g,disabled:b})=>{let p=`${t} List`,y=(0,re.useRef)(new Map),v=(0,re.useRef)(null),S=(0,re.useRef)(null),w=(0,re.useCallback)((k,A)=>{A?y.current.set(k,A):y.current.delete(k)},[]),O=(0,re.useCallback)(k=>{let A=n.findIndex(L=>L.id===k),D=n[A+1],E=n[A-1];S.current=D?.id??E?.id??"__add__",m(k)},[n,m]);return(0,re.useEffect)(()=>{let k=S.current;if(k!==null){if(S.current=null,k==="__add__"){v.current?.focus();return}y.current.get(k)?.focus()}},[n]),(0,q.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,q.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,q.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,q.jsx)(JV,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,q.jsx)("ul",{className:"spytial-ed-rows","aria-label":p,children:n.map((k,A)=>(0,q.jsx)(WV,{item:k,index:A,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===k.id,onToggleExpand:l,onCollapse:a,registerToggle:w,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:O,onMove:g,disabled:b},k.id))})]})},WV=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:m,onMove:g,disabled:b})=>{let p=(0,re.useId)(),y=`${p}-panel`,v=It(t.type),S=(0,re.useRef)(null),w=t.id;(0,re.useEffect)(()=>(c(w,S.current),()=>c(w,null)),[w,c]);let O=(0,re.useMemo)(()=>(i??[]).filter(L=>L.itemId===t.id),[i,t.id]),k=tY(O);if(!v)return(0,q.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,q.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,q.jsx)("span",{className:"spytial-ed-badge spytial-ed-badge--unknown",children:t.kind==="constraint"?"C":"D"}),(0,q.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,q.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let A=(()=>{try{return v.summary(t.params)}catch{return""}})(),D=XV.has(t.type),E=t.params.hold==="never";return(0,q.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${k?` spytial-ed-row--${k}`:""}`,children:[(0,q.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,q.jsxs)("button",{ref:S,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":y,disabled:b,onClick:()=>l(t.id),children:[(0,q.jsx)("span",{className:`spytial-ed-badge spytial-ed-badge--${t.kind}`,"aria-hidden":"true",children:t.kind==="constraint"?"C":"D"}),(0,q.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),E?(0,q.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,q.jsx)("span",{className:"spytial-ed-row-summary",children:A}),k?(0,q.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${k}`,role:"img","aria-label":`${k}: ${O.length} issue${O.length===1?"":"s"}`}):null]}),(0,q.jsx)(ZV,{item:t,index:e,count:n,disabled:b,onDuplicate:d,onRemove:m,onMove:g,onAddComment:()=>l(t.id)})]}),o?(0,q.jsxs)("div",{className:"spytial-ed-row-panel",id:y,onKeyDown:L=>{L.key==="Escape"&&(L.stopPropagation(),a(t.id),S.current?.focus())},children:[(0,q.jsx)(Wd,{fields:eY(v.fields),values:t.params,diagnostics:O,options:r,disabled:b,onChange:(L,R)=>u(t.id,L,R),selectorProps:s?L=>s(t,L):void 0}),D?(0,q.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,q.jsx)("span",{className:"spytial-ed-field-label",id:`${p}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,q.jsx)("div",{className:"spytial-ed-field-control",children:(0,q.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${p}-hold-label`,children:[(0,q.jsx)("button",{type:"button",role:"radio","aria-checked":!E,className:`spytial-ed-pill${E?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>h(t.id,!1),children:"Should hold"}),(0,q.jsx)("button",{type:"button",role:"radio","aria-checked":E,className:`spytial-ed-pill${E?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>h(t.id,!0),children:"Should not hold"})]})})]}):null,(0,q.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,q.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${p}-comment`,children:"Comment"}),(0,q.jsx)("div",{className:"spytial-ed-field-control",children:(0,q.jsx)("input",{id:`${p}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:L=>f(t.id,L.target.value)})})]})]}):null]})},ZV=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,re.useState)(!1),u=(0,re.useRef)(null),f=(0,re.useRef)(null),h=yu(a,f,{align:"end",estimatedHeight:220}),d=It(t.type)?.label??t.type;(0,re.useEffect)(()=>{if(!a)return;let b=p=>{u.current&&!u.current.contains(p.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let m=(0,re.useCallback)(()=>c(!1),[]),g=(0,re.useCallback)(b=>{b(),m()},[m]);return(0,q.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,q.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${d}`,disabled:i,onClick:()=>c(b=>!b),children:(0,q.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,q.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:h,role:"menu","aria-label":`Actions for ${d}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),m())},children:[(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(l),children:"Add comment"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(()=>r(t.id)),children:"Duplicate"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>g(()=>o(t.id,-1)),children:"Move up"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>g(()=>o(t.id,1)),children:"Move down"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${d} ${t.kind}`,onClick:()=>g(()=>s(t.id)),children:"Delete"})})]}):null]})},JV=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,re.useState)(!1),[o,l]=(0,re.useState)(""),a=(0,re.useRef)(null),c=(0,re.useRef)(null),u=(0,re.useRef)(null),f=(0,re.useCallback)(y=>{u.current=y,typeof i=="function"?i(y):i&&typeof i=="object"&&(i.current=y)},[i]),h=yu(r,u,{align:"end",estimatedHeight:320}),d=(0,re.useMemo)(()=>I0(t),[t]),m=(0,re.useMemo)(()=>{let y=o.trim().toLowerCase();return y?d.filter(v=>v.label.toLowerCase().includes(y)||v.type.toLowerCase().includes(y)||(v.description??"").toLowerCase().includes(y)):d},[d,o]);(0,re.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let y=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);let g=(0,re.useCallback)(()=>{s(!1),l("")},[]),b=(0,re.useCallback)(y=>{e(t,y),g()},[e,t,g]),p=t==="constraint"?"Add constraint":"Add directive";return(0,q.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,q.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(y=>!y),children:["+ ",p]}),r?(0,q.jsxs)("div",{className:"spytial-ed-add-menu",style:h,role:"menu","aria-label":p,onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),g())},children:[(0,q.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:y=>l(y.target.value)}),(0,q.jsx)("ul",{className:"spytial-ed-add-list",children:m.length===0?(0,q.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):m.map(y=>(0,q.jsx)("li",{role:"none",children:(0,q.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(y.type),children:[(0,q.jsx)("span",{className:"spytial-ed-add-item-label",children:y.label}),y.description?(0,q.jsx)("span",{className:"spytial-ed-add-item-desc",children:y.description}):null]})},y.type))})]}):null]})};function eY(t){return t.filter(e=>e.key!=="hold")}function tY(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var vt=Pe(Ut()),kS=({result:t,onDismiss:e})=>{let n=t.suggestions??[],i=t.notes??[];return(0,vt.jsxs)("div",{className:"spytial-ed-suggestions",role:"region","aria-label":"Layout suggestions",children:[(0,vt.jsxs)("div",{className:"spytial-ed-suggestions-head",children:[(0,vt.jsx)("span",{className:"spytial-ed-suggestions-title",children:n.length>0?`${n.length} suggestion${n.length===1?"":"s"}`:"Suggestion applied"}),(0,vt.jsx)("button",{type:"button",className:"spytial-ed-suggestions-dismiss","aria-label":"Dismiss suggestions",title:"Dismiss",onClick:e,children:(0,vt.jsx)("span",{"aria-hidden":"true",children:"\xD7"})})]}),n.length>0?(0,vt.jsx)("ul",{className:"spytial-ed-suggestions-list",children:n.map(r=>(0,vt.jsx)(nY,{suggestion:r},r.id))}):null,i.length>0?(0,vt.jsx)("ul",{className:"spytial-ed-suggestions-notes",children:i.map((r,s)=>(0,vt.jsx)("li",{children:r},s))}):null]})},nY=({suggestion:t})=>{let{id:e,rationale:n,confidence:i,outcome:r}=t;return(0,vt.jsxs)("li",{className:`spytial-ed-suggestion${r==="omitted"?" spytial-ed-suggestion--omitted":""}`,children:[(0,vt.jsxs)("div",{className:"spytial-ed-suggestion-head",children:[(0,vt.jsx)("span",{className:"spytial-ed-suggestion-text",children:n||e}),i?(0,vt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${i}`,title:`${i} confidence`,children:i}):null,r?(0,vt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${r}`,title:`Outcome: ${r}`,children:r}):null]}),n?(0,vt.jsx)("code",{className:"spytial-ed-suggestion-id",children:e}):null]})};var F=Pe(yi());var $e=Pe(Ut()),iY=300,rY=400,OS=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,layoutAssistant:o,density:l="compact",syntaxHighlighting:a=!0,defaultView:c="builder",view:u,onViewChange:f,className:h,disabled:d=!1,"aria-label":m="Layout specification editor",onDiagnostics:g})=>{let b=(0,F.useRef)(null);b.current===null&&(b.current=sY(t));let p=b.current.doc,[,y]=(0,F.useReducer)(P=>P+1,0),v=(0,F.useRef)(t),S=(0,F.useRef)(0),[w,O]=(0,F.useState)(c),k=u??w,A=(0,F.useRef)(null),D=(0,F.useRef)(null),E=(0,F.useRef)(()=>{}),L=(0,F.useCallback)(P=>{E.current(),u===void 0&&O(P),f?.(P)},[u,f]),[R,Z]=(0,F.useState)(()=>b.current?.error??null),$=(0,F.useMemo)(()=>{if(i)return i;if(n)return qb(n)},[i,n]),ke=(0,F.useMemo)(()=>zb($),[$]),Kt=(0,F.useMemo)(()=>$?.relations.map(P=>P.name)??[],[$]),mi=(0,F.useMemo)(()=>$?.types.map(P=>P.name)??[],[$]),me=(0,F.useCallback)(()=>{let P=p.toYaml();v.current=P,S.current+=1,Z(null),e(P)},[p,e]),[ot,Yn]=(0,F.useState)([]),St=(0,F.useRef)(0),He=(0,F.useRef)(null),dt=(0,F.useMemo)(()=>p.validate($),[p,$,t]),pt=(0,F.useMemo)(()=>[...dt,...ot],[dt,ot]),rn=(0,F.useRef)("");(0,F.useEffect)(()=>{if(!g)return;let P=oY(pt);P!==rn.current&&(rn.current=P,g(pt))},[pt,g]),(0,F.useEffect)(()=>{if(t===v.current)return;let P;try{P=p.toYaml()}catch{P=""}if(t===P){v.current=t;return}try{p.replaceFromYaml(t),v.current=t,S.current+=1,Z(null),y()}catch(Ae){Z(AS(Ae))}},[t,p]),(0,F.useEffect)(()=>p.subscribe(()=>y()),[p]);let sn=(0,F.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null);let P=D.current;if(D.current=null,!!P&&S.current===P.seq)try{p.replaceFromYaml(P.text),Z(null),y()}catch(Ae){Z(AS(Ae))}},[p]);E.current=sn;let Kn=(0,F.useCallback)(P=>{d||(v.current=P,e(P),A.current&&clearTimeout(A.current),D.current={text:P,seq:S.current},A.current=setTimeout(sn,iY))},[d,e,sn]);(0,F.useEffect)(()=>()=>{La.current=!1,A.current&&clearTimeout(A.current),He.current&&clearTimeout(He.current)},[]);let[Qn,No]=(0,F.useState)({running:!1,result:null,error:null}),Ro=(0,F.useRef)(0),La=(0,F.useRef)(!0),Km=(0,F.useCallback)(()=>{let P=o?.suggest;if(!P||d)return;E.current();let Ae=++Ro.current;No({running:!0,result:null,error:null});let xt={domain:$,instance:n,currentYaml:t};Promise.resolve().then(()=>P(xt)).then(kn=>{Ae!==Ro.current||!La.current||(p.replaceFromYaml(kn.yaml),me(),No({running:!1,result:kn,error:null}))}).catch(kn=>{Ae!==Ro.current||!La.current||No({running:!1,result:null,error:kn instanceof Error?kn.message:String(kn)})})},[o,d,$,n,t,p,me]),_o=(0,F.useCallback)(()=>{Ro.current+=1,No({running:!1,result:null,error:null})},[]),Ef=(0,F.useCallback)((P,Ae)=>{if(d)return;let xt=p.addItem(P,Ae);return me(),xt},[d,p,me]),Qm=(0,F.useCallback)((P,Ae,xt)=>{if(d)return;let kn=xt===""?void 0:xt;p.updateItem(P,{params:{[Ae]:kn}}),me()},[d,p,me]),$m=(0,F.useCallback)((P,Ae)=>{d||(p.updateItem(P,{comment:Ae}),me())},[d,p,me]),Gm=(0,F.useCallback)((P,Ae)=>{d||(p.updateItem(P,{params:{hold:Ae?"never":void 0}}),me())},[d,p,me]),Xm=(0,F.useCallback)(P=>{d||!p.duplicateItem(P)||me()},[d,p,me]),U=(0,F.useCallback)(P=>{d||(p.removeItem(P),me())},[d,p,me]),ee=(0,F.useCallback)((P,Ae)=>{if(d)return;let xt=p.getState(),Dr=(xt.constraints.some(wt=>wt.id===P)?xt.constraints:xt.directives).findIndex(wt=>wt.id===P);Dr!==-1&&(p.moveItem(P,Dr+Ae),me())},[d,p,me]),Yi=(0,F.useCallback)(()=>{d||!p.canUndo()||(p.undo(),me())},[d,p,me]),Er=(0,F.useCallback)(()=>{d||!p.canRedo()||(p.redo(),me())},[d,p,me]),Lo=(0,F.useCallback)(P=>{!(P.metaKey||P.ctrlKey)||P.key.toLowerCase()!=="z"||(P.preventDefault(),P.shiftKey?Er():Yi())},[Yi,Er]),Ns=(0,F.useCallback)((P,Ae)=>{if(Ae.kind!=="selector")return;let xt={itemKind:P.kind,itemType:P.type,fieldKey:Ae.key,domain:$,specYaml:v.current},Dr={complete:wt=>{let Ki=ke(wt),Qi=s?.complete;if(!Qi)return Ki;let Ba={...xt,currentValue:String(P.params[Ae.key]??"")},Df;try{Df=Qi(Ba,wt)??[]}catch{return Ki}return Promise.resolve(Df).then(Wm=>Hb(Wm??[],Ki)).catch(()=>Ki)},highlight:a};if(s?.synthesize){let wt=s.synthesize;Dr.synthesize=Ki=>{let Qi={...xt,currentValue:String(P.params[Ae.key]??"")};return wt(Qi,Ki)}}return Dr},[$,ke,s,a]);(0,F.useEffect)(()=>{let P=s?.review;if(!P){Yn([]);return}He.current&&clearTimeout(He.current);let Ae=++St.current;He.current=setTimeout(()=>{let xt=p.getState(),kn=[...xt.constraints,...xt.directives],Dr=[];for(let wt of kn){let Ki=It(wt.type);if(Ki)for(let Qi of Ki.fields){if(Qi.kind!=="selector")continue;let Ba=String(wt.params[Qi.key]??"");if(Ba.trim()==="")continue;let Df={itemKind:wt.kind,itemType:wt.type,fieldKey:Qi.key,currentValue:Ba,domain:$,specYaml:v.current};Dr.push(Promise.resolve().then(()=>P(Df,Ba)).then(Wm=>(Wm??[]).map($4=>({...$4,itemId:wt.id,fieldKey:Qi.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(Dr).then(wt=>{Ae===St.current&&Yn(wt.flat())}).catch(()=>{Ae===St.current&&Yn([])})},rY)},[s,$,t,p]);let gi=p.getState(),Tx=R!==null,K4=["spytial-ed",l==="compact"?"spytial-ed--compact":"",h??""].filter(Boolean).join(" "),Q4=(0,F.useMemo)(()=>Ib(t,$),[t,$]),Cx=jb(r);return(0,$e.jsxs)("section",{className:K4,style:Cx?Ub(Cx):void 0,"aria-label":m,onKeyDown:Lo,children:[(0,$e.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,$e.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,$e.jsxs)("button",{type:"button",role:"tab","aria-selected":k==="builder",className:`spytial-ed-viewtoggle-btn${k==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:d,onClick:()=>L("builder"),children:["Builder",Tx?(0,$e.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,$e.jsx)("button",{type:"button",role:"tab","aria-selected":k==="code",className:`spytial-ed-viewtoggle-btn${k==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:d,onClick:()=>L("code"),children:"Code"})]}),(0,$e.jsxs)("div",{className:"spytial-ed-toolbar-actions",children:[o?.suggest?(0,$e.jsxs)("button",{type:"button",className:"spytial-ed-suggest-btn",title:"Suggest a layout for the current data",disabled:d||Qn.running,"aria-busy":Qn.running,onClick:Km,children:[(0,$e.jsx)("span",{"aria-hidden":"true",children:"\u2726"}),Qn.running?"Analyzing\u2026":"Suggest"]}):null,(0,$e.jsxs)("div",{className:"spytial-ed-history",children:[(0,$e.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:d||!p.canUndo(),onClick:Yi,children:(0,$e.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,$e.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:d||!p.canRedo(),onClick:Er,children:(0,$e.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]})]}),Qn.error!==null?(0,$e.jsx)("p",{className:"spytial-ed-suggest-error",role:"alert",children:Qn.error}):null,Qn.result!==null?(0,$e.jsx)(kS,{result:Qn.result,onDismiss:_o}):null,(0,$e.jsx)("div",{className:"spytial-ed-body",children:k==="builder"?(0,$e.jsx)(wS,{constraints:gi.constraints,directives:gi.directives,diagnostics:pt,options:{relationNames:Kt,typeNames:mi},selectorProps:Ns,onAddItem:Ef,onUpdateParam:Qm,onUpdateComment:$m,onToggleNegate:Gm,onDuplicate:Xm,onRemove:U,onMove:ee,disabled:d}):(0,$e.jsx)(xS,{value:t,onChange:Kn,diagnostics:Q4,hasUnappliedEdits:Tx,syntaxHighlighting:a,disabled:d})})]})};function sY(t){try{return{doc:Bl.fromYaml(t),error:null}}catch(e){return{doc:new Bl,error:AS(e)}}}function AS(t){return t instanceof os?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function oY(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
198
+ `)}function lY(t,e){return{_:"tuple",types:t,atoms:Array.from(e.querySelectorAll("atom")).map((n,i)=>TS(t[i],n).id)}}function NN(t,e){return Array.from(e).map(n=>lY(t,n))}function mm(t){return t.tuples}function aY(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label found for field element");let i=cY(t,e);if(i.length===0)throw new Error("No types found for field element");let r=e.getAttribute("parentID"),o=(r?t[r]:void 0)??i[0],l=NN(i,e.querySelectorAll("tuple"));return{_:"relation",id:`${o}<:${n}`,name:n,types:i,tuples:l}}function CS(t,e){return Array.from(e).map(n=>aY(t,n))}function cY(t,e){let n=e.querySelectorAll("type");return Array.from(n).map(i=>{let r=i.getAttribute("ID");if(!r)throw new Error("Type element must have an ID attribute");let s=t[r];if(!s)throw new Error(`Type element with ID ${r} not found`);return s})}function RN(t){return t!==void 0}function gm(t,e){let n={};for(let i of t)n[e(i)]=i;return n}function _N(t){let n=new globalThis.DOMParser().parseFromString(t,"application/xml"),i=Array.from(n.querySelectorAll("instance"));if(!i.length)throw new Error(`No Alloy instance in XML: ${t}`);let r=n.querySelectorAll("visualizer"),s,o,l;for(let a of Array.from(r))s=ym(a,"script")??s,o=ym(a,"theme")??o,l=ym(a,"cnd")??l;return{instances:i.map(a=>IN(a)),bitwidth:Cr(i[0],"bitwidth"),command:ym(i[0],"command"),loopBack:uY(i[0]),maxSeq:Cr(i[0],"maxseq"),maxTrace:Cr(i[0],"maxtrace"),minTrace:Cr(i[0],"mintrace"),traceLength:Cr(i[0],"tracelength"),visualizerConfig:{script:ES(s),theme:ES(o),cnd:ES(l)}}}function uY(t){let e=Cr(t,"backloop");if(e!==void 0)return e;let n=Cr(t,"loop");if(n!==void 0)return n;let i=Cr(t,"tracelength"),r=Cr(t,"looplength");if(i!==void 0&&r!==void 0&&i>1)return i-r}function Cr(t,e){let n=t.getAttribute(e);return n?+n:void 0}function ym(t,e){let n=t.getAttribute(e);return n?`${n}`:void 0}function ES(t){return t?.replaceAll("&quot;",'"').replaceAll('\\"','"').replaceAll("&gt;",">").replaceAll("&lt;","<")}function DS(t){return t.querySelectorAll("type").length>0}function LN(t,e){let n={},i=e.querySelectorAll("sig");for(let o of i)if(!DS(o)){let l=o.getAttribute("ID"),a=o.getAttribute("parentID"),c=o.getAttribute("label");if(!l)throw new Error("No ID found for sig element");if(!c)throw new Error("No label found for sig element");a&&(n[l]=a)}let r=(o,l)=>n[o]?r(n[o],[...l,t[o]]):l,s={};for(let o in t)s[t[o]]=r(o,[]);return s}function BN(t){let e={},n=t.querySelectorAll("sig");for(let i of n){let r=i.getAttribute("ID"),s=i.getAttribute("label");if(!r)throw new Error("No ID found for sig element");if(!s)throw new Error("No label found for sig element");e[r]=s}return e}function qN(t,e){let n=e.find(i=>i.id==="Int");if(!n)throw new Error("Could not find Int type");n.atoms=FN(t)}function PN(t){return t.types[t.types.length-1]}function zN(t){return t.atoms}function Os(t){return t.meta!==void 0&&t.meta.builtin===!0}function fY(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");let i=t[n];if(!i)throw console.log(t),new Error(`No type hierarchy for ${n}`);let r=hY(e),s={_:"type",id:n,types:i,atoms:UN(n,e.querySelectorAll("atom")),meta:void 0};return RN(r)&&(s.meta=r),s}function HN(t,e){return Array.from(e).filter(n=>!DS(n)).map(n=>fY(t,n))}function bm(t,e,n){return typeof e=="string"&&(e=vm(t,e)),typeof n!="string"&&(n=n.id),e.types.includes(n)}function hY(t){let e={};return t.getAttribute("abstract")==="yes"&&(e.abstract=!0),t.getAttribute("builtin")==="yes"&&(e.builtin=!0),t.getAttribute("enum")==="yes"&&(e.enum=!0),t.getAttribute("meta")==="yes"&&(e.meta=!0),t.getAttribute("one")==="yes"&&(e.one=!0),t.getAttribute("private")==="yes"&&(e.private=!0),Object.keys(e).length===0?void 0:e}function Ts(t,e){let n=Ao(t).find(i=>i.id===e);if(!n)throw new Error(`Could not find atom with id ${e}`);return n}function Ao(t){return sf(t).map(zN).reduce((e,n)=>e.concat(n),[])}function jN(t,e){let n=Ts(t,e),i={...t.types},r={...t.relations},s={...t.skolems},o=t.types[n.type];if(o){let l=o.atoms.filter(a=>a.id!==e);l.length===0?delete i[o.id]:i[n.type]={...o,atoms:l};for(let[a,c]of Object.entries(t.relations)){let u=c.tuples.filter(f=>!f.atoms.includes(e));r[a]={...c,tuples:u}}for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!f.atoms.includes(e));s[a]={...c,tuples:u}}return{types:i,relations:r,skolems:s}}else throw new Error(`Could not find type for atom ${e}`)}function VN(t,e){let n={...t.types},i=n[e.type];if(i)n[e.type]={...i,atoms:[...i.atoms,e]};else{let r={_:"type",id:e.type,types:[e.type,"univ"],atoms:[e]};n[r.id]=r}return{...t,types:n}}function YN(t,e,n){let i=dY(t,e),r={...t.relations},s={...t.skolems},o=(a,c)=>a.atoms.length===c.atoms.length&&a.atoms.every((u,f)=>u===c.atoms[f]),l=i.tuples.filter(a=>!o(a,n));r[i.id]={...i,tuples:l};for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!o(f,n));u.length===0?delete s[a]:s[a]={...c,tuples:u}}return{...t,relations:r,skolems:s}}function KN(t,e,n){let i=t.relations[e];if(!i){let o=Object.values(t.relations).filter(l=>l.name===e);o.length>1&&console.warn(`addInstanceRelationTuple: name "${e}" is ambiguous (${o.map(l=>l.id).join(", ")}); appending to the first. Use a qualified id (Sig<:field) to disambiguate.`),i=o[0]}let r={...t.relations},s={...t.skolems};return i?r[i.id]={...i,tuples:[...i.tuples,n]}:r[e]={id:e,name:e,tuples:[n],types:n.types,_:"relation"},{...t,relations:r,skolems:s}}function dY(t,e){let n=t.relations[e];if(n)return n;let i=Object.values(t.relations).filter(r=>r.name===e);if(i.length>1&&console.warn(`getInstanceRelation: name "${e}" is ambiguous (${i.map(r=>r.id).join(", ")}); returning the first. Use a qualified id (Sig<:field) to disambiguate.`),i.length>0)return i[0];throw new Error(`Could not find relation ${e}`)}function ka(t){return Object.values(t.relations)}function rf(t,e){let n=[];for(let i of Object.values(t.skolems))for(let r of i.tuples)if(r.atoms.includes(e)){n.push(i.name);break}return n}function vm(t,e){let n=t.types[e];if(!n)throw new Error(`Could not find type with id ${e}`);return n}function sf(t){return Object.values(t.types)}function IN(t){let e=t.getAttribute("bitwidth");if(!e)throw new Error("No bitwidth found in instance");let n=BN(t),i=LN(n,t),r=HN(i,t.querySelectorAll("sig")),s=CS(n,t.querySelectorAll("field")),o=CS(n,t.querySelectorAll("skolem"));return qN(parseInt(e),r),{types:gm(r,l=>l.id),relations:gm(s,l=>l.id),skolems:gm(o,l=>l.id)}}function TS(t,e){let n=e.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:t}}function UN(t,e){return Array.from(e).map(n=>TS(t,n))}function QN(t,e){return typeof e=="string"&&(e=Ts(t,e)),of(t,e).types.map(r=>vm(t,r)).some(Os)}function FN(t){let e=[],n=Math.pow(2,t);for(let i=-n/2;i<n/2;++i)e.push({_:"atom",id:i.toString(),type:"Int"});return e}function of(t,e){if(typeof e=="string"&&(e=Ts(t,e)),!t.types[e.type])throw new Error(`The atom's type is not part of the instance: ${e.type}`);return t.types[e.type]}function $N(t,e){let n={};return e.forEach(i=>{let r=of(t,i),s=PN(r);if(!n[s])n[s]=i;else throw new Error(`Cannot project ${i} and ${n[s]}. Both are of type ${s}`)}),{types:pY(t,n),relations:mY(t,n),skolems:t.skolems}}function pY(t,e){let n={},i=Object.keys(e);for(let r in t.types){let s=t.types[r],o=i.some(l=>bm(t,s,l));n[r]={_:"type",id:s.id,types:s.types,atoms:o?[]:s.atoms,meta:s.meta}}return n}function mY(t,e){let n={},i=Object.keys(e),r=Object.values(e);for(let s in t.relations){let o=t.relations[s],l=o.types.some(c=>i.some(u=>bm(t,c,u))),a=l?gY(t,o.types,i):[];n[s]={_:"relation",id:o.id,name:o.name,types:l?MS(o.types,a):o.types,tuples:l?yY(o.tuples,a,r):o.tuples},l||(n[s]=o)}return n}function gY(t,e,n){let i=[];return e.forEach((r,s)=>{n.some(o=>bm(t,r,o))&&i.push(s)}),i}function yY(t,e,n){return t.filter(i=>i.atoms.some(r=>n.includes(r))).map(i=>({_:"tuple",types:MS(i.types,e),atoms:MS(i.atoms,e)})).filter(i=>i.atoms.length>1)}function MS(t,e){let n=[];for(let i=0;i<t.length;i++)e.includes(i)||n.push(t[i]);return n}function Oo(t){return t.id}function NS(t,e){let n=t.id,i=e.atoms;return`${n}:${i.join("->")}`}var j4=Pe(F4());function tse(t,e){return e<2?[0,0]:[0,e-1]}function V4(t,e,n){let i=new j4.Graph({directed:!0,multigraph:!0}),{nodeIds:r,edgeIds:s}=nse(t,e,n);return Ao(t).forEach(o=>{let l=Oo(o);r.has(l)&&i.setNode(l,l)}),ka(t).forEach(o=>{mm(o).forEach(a=>{let c=NS(o,a),u=a.atoms,[f,h]=tse(o.id,u.length),d=f?u[f]:u[0],m=h?u[h]:u[u.length-1];if(d&&m&&s.has(c)){let g=u.slice(1,-1).join(","),b=g.length>0?`[${g}]`:"",p=o.name+b,y=Oo(Ts(t,d)),v=Oo(Ts(t,m));i.setEdge(y,v,p,c)}})}),i}function nse(t,e,n){let i=new Set,r=new Set;return ka(t).forEach(s=>{mm(s).forEach(o=>{let l=o.atoms.map(u=>Ts(t,u)),[a,c]=ise(s,l);a&&c&&(i.add(Oo(a)),i.add(Oo(c)),r.add(NS(s,o)))})}),Ao(t).forEach(s=>{let o=Oo(s);i.has(o)||e||(!QN(t,s)||!n)&&i.add(o)}),{nodeIds:i,edgeIds:r}}function ise(t,e){let n=e[0],i=e[e.length-1];return[n,i]}var Cf=class t{constructor(e){this.eventListeners=new Map;this.alloyInstance=e,this.declaredTypeIds=new Set(Object.keys(e.types)),this.declaredRelationNames=new Set(Object.values(e.relations).map(n=>n.name))}isValidForgeIdentifier(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)}sanitizeForgeIdentifier(e,n){let i=e.replace(/[^A-Za-z0-9_$]/g,"_");i||(i="_"),/^[A-Za-z_$]/.test(i)||(i=`_${i}`);let r=i,s=1;for(;n.has(r);)r=`${i}_${s}`,s++;return n.add(r),r}addEventListener(e,n){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(n)}removeEventListener(e,n){let i=this.eventListeners.get(e);i&&i.delete(n)}emitEvent(e){let n=this.eventListeners.get(e.type);n&&n.forEach(i=>{try{i(e)}catch(r){console.error("Error in data instance event listener:",r)}})}getAtomType(e){let n=of(this.alloyInstance,e);return{id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=rf(this.alloyInstance,i.id);return{id:i.id,label:i.id,type:i.type,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Os(n)}}getTypes(){return sf(this.alloyInstance).map(n=>({id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=rf(this.alloyInstance,i.id);return{id:i.id,type:i.type,label:i.id,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Os(n)}))}getAtoms(){return Ao(this.alloyInstance).map(n=>{let i=rf(this.alloyInstance,n.id);return{id:n.id,type:n.type,label:n.id,labels:i.length>0?{skolems:i}:void 0}})}getRelations(){return ka(this.alloyInstance).map(n=>({id:n.id,name:n.name,types:n.types,tuples:n.tuples.map(i=>({atoms:i.atoms,types:i.types}))}))}applyProjections(e){let n=$N(this.alloyInstance,e);return new t(n)}generateGraph(e,n){return V4(this.alloyInstance,e,n)}getAlloyInstance(){return this.alloyInstance}reify(){let e="",i="inst builtinstance {",r="}",s=this.alloyInstance.types,o=new Set,l=new Map,a=[],c=[],u=new Set,f=new Set,h=new Set,d=p=>{let y=l.get(p);if(y)return y;let v=this.sanitizeForgeIdentifier(p,o);return l.set(p,v),v!==p&&a.push(`${p} -> ${v}`),v},m={};for(let p in s){let y=s[p];if(Os(y))continue;if(!this.declaredTypeIds.has(p)){y.atoms.length>0&&c.push(p);continue}let v=y.atoms;m[p]=v.map(S=>(h.add(S.id),`\`${d(S.id)}`))}let g=this.alloyInstance.relations,b={};for(let p in g){let y=g[p];if(!this.declaredRelationNames.has(y.name)||!this.isValidForgeIdentifier(y.name)){y.tuples.length>0&&u.add(y.name);continue}let S=y.tuples.filter(O=>{let k=O.atoms.every((A,D)=>{let E=s[O.types[D]];return E&&Os(E)||h.has(A)});return k||f.add(y.name),k}).map(O=>`(${O.atoms.map((A,D)=>{let E=s[O.types[D]];return E&&Os(E)?A:`\`${d(A)}`}).join("->")})`),w=y.name;b[w]=(b[w]??[]).concat(S)}for(let p in m){let y=m[p];y.length>0&&(e+=`${p} = ${y.join("+")}
199
+ `)}for(let p in b){let y=b[p];y.length>0?e+=`${p} = ${y.join("+")}
200
+ `:e+=`no ${p}
201
201
  `}return c.length>0&&console.warn(`AlloyDataInstance.reify: dropped ${c.length} sig(s) not declared in the parsed spec (${c.join(", ")}); their atoms were omitted from the inst.`),u.size>0&&console.warn(`AlloyDataInstance.reify: dropped ${u.size} field(s) not declared in the parsed spec or not a valid Forge identifier (${[...u].join(", ")}); their tuples were omitted from the inst.`),f.size>0&&console.warn(`AlloyDataInstance.reify: dropped tuple(s) from declared field(s) (${[...f].join(", ")}) that referenced unbound atoms (atoms of a dropped/undeclared sig); they were omitted to avoid a dangling reference.`),a.length>0&&console.warn(`AlloyDataInstance.reify: rewrote ${a.length} atom id(s) to valid Forge identifiers (${a.join(", ")}).`),`${i}
202
202
  ${e}
203
- ${r}`}removeAtom(e){this.alloyInstance=IN(this.alloyInstance,e),this.emitEvent({type:"atomRemoved",data:{atomId:e}})}addAtom(e){let n={_:"atom",id:e.id,type:e.type};this.alloyInstance=qN(this.alloyInstance,n),this.emitEvent({type:"atomAdded",data:{atom:e}})}addRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=zN(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleAdded",data:{relationId:e,tuple:n}})}removeRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=PN(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleRemoved",data:{relationId:e,tuple:n}})}addFromDataInstance(e,n){if(!Gre(e))return!1;let i=e.getAlloyInstance(),r=new Map;return vo(i).forEach(s=>{let o=this.getAtomType(s.id).isBuiltin;if(n&&o){let a=this.getAtoms().find(c=>c.type===s.type&&c.label===s.id);if(a){r.set(s.id,a.id);return}}let l=`atom_${this.getAtoms().length+1}`;r.set(s.id,l),this.addAtom({id:l,type:s.type,label:s.id})}),ga(i).forEach(s=>{s.tuples.forEach(o=>{let l={atoms:o.atoms.map(a=>r.get(a)||a),types:o.types};this.addRelationTuple(s.id,l)})}),Ju(i).forEach(s=>{this.getTypes().find(l=>l.id===s.id)||(this.alloyInstance.types[s.id]={_:"type",id:s.id,types:s.types,atoms:s.atoms.map(l=>({_:"atom",id:r.get(l.id)||l.id,type:l.type})),meta:{builtin:!1,abstract:!1,enum:!1,one:!1,private:!1}})}),!0}};function Gre(t){return t instanceof wf}var lt=Ve(dn()),$re=`<alloy builddate="2025-05-14">
203
+ ${r}`}removeAtom(e){this.alloyInstance=jN(this.alloyInstance,e),this.emitEvent({type:"atomRemoved",data:{atomId:e}})}addAtom(e){let n={_:"atom",id:e.id,type:e.type};this.alloyInstance=VN(this.alloyInstance,n),this.emitEvent({type:"atomAdded",data:{atom:e}})}addRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=KN(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleAdded",data:{relationId:e,tuple:n}})}removeRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=YN(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleRemoved",data:{relationId:e,tuple:n}})}addFromDataInstance(e,n){if(!rse(e))return!1;let i=e.getAlloyInstance(),r=new Map;return Ao(i).forEach(s=>{let o=this.getAtomType(s.id).isBuiltin;if(n&&o){let a=this.getAtoms().find(c=>c.type===s.type&&c.label===s.id);if(a){r.set(s.id,a.id);return}}let l=`atom_${this.getAtoms().length+1}`;r.set(s.id,l),this.addAtom({id:l,type:s.type,label:s.id})}),ka(i).forEach(s=>{s.tuples.forEach(o=>{let l={atoms:o.atoms.map(a=>r.get(a)||a),types:o.types};this.addRelationTuple(s.id,l)})}),sf(i).forEach(s=>{this.getTypes().find(l=>l.id===s.id)||(this.alloyInstance.types[s.id]={_:"type",id:s.id,types:s.types,atoms:s.atoms.map(l=>({_:"atom",id:r.get(l.id)||l.id,type:l.type})),meta:{builtin:!1,abstract:!1,enum:!1,one:!1,private:!1}})}),!0}};function rse(t){return t instanceof Cf}var st=Pe(Ut()),sse=`<alloy builddate="2025-05-14">
204
204
  <instance bitwidth="4" maxseq="-1" command="bst" filename="bst.frg" version="4.1">
205
205
  <sig label="seq/Int" ID="0" parentID="1" builtin="yes"></sig>
206
206
  <sig label="Int" ID="1" parentID="2" builtin="yes"></sig>
@@ -230,7 +230,7 @@ ${r}`}removeAtom(e){this.alloyInstance=IN(this.alloyInstance,e),this.emitEvent({
230
230
  <types><type ID="4"/><type ID="4"/></types>
231
231
  </field>
232
232
  </instance>
233
- </alloy>`;function Xre(){try{let t=TN($re);return new wf(t.instances[0])}catch(t){console.warn("spec-editor demo: failed to build sample instance",t);return}}var Wre=`constraints:
233
+ </alloy>`;function ose(){try{let t=_N(sse);return new Cf(t.instances[0])}catch(t){console.warn("spec-editor demo: failed to build sample instance",t);return}}var lse=`constraints:
234
234
  # the left child sits below-left of its parent
235
235
  - orientation:
236
236
  selector: left
@@ -246,7 +246,7 @@ directives:
246
246
  - attribute:
247
247
  field: key
248
248
  - flag: hideDisconnectedBuiltIns
249
- `;function Zre(t,e){let n=e.toLowerCase(),i=t.domain?.relations??[],r=t.domain?.types??[];for(let o of i)if(n.includes(o.name.toLowerCase()))return{value:o.name,explanation:`Matched the relation "${o.name}" mentioned in your request.`};if(/child|children|descend/.test(n)&&i.some(o=>o.name==="left"))return{value:"left + right",explanation:"Both child edges (the union of the left and right relations)."};if(/leaf|childless/.test(n)&&r.some(o=>o.name==="Node"))return{value:"Node - (left + right).Node",explanation:"Nodes that are not the parent end of any child edge (leaves)."};for(let o of r)if(n.includes(o.name.toLowerCase()))return{value:o.name,explanation:`All atoms of the "${o.name}" sig.`};let s=i[0]?.name??r[0]?.name??"univ";return{value:s,explanation:`Couldn't match your request precisely; suggesting "${s}" as a starting point.`}}var Jre={synthesize:(t,e)=>new Promise(n=>{setTimeout(()=>n(Zre(t,e)),600)}),review:(t,e)=>new Promise(n=>{let i=[];/TODO/.test(e)&&i.push({severity:"warning",message:'Selector contains a "TODO" \u2014 replace it before rendering.',source:"assistant"}),setTimeout(()=>n(i),200)})},ese={accent:"#ff2e88",accentText:"#1a022b",surface:"#fdf2ff",surfaceRaised:"#f6e0ff",border:"#e2a8ff",text:"#2a0a3d",textMuted:"#8a4fb0",danger:"#e11d48",warning:"#d97706",success:"#0ea5a3",fontFamily:"'Trebuchet MS', 'Segoe UI', sans-serif",radius:"12px",synKeyword:"#d6009d",synType:"#0891b2",synRelation:"#7c3aed",synOperator:"#db2777",synString:"#ca8a04",synComment:"#9d6fb8"};Pb({funky:ese});var tse=()=>{let t=(0,Ta.useMemo)(()=>Xre(),[]),[e,n]=(0,Ta.useState)(Wre),[i,r]=(0,Ta.useState)("light"),[s,o]=(0,Ta.useState)([]);return(0,lt.jsxs)("div",{children:[(0,lt.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",marginBottom:12,flexWrap:"wrap"},children:[(0,lt.jsxs)("label",{style:{fontWeight:600},children:["Theme:"," ",(0,lt.jsxs)("select",{value:i,onChange:a=>r(a.target.value),children:[(0,lt.jsx)("option",{value:"light",children:"Default (light)"}),(0,lt.jsx)("option",{value:"dark",children:"Dark"}),(0,lt.jsx)("option",{value:"funky",children:"Funky (custom)"})]})]}),(0,lt.jsx)("span",{style:{color:"#6b6b75",fontSize:13},children:t?"Domain loaded: sig Node \xB7 fields left, right, key \u2014 try the \u2728 button or type a selector.":"No domain (fixture unavailable) \u2014 completions are language-only."})]}),(0,lt.jsx)("div",{style:i==="dark"?{background:"#101014",padding:16,borderRadius:8}:{padding:16},children:(0,lt.jsx)(SS,{value:e,onChange:n,instance:t,selectorAssistant:Jre,theme:i==="light"?void 0:i,onDiagnostics:o,"aria-label":"Spytial spec editor demo"})}),(0,lt.jsxs)("details",{style:{marginTop:12},children:[(0,lt.jsxs)("summary",{style:{cursor:"pointer",fontWeight:600},children:["Diagnostics (",s.length,") & current YAML"]}),(0,lt.jsx)("ul",{style:{fontSize:13},children:s.map((a,c)=>(0,lt.jsxs)("li",{children:[(0,lt.jsx)("strong",{children:a.severity})," [",a.source,"]: ",a.message]},c))}),(0,lt.jsx)("pre",{style:{background:"#f5f5f7",padding:12,borderRadius:6,overflow:"auto",fontSize:12},children:e})]})]})};function Sx(t="spec-editor-demo-root"){let e=document.getElementById(t);return e?((0,P4.createRoot)(e).render((0,lt.jsx)(tse,{})),!0):(console.error(`Spec Editor demo: container "${t}" not found`),!1)}if(typeof window<"u"){let t=window;t.SpecEditorDemo={mountSpecEditorDemo:Sx},t.mountSpecEditorDemo=Sx}return K4(nse);})();
249
+ `;function ase(t,e){let n=e.toLowerCase(),i=t.domain?.relations??[],r=t.domain?.types??[];for(let o of i)if(n.includes(o.name.toLowerCase()))return{value:o.name,explanation:`Matched the relation "${o.name}" mentioned in your request.`};if(/child|children|descend/.test(n)&&i.some(o=>o.name==="left"))return{value:"left + right",explanation:"Both child edges (the union of the left and right relations)."};if(/leaf|childless/.test(n)&&r.some(o=>o.name==="Node"))return{value:"Node - (left + right).Node",explanation:"Nodes that are not the parent end of any child edge (leaves)."};for(let o of r)if(n.includes(o.name.toLowerCase()))return{value:o.name,explanation:`All atoms of the "${o.name}" sig.`};let s=i[0]?.name??r[0]?.name??"univ";return{value:s,explanation:`Couldn't match your request precisely; suggesting "${s}" as a starting point.`}}var cse={synthesize:(t,e)=>new Promise(n=>{setTimeout(()=>n(ase(t,e)),600)}),review:(t,e)=>new Promise(n=>{let i=[];/TODO/.test(e)&&i.push({severity:"warning",message:'Selector contains a "TODO" \u2014 replace it before rendering.',source:"assistant"}),setTimeout(()=>n(i),200)})},use={accent:"#ff2e88",accentText:"#1a022b",surface:"#fdf2ff",surfaceRaised:"#f6e0ff",border:"#e2a8ff",text:"#2a0a3d",textMuted:"#8a4fb0",danger:"#e11d48",warning:"#d97706",success:"#0ea5a3",fontFamily:"'Trebuchet MS', 'Segoe UI', sans-serif",radius:"12px",synKeyword:"#d6009d",synType:"#0891b2",synRelation:"#7c3aed",synOperator:"#db2777",synString:"#ca8a04",synComment:"#9d6fb8"};Fb({funky:use});var fse=()=>{let t=(0,_a.useMemo)(()=>ose(),[]),[e,n]=(0,_a.useState)(lse),[i,r]=(0,_a.useState)("light"),[s,o]=(0,_a.useState)([]);return(0,st.jsxs)("div",{children:[(0,st.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",marginBottom:12,flexWrap:"wrap"},children:[(0,st.jsxs)("label",{style:{fontWeight:600},children:["Theme:"," ",(0,st.jsxs)("select",{value:i,onChange:a=>r(a.target.value),children:[(0,st.jsx)("option",{value:"light",children:"Default (light)"}),(0,st.jsx)("option",{value:"dark",children:"Dark"}),(0,st.jsx)("option",{value:"funky",children:"Funky (custom)"})]})]}),(0,st.jsx)("span",{style:{color:"#6b6b75",fontSize:13},children:t?"Domain loaded: sig Node \xB7 fields left, right, key \u2014 try the \u2728 button or type a selector.":"No domain (fixture unavailable) \u2014 completions are language-only."})]}),(0,st.jsx)("div",{style:i==="dark"?{background:"#101014",padding:16,borderRadius:8}:{padding:16},children:(0,st.jsx)(OS,{value:e,onChange:n,instance:t,selectorAssistant:cse,theme:i==="light"?void 0:i,onDiagnostics:o,"aria-label":"Spytial spec editor demo"})}),(0,st.jsxs)("details",{style:{marginTop:12},children:[(0,st.jsxs)("summary",{style:{cursor:"pointer",fontWeight:600},children:["Diagnostics (",s.length,") & current YAML"]}),(0,st.jsx)("ul",{style:{fontSize:13},children:s.map((a,c)=>(0,st.jsxs)("li",{children:[(0,st.jsx)("strong",{children:a.severity})," [",a.source,"]: ",a.message]},c))}),(0,st.jsx)("pre",{style:{background:"#f5f5f7",padding:12,borderRadius:6,overflow:"auto",fontSize:12},children:e})]})]})};function Ox(t="spec-editor-demo-root"){let e=document.getElementById(t);return e?((0,Y4.createRoot)(e).render((0,st.jsx)(fse,{})),!0):(console.error(`Spec Editor demo: container "${t}" not found`),!1)}if(typeof window<"u"){let t=window;t.SpecEditorDemo={mountSpecEditorDemo:Ox},t.mountSpecEditorDemo=Ox}return t5(hse);})();
250
250
  /*! Bundled license information:
251
251
 
252
252
  react/cjs/react.production.js: